(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[853],{4853(Pi,Wi,We){"use strict";We.d(Wi,{CLNModule:()=>jw});var de=We(2200),Sn=We(8132),xt=We(3694),Mn=We(9881),A=We(3664),eA=We(7575),Q=We(2920);function f(n,l){1&n&&A.nrm(0,"mat-progress-bar",3)}let t=(()=>{var n;class l{constructor(i){this.router=i,this.loading=!1,this.router.events.subscribe(o=>{switch(!0){case o instanceof xt.Z:this.loading=!0;break;case o instanceof xt.wF:case o instanceof xt.j5:case o instanceof xt.L6:this.loading=!1}})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-root"]],standalone:!1,decls:4,vars:1,consts:[["outlet","outlet"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["color","primary","mode","indeterminate"]],template:function(o,r){1&o&&(A.j41(0,"div",1),A.DNE(1,f,1,0,"mat-progress-bar",2),A.nrm(2,"router-outlet",null,0),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",r.loading))},dependencies:[de.bT,eA.HM,Q.DJ,Q.sA,Q.UI,xt.n3],encapsulation:2,data:{animation:[Mn.E]}}))}return n(),l})();var g=We(1413),I=We(6977),N=We(3993),K=We(614),v=We(5383),B=We(4416),j=We(9647),tA=We(9584),w=We(2615),aA=We(8570),AA=We(9640),L=We(2571),P=We(60),rA=We(2598),QA=We(5596),NA=We(2885),oA=We(2629),uA=We(9115),dA=We(6038),RA=We(6850),nA=We(5964),H=We(6695),pA=We(2042),z=We(1676),OA=We(6183),wA=We(1585),VA=We(8430),kA=We(1747),hA=We(9417),fA=We(8834),UA=We(3746),yA=We(9588),xA=We(3029),Ee=We(450),HA=We(455),cA=We(9587),J=We(6114);function U(n,l){1&n&&(A.j41(0,"span",31),A.EFF(1,"= "),A.k0s())}function O(n,l){if(1&n&&(A.j41(0,"span",32),A.nrm(1,"fa-icon",33),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function lA(n,l){if(1&n&&A.nrm(0,"span",34),2&n){const e=A.XpG();A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function LA(n,l){if(1&n&&(A.j41(0,"mat-option",35),A.EFF(1),A.nI1(2,"titlecase"),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e),A.R7$(),A.JRh(A.bMT(2,2,e))}}function JA(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.invoiceError)}}function $A(n,l){if(1&n&&(A.j41(0,"div",36),A.nrm(1,"fa-icon",37),A.DNE(2,JA,2,1,"span",38),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.invoiceError)}}let IA=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.dialogRef=i,this.data=o,this.store=r,this.decimalPipe=iA,this.commonService=ne,this.actions=re,this.faExclamationTriangle=v.zpE,this.convertedCurrency=null,this.description="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=B.md,this.timeUnitEnum=B.F7,this.timeUnits=B.SY,this.selTimeUnit=B.F7.SECS,this.invoiceError="",this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.information=i}),this.actions.pipe((0,I.Q)(this.unSubs[2]),(0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN)).subscribe(i=>{i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&"SaveNewInvoice"===i.payload.action&&(i.payload.status===B.wn.ERROR&&(this.invoiceError=i.payload.message),i.payload.status===B.wn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(i){this.invoiceError="",this.invoiceValue||(this.invoiceValue=0);let o=this.expiry?this.expiry:B.It;this.selTimeUnit!==B.F7.SECS&&this.expiry&&(o=this.commonService.convertTime(this.expiry,this.selTimeUnit,B.F7.SECS)),this.store.dispatch((0,VA.VK)({payload:{label:"ulbl"+Math.random().toString(36).slice(2)+Date.now(),amount_msat:this.invoiceValue?1e3*this.invoiceValue:"any",description:this.description,expiry:o,exposeprivatechannels:this.private}}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=B.F7.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode&&this.selNode.settings.fiatConversion&&(this.invoiceValueHint="",this.invoiceValue&&this.invoiceValue>99&&this.commonService.convertCurrency(this.invoiceValue,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[3])).subscribe({next:i=>{this.convertedCurrency=i,this.invoiceValueHint=this.decimalPipe.transform(this.convertedCurrency.OTHER,B.k.OTHER)+" "+this.convertedCurrency.unit},error:i=>{this.invoiceValueHint="Conversion Error: "+i}}))}onTimeUnitChange(i){this.expiry&&this.selTimeUnit!==i.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,i.value)),this.selTimeUnit=i.value}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(de.QX),A.rXU(L.h),A.rXU(kA.En))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-create-invoices"]],standalone:!1,decls:50,vars:19,consts:[["addInvoiceForm","ngForm"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["fxFlex","5","fxLayoutAlign","center center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","name","description",3,"ngModelChange","ngModel"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxLayout","column","fxFlex","40"],["matInput","","type","number","name","invoiceValue",3,"ngModelChange","keyup","step","min","ngModel"],["matSuffix",""],["fxLayout","row wrap","fxFlex","100"],["class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",3,"innerHTML",4,"ngIf"],["fxLayout","column","fxFlex","30"],["matInput","","name","expiry","type","number",3,"ngModelChange","step","min","ngModel"],["fxLayout","column","fxFlex","26"],["name","timeUnit",3,"selectionChange","value"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","50","fxLayoutAlign","start center",1,"ml-2"],["color","primary","name","private",3,"ngModelChange","ngModel"],["matTooltip","Include routing hints for private channels","matTooltipPosition","above",1,"info-icon"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-1"],["mat-button","","color","primary","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary",3,"click"],[1,"mr-3px"],["fxLayoutAlign","center center",1,"mr-3px"],[3,"icon"],["fxLayoutAlign","center center",1,"mr-3px",3,"innerHTML"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2)(2,"mat-card-header",3)(3,"div",4)(4,"span",5),A.EFF(5,"Create Invoice"),A.k0s()(),A.j41(6,"button",6),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",7)(9,"form",8,0)(11,"mat-form-field",9)(12,"mat-label"),A.EFF(13,"Description"),A.k0s(),A.j41(14,"input",10),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.description,re)||(r.description=re),w.Njj(re)}),A.k0s()(),A.j41(15,"div",11)(16,"mat-form-field",12)(17,"mat-label"),A.EFF(18,"Amount"),A.k0s(),A.j41(19,"input",13),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.invoiceValue,re)||(r.invoiceValue=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onInvoiceValueChange())}),A.k0s(),A.j41(20,"span",14),A.EFF(21,"Sats "),A.k0s(),A.j41(22,"mat-hint",15),A.DNE(23,U,2,0,"span",16)(24,O,2,1,"span",17)(25,lA,1,1,"span",18),A.EFF(26),A.k0s()(),A.j41(27,"mat-form-field",19)(28,"mat-label"),A.EFF(29,"Expiry"),A.k0s(),A.j41(30,"input",20),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.expiry,re)||(r.expiry=re),w.Njj(re)}),A.k0s(),A.j41(31,"span",14),A.EFF(32),A.nI1(33,"titlecase"),A.k0s()(),A.j41(34,"mat-form-field",21)(35,"mat-label"),A.EFF(36,"Time Unit"),A.k0s(),A.j41(37,"mat-select",22),A.bIt("selectionChange",function(re){return w.eBV(iA),w.Njj(r.onTimeUnitChange(re))}),A.DNE(38,LA,3,4,"mat-option",23),A.k0s()()(),A.j41(39,"div",24)(40,"mat-slide-toggle",25),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.private,re)||(r.private=re),w.Njj(re)}),A.EFF(41,"Private Routing Hints"),A.k0s(),A.j41(42,"mat-icon",26),A.EFF(43,"info_outline"),A.k0s()(),A.DNE(44,$A,3,2,"div",27),A.j41(45,"div",28)(46,"button",29),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(47,"Clear Field"),A.k0s(),A.j41(48,"button",30),A.bIt("click",function(){w.eBV(iA);const re=A.sdS(10);return w.Njj(r.onAddInvoice(re))}),A.EFF(49,"Create Invoice"),A.k0s()()()()()()}2&o&&(A.R7$(6),A.Y8G("mat-dialog-close",!1),A.R7$(8),A.R50("ngModel",r.description),A.R7$(5),A.Y8G("step",100)("min",1),A.R50("ngModel",r.invoiceValue),A.R7$(4),A.Y8G("ngIf",""!==r.invoiceValueHint),A.R7$(),A.Y8G("ngIf",r.convertedCurrency&&"FA"===r.convertedCurrency.iconType&&""!==r.invoiceValueHint),A.R7$(),A.Y8G("ngIf",r.convertedCurrency&&"SVG"===r.convertedCurrency.iconType&&""!==r.invoiceValueHint),A.R7$(),A.SpI(" ",r.invoiceValueHint," "),A.R7$(4),A.Y8G("step",r.selTimeUnit===r.timeUnitEnum.SECS?300:r.selTimeUnit===r.timeUnitEnum.MINS?10:r.selTimeUnit===r.timeUnitEnum.HOURS?2:1)("min",1),A.R50("ngModel",r.expiry),A.R7$(2),A.SpI("",A.bMT(33,17,r.selTimeUnit)," "),A.R7$(5),A.Y8G("value",r.selTimeUnit),A.R7$(),A.Y8G("ngForOf",r.timeUnits),A.R7$(2),A.R50("ngModel",r.private),A.R7$(4),A.Y8G("ngIf",""!==r.invoiceError))},dependencies:[de.Sq,de.bT,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.VZ,hA.vS,hA.cV,P.aY,wA.tx,fA.$z,QA.m2,QA.MM,oA.An,UA.fg,yA.rl,yA.nJ,yA.MV,yA.yw,Q.DJ,Q.sA,Q.UI,OA.VO,xA.wT,Ee.sG,HA.oV,cA.N,J.V,de.PV],encapsulation:2}))}return n(),l})();var gA=We(8321),C=We(1771),b=We(7541),R=We(2929),M=We(497);const D=()=>["all"],X=n=>({"error-border":n}),YA=()=>["no_invoice"],KA=n=>({"mr-0":n}),bA=n=>({width:n}),le=n=>({"display-none":n});function ve(n,l){1&n&&(A.j41(0,"span",19),A.EFF(1,"= "),A.k0s())}function Ne(n,l){if(1&n&&(A.j41(0,"span",20),A.nrm(1,"fa-icon",21),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function Te(n,l){if(1&n&&A.nrm(0,"span",22),2&n){const e=A.XpG(2);A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function ze(n,l){if(1&n){const e=A.RV6();A.j41(0,"form",6,0)(2,"mat-form-field",7)(3,"mat-label"),A.EFF(4,"Description"),A.k0s(),A.j41(5,"input",8),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.description,o)||(r.description=o),w.Njj(o)}),A.k0s()(),A.j41(6,"mat-form-field",9)(7,"mat-label"),A.EFF(8,"Amount"),A.k0s(),A.j41(9,"input",10),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.invoiceValue,o)||(r.invoiceValue=o),w.Njj(o)}),A.bIt("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onInvoiceValueChange())}),A.k0s(),A.j41(10,"span",11),A.EFF(11,"Sats "),A.k0s(),A.j41(12,"mat-hint",12),A.DNE(13,ve,2,0,"span",13)(14,Ne,2,1,"span",14)(15,Te,1,1,"span",15),A.EFF(16),A.k0s()(),A.j41(17,"div",16)(18,"button",17),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.resetData())}),A.EFF(19,"Clear Field"),A.k0s(),A.j41(20,"button",18),A.bIt("click",function(){w.eBV(e);const o=A.sdS(1),r=A.XpG();return w.Njj(r.onAddInvoice(o))}),A.EFF(21,"Create Invoice"),A.k0s()()()}if(2&n){const e=A.XpG();A.R7$(5),A.R50("ngModel",e.description),A.R7$(4),A.Y8G("step",100)("min",1),A.R50("ngModel",e.invoiceValue),A.R7$(4),A.Y8G("ngIf",""!==e.invoiceValueHint),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"FA"===e.convertedCurrency.iconType&&""!==e.invoiceValueHint),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"SVG"===e.convertedCurrency.iconType&&""!==e.invoiceValueHint),A.R7$(),A.SpI(" ",e.invoiceValueHint," ")}}function Oe(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",23)(1,"button",24),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDeleteExpiredInvoices())}),A.EFF(2,"Delete Expired"),A.k0s(),A.j41(3,"button",25),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.openCreateInvoiceModal())}),A.EFF(4,"Create Invoice"),A.k0s()()}}function oe(n,l){if(1&n&&(A.j41(0,"mat-option",62),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function sA(n,l){1&n&&A.nrm(0,"mat-progress-bar",63)}function S(n,l){1&n&&A.nrm(0,"th",64)}function Y(n,l){if(1&n&&A.nrm(0,"span",69),2&n){const e=A.XpG(3);A.Y8G("ngClass",A.eq3(1,KA,e.screenSize===e.screenSizeEnum.XS))}}function k(n,l){if(1&n&&A.nrm(0,"span",70),2&n){const e=A.XpG(3);A.Y8G("ngClass",A.eq3(1,KA,e.screenSize===e.screenSizeEnum.XS))}}function m(n,l){if(1&n&&A.nrm(0,"span",71),2&n){const e=A.XpG(3);A.Y8G("ngClass",A.eq3(1,KA,e.screenSize===e.screenSizeEnum.XS))}}function E(n,l){if(1&n&&(A.j41(0,"td",65),A.DNE(1,Y,1,3,"span",66)(2,k,1,3,"span",67)(3,m,1,3,"span",68),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf","paid"===(null==e?null:e.status)),A.R7$(),A.Y8G("ngIf","unpaid"===(null==e?null:e.status)),A.R7$(),A.Y8G("ngIf","expired"===(null==e?null:e.status))}}function mA(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Expiry Date"),A.k0s())}function ie(n,l){if(1&n&&(A.j41(0,"td",65),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,1e3*(null==e?null:e.expires_at),"dd/MMM/y HH:mm")," ")}}function DA(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Date Settled"),A.k0s())}function Ae(n,l){if(1&n&&(A.j41(0,"td",65),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.paid_at),"dd/MMM/y HH:mm")||"-")}}function pe(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Type"),A.k0s())}function MA(n,l){if(1&n&&(A.j41(0,"td",65),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null!=e&&e.bolt12?"Bolt12":null!=e&&e.bolt11&&e.label.includes("keysend-")?"Keysend":"Bolt11")}}function Pe(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Description"),A.k0s())}function At(n,l){if(1&n&&(A.j41(0,"td",65)(1,"div",73)(2,"span",74),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,bA,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.description)}}function _(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Label"),A.k0s())}function be(n,l){if(1&n&&(A.j41(0,"td",65)(1,"div",73)(2,"span",74),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,bA,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.label)}}function Re(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Payment Hash"),A.k0s())}function SA(n,l){if(1&n&&(A.j41(0,"td",65)(1,"div",73)(2,"span",74),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,bA,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.payment_hash)}}function we(n,l){1&n&&(A.j41(0,"th",72),A.EFF(1,"Invoice"),A.k0s())}function Fe(n,l){if(1&n&&(A.j41(0,"td",65)(1,"div",73)(2,"span",74),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,bA,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.bolt11)}}function et(n,l){1&n&&(A.j41(0,"th",75),A.EFF(1,"Amount (Sats)"),A.k0s())}function Ke(n,l){if(1&n&&(A.j41(0,"td",65)(1,"span",76),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.amount_msat)/1e3,(null==e?null:e.amount_msat)<1e3?"1.0-4":"1.0-0"))}}function $e(n,l){1&n&&(A.j41(0,"th",75),A.EFF(1,"Amount Settled (Sats)"),A.k0s())}function ht(n,l){if(1&n&&(A.j41(0,"td",65)(1,"span",76),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.amount_received_msat)/1e3,(null==e?null:e.amount_received_msat)<1e3?"1.0-4":"1.0-0"))}}function cn(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",77)(1,"div",78)(2,"mat-select",79),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",80),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function at(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",81)(1,"div",78)(2,"mat-select",82),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",80),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onInvoiceClick(o))}),A.EFF(5,"View Info"),A.k0s(),A.j41(6,"mat-option",80),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onRefreshInvoice(o))}),A.EFF(7,"Refresh"),A.k0s()()()()}}function It(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No invoice available."),A.k0s())}function mt(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting invoices..."),A.k0s())}function Tt(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function Lt(n,l){if(1&n&&(A.j41(0,"td",83),A.DNE(1,It,2,0,"p",84)(2,mt,2,0,"p",84)(3,Tt,2,1,"p",84),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function Qn(n,l){if(1&n&&A.nrm(0,"tr",85),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,le,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function pn(n,l){1&n&&A.nrm(0,"tr",86)}function Gt(n,l){1&n&&A.nrm(0,"tr",87)}function Mt(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",26)(1,"div",27)(2,"div",28),A.nrm(3,"fa-icon",29),A.j41(4,"span",30),A.EFF(5,"Invoices History"),A.k0s()(),A.j41(6,"div",31)(7,"mat-form-field",32)(8,"mat-label"),A.EFF(9,"Filter By"),A.k0s(),A.j41(10,"mat-select",33),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilterBy,o)||(r.selFilterBy=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return o.selFilter="",w.Njj(o.applyFilter())}),A.j41(11,"perfect-scrollbar"),A.DNE(12,oe,2,2,"mat-option",34),A.k0s()()(),A.j41(13,"mat-form-field",32)(14,"mat-label"),A.EFF(15,"Filter"),A.k0s(),A.j41(16,"input",35),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilter,o)||(r.selFilter=o),w.Njj(o)}),A.bIt("input",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())})("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())}),A.k0s()()()(),A.j41(17,"div",36),A.DNE(18,sA,1,0,"mat-progress-bar",37),A.j41(19,"table",38,1),A.qex(21,39),A.DNE(22,S,1,0,"th",40)(23,E,4,3,"td",41),A.bVm(),A.qex(24,42),A.DNE(25,mA,2,0,"th",43)(26,ie,3,4,"td",41),A.bVm(),A.qex(27,44),A.DNE(28,DA,2,0,"th",43)(29,Ae,3,4,"td",41),A.bVm(),A.qex(30,45),A.DNE(31,pe,2,0,"th",43)(32,MA,2,1,"td",41),A.bVm(),A.qex(33,46),A.DNE(34,Pe,2,0,"th",43)(35,At,4,4,"td",41),A.bVm(),A.qex(36,47),A.DNE(37,_,2,0,"th",43)(38,be,4,4,"td",41),A.bVm(),A.qex(39,48),A.DNE(40,Re,2,0,"th",43)(41,SA,4,4,"td",41),A.bVm(),A.qex(42,49),A.DNE(43,we,2,0,"th",43)(44,Fe,4,4,"td",41),A.bVm(),A.qex(45,50),A.DNE(46,et,2,0,"th",51)(47,Ke,4,4,"td",41),A.bVm(),A.qex(48,52),A.DNE(49,$e,2,0,"th",51)(50,ht,4,4,"td",41),A.bVm(),A.qex(51,53),A.DNE(52,cn,6,0,"th",54)(53,at,8,0,"td",55),A.bVm(),A.qex(54,56),A.DNE(55,Lt,4,3,"td",57),A.bVm(),A.DNE(56,Qn,1,3,"tr",58)(57,pn,1,0,"tr",59)(58,Gt,1,0,"tr",60),A.k0s()(),A.nrm(59,"mat-paginator",61),A.k0s()}if(2&n){const e=A.XpG();A.R7$(3),A.Y8G("icon",e.faHistory),A.R7$(7),A.R50("ngModel",e.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(15,D).concat(e.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",e.selFilter),A.R7$(2),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.invoices)("ngClass",A.eq3(16,X,""!==e.errorMessage)),A.R7$(37),A.Y8G("matFooterRowDef",A.lJ4(18,YA)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns),A.R7$(),A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Ot=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln,Qt){this.logger=i,this.store=o,this.decimalPipe=r,this.commonService=iA,this.rtlEffects=ne,this.datePipe=re,this.actions=ln,this.camelCaseWithReplace=Qt,this.calledFrom="transactions",this.faHistory=v.Int,this.nodePageDefs=B.Jd,this.convertedCurrency=null,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"invoices",recordsPerPage:B.md,sortBy:"expires_at",sortOrder:B.oi.DESCENDING},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoices=new z.I6([]),this.invoiceJSONArr=[],this.information={},this.private=!1,this.expiryStep=100,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.information=i}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.Pj).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.invoiceJSONArr=i.listInvoices.invoices||[],this.invoiceJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(i)}),this.actions.pipe((0,I.Q)(this.unSubs[4]),(0,nA.p)(i=>i.type===B.TC.SET_LOOKUP_CLN||i.type===B.TC.UPDATE_API_CALL_STATUS_CLN)).subscribe(i=>{i.type===B.TC.SET_LOOKUP_CLN&&this.invoiceJSONArr&&this.sort&&this.paginator&&i.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(i.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,C.xO)({payload:{data:{pageSize:this.pageSize,component:IA}}}))}onAddInvoice(i){this.invoiceValue||(this.invoiceValue=0);const o=this.expiry?this.expiry:B.It;this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue,this.store.dispatch((0,VA.VK)({payload:{label:this.newlyAddedInvoiceMemo,amount_msat:this.invoiceValue?1e3*this.invoiceValue:"any",description:this.description,expiry:o,exposeprivatechannels:this.private}})),this.resetData()}onDeleteExpiredInvoices(){this.store.dispatch((0,C.I1)({payload:{data:{type:"CONFIRM",titleMessage:"Delete Expired Invoices",noBtnText:"Cancel",yesBtnText:"Delete Invoices"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[5])).subscribe(i=>{i&&this.store.dispatch((0,VA.a5)({payload:null}))})}onInvoiceClick(i){this.store.dispatch((0,C.xO)({payload:{data:{invoice:{amount_msat:i.amount_msat,label:i.label,expires_at:i.expires_at,paid_at:i.paid_at,bolt11:i.bolt11,payment_hash:i.payment_hash,description:i.description,status:i.status,amount_received_msat:i.amount_received_msat},newlyAdded:!1,component:gA.y}}}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint=""}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.invoices.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=this.datePipe.transform(new Date(1e3*(i.paid_at||0)),"dd/MMM/y HH:mm")?.toLowerCase()+this.datePipe.transform(new Date(1e3*(i.expires_at||0)),"dd/MMM/y HH:mm")?.toLowerCase()+(i.bolt12?"bolt12":i.bolt11?"bolt11":"keysend")+JSON.stringify(i).toLowerCase();break;case"status":r="paid"===i?.status?"paid":"unpaid"===i?.status?"unpaid":"expired";break;case"expires_at":case"paid_at":r=this.datePipe.transform(new Date(1e3*(i[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"type":r=i?.bolt12?"bolt12":i?.bolt11&&i?.label?.includes("keysend-")?"keysend":"bolt11";break;case"msatoshi":r=((i.amount_msat||0)/1e3).toString()||"";break;case"msatoshi_received":r=((i.amount_received_msat||0)/1e3).toString()||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"status"===this.selFilterBy||"type"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}onInvoiceValueChange(){this.selNode&&this.selNode.settings.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,B.BQ.SATS,B.BQ.OTHER,this.selNode?.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[6])).subscribe({next:i=>{this.convertedCurrency=i,this.invoiceValueHint=this.decimalPipe.transform(this.convertedCurrency.OTHER,B.k.OTHER)+" "+this.convertedCurrency.unit},error:i=>{this.invoiceValueHint="Conversion Error: "+i}}))}onRefreshInvoice(i){this.store.dispatch((0,VA.Yi)({payload:i.label}))}updateInvoicesData(i){this.invoiceJSONArr=this.invoiceJSONArr?.map(o=>o.label===i.label?i:o)}loadInvoicesTable(i){this.invoices=new z.I6(i?[...i]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(o,r)=>{switch(r){case"msatoshi":return o.amount_msat;case"msatoshi_received":return o.amount_received_msat;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.invoices.paginator=this.paginator,this.applyFilter(),this.setFilterPredicate()}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(de.QX),A.rXU(L.h),A.rXU(b.H),A.rXU(de.vh),A.rXU(kA.En),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-lightning-invoices-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},inputs:{calledFrom:"calledFrom"},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Invoices")}])],decls:4,vars:3,consts:[["addInvoiceForm","ngForm"],["table",""],["fxLayout","column","fxFlex","110","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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","tabindex","2","name","description",3,"ngModelChange","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","name","invoiceValue","type","number","tabindex","3",3,"ngModelChange","keyup","step","min","ngModel"],["matSuffix",""],["fxLayout","row wrap","fxFlex","100"],["class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",3,"innerHTML",4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","9","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","10",3,"click"],[1,"mr-3px"],["fxLayoutAlign","center center",1,"mr-3px"],[3,"icon"],["fxLayoutAlign","center center",1,"mr-3px",3,"innerHTML"],["fxLayout","row"],["mat-stroked-button","","color","warn","tabindex","7","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","expires_at"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","paid_at"],["matColumnDef","type"],["matColumnDef","description"],["matColumnDef","label"],["matColumnDef","payment_hash"],["matColumnDef","bolt11"],["matColumnDef","msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi_received"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Paid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Paid","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unpaid","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Expired","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){1&o&&(A.j41(0,"div",2),A.DNE(1,ze,22,8,"form",3)(2,Oe,5,0,"div",4)(3,Mt,60,19,"div",5),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf","home"===r.calledFrom),A.R7$(),A.Y8G("ngIf","transactions"===r.calledFrom),A.R7$(),A.Y8G("ngIf","transactions"===r.calledFrom))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.VZ,hA.vS,hA.cV,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,yA.MV,yA.yw,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,J.V,de.QX,de.vh],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}))}return n(),l})();var bt=We(6697),Dt=We(1534),Ze=We(2765),qe=We(5951);const Et=["sendPaymentForm"],ct=["paymentAmt"],Ht=["offerAmt"],Jt=["paymentReq"],GA=["offerReq"];function zA(n,l){if(1&n&&(A.j41(0,"mat-radio-button",26),A.EFF(1,"Offer"),A.k0s()),2&n){const e=A.XpG();A.Y8G("value",A.mNQ(e.paymentTypes.OFFER))}}function vA(n,l){1&n&&A.eu8(0)}function qA(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.paymentError)}}function ZA(n,l){if(1&n&&(A.j41(0,"div",27),A.nrm(1,"fa-icon",28),A.DNE(2,qA,2,1,"span",29),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.paymentError)}}function jA(n,l){if(1&n&&(A.j41(0,"span",37),A.nrm(1,"fa-icon",38),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function ue(n,l){if(1&n&&A.nrm(0,"span",39),2&n){const e=A.XpG(3);A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function WA(n,l){if(1&n&&(A.j41(0,"mat-hint",34),A.EFF(1),A.DNE(2,jA,2,1,"span",35)(3,ue,1,1,"span",36),A.EFF(4),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.SpI(" ",e.paymentDecodedHintPre," "),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"FA"===e.convertedCurrency.iconType&&""!==e.paymentDecodedHintPre),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"SVG"===e.convertedCurrency.iconType&&""!==e.paymentDecodedHintPre),A.R7$(),A.SpI(" ",e.paymentDecodedHintPost," ")}}function ae(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Payment request is required."),A.k0s())}function ce(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.paymentDecodedHint)}}function ye(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Payment amount is required."),A.k0s())}function ke(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",10)(1,"mat-label"),A.EFF(2,"Amount (Sats)"),A.k0s(),A.j41(3,"input",40,5),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG(2);return A.DH7(r.paymentAmount,o)||(r.paymentAmount=o),w.Njj(o)}),A.bIt("change",function(o){w.eBV(e);const r=A.XpG(2);return w.Njj(r.onAmountChange(o))}),A.k0s(),A.j41(5,"mat-hint"),A.EFF(6,"It is a zero amount invoice, enter amount to be paid."),A.k0s(),A.DNE(7,ye,2,0,"mat-error",29),A.k0s()}if(2&n){const e=A.XpG(2);A.R7$(3),A.R50("ngModel",e.paymentAmount),A.R7$(4),A.Y8G("ngIf",!e.paymentAmount)}}function Je(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",30)(1,"mat-label"),A.EFF(2,"Payment Request"),A.k0s(),A.j41(3,"textarea",31,4),A.bIt("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return w.eBV(e),w.Njj(!0)}),A.k0s(),A.DNE(5,WA,5,4,"mat-hint",32)(6,ae,2,0,"mat-error",29)(7,ce,2,1,"mat-error",29),A.k0s(),A.DNE(8,ke,8,2,"mat-form-field",33)}if(2&n){const e=A.sdS(4),i=A.XpG();A.R7$(3),A.Y8G("ngModel",i.paymentRequest),A.R7$(2),A.Y8G("ngIf",i.paymentRequest&&""!==i.paymentDecodedHintPre),A.R7$(),A.Y8G("ngIf",!i.paymentRequest),A.R7$(),A.Y8G("ngIf",null==e.errors?null:e.errors.decodeError),A.R7$(),A.Y8G("ngIf",i.zeroAmtInvoice)}}function tt(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Pubkey is required."),A.k0s())}function je(n,l){1&n&&(A.j41(0,"span",45),A.EFF(1,"= "),A.k0s())}function Ce(n,l){if(1&n&&(A.j41(0,"span",37),A.nrm(1,"fa-icon",38),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function _e(n,l){if(1&n&&A.nrm(0,"span",39),2&n){const e=A.XpG(2);A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function st(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Keysend amount is required."),A.k0s())}function lt(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",30)(1,"mat-label"),A.EFF(2,"Pubkey"),A.k0s(),A.j41(3,"input",41),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.pubkey,o)||(r.pubkey=o),w.Njj(o)}),A.k0s(),A.DNE(4,tt,2,0,"mat-error",29),A.k0s(),A.j41(5,"mat-form-field",30)(6,"mat-label"),A.EFF(7,"Amount"),A.k0s(),A.j41(8,"input",42,6),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.keysendAmount,o)||(r.keysendAmount=o),w.Njj(o)}),A.bIt("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onKeysendAmountChange())}),A.k0s(),A.j41(10,"span",43),A.EFF(11,"Sats "),A.k0s(),A.j41(12,"mat-hint",34),A.DNE(13,je,2,0,"span",44)(14,Ce,2,1,"span",35)(15,_e,1,1,"span",36),A.EFF(16),A.k0s(),A.DNE(17,st,2,0,"mat-error",29),A.k0s()}if(2&n){const e=A.XpG();A.R7$(3),A.R50("ngModel",e.pubkey),A.R7$(),A.Y8G("ngIf",!e.pubkey),A.R7$(4),A.R50("ngModel",e.keysendAmount),A.R7$(5),A.Y8G("ngIf",""!==e.keysendValueHint),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"FA"===e.convertedCurrency.iconType&&""!==e.keysendValueHint),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"SVG"===e.convertedCurrency.iconType&&""!==e.keysendValueHint),A.R7$(),A.SpI(" ",e.keysendValueHint," "),A.R7$(),A.Y8G("ngIf",!e.keysendAmount)}}function wt(n,l){if(1&n&&(A.j41(0,"span",37),A.nrm(1,"fa-icon",38),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function Bt(n,l){if(1&n&&A.nrm(0,"span",39),2&n){const e=A.XpG(3);A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function pt(n,l){if(1&n&&(A.j41(0,"mat-hint",34),A.EFF(1),A.DNE(2,wt,2,1,"span",35)(3,Bt,1,1,"span",36),A.EFF(4),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.SpI(" ",e.offerDecodedHintPre," "),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"FA"===e.convertedCurrency.iconType&&""!==e.offerDecodedHintPre),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"SVG"===e.convertedCurrency.iconType&&""!==e.offerDecodedHintPre),A.R7$(),A.SpI(" ",e.offerDecodedHintPost," ")}}function ot(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Offer request is required."),A.k0s())}function ut(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.offerDecodedHint)}}function an(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Offer amount is required."),A.k0s())}function Wt(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",10)(1,"mat-label"),A.EFF(2,"Amount (Sats)"),A.k0s(),A.j41(3,"input",51,8),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG(2);return A.DH7(r.offerAmount,o)||(r.offerAmount=o),w.Njj(o)}),A.bIt("change",function(o){w.eBV(e);const r=A.XpG(2);return w.Njj(r.onAmountChange(o))}),A.k0s(),A.j41(5,"mat-hint"),A.EFF(6,"It is a zero amount offer, enter amount to be paid."),A.k0s(),A.DNE(7,an,2,0,"mat-error",29),A.k0s()}if(2&n){const e=A.XpG(2);A.R7$(3),A.R50("ngModel",e.offerAmount),A.R7$(4),A.Y8G("ngIf",!e.offerAmount)}}function _t(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",52)(1,"mat-label"),A.EFF(2,"Title to Save"),A.k0s(),A.j41(3,"input",53),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG(2);return A.DH7(r.offerTitle,o)||(r.offerTitle=o),w.Njj(o)}),A.k0s()()}if(2&n){const e=A.XpG(2);A.R7$(3),A.R50("ngModel",e.offerTitle)}}function Pt(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",30)(1,"mat-label"),A.EFF(2,"Offer Request"),A.k0s(),A.j41(3,"textarea",46,7),A.bIt("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return w.eBV(e),w.Njj(!0)}),A.k0s(),A.DNE(5,pt,5,4,"mat-hint",32)(6,ot,2,0,"mat-error",29)(7,ut,2,1,"mat-error",29),A.k0s(),A.DNE(8,Wt,8,2,"mat-form-field",33),A.j41(9,"div",47)(10,"mat-checkbox",48),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.flgSaveToDB,o)||(r.flgSaveToDB=o),w.Njj(o)}),A.EFF(11,"Bookmark Offer"),A.k0s(),A.j41(12,"mat-icon",49),A.EFF(13,"info_outline"),A.k0s()(),A.DNE(14,_t,4,1,"mat-form-field",50)}if(2&n){const e=A.sdS(4),i=A.XpG();A.R7$(3),A.Y8G("ngModel",i.offerRequest),A.R7$(2),A.Y8G("ngIf",i.offerRequest&&""!==i.offerDecodedHintPre),A.R7$(),A.Y8G("ngIf",!i.offerRequest),A.R7$(),A.Y8G("ngIf",null==e.errors?null:e.errors.decodeError),A.R7$(),A.Y8G("ngIf",i.zeroAmtOffer),A.R7$(2),A.R50("ngModel",i.flgSaveToDB),A.R7$(4),A.Y8G("ngIf",i.flgSaveToDB||""!==i.offerTitle)}}let Bn=(()=>{var n;class l{set payReq(i){i&&(this.paymentReq=i)}set offrReq(i){i&&(this.offerReq=i)}constructor(i,o,r,iA,ne,re,ln,Qt){this.dialogRef=i,this.data=o,this.store=r,this.logger=iA,this.commonService=ne,this.decimalPipe=re,this.actions=ln,this.dataService=Qt,this.faExclamationTriangle=v.zpE,this.convertedCurrency=null,this.paymentTypes=B.Y0,this.paymentType=B.Y0.INVOICE,this.offerDecoded={},this.offerRequest="",this.offerDecodedHintPre="",this.offerDecodedHintPost="",this.offerDescription="",this.offerIssuer="",this.offerTitle="",this.zeroAmtOffer=!1,this.offerInvoice=null,this.offerAmount=null,this.flgSaveToDB=!1,this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHintPre="",this.paymentDecodedHintPost="",this.zeroAmtInvoice=!1,this.paymentAmount=null,this.pubkey="",this.keysendAmount=null,this.keysendValueHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=B.nv[0],this.feeLimitTypes=B.nv,this.paymentError="",this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B]}ngOnInit(){if(this.data&&this.data.paymentType)switch(this.paymentType=this.data.paymentType,this.paymentType){case B.Y0.INVOICE:this.paymentRequest=this.data.invoiceBolt11;break;case B.Y0.KEYSEND:this.pubkey=this.data.pubkeyKeysend;break;case B.Y0.OFFER:this.onPaymentRequestEntry(this.data.bolt12),this.offerTitle=this.data.offerTitle,this.flgSaveToDB=!1}this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.activeChannels=i.activeChannels,this.logger.info(i)}),this.actions.pipe((0,I.Q)(this.unSubs[3]),(0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN||i.type===B.TC.SEND_PAYMENT_STATUS_CLN||i.type===B.TC.SET_OFFER_INVOICE_CLN)).subscribe(i=>{i.type===B.TC.SEND_PAYMENT_STATUS_CLN&&this.dialogRef.close(),i.type===B.TC.SET_OFFER_INVOICE_CLN&&(this.offerInvoice=i.payload,this.sendPayment()),i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&i.payload.status===B.wn.ERROR&&("SendPayment"===i.payload.action&&(delete this.paymentDecoded.amount_msat,this.paymentError=i.payload.message),"DecodePayment"===i.payload.action&&(this.paymentType===B.Y0.INVOICE&&(this.paymentDecodedHintPre="ERROR: "+i.payload.message,this.paymentDecodedHintPost="",this.paymentReq.control.setErrors({decodeError:!0})),this.paymentType===B.Y0.OFFER&&(this.offerDecodedHintPre="ERROR: "+i.payload.message,this.offerDecodedHintPost="",this.offerReq.control.setErrors({decodeError:!0})),this.paymentType===B.Y0.KEYSEND&&(this.keysendValueHint="ERROR: "+i.payload.message)),"FetchOfferInvoice"===i.payload.action&&this.paymentType===B.Y0.OFFER&&(this.paymentError=i.payload.message))})}onSendPayment(){switch(this.paymentType){case B.Y0.KEYSEND:if(!this.pubkey||""===this.pubkey.trim()||!this.keysendAmount||this.keysendAmount<=0)return!0;this.keysendPayment();break;case B.Y0.INVOICE:if(!this.paymentRequest||this.zeroAmtInvoice&&(0===this.paymentAmount||!this.paymentAmount))return this.paymentReq.control.markAsTouched(),this.paymentAmt.control.markAsTouched(),!0;this.paymentDecoded.created_at?this.sendPayment():(this.resetInvoiceDetails(),this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{"bolt12 offer"===i.type&&i.offer_id?(this.paymentDecodedHintPre="ERROR: Select Offer option to pay the bolt12 offer invoice.",this.paymentDecodedHintPost="",this.paymentReq.control.setErrors({decodeError:!0})):(this.paymentDecoded=i,this.setPaymentDecodedDetails())}));break;case B.Y0.OFFER:if(!this.offerRequest||this.zeroAmtOffer&&(0===this.offerAmount||!this.offerAmount))return this.offerReq.control.markAsTouched(),this.offerAmt.control.markAsTouched(),!0;this.offerDecoded.offer_id?this.sendPayment():(this.resetOfferDetails(),this.dataService.decodePayment(this.offerRequest,!0).pipe((0,I.Q)(this.unSubs[5])).subscribe(i=>{"bolt11 invoice"===i.type&&i.payment_hash?(this.offerDecodedHintPre="ERROR: Select Invoice option to pay the bolt11 invoice.",this.offerDecodedHintPost="",this.offerReq.control.setErrors({decodeError:!0})):(this.offerDecoded=i,this.setOfferDecodedDetails())}))}}keysendPayment(){this.keysendAmount&&this.store.dispatch((0,VA.Fd)({payload:{uiMessage:B.MZ.SEND_KEYSEND,paymentType:B.Y0.KEYSEND,destination:this.pubkey,amount_msat:1e3*this.keysendAmount,fromDialog:!0}}))}sendPayment(){this.paymentError="",this.paymentType===B.Y0.INVOICE?this.store.dispatch((0,VA.Fd)(this.zeroAmtInvoice&&this.paymentAmount?{payload:{uiMessage:B.MZ.SEND_PAYMENT,paymentType:B.Y0.INVOICE,bolt11:this.paymentRequest,amount_msat:1e3*this.paymentAmount,fromDialog:!0}}:{payload:{uiMessage:B.MZ.SEND_PAYMENT,paymentType:B.Y0.INVOICE,bolt11:this.paymentRequest,fromDialog:!0}})):this.paymentType===B.Y0.OFFER&&(this.offerInvoice?this.offerAmount&&this.store.dispatch((0,VA.Fd)({payload:{uiMessage:B.MZ.SEND_PAYMENT,paymentType:B.Y0.OFFER,bolt11:this.offerInvoice.invoice,saveToDB:this.flgSaveToDB,bolt12:this.offerRequest,amount_msat:1e3*this.offerAmount,zeroAmtOffer:this.zeroAmtOffer,title:this.offerTitle,issuer:this.offerIssuer,description:this.offerDescription,fromDialog:!0}})):this.store.dispatch((0,VA.Ew)(this.zeroAmtOffer&&this.offerAmount?{payload:{offer:this.offerRequest,amount_msat:1e3*this.offerAmount}}:{payload:{offer:this.offerRequest}})))}onPaymentRequestEntry(i){this.paymentType===B.Y0.INVOICE?(this.paymentRequest=i,this.resetInvoiceDetails()):this.paymentType===B.Y0.OFFER&&(this.offerRequest=i,this.resetOfferDetails()),i.length>100&&this.dataService.decodePayment(i,!0).pipe((0,I.Q)(this.unSubs[6])).subscribe(o=>{this.paymentType===B.Y0.INVOICE?"bolt12 offer"===o.type&&o.offer_id?(this.paymentDecodedHintPre="ERROR: Select Offer option to pay the bolt12 offer invoice.",this.paymentDecodedHintPost="",this.paymentReq.control.setErrors({decodeError:!0})):(this.paymentDecoded=o,this.setPaymentDecodedDetails()):this.paymentType===B.Y0.OFFER&&("bolt11 invoice"===o.type&&o.payment_hash?(this.offerDecodedHintPre="ERROR: Select Invoice option to pay the bolt11 invoice.",this.offerDecodedHintPost="",this.offerReq.control.setErrors({decodeError:!0})):(this.offerDecoded=o,this.setOfferDecodedDetails()))})}resetOfferDetails(){this.offerInvoice=null,this.offerAmount=null,this.offerDecodedHintPre="",this.offerDecodedHintPost="",this.zeroAmtOffer=!1,this.paymentError="",this.offerReq&&this.offerReq.control.setErrors(null)}resetInvoiceDetails(){this.paymentAmount=null,this.paymentDecodedHintPre="",this.paymentDecodedHintPost="",this.zeroAmtInvoice=!1,this.paymentError="",this.paymentReq&&this.paymentReq.control.setErrors(null)}onAmountChange(i){this.paymentType===B.Y0.INVOICE&&(delete this.paymentDecoded.amount_msat,this.paymentDecoded.amount_msat=+i.target.value),this.paymentType===B.Y0.OFFER&&(delete this.offerDecoded.offer_amount_msat,this.offerDecoded.offer_amount_msat=i.target.value)}onPaymentTypeChange(){this.paymentError="",this.paymentDecodedHintPre="",this.paymentDecodedHintPost="",this.offerDecodedHintPre="",this.offerDecodedHintPost="",this.offerInvoice=null}setOfferDecodedDetails(){this.offerDecoded.offer_id&&!this.offerDecoded.offer_amount_msat?(this.offerDecoded.offer_amount_msat=0,this.zeroAmtOffer=!0,this.offerDescription=this.offerDecoded.offer_description||"",this.offerIssuer=this.offerDecoded.offer_issuer?this.offerDecoded.offer_issuer:"",this.offerDecodedHintPre="Zero Amount Offer | Description: "+this.offerDecoded.offer_description,this.offerDecodedHintPost=""):(this.zeroAmtOffer=!1,this.offerAmount=this.offerDecoded.offer_amount_msat?this.offerDecoded.offer_amount_msat/1e3:0,this.offerDescription=this.offerDecoded.offer_description||"",this.offerIssuer=this.offerDecoded.offer_issuer?this.offerDecoded.offer_issuer:"",this.selNode&&this.selNode.settings.fiatConversion?this.commonService.convertCurrency(this.offerAmount,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[7])).subscribe({next:i=>{this.convertedCurrency=i,this.offerDecodedHintPre="Sending: "+this.decimalPipe.transform(this.offerAmount)+" Sats (",this.offerDecodedHintPost=this.decimalPipe.transform(this.convertedCurrency.OTHER?this.convertedCurrency.OTHER:0,B.k.OTHER)+" "+this.convertedCurrency.unit+") | Description: "+this.offerDecoded.offer_description},error:i=>{this.offerDecodedHintPre="Sending: "+this.decimalPipe.transform(this.offerAmount)+" Sats | Description: "+this.offerDecoded.offer_description+". Unable to convert currency.",this.offerDecodedHintPost=""}}):(this.offerDecodedHintPre="Sending: "+this.decimalPipe.transform(this.offerAmount)+" Sats | Description: "+this.offerDecoded.offer_description,this.offerDecodedHintPost=""))}setPaymentDecodedDetails(){this.paymentDecoded.created_at&&!this.paymentDecoded.amount_msat?(this.paymentDecoded.amount_msat=0,this.zeroAmtInvoice=!0,this.paymentDecodedHintPre="Zero Amount Invoice | Memo: "+this.paymentDecoded.description,this.paymentDecodedHintPost=""):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.settings.fiatConversion?this.commonService.convertCurrency(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[8])).subscribe({next:i=>{this.convertedCurrency=i,this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats (",this.paymentDecodedHintPost=this.decimalPipe.transform(this.convertedCurrency.OTHER?this.convertedCurrency.OTHER:0,B.k.OTHER)+" "+this.convertedCurrency.unit+") | Memo: "+this.paymentDecoded.description},error:i=>{this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency.",this.paymentDecodedHintPost=""}}):(this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description,this.paymentDecodedHintPost=""))}resetData(){switch(this.paymentType){case B.Y0.KEYSEND:this.pubkey="",this.keysendValueHint="",this.keysendAmount=null;break;case B.Y0.INVOICE:this.paymentRequest="",this.paymentDecoded={},this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=B.nv[0],this.resetInvoiceDetails();break;case B.Y0.OFFER:this.offerRequest="",this.offerDecoded={},this.flgSaveToDB=!1,this.resetOfferDetails()}this.paymentError=""}onKeysendAmountChange(){this.selNode&&this.selNode.settings.fiatConversion&&(this.keysendValueHint="",this.keysendAmount&&this.keysendAmount>99&&this.commonService.convertCurrency(this.keysendAmount,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[3])).subscribe({next:i=>{this.convertedCurrency=i,this.keysendValueHint=this.decimalPipe.transform(this.convertedCurrency.OTHER,B.k.OTHER)+" "+this.convertedCurrency.unit},error:i=>{this.keysendValueHint="Conversion Error: "+i}}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(aA.gP),A.rXU(L.h),A.rXU(de.QX),A.rXU(kA.En),A.rXU(Dt.u))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-lightning-send-payments"]],viewQuery:function(o,r){if(1&o&&(A.GBs(Et,5),A.GBs(ct,5),A.GBs(Ht,5),A.GBs(Jt,5),A.GBs(GA,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first),A.mGM(iA=A.lsd())&&(r.paymentAmt=iA.first),A.mGM(iA=A.lsd())&&(r.offerAmt=iA.first),A.mGM(iA=A.lsd())&&(r.payReq=iA.first),A.mGM(iA=A.lsd())&&(r.offrReq=iA.first)}},standalone:!1,decls:30,vars:9,consts:[["sendPaymentForm","ngForm"],["invoiceBlock",""],["keysendBlock",""],["offerBlock",""],["paymentReq","ngModel"],["paymentAmt","ngModel"],["keysendAmt","ngModel"],["offerReq","ngModel"],["offerAmt","ngModel"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","12","fxLayoutAlign","center center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["color","primary","name","paymentType","fxFlex","100","fxLayoutAlign","start start",1,"my-1",3,"ngModelChange","change","ngModel"],["fxFlex","20","tabindex","1",3,"value"],["fxFlex","20","tabindex","2",3,"value"],["fxFlex","20","tabindex","3",3,"value",4,"ngIf"],["fxLayoutAlign","space-between stretch","fxLayout","column",3,"submit","reset"],[4,"ngTemplateOutlet"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","9","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],["fxFlex","20","tabindex","3",3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","rows","4","name","paymentRequest","tabindex","4","required","",3,"ngModelChange","matTextareaAutosize","ngModel"],["fxLayout","row wrap","fxFlex","100",4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxLayout","row wrap","fxFlex","100"],["fxLayoutAlign","center center","class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",3,"innerHTML",4,"ngIf"],["fxLayoutAlign","center center",1,"mr-3px"],[3,"icon"],["fxLayoutAlign","center center",1,"mr-3px",3,"innerHTML"],["matInput","","name","amount","tabindex","5","required","",3,"ngModelChange","change","ngModel"],["autoFocus","","matInput","","name","pubkey","tabindex","4","required","",3,"ngModelChange","ngModel"],["matInput","","name","keysendAmount","tabindex","5","required","",3,"ngModelChange","keyup","ngModel"],["matSuffix",""],["class","mr-3px",4,"ngIf"],[1,"mr-3px"],["autoFocus","","matInput","","rows","4","name","offerRequest","tabindex","4","required","",3,"ngModelChange","matTextareaAutosize","ngModel"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",1,"mt-1"],["fxFlex","none","tabindex","6","color","primary",3,"ngModelChange","ngModel"],["matTooltip","Save offer in database for future payments","matTooltipPosition","below","fxFlex","none",1,"info-icon"],["fxFlex","100","class","mt-1",4,"ngIf"],["matInput","","name","amountoffer","tabindex","5","required","",3,"ngModelChange","change","ngModel"],["fxFlex","100",1,"mt-1"],["matInput","","tabindex","7",3,"ngModelChange","ngModel"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",9)(1,"div",10)(2,"mat-card-header",11)(3,"div",12)(4,"span",13),A.EFF(5,"Send Payment"),A.k0s()(),A.j41(6,"button",14),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",15)(9,"mat-radio-group",16),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.paymentType,re)||(r.paymentType=re),w.Njj(re)}),A.bIt("change",function(){return w.eBV(iA),w.Njj(r.onPaymentTypeChange())}),A.j41(10,"mat-radio-button",17),A.EFF(11,"Invoice"),A.k0s(),A.j41(12,"mat-radio-button",18),A.EFF(13,"Keysend"),A.k0s(),A.DNE(14,zA,2,2,"mat-radio-button",19),A.k0s(),A.j41(15,"form",20,0),A.bIt("submit",function(){return w.eBV(iA),w.Njj(r.onSendPayment())})("reset",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.DNE(17,vA,1,0,"ng-container",21)(18,ZA,3,2,"div",22),A.j41(19,"div",23)(20,"button",24),A.EFF(21,"Clear Fields"),A.k0s(),A.j41(22,"button",25),A.EFF(23,"Send Payment"),A.k0s()()()()()(),A.DNE(24,Je,9,5,"ng-template",null,1,A.C5r)(26,lt,18,8,"ng-template",null,2,A.C5r)(28,Pt,15,7,"ng-template",null,3,A.C5r)}if(2&o){const iA=A.sdS(25),ne=A.sdS(27),re=A.sdS(29);A.R7$(6),A.Y8G("mat-dialog-close",!1),A.R7$(3),A.R50("ngModel",r.paymentType),A.R7$(),A.Y8G("value",A.mNQ(r.paymentTypes.INVOICE)),A.R7$(2),A.Y8G("value",A.mNQ(r.paymentTypes.KEYSEND)),A.R7$(2),A.Y8G("ngIf",r.selNode.settings.enableOffers),A.R7$(3),A.Y8G("ngTemplateOutlet",r.paymentType===r.paymentTypes.KEYSEND?ne:r.paymentType===r.paymentTypes.OFFER?re:iA),A.R7$(),A.Y8G("ngIf",""!==r.paymentError)}},dependencies:[de.bT,de.T3,hA.qT,hA.me,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,P.aY,wA.tx,fA.$z,QA.m2,QA.MM,Ze.So,oA.An,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,yA.yw,qe.VT,qe._g,Q.DJ,Q.sA,Q.UI,HA.oV,cA.N],encapsulation:2}))}return n(),l})();const In=["sendPaymentForm"],Dn=()=>["all"],Cn=n=>({"error-border":n}),Nn=()=>["no_payment"],St=n=>({width:n}),vn=n=>({"display-none":n});function Un(n,l){if(1&n&&(A.j41(0,"span",18),A.nrm(1,"fa-icon",19),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.Y8G("icon",e.convertedCurrency.symbol)}}function Ln(n,l){if(1&n&&A.nrm(0,"span",20),2&n){const e=A.XpG(3);A.Y8G("innerHTML",e.convertedCurrency.symbol,A.npT)}}function Fn(n,l){if(1&n&&(A.j41(0,"mat-hint",15),A.EFF(1),A.DNE(2,Un,2,1,"span",16)(3,Ln,1,1,"span",17),A.EFF(4),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.SpI(" ",e.paymentDecodedHintPre," "),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"FA"===e.convertedCurrency.iconType&&""!==e.paymentDecodedHintPre),A.R7$(),A.Y8G("ngIf",e.convertedCurrency&&"SVG"===e.convertedCurrency.iconType&&""!==e.paymentDecodedHintPre),A.R7$(),A.SpI(" ",e.paymentDecodedHintPost," ")}}function On(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Payment request is required."),A.k0s())}function Ei(n,l){if(1&n){const e=A.RV6();A.j41(0,"form",7,0)(2,"mat-form-field",8)(3,"mat-label"),A.EFF(4,"Payment Request"),A.k0s(),A.j41(5,"textarea",9,1),A.bIt("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return w.eBV(e),w.Njj(!0)}),A.k0s(),A.DNE(7,Fn,5,4,"mat-hint",10)(8,On,2,0,"mat-error",11),A.k0s(),A.j41(9,"div",12)(10,"button",13),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.resetData())}),A.EFF(11,"Clear Field"),A.k0s(),A.j41(12,"button",14),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onSendPayment())}),A.EFF(13,"Send Payment"),A.k0s()()()}if(2&n){const e=A.XpG();A.R7$(5),A.Y8G("ngModel",e.paymentRequest),A.R7$(2),A.Y8G("ngIf",e.paymentRequest&&""!==e.paymentDecodedHintPre),A.R7$(),A.Y8G("ngIf",!e.paymentRequest)}}function wi(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",21)(1,"button",14),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.openSendPaymentModal())}),A.EFF(2,"Send Payment"),A.k0s()()}}function Ci(n,l){if(1&n&&(A.j41(0,"mat-option",70),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function di(n,l){1&n&&A.nrm(0,"mat-progress-bar",71)}function ri(n,l){1&n&&A.nrm(0,"th",72)}function xn(n,l){1&n&&A.nrm(0,"span",76)}function ai(n,l){1&n&&A.nrm(0,"span",77)}function Ki(n,l){if(1&n&&(A.j41(0,"td",73),A.DNE(1,xn,1,0,"span",74)(2,ai,1,0,"span",75),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf","complete"===e.status),A.R7$(),A.Y8G("ngIf","complete"!==e.status)}}function Qi(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Created At"),A.k0s())}function Xi(n,l){if(1&n&&(A.j41(0,"td",73),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,1e3*(null==e?null:e.created_at),"dd/MMM/y HH:mm")," ")}}function mi(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Type"),A.k0s())}function fn(n,l){if(1&n&&(A.j41(0,"td",73),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null!=e&&e.bolt12?"Bolt12":null!=e&&e.bolt11?"Bolt11":"Keysend")}}function ms(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Payment Hash"),A.k0s())}function Ms(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",79)(2,"span",80),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.payment_hash)}}function Mi(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Invoice"),A.k0s())}function pi(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",79)(2,"span",80),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.bolt11)}}function Zi(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Label"),A.k0s())}function qi(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",79)(2,"span",80),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.label)}}function $i(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Destination"),A.k0s())}function ps(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",79)(2,"span",80),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.destination)}}function As(n,l){1&n&&(A.j41(0,"th",78),A.EFF(1,"Memo"),A.k0s())}function Is(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",79)(2,"span",80),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.memo)}}function Ui(n,l){1&n&&(A.j41(0,"th",81),A.EFF(1,"Sats Sent"),A.k0s())}function es(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",82),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.amount_sent_msat)/1e3,"1.0-4"))}}function Zn(n,l){1&n&&(A.j41(0,"th",81),A.EFF(1,"Sats Received"),A.k0s())}function Ds(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",82),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.amount_msat)/1e3,"1.0-4"))}}function Fs(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",83)(1,"div",84)(2,"mat-select",85),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",86),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function Li(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",87)(1,"button",88),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onPaymentClick(o))}),A.EFF(2,"View Info"),A.k0s()()}}function Gi(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No payment available."),A.k0s())}function un(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting payments..."),A.k0s())}function Ii(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function qn(n,l){if(1&n&&(A.j41(0,"td",89),A.DNE(1,Gi,2,0,"p",11)(2,un,2,0,"p",11)(3,Ii,2,1,"p",11),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",!(null!=e.payments&&e.payments.data&&null!=e.payments&&null!=e.payments.data&&e.payments.data.length||(null==e.apiCallStatus?null:e.apiCallStatus.status)!==e.apiCallStatusEnum.COMPLETED)),A.R7$(),A.Y8G("ngIf",!(null!=e.payments&&e.payments.data&&null!=e.payments&&null!=e.payments.data&&e.payments.data.length||(null==e.apiCallStatus?null:e.apiCallStatus.status)!==e.apiCallStatusEnum.INITIATED)),A.R7$(),A.Y8G("ngIf",!(null!=e.payments&&e.payments.data&&null!=e.payments&&null!=e.payments.data&&e.payments.data.length||(null==e.apiCallStatus?null:e.apiCallStatus.status)!==e.apiCallStatusEnum.ERROR))}}function ys(n,l){1&n&&A.nrm(0,"span",76)}function xs(n,l){1&n&&A.nrm(0,"span",77)}function Di(n,l){1&n&&A.nrm(0,"span",76)}function oi(n,l){1&n&&A.nrm(0,"span",77)}function Ys(n,l){if(1&n&&(A.j41(0,"span",90),A.DNE(1,Di,1,0,"span",74)(2,oi,1,0,"span",75),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf","complete"===e.status),A.R7$(),A.Y8G("ngIf","complete"!==e.status)}}function bs(n,l){if(1&n&&(A.qex(0),A.DNE(1,Ys,3,2,"span",91),A.bVm()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function zi(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",90),A.DNE(2,ys,1,0,"span",74)(3,xs,1,0,"span",75),A.k0s(),A.DNE(4,bs,2,1,"ng-container",11),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.Y8G("ngIf","complete"===e.status),A.R7$(),A.Y8G("ngIf","complete"!==e.status),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function vs(n,l){if(1&n&&(A.j41(0,"span",90),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,1e3*e.created_at,"dd/MMM/y HH:mm")," ")}}function ts(n,l){if(1&n&&(A.qex(0),A.DNE(1,vs,3,4,"span",91),A.bVm()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function Rs(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",90),A.EFF(2),A.k0s(),A.DNE(3,ts,2,1,"ng-container",11),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" Total Attempts: ",null==e?null:e.total_parts," "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function ns(n,l){1&n&&A.nrm(0,"span",90)}function Ss(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,ns,1,0,"span",91),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function li(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",90),A.EFF(2),A.k0s(),A.DNE(3,Ss,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(null!=e&&e.bolt12?"Bolt12":null!=e&&e.bolt11?"Bolt11":"Keysend"),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Ns(n,l){if(1&n&&(A.j41(0,"span",90),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" Part ID ",e.partid?e.partid:0," ")}}function is(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,Ns,2,1,"span",91),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function Ts(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",92)(2,"span",80),A.EFF(3),A.k0s()(),A.DNE(4,is,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(3,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.payment_hash),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Ps(n,l){if(1&n&&(A.j41(0,"span",94),A.nrm(1,"span",80),A.k0s()),2&n){const e=A.XpG(4);A.Y8G("ngStyle",A.eq3(1,St,e.screenSize===e.screenSizeEnum.XS?"6rem":e.colWidth))}}function Fi(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,Ps,2,3,"span",93),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function ki(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",92)(2,"span",80),A.EFF(3),A.k0s()(),A.DNE(4,Fi,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(3,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.bolt11),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Us(n,l){if(1&n&&(A.j41(0,"span",94),A.nrm(1,"span",80),A.k0s()),2&n){const e=A.XpG(4);A.Y8G("ngStyle",A.eq3(1,St,e.screenSize===e.screenSizeEnum.XS?"6rem":e.colWidth))}}function zn(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,Us,2,3,"span",93),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function Ls(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",92)(2,"span",80),A.EFF(3),A.k0s()(),A.DNE(4,zn,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(3,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.label),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function ss(n,l){if(1&n&&(A.j41(0,"span",94),A.nrm(1,"span",80),A.k0s()),2&n){const e=A.XpG(4);A.Y8G("ngStyle",A.eq3(1,St,e.screenSize===e.screenSizeEnum.XS?"6rem":e.colWidth))}}function Gs(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,ss,2,3,"span",93),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function yi(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",92)(2,"span",80),A.EFF(3),A.k0s()(),A.DNE(4,Gs,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(3,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.destination),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Yn(n,l){if(1&n&&(A.j41(0,"span",94),A.nrm(1,"span",80),A.k0s()),2&n){const e=A.XpG(4);A.Y8G("ngStyle",A.eq3(1,St,e.screenSize===e.screenSizeEnum.XS?"6rem":e.colWidth))}}function h(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,Yn,2,3,"span",93),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function c(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",92)(2,"span",80),A.EFF(3),A.k0s()(),A.DNE(4,h,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(3,St,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.memo),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function y(n,l){if(1&n&&(A.j41(0,"span",95),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,e.amount_sent_msat/1e3,e.amount_sent_msat<1e3?"1.0-4":"1.0-0")," ")}}function p(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,y,3,4,"span",96),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function q(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",95),A.EFF(2),A.nI1(3,"number"),A.k0s(),A.DNE(4,p,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,2,(null==e?null:e.amount_sent_msat)/1e3,(null==e?null:e.amount_sent_msat)<1e3?"1.0-4":"1.0-0")),A.R7$(2),A.Y8G("ngIf",e.is_expanded)}}function CA(n,l){if(1&n&&(A.j41(0,"span",95),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,e.amount_msat/1e3,e.amount_msat<1e3?"1.0-4":"1.0-0")," ")}}function _A(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,CA,3,4,"span",96),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function ee(n,l){if(1&n&&(A.j41(0,"td",73)(1,"span",95),A.EFF(2),A.nI1(3,"number"),A.k0s(),A.DNE(4,_A,2,1,"span",11),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,2,(null==e?null:e.amount_msat)/1e3,(null==e?null:e.amount_msat)<1e3?"1.0-4":"1.0-0")),A.R7$(2),A.Y8G("ngIf",e.is_expanded)}}function he(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",100)(1,"button",101),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(4);return w.Njj(r.onPaymentClick(o))}),A.EFF(2),A.k0s()()}if(2&n){const e=l.$implicit;A.R7$(2),A.SpI("View ",e.partid?e.partid:0)}}function Ie(n,l){if(1&n&&(A.j41(0,"div"),A.DNE(1,he,3,1,"div",99),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.mpps)}}function xe(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",73)(1,"span",97)(2,"button",98),A.bIt("click",function(){const o=w.eBV(e).$implicit;return w.Njj(o.is_expanded=!o.is_expanded)}),A.EFF(3),A.k0s()(),A.DNE(4,Ie,2,1,"div",11),A.k0s()}if(2&n){const e=l.$implicit;A.R7$(3),A.JRh(e.is_expanded?"Hide":"Show"),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function $(n,l){1&n&&A.nrm(0,"tr",102)}function s(n,l){if(1&n&&A.nrm(0,"tr",103),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,vn,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function d(n,l){1&n&&A.nrm(0,"tr",104)}function F(n,l){1&n&&A.nrm(0,"tr",102)}function W(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",22)(1,"div",23)(2,"div",24),A.nrm(3,"fa-icon",25),A.j41(4,"span",26),A.EFF(5,"Payments History"),A.k0s()(),A.j41(6,"div",27)(7,"mat-form-field",28)(8,"mat-label"),A.EFF(9,"Filter By"),A.k0s(),A.j41(10,"mat-select",29),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilterBy,o)||(r.selFilterBy=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return o.selFilter="",w.Njj(o.applyFilter())}),A.j41(11,"perfect-scrollbar"),A.DNE(12,Ci,2,2,"mat-option",30),A.k0s()()(),A.j41(13,"mat-form-field",28)(14,"mat-label"),A.EFF(15,"Filter"),A.k0s(),A.j41(16,"input",31),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilter,o)||(r.selFilter=o),w.Njj(o)}),A.bIt("input",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())})("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())}),A.k0s()()()(),A.j41(17,"div",32)(18,"div",33),A.DNE(19,di,1,0,"mat-progress-bar",34),A.j41(20,"table",35,2),A.qex(22,36),A.DNE(23,ri,1,0,"th",37)(24,Ki,3,2,"td",38),A.bVm(),A.qex(25,39),A.DNE(26,Qi,2,0,"th",40)(27,Xi,3,4,"td",38),A.bVm(),A.qex(28,41),A.DNE(29,mi,2,0,"th",40)(30,fn,2,1,"td",38),A.bVm(),A.qex(31,42),A.DNE(32,ms,2,0,"th",40)(33,Ms,4,4,"td",38),A.bVm(),A.qex(34,43),A.DNE(35,Mi,2,0,"th",40)(36,pi,4,4,"td",38),A.bVm(),A.qex(37,44),A.DNE(38,Zi,2,0,"th",40)(39,qi,4,4,"td",38),A.bVm(),A.qex(40,45),A.DNE(41,$i,2,0,"th",40)(42,ps,4,4,"td",38),A.bVm(),A.qex(43,46),A.DNE(44,As,2,0,"th",40)(45,Is,4,4,"td",38),A.bVm(),A.qex(46,47),A.DNE(47,Ui,2,0,"th",48)(48,es,4,4,"td",38),A.bVm(),A.qex(49,49),A.DNE(50,Zn,2,0,"th",48)(51,Ds,4,4,"td",38),A.bVm(),A.qex(52,50),A.DNE(53,Fs,6,0,"th",51)(54,Li,3,0,"td",52),A.bVm(),A.qex(55,53),A.DNE(56,qn,4,3,"td",54),A.bVm(),A.qex(57,55),A.DNE(58,zi,5,3,"td",38),A.bVm(),A.qex(59,56),A.DNE(60,Rs,4,2,"td",38),A.bVm(),A.qex(61,57),A.DNE(62,li,4,2,"td",38),A.bVm(),A.qex(63,58),A.DNE(64,Ts,5,5,"td",38),A.bVm(),A.qex(65,59),A.DNE(66,ki,5,5,"td",38),A.bVm(),A.qex(67,60),A.DNE(68,Ls,5,5,"td",38),A.bVm(),A.qex(69,61),A.DNE(70,yi,5,5,"td",38),A.bVm(),A.qex(71,62),A.DNE(72,c,5,5,"td",38),A.bVm(),A.qex(73,63),A.DNE(74,q,5,5,"td",38),A.bVm(),A.qex(75,64),A.DNE(76,ee,5,5,"td",38),A.bVm(),A.qex(77,65),A.DNE(78,xe,5,2,"td",38),A.bVm(),A.DNE(79,$,1,0,"tr",66)(80,s,1,3,"tr",67)(81,d,1,0,"tr",68)(82,F,1,0,"tr",66),A.k0s()()(),A.nrm(83,"mat-paginator",69),A.k0s()}if(2&n){const e=A.XpG();A.R7$(3),A.Y8G("icon",e.faHistory),A.R7$(7),A.R50("ngModel",e.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(18,Dn).concat(e.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",e.selFilter),A.R7$(3),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.payments)("ngClass",A.eq3(19,Cn,""!==e.errorMessage)),A.R7$(59),A.Y8G("matRowDefColumns",e.mppColumns)("matRowDefWhen",e.is_group),A.R7$(),A.Y8G("matFooterRowDef",A.lJ4(21,Nn)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)("matRowDefWhen",!e.is_group),A.R7$(),A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Z=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln,Qt,wn){this.logger=i,this.commonService=o,this.store=r,this.rtlEffects=iA,this.decimalPipe=ne,this.titleCasePipe=re,this.datePipe=ln,this.dataService=Qt,this.camelCaseWithReplace=wn,this.calledFrom="transactions",this.convertedCurrency=null,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"payments",recordsPerPage:B.md,sortBy:"created_at",sortOrder:B.oi.DESCENDING},this.faHistory=v.Int,this.newlyAddedPayment="",this.information={},this.payments=new z.I6([]),this.paymentJSONArr=[],this.displayedColumns=[],this.mppColumns=[],this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHintPre="",this.paymentDecodedHintPost="",this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.information=i}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.mppColumns=[],this.displayedColumns.map(o=>this.mppColumns.push("group_"+o)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns),this.logger.info(this.mppColumns)}),this.store.select(tA.KT).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.paymentJSONArr=i.payments||[],this.paymentJSONArr.length&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(i)})}ngAfterViewInit(){this.paymentJSONArr.length&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}is_group(i,o){return o.is_group||!1}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.created_at?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{this.paymentDecoded=i,this.paymentDecoded.created_at?(this.paymentDecoded.amount_msat||(this.paymentDecoded.amount_msat=0),this.sendPayment()):this.resetData()})}sendPayment(){this.newlyAddedPayment=this.paymentDecoded?.payment_hash||"",this.paymentDecoded.amount_msat&&0!==this.paymentDecoded.amount_msat?(this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.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:"payee",value:this.paymentDecoded.payee,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"created_at",value:this.paymentDecoded.created_at,title:"Creation Date",width:50,type:B.UN.DATE_TIME},{key:"num_satoshis",value:this.paymentDecoded.amount_msat/1e3,title:"Amount (Sats)",width:50,type:B.UN.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:B.UN.NUMBER},{key:"min_finaltv_expiry",value:this.paymentDecoded.min_final_cltv_expiry,title:"CLTV Expiry",width:50}]]}}})),this.rtlEffects.closeConfirm.pipe((0,bt.s)(1)).subscribe(o=>{o&&(this.store.dispatch((0,VA.Fd)({payload:{uiMessage:B.MZ.SEND_PAYMENT,paymentType:B.Y0.INVOICE,bolt11:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"payee",value:this.paymentDecoded.payee,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"created_at",value:this.paymentDecoded.created_at,title:"Creation Date",width:40,type:B.UN.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:B.UN.NUMBER},{key:"min_finaltv_expiry",value:this.paymentDecoded.min_final_cltv_expiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",getInputs:[{placeholder:"Amount (Sats)",inputType:B.UN.NUMBER,inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,bt.s)(1)).subscribe(r=>{r&&(this.paymentDecoded.amount_msat=r[0].inputValue,this.store.dispatch((0,VA.Fd)({payload:{uiMessage:B.MZ.SEND_PAYMENT,paymentType:B.Y0.INVOICE,bolt11:this.paymentRequest,amount_msat:1e3*r[0].inputValue,fromDialog:!1}})),this.resetData())}))}onPaymentRequestEntry(i){this.paymentRequest=i,this.paymentDecodedHintPre="",this.paymentDecodedHintPost="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,I.Q)(this.unSubs[5])).subscribe(o=>{this.paymentDecoded=o,this.paymentDecoded.amount_msat?this.selNode?.settings.fiatConversion?this.commonService.convertCurrency(this.paymentDecoded.amount_msat/1e3||0,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[6])).subscribe({next:r=>{this.convertedCurrency=r,this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats (",this.paymentDecodedHintPost=this.decimalPipe.transform(this.convertedCurrency.OTHER?this.convertedCurrency.OTHER:0,B.k.OTHER)+" "+this.convertedCurrency.unit+") | Memo: "+this.paymentDecoded.description},error:r=>{this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency.",this.paymentDecodedHintPost=""}}):(this.paymentDecodedHintPre="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount_msat?this.paymentDecoded.amount_msat/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description,this.paymentDecodedHintPost=""):(this.paymentDecodedHintPre="Zero Amount Invoice | Memo: "+this.paymentDecoded.description,this.paymentDecodedHintPost="")})}openSendPaymentModal(){this.store.dispatch((0,C.xO)({payload:{data:{component:Bn}}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}onPaymentClick(i){const o=[[{key:"payment_preimage",value:i.payment_preimage,title:"Payment Preimage",width:100,type:B.UN.STRING}],[{key:"id",value:i.id,title:"ID",width:20,type:B.UN.STRING},{key:"destination",value:i.destination,title:"Destination",width:80,type:B.UN.STRING}],[{key:"created_at",value:i.created_at,title:"Creation Date",width:50,type:B.UN.DATE_TIME},{key:"status",value:this.titleCasePipe.transform(i.status),title:"Status",width:50,type:B.UN.STRING}],[{key:"amount_msat",value:i.amount_msat,title:"Amount (mSats)",width:50,type:B.UN.NUMBER},{key:"amount_sent_msat",value:i.amount_sent_msat,title:"Amount Sent (mSats)",width:50,type:B.UN.NUMBER}]];i.bolt11&&""!==i.bolt11&&o?.unshift([{key:"bolt11",value:i.bolt11,title:"Bolt 11",width:100,type:B.UN.STRING}]),i.bolt12&&""!==i.bolt12&&o?.unshift([{key:"bolt12",value:i.bolt12,title:"Bolt 12",width:100,type:B.UN.STRING}]),i.memo&&""!==i.memo&&o?.splice(2,0,[{key:"memo",value:i.memo,title:"Memo",width:100,type:B.UN.STRING}]),i.hasOwnProperty("partid")?o?.unshift([{key:"payment_hash",value:i.payment_hash,title:"Payment Hash",width:80,type:B.UN.STRING},{key:"partid",value:i.partid,title:"Part ID",width:20,type:B.UN.STRING}]):o?.unshift([{key:"payment_hash",value:i.payment_hash,title:"Payment Hash",width:100,type:B.UN.STRING}]),this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Payment Information",message:o}}}))}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.payments.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.created_at?this.datePipe.transform(new Date(1e3*i.created_at),"dd/MMM/y HH:mm")?.toLowerCase():"")+(i.bolt12?"bolt12":i.bolt11?"bolt11":"keysend")+JSON.stringify(i).toLowerCase();break;case"status":r="complete"===i?.status?"completed":"incomplete/failed";break;case"created_at":r=this.datePipe.transform(new Date(1e3*(i[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"msatoshi_sent":r=((i.amount_sent_msat||0)/1e3).toString()||"";break;case"msatoshi":r=((i.amount_msat||0)/1e3).toString()||"";break;case"type":r=i?.bolt12?"bolt12":i?.bolt11?"bolt11":"keysend";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"status"===this.selFilterBy||"type"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadPaymentsTable(i){this.payments=new z.I6(i?[...i]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(o,r)=>{switch(r){case"msatoshi_sent":return o.amount_sent_msat;case"msatoshi":return o.amount_msat;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.payments.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const o=JSON.parse(JSON.stringify(this.payments.data))?.reduce((r,iA)=>iA.mpps?r.concat(iA.mpps):(delete iA.is_group,delete iA.is_expanded,delete iA.total_parts,r.concat(iA)),[]);this.commonService.downloadFile(o,"Payments")}}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(b.H),A.rXU(de.QX),A.rXU(de.PV),A.rXU(de.vh),A.rXU(Dt.u),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-lightning-payments"]],viewQuery:function(o,r){if(1&o&&(A.GBs(In,5),A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first),A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},inputs:{calledFrom:"calledFrom"},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Payments")}])],decls:4,vars:3,consts:[["sendPaymentForm","ngForm"],["paymentReq","ngModel"],["table",""],["fxLayout","column","fxFlex","110","fxLayoutAlign","space-between stretch",1,"padding-gap"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxLayout","column","fxFlex","100"],["matInput","","name","paymentRequest","tabindex","1","required","",3,"ngModelChange","matTextareaAutosize","perfectScrollbar","ngModel"],["fxLayout","row wrap","fxFlex","100",4,"ngIf"],[4,"ngIf"],["fxLayout","row",1,"mt-3"],["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 wrap","fxFlex","100"],["fxLayoutAlign","center center","class","mr-3px",4,"ngIf"],["fxLayoutAlign","center center","class","mr-3px",3,"innerHTML",4,"ngIf"],["fxLayoutAlign","center center",1,"mr-3px"],[3,"icon"],["fxLayoutAlign","center center",1,"mr-3px",3,"innerHTML"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","created_at"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","type"],["matColumnDef","payment_hash"],["matColumnDef","bolt11"],["matColumnDef","label"],["matColumnDef","destination"],["matColumnDef","memo"],["matColumnDef","msatoshi_sent"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","group_status"],["matColumnDef","group_created_at"],["matColumnDef","group_type"],["matColumnDef","group_payment_hash"],["matColumnDef","group_bolt11"],["matColumnDef","group_label"],["matColumnDef","group_destination"],["matColumnDef","group_memo"],["matColumnDef","group_msatoshi_sent"],["matColumnDef","group_msatoshi"],["matColumnDef","group_actions"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Completed","matTooltipPosition","right",4,"ngIf"],["class","dot yellow","matTooltip","Incomplete/Failed","matTooltipPosition","right",4,"ngIf"],["matTooltip","Completed","matTooltipPosition","right",1,"dot","green"],["matTooltip","Incomplete/Failed","matTooltipPosition","right",1,"dot","yellow"],["mat-header-cell","","mat-sort-header",""],["fxLayout.gt-xs","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"mpp-row-span"],["fxLayoutAlign","start center","class","mpp-row-span",4,"ngFor","ngForOf"],["fxLayout","row",1,"ellipsis-parent","mpp-row-span",3,"ngStyle"],["fxLayoutAlign","start center","class","ellipsis-parent mpp-row-span",3,"ngStyle",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","mpp-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"mpp-row-span"],["fxLayoutAlign","end center","class","mpp-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"mpp-group-head"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-mpp-expand",3,"click"],["class","mpp-group-details","fxLayoutAlign","end center",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"mpp-group-details"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-mpp-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(o,r){1&o&&(A.j41(0,"div",3),A.DNE(1,Ei,14,3,"form",4)(2,wi,3,0,"div",5)(3,W,84,22,"div",6),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf","home"===r.calledFrom),A.R7$(),A.Y8G("ngIf","transactions"===r.calledFrom),A.R7$(),A.Y8G("ngIf","transactions"===r.calledFrom))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.qT,hA.me,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,de.QX,de.vh],styles:[".mat-column-status[_ngcontent-%COMP%], .mat-column-group_status[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-group_actions[_ngcontent-%COMP%] .mpp-group-head[_ngcontent-%COMP%], .mat-column-group_actions[_ngcontent-%COMP%] .mpp-group-details[_ngcontent-%COMP%]{min-height:3rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-mpp-expand[_ngcontent-%COMP%]{min-width:8rem;width:8rem;margin:0}.mat-column-group_actions[_ngcontent-%COMP%] .btn-mpp-info[_ngcontent-%COMP%]{min-width:7rem;margin:0}.mat-column-group_status[_ngcontent-%COMP%] .mpp-row-span[_ngcontent-%COMP%]:not(:first-of-type), .mat-column-group_created_at[_ngcontent-%COMP%] .mpp-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:2rem}.mpp-row-span[_ngcontent-%COMP%]{min-height:3rem}.mpp-row-span.ellipsis-parent[_ngcontent-%COMP%]{display:flex;align-items:center}.mpp-row-span[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{margin-top:-.3rem;position:absolute}.mat-column-group_created_at[_ngcontent-%COMP%]{min-width:11rem}"]}))}return n(),l})();const EA=n=>({backgroundColor:n});function PA(n,l){if(1&n&&A.nrm(0,"span",6),2&n){const e=A.XpG();A.Y8G("ngStyle",A.eq3(1,EA,"#"+(null==e.information?null:e.information.color)))}}function FA(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",1),A.EFF(2,"Color"),A.k0s(),A.j41(3,"div",2),A.nrm(4,"span",7),A.EFF(5),A.nI1(6,"uppercase"),A.k0s()()),2&n){const e=A.XpG();A.R7$(4),A.Y8G("ngStyle",A.eq3(4,EA,"#"+(null==e.information?null:e.information.color))),A.R7$(),A.SpI(" ",A.bMT(6,2,null==e.information?null:e.information.color)," ")}}function te(n,l){if(1&n&&(A.j41(0,"span",2),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(e)}}let ge=(()=>{var n;class l{constructor(i){this.commonService=i,this.chains=[""]}ngOnChanges(){this.information&&this.information.chains&&this.information.chains.length>0&&(this.chains=[""],this.information.chains.forEach(i=>{this.chains.push(this.commonService.titleCase(i.chain||"")+" "+this.commonService.titleCase(i.network||""))}))}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(L.h))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},standalone:!1,features:[A.OA$],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mt-2"],[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(o,r){1&o&&(A.j41(0,"div",0)(1,"div")(2,"h4",1),A.EFF(3,"Alias"),A.k0s(),A.j41(4,"div",2),A.EFF(5),A.DNE(6,PA,1,3,"span",3),A.k0s()(),A.DNE(7,FA,7,6,"div",4),A.j41(8,"div")(9,"h4",1),A.EFF(10,"Implementation"),A.k0s(),A.j41(11,"div",2),A.EFF(12),A.k0s()(),A.j41(13,"div")(14,"h4",1),A.EFF(15,"Chain"),A.k0s(),A.DNE(16,te,2,1,"span",5),A.k0s()()),2&o&&(A.R7$(5),A.SpI(" ",null==r.information?null:r.information.alias," "),A.R7$(),A.Y8G("ngIf",!r.showColorFieldSeparately),A.R7$(),A.Y8G("ngIf",r.showColorFieldSeparately),A.R7$(5),A.JRh(null!=r.information&&r.information.lnImplementation||null!=r.information&&r.information.version?(null==r.information?null:r.information.lnImplementation)+" "+(null==r.information?null:r.information.version):""),A.R7$(4),A.Y8G("ngForOf",r.chains))},dependencies:[de.Sq,de.bT,de.B3,Q.DJ,Q.sA,Q.UI,dA.eI,de.Pc],encapsulation:2}))}return n(),l})();function Me(n,l){if(1&n&&(A.j41(0,"div",2)(1,"div")(2,"h4",3),A.EFF(3,"Lightning"),A.k0s(),A.j41(4,"div",4),A.EFF(5),A.nI1(6,"number"),A.k0s(),A.nrm(7,"mat-progress-bar",5),A.k0s(),A.j41(8,"div")(9,"h4",3),A.EFF(10,"On-chain"),A.k0s(),A.j41(11,"div",4),A.EFF(12),A.nI1(13,"number"),A.k0s(),A.nrm(14,"mat-progress-bar",5),A.k0s(),A.j41(15,"div")(16,"h4",3),A.EFF(17,"Total"),A.k0s(),A.j41(18,"div",4),A.EFF(19),A.nI1(20,"number"),A.k0s()()()),2&n){const e=A.XpG();A.R7$(5),A.SpI("",A.i5U(6,7,e.balances.lightning,"1.0-0")," Sats"),A.R7$(2),A.Y8G("value",A.mNQ(e.balances.lightning/e.balances.total*100)),A.R7$(5),A.SpI("",A.i5U(13,10,e.balances.onchain,"1.0-0")," Sats"),A.R7$(2),A.Y8G("value",A.mNQ(e.balances.onchain/e.balances.total*100)),A.R7$(5),A.SpI("",A.i5U(20,13,e.balances.total,"1.0-0")," Sats")}}function Qe(n,l){if(1&n&&(A.j41(0,"div",6)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let me=(()=>{var n;class l{constructor(){this.balances={onchain:0,lightning:0,total:0}}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-balances-info"]],inputs:{balances:"balances",errorMessage:"errorMessage"},standalone:!1,decls:3,vars:2,consts:[["errorBlock",""],["class","mt-1","fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mt-1"],["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(o,r){if(1&o&&A.DNE(0,Me,21,16,"div",1)(1,Qe,3,1,"ng-template",null,0,A.C5r),2&o){const iA=A.sdS(2);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.bT,eA.HM,Q.DJ,Q.sA,Q.UI,de.QX],encapsulation:2}))}return n(),l})();const Ye=()=>["../routing"];function Ue(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",4),A.EFF(2,"Transactions"),A.k0s(),A.j41(3,"div",5),A.EFF(4),A.nI1(5,"number"),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(4),A.JRh(A.bMT(5,1,null==e.fees?null:e.fees.totalTxCount))}}function De(n,l){1&n&&(A.j41(0,"div")(1,"h4",4),A.EFF(2,"Transactions"),A.k0s(),A.j41(3,"a",8),A.EFF(4," Go to Routing "),A.k0s()()),2&n&&(A.R7$(3),A.Y8G("routerLink",A.lJ4(1,Ye)))}function Le(n,l){if(1&n&&(A.j41(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),A.EFF(4,"Total"),A.k0s(),A.j41(5,"div",5),A.EFF(6),A.nI1(7,"number"),A.k0s()()(),A.j41(8,"div",6),A.DNE(9,Ue,6,3,"div",7)(10,De,5,2,"div",7),A.k0s()()),2&n){const e=A.XpG();A.R7$(6),A.SpI("",A.bMT(7,3,(null==e.fees?null:e.fees.feeCollected)/1e3)," Sats"),A.R7$(3),A.Y8G("ngIf",null==e.fees?null:e.fees.totalTxCount),A.R7$(),A.Y8G("ngIf",!(null!=e.fees&&e.fees.totalTxCount))}}function Se(n,l){if(1&n&&(A.j41(0,"div",9)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let it=(()=>{var n;class l{constructor(){this.totalFees=[{name:"Total",value:0}]}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},standalone:!1,decls:3,vars:2,consts:[["errorBlock",""],["class","mt-2","fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",1,"mt-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],[4,"ngIf"],[1,"overflow-wrap","dashboard-info-value",3,"routerLink"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(o,r){if(1&o&&A.DNE(0,Le,11,5,"div",1)(1,Se,3,1,"ng-template",null,0,A.C5r),2&o){const iA=A.sdS(2);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.bT,Q.DJ,Q.sA,Q.UI,Sn.Wk,de.QX],encapsulation:2}))}return n(),l})();function Ve(n,l){if(1&n&&(A.j41(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),A.EFF(4,"Active"),A.k0s(),A.j41(5,"div",5),A.nrm(6,"span",6),A.EFF(7),A.nI1(8,"number"),A.k0s()(),A.j41(9,"div")(10,"h4",4),A.EFF(11,"Pending"),A.k0s(),A.j41(12,"div",5),A.nrm(13,"span",7),A.EFF(14),A.nI1(15,"number"),A.k0s()(),A.j41(16,"div")(17,"h4",4),A.EFF(18,"Inactive"),A.k0s(),A.j41(19,"div",5),A.nrm(20,"span",8),A.EFF(21),A.nI1(22,"number"),A.k0s()()(),A.j41(23,"div",3)(24,"div")(25,"h4",4),A.EFF(26,"Capacity"),A.k0s(),A.j41(27,"div",5),A.EFF(28),A.nI1(29,"number"),A.k0s()(),A.j41(30,"div")(31,"h4",4),A.EFF(32,"Capacity"),A.k0s(),A.j41(33,"div",5),A.EFF(34),A.nI1(35,"number"),A.k0s()(),A.j41(36,"div")(37,"h4",4),A.EFF(38,"Capacity"),A.k0s(),A.j41(39,"div",5),A.EFF(40),A.nI1(41,"number"),A.k0s()()()()),2&n){const e=A.XpG();A.R7$(7),A.JRh(A.bMT(8,6,(null==e.channelsStatus||null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),A.R7$(7),A.JRh(A.bMT(15,8,(null==e.channelsStatus||null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),A.R7$(7),A.JRh(A.bMT(22,10,(null==e.channelsStatus||null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),A.R7$(7),A.SpI("",A.i5U(29,12,(null==e.channelsStatus||null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0,"1.0-0")," Sats"),A.R7$(6),A.SpI("",A.i5U(35,15,(null==e.channelsStatus||null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0,"1.0-0")," Sats"),A.R7$(6),A.SpI("",A.i5U(41,18,(null==e.channelsStatus||null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0,"1.0-0")," Sats")}}function vt(n,l){if(1&n&&(A.j41(0,"div",9)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let zt=(()=>{var n;class l{constructor(){this.channelsStatus={active:{},pending:{},inactive:{}}}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-status-info"]],inputs:{channelsStatus:"channelsStatus",errorMessage:"errorMessage"},standalone:!1,decls:3,vars:2,consts:[["errorBlock",""],["class","mt-2","fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",1,"mt-2"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],[1,"dot","tiny-dot","green"],[1,"dot","tiny-dot","yellow"],[1,"dot","tiny-dot","grey"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(o,r){if(1&o&&A.DNE(0,Ve,42,21,"div",1)(1,vt,3,1,"ng-template",null,0,A.C5r),2&o){const iA=A.sdS(2);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.bT,Q.DJ,Q.sA,Q.UI,de.QX],encapsulation:2}))}return n(),l})();var sn=We(1997);const gn=()=>["../connections/channels/open"],Tn=(n,l)=>({filterColumn:n,filterValue:l});function rs(n,l){if(1&n&&(A.j41(0,"div",19)(1,"a",20),A.EFF(2),A.nI1(3,"slice"),A.k0s(),A.j41(4,"div",6)(5,"mat-hint",21)(6,"strong",8),A.EFF(7,"Local:"),A.k0s(),A.EFF(8),A.nI1(9,"number"),A.k0s(),A.j41(10,"mat-hint",22),A.nrm(11,"fa-icon",23),A.EFF(12),A.nI1(13,"number"),A.k0s(),A.j41(14,"mat-hint",24)(15,"strong",8),A.EFF(16,"Remote:"),A.k0s(),A.EFF(17),A.nI1(18,"number"),A.k0s()(),A.nrm(19,"mat-progress-bar",25),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(3);A.R7$(),A.Y8G("matTooltip",A.mNQ(e.alias||e.peer_id))("matTooltipDisabled",A.mNQ((e.alias||e.peer_id).length<26))("routerLink",A.lJ4(26,gn))("state",A.l_i(27,Tn,e.alias?"alias":"peer_id",e.alias||e.peer_id)),A.R7$(),A.Lme(" ",A.brH(3,14,(null==e?null:e.alias)||(null==e?null:e.peer_id)||"",0,24),"",(e.alias||e.peer_id||"").length>25?"...":""," "),A.R7$(6),A.SpI("",A.i5U(9,18,e.to_us_msat/1e3||0,"1.0-0")," Sats"),A.R7$(3),A.Y8G("icon",i.faBalanceScale),A.R7$(),A.SpI(" (",A.bMT(13,21,e.balancedness||0),") "),A.R7$(5),A.SpI("",A.i5U(18,23,e.to_them_msat/1e3||0,"1.0-0")," Sats"),A.R7$(2),A.Y8G("value",A.mNQ(e.to_us_msat&&e.to_us_msat>0?e.to_us_msat/(e.to_us_msat+e.to_them_msat)*100:0))}}function kn(n,l){if(1&n&&(A.j41(0,"div",17),A.DNE(1,rs,20,30,"div",18),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngForOf",e.activeChannels)}}function Jn(n,l){if(1&n&&(A.j41(0,"div",3)(1,"div",4)(2,"span",5),A.EFF(3,"Total Capacity"),A.k0s(),A.j41(4,"div",6)(5,"mat-hint",7)(6,"strong",8),A.EFF(7,"Local:"),A.k0s(),A.EFF(8),A.nI1(9,"number"),A.k0s(),A.j41(10,"mat-hint",9),A.nrm(11,"fa-icon",10),A.EFF(12),A.nI1(13,"number"),A.k0s(),A.j41(14,"mat-hint",11)(15,"strong",8),A.EFF(16,"Remote:"),A.k0s(),A.EFF(17),A.nI1(18,"number"),A.k0s()(),A.nrm(19,"mat-progress-bar",12),A.k0s(),A.j41(20,"div",13),A.nrm(21,"mat-divider",14),A.k0s(),A.j41(22,"div",15),A.DNE(23,kn,2,1,"div",16),A.k0s()()),2&n){const e=A.XpG(),i=A.sdS(2);A.R7$(8),A.SpI("",A.i5U(9,8,(null==e.channelBalances?null:e.channelBalances.localBalance)||0,"1.0-0")," Sats"),A.R7$(3),A.Y8G("icon",e.faBalanceScale),A.R7$(),A.SpI(" (",A.bMT(13,11,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),A.R7$(5),A.SpI("",A.i5U(18,13,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),A.R7$(2),A.Y8G("value",A.mNQ(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)),A.R7$(4),A.Y8G("ngIf",e.activeChannels&&e.activeChannels.length>0)("ngIfElse",i)}}function Xt(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",26),A.EFF(1," No channels available. "),A.j41(2,"button",27),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.goToChannels())}),A.EFF(3,"Open Channel"),A.k0s()()}}function dn(n,l){if(1&n&&(A.j41(0,"div",28)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let Zt=(()=>{var n;class l{constructor(i){this.router=i,this.faBalanceScale=v.GR4,this.faDumbbell=v.VwO,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/cln/connections")}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",activeChannels:"activeChannels",sortBy:"sortBy",errorMessage:"errorMessage"},standalone:!1,decls:5,vars:2,consts:[["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","8","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"matTooltip","matTooltipDisabled","routerLink","state"],["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(o,r){if(1&o&&A.DNE(0,Jn,24,16,"div",2)(1,Xt,4,0,"ng-template",null,0,A.C5r)(3,dn,3,1,"ng-template",null,1,A.C5r),2&o){const iA=A.sdS(4);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.Sq,de.bT,P.aY,fA.$z,yA.MV,sn.q,eA.HM,Q.DJ,Q.sA,Q.UI,HA.oV,M.Ld,Sn.Wk,de.P9,de.QX],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}))}return n(),l})();const _n=(n,l,e)=>({"mb-4":n,"mb-2":l,"mb-1":e}),Yt=()=>["../connections/channels/open"],mn=(n,l)=>({filterColumn:n,filterValue:l});function ci(n,l){if(1&n&&(A.j41(0,"mat-hint",19)(1,"strong",20),A.EFF(2,"Capacity: "),A.k0s(),A.EFF(3),A.nI1(4,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(3),A.SpI("",A.i5U(4,1,e.to_them_msat/1e3||0,"1.0-0")," Sats")}}function $n(n,l){if(1&n&&(A.j41(0,"mat-hint",19)(1,"strong",20),A.EFF(2,"Capacity: "),A.k0s(),A.EFF(3),A.nI1(4,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(3),A.SpI("",A.i5U(4,1,e.to_us_msat/1e3||0,"1.0-0")," Sats")}}function zs(n,l){if(1&n&&A.nrm(0,"mat-progress-bar",21),2&n){const e=A.XpG().$implicit,i=A.XpG(3);A.Y8G("value",A.mNQ(i.totalLiquidity>0?(e.to_them_msat/1e3||0)/i.totalLiquidity*100:0))}}function ks(n,l){if(1&n&&A.nrm(0,"mat-progress-bar",21),2&n){const e=A.XpG().$implicit,i=A.XpG(3);A.Y8G("value",A.mNQ(i.totalLiquidity>0?(e.to_us_msat/1e3||0)/i.totalLiquidity*100:0))}}function qs(n,l){if(1&n&&(A.j41(0,"div",14)(1,"a",15),A.EFF(2),A.nI1(3,"slice"),A.k0s(),A.j41(4,"div",16),A.DNE(5,ci,5,4,"mat-hint",17)(6,$n,5,4,"mat-hint",17),A.k0s(),A.DNE(7,zs,1,2,"mat-progress-bar",18)(8,ks,1,2,"mat-progress-bar",18),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(3);A.R7$(),A.Y8G("matTooltip",A.mNQ(e.alias||e.peer_id))("matTooltipDisabled",A.mNQ((e.alias||e.peer_id).length<26))("routerLink",A.lJ4(16,Yt))("state",A.l_i(17,mn,e.alias?"alias":"peer_id",e.alias||e.peer_id)),A.R7$(),A.Lme(" ",A.brH(3,12,e.alias||e.peer_id||"",0,24),"",(e.alias||e.peer_id||"").length>25?"...":""," "),A.R7$(3),A.Y8G("ngIf","In"===i.direction),A.R7$(),A.Y8G("ngIf","Out"===i.direction),A.R7$(),A.Y8G("ngIf","In"===i.direction),A.R7$(),A.Y8G("ngIf","Out"===i.direction)}}function $s(n,l){if(1&n&&(A.j41(0,"div",12),A.DNE(1,qs,9,20,"div",13),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngForOf",e.activeChannels)}}function as(n,l){if(1&n&&(A.j41(0,"div",3)(1,"div",4)(2,"span",5),A.EFF(3,"Total Capacity"),A.k0s(),A.j41(4,"mat-hint",6),A.EFF(5),A.nI1(6,"number"),A.k0s(),A.nrm(7,"mat-progress-bar",7),A.k0s(),A.j41(8,"div",8),A.nrm(9,"mat-divider",9),A.k0s(),A.j41(10,"div",10),A.DNE(11,$s,2,1,"div",11),A.k0s()()),2&n){const e=A.XpG(),i=A.sdS(2);A.Y8G("ngClass",A.sMw(7,_n,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)),A.R7$(5),A.SpI("",A.i5U(6,4,e.totalLiquidity,"1.0-0")," Sats"),A.R7$(6),A.Y8G("ngIf",e.activeChannels&&e.activeChannels.length>0)("ngIfElse",i)}}function Ir(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",25),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.goToChannels())}),A.EFF(1,"Open Channel"),A.k0s()}}function Hn(n,l){if(1&n&&(A.j41(0,"div",22)(1,"div",23)(2,"div"),A.EFF(3,"No channels available."),A.k0s(),A.DNE(4,Ir,2,0,"button",24),A.k0s()()),2&n){const e=A.XpG();A.R7$(4),A.Y8G("ngIf","Out"===e.direction)}}function xi(n,l){if(1&n&&(A.j41(0,"div",26)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let Ar=(()=>{var n;class l{constructor(i,o){this.router=i,this.commonService=o,this.screenSize="",this.screenSizeEnum=B.f7}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/cln/connections")}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix),A.rXU(L.h))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",activeChannels:"activeChannels",errorMessage:"errorMessage"},standalone:!1,decls:5,vars:2,consts:[["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","8","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"matTooltip","matTooltipDisabled","routerLink","state"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"w-100","mt-1"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["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(o,r){if(1&o&&A.DNE(0,as,12,11,"div",2)(1,Hn,5,1,"ng-template",null,0,A.C5r)(3,xi,3,1,"ng-template",null,1,A.C5r),2&o){const iA=A.sdS(4);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.YU,de.Sq,de.bT,fA.$z,yA.MV,sn.q,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,HA.oV,M.Ld,Sn.Wk,de.P9,de.QX],encapsulation:2}))}return n(),l})();const Dr=n=>({"dashboard-card-content":!0,"error-border":n}),Na=n=>({"p-0":n});function Ta(n,l){if(1&n&&(A.j41(0,"button",28)(1,"mat-icon"),A.EFF(2,"more_vert"),A.k0s()()),2&n){A.XpG();const e=A.sdS(11);A.Y8G("matMenuTriggerFor",e)}}function Pa(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",29),A.bIt("click",function(){const o=w.eBV(e).index,r=A.XpG().$implicit,iA=A.XpG(2);return w.Njj(iA.onNavigateTo(r.links[o]))}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit;A.R7$(),A.JRh(e)}}function Ua(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",29),A.bIt("click",function(){w.eBV(e);const o=A.XpG(3);return w.Njj(o.onsortChannelsBy())}),A.EFF(1),A.k0s()}if(2&n){const e=A.XpG(3);A.R7$(),A.SpI("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score")}}function La(n,l){1&n&&A.nrm(0,"mat-progress-bar",30)}function Ga(n,l){if(1&n&&A.nrm(0,"rtl-cln-node-info",31),2&n){const e=A.XpG(3);A.Y8G("information",e.information)("showColorFieldSeparately",!1)}}function za(n,l){if(1&n&&A.nrm(0,"rtl-cln-balances-info",32),2&n){const e=A.XpG(3);A.Y8G("balances",e.balances)("errorMessage",e.errorMessages[1])}}function ka(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-capacity-info",33),2&n){const e=A.XpG(3);A.Y8G("sortBy",e.sortField)("channelBalances",e.channelBalances)("activeChannels",e.activeChannelsCapacity)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[1])}}function Ha(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-info",34),2&n){const e=A.XpG(3);A.Y8G("fees",e.fees)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[2]+" "+e.errorMessages[3])}}function ja(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-status-info",35),2&n){const e=A.XpG(3);A.Y8G("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[1]+" "+e.errorMessages[2])}}function Ct(n,l){1&n&&(A.j41(0,"h3"),A.EFF(1,"Error! Unable to find information!"),A.k0s())}function er(n,l){if(1&n&&(A.j41(0,"mat-grid-tile",11)(1,"mat-card",12)(2,"mat-card-header")(3,"mat-card-title",13)(4,"div"),A.nrm(5,"fa-icon",14),A.j41(6,"span"),A.EFF(7),A.k0s()(),A.j41(8,"div"),A.DNE(9,Ta,3,1,"button",15),A.j41(10,"mat-menu",16,1),A.DNE(12,Pa,2,1,"button",17)(13,Ua,2,1,"button",18),A.k0s()()()(),A.j41(14,"mat-card-content",19),A.DNE(15,La,1,0,"mat-progress-bar",20),A.j41(16,"div",21),A.DNE(17,Ga,1,2,"rtl-cln-node-info",22)(18,za,1,2,"rtl-cln-balances-info",23)(19,ka,1,4,"rtl-cln-channel-capacity-info",24)(20,Ha,1,2,"rtl-cln-fee-info",25)(21,ja,1,2,"rtl-cln-channel-status-info",26)(22,Ct,2,0,"h3",27),A.k0s()()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("colspan",e.cols)("rowspan",e.rows),A.R7$(5),A.Y8G("icon",e.icon),A.R7$(2),A.JRh(e.title),A.R7$(2),A.Y8G("ngIf",e.links[0]),A.R7$(3),A.Y8G("ngForOf",e.goToOptions),A.R7$(),A.Y8G("ngIf","capacity"===e.id),A.R7$(),A.Y8G("fxFlex",A.mNQ("capacity"===e.id?90:70))("ngClass",A.eq3(17,Dr,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&i.apiCallStatusBalances.status===i.apiCallStatusEnum.ERROR||"capacity"===e.id&&(i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusBalances.status===i.apiCallStatusEnum.ERROR)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.ERROR)||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusBalances.status===i.apiCallStatusEnum.ERROR))),A.R7$(),A.Y8G("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&i.apiCallStatusBalances.status===i.apiCallStatusEnum.INITIATED||"capacity"===e.id&&(i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusBalances.status===i.apiCallStatusEnum.INITIATED)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.INITIATED)||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusBalances.status===i.apiCallStatusEnum.INITIATED)),A.R7$(),A.Y8G("ngSwitch",e.id),A.R7$(),A.Y8G("ngSwitchCase","node"),A.R7$(),A.Y8G("ngSwitchCase","balance"),A.R7$(),A.Y8G("ngSwitchCase","capacity"),A.R7$(),A.Y8G("ngSwitchCase","fee"),A.R7$(),A.Y8G("ngSwitchCase","status")}}function Oa(n,l){if(1&n&&(A.j41(0,"div",5)(1,"div",6),A.nrm(2,"fa-icon",7),A.j41(3,"span",8),A.EFF(4),A.k0s()(),A.j41(5,"mat-grid-list",9),A.DNE(6,er,23,19,"mat-grid-tile",10),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.Y8G("icon",e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),A.R7$(2),A.JRh(e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),A.R7$(),A.Y8G("rowHeight",e.operatorCardHeight),A.R7$(),A.Y8G("ngForOf",e.operatorCards)}}function Fr(n,l){if(1&n&&(A.j41(0,"button",28)(1,"mat-icon"),A.EFF(2,"more_vert"),A.k0s()()),2&n){A.XpG();const e=A.sdS(9);A.Y8G("matMenuTriggerFor",e)}}function Or(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",29),A.bIt("click",function(){const o=w.eBV(e).index,r=A.XpG(2).$implicit,iA=A.XpG(2);return w.Njj(iA.onNavigateTo(r.links[o]))}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit;A.R7$(),A.JRh(e)}}function tr(n,l){if(1&n&&(A.j41(0,"mat-card-header")(1,"mat-card-title",13)(2,"div"),A.nrm(3,"fa-icon",14),A.j41(4,"span"),A.EFF(5),A.k0s()(),A.j41(6,"div"),A.DNE(7,Fr,3,1,"button",15),A.j41(8,"mat-menu",16,2),A.DNE(10,Or,2,1,"button",17),A.k0s()()()()),2&n){const e=A.XpG().$implicit;A.R7$(3),A.Y8G("icon",e.icon),A.R7$(2),A.JRh(e.title),A.R7$(2),A.Y8G("ngIf",e.links[0]),A.R7$(3),A.Y8G("ngForOf",e.goToOptions)}}function os(n,l){1&n&&A.nrm(0,"mat-progress-bar",30)}function nr(n,l){if(1&n&&A.nrm(0,"rtl-cln-node-info",45),2&n){const e=A.XpG(3);A.Y8G("information",e.information)}}function Jr(n,l){if(1&n&&A.nrm(0,"rtl-cln-balances-info",32),2&n){const e=A.XpG(3);A.Y8G("balances",e.balances)("errorMessage",e.errorMessages[1])}}function Hs(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-liquidity-info",46),2&n){const e=A.XpG(3);A.Y8G("totalLiquidity",e.totalInboundLiquidity)("activeChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function yr(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-liquidity-info",47),2&n){const e=A.XpG(3);A.Y8G("totalLiquidity",e.totalOutboundLiquidity)("activeChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function xr(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",29),A.bIt("click",function(){const o=w.eBV(e).index,r=A.XpG(2).$implicit,iA=A.XpG(2);return w.Njj(iA.onNavigateTo(r.links[o]))}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit;A.R7$(),A.JRh(e)}}function Ja(n,l){if(1&n&&(A.j41(0,"span",48)(1,"mat-tab-group",49)(2,"mat-tab",50),A.nrm(3,"rtl-cln-lightning-invoices-table",51),A.k0s(),A.j41(4,"mat-tab",52),A.nrm(5,"rtl-cln-lightning-payments",53),A.k0s()(),A.j41(6,"div",54)(7,"button",28)(8,"mat-icon"),A.EFF(9,"more_vert"),A.k0s()(),A.j41(10,"mat-menu",16,3),A.DNE(12,xr,2,1,"button",17),A.k0s()()()),2&n){const e=A.sdS(11),i=A.XpG().$implicit;A.R7$(7),A.Y8G("matMenuTriggerFor",e),A.R7$(5),A.Y8G("ngForOf",i.goToOptions)}}function _a(n,l){1&n&&(A.j41(0,"h3"),A.EFF(1,"Error! Unable to find information!"),A.k0s())}function Yi(n,l){if(1&n&&(A.j41(0,"mat-grid-tile",11)(1,"mat-card",38),A.DNE(2,tr,11,4,"mat-card-header",39),A.j41(3,"mat-card-content",40),A.DNE(4,os,1,0,"mat-progress-bar",20),A.j41(5,"div",21),A.DNE(6,nr,1,1,"rtl-cln-node-info",41)(7,Jr,1,2,"rtl-cln-balances-info",23)(8,Hs,1,3,"rtl-cln-channel-liquidity-info",42)(9,yr,1,3,"rtl-cln-channel-liquidity-info",43)(10,Ja,13,2,"span",44)(11,_a,2,0,"h3",27),A.k0s()()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("colspan",e.cols)("rowspan",e.rows),A.R7$(),A.Y8G("ngClass",A.eq3(14,Na,"transactions"===e.id)),A.R7$(),A.Y8G("ngIf","transactions"!==e.id),A.R7$(),A.Y8G("fxFlex",A.mNQ("transactions"===e.id?100:"balance"===e.id?70:90))("ngClass",A.eq3(16,Dr,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&i.apiCallStatusBalances.status===i.apiCallStatusEnum.ERROR||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR)),A.R7$(),A.Y8G("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&i.apiCallStatusBalances.status===i.apiCallStatusEnum.INITIATED||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngSwitch",e.id),A.R7$(),A.Y8G("ngSwitchCase","node"),A.R7$(),A.Y8G("ngSwitchCase","balance"),A.R7$(),A.Y8G("ngSwitchCase","inboundLiq"),A.R7$(),A.Y8G("ngSwitchCase","outboundLiq"),A.R7$(),A.Y8G("ngSwitchCase","transactions")}}function Hi(n,l){if(1&n&&(A.j41(0,"div",36),A.nrm(1,"fa-icon",7),A.j41(2,"span",8),A.EFF(3),A.k0s()(),A.j41(4,"mat-grid-list",37),A.DNE(5,Yi,12,18,"mat-grid-tile",10),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faSmile),A.R7$(2),A.SpI("Welcome ",e.information.alias,"! Your node is up and running."),A.R7$(),A.Y8G("rowHeight",e.merchantCardHeight),A.R7$(),A.Y8G("ngForOf",e.merchantCards)}}let Yr=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.store=o,this.commonService=r,this.router=iA,this.faSmile=K.Qpm,this.faFrown=K.wB1,this.faAngleDoubleDown=v.WxX,this.faAngleDoubleUp=v.$sC,this.faChartPie=v.W1p,this.faBolt=v.zm_,this.faServer=v.D6w,this.faNetworkWired=v.eGi,this.userPersonaEnum=B.HW,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.information={},this.totalBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.activeChannels=[],this.channelsStatus={active:{},pending:{},inactive:{}},this.activeChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="390px",this.merchantCardHeight="62px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo=null,this.apiCallStatusBalances=null,this.apiCallStatusChannels=null,this.apiCallStatusFHistory=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize(),this.screenSize===B.f7.XS?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/pending"],icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:6,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===B.f7.SM||this.screenSize===B.f7.MD?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/pending"],icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:3,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/pending"],icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(tA.RQ).pipe((0,I.Q)(this.unSubs[0]),(0,N.E)(this.store.select(j._c))).subscribe(([i,o])=>{this.errorMessages[0]="",this.errorMessages[3]="",this.apiCallStatusNodeInfo=i.apisCallStatus[0],this.apiCallStatusFHistory=i.apisCallStatus[1],this.apiCallStatusNodeInfo.status===B.wn.ERROR&&(this.errorMessages[0]=this.apiCallStatusNodeInfo.message?"object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message:""),this.apiCallStatusFHistory.status===B.wn.ERROR&&(this.errorMessages[3]=this.apiCallStatusFHistory.message?"object"==typeof this.apiCallStatusFHistory.message?JSON.stringify(this.apiCallStatusFHistory.message):this.apiCallStatusFHistory.message:""),this.selNode=o,this.information=i.information,this.fees=i.fees}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessages[2]="",this.apiCallStatusChannels=i.apiCallStatus,this.apiCallStatusChannels.status===B.wn.ERROR&&(this.errorMessages[2]=this.apiCallStatusChannels.message?"object"==typeof this.apiCallStatusChannels.message?JSON.stringify(this.apiCallStatusChannels.message):this.apiCallStatusChannels.message:""),this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.activeChannels=i.activeChannels,this.activeChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels,"balancedness")))||[],this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels?.filter(o=>!!o.to_them_msat&&o.to_them_msat>0),"to_them_msat")))||[],this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels?.filter(o=>!!o.to_us_msat&&o.to_us_msat>0),"to_us_msat")))||[],this.activeChannels.forEach(o=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil((o.to_them_msat||0)/1e3),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor((o.to_us_msat||0)/1e3)}),this.channelsStatus.active.channels=i.activeChannels.length||0,this.channelsStatus.pending.channels=i.pendingChannels.length||0,this.channelsStatus.inactive.channels=i.inactiveChannels.length||0,this.logger.info(i)}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.errorMessages[1]="",this.apiCallStatusBalances=i.apiCallStatus,this.apiCallStatusBalances.status===B.wn.ERROR&&(this.errorMessages[1]=this.apiCallStatusBalances.message?"object"==typeof this.apiCallStatusBalances.message?JSON.stringify(this.apiCallStatusBalances.message):this.apiCallStatusBalances.message:""),this.totalBalance=i.balance,this.balances.onchain=i.balance.totalBalance||0,this.balances.lightning=i.localRemoteBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const o=i.localRemoteBalance.localBalance?+i.localRemoteBalance.localBalance:0,r=i.localRemoteBalance.remoteBalance?+i.localRemoteBalance.remoteBalance:0;this.channelBalances={localBalance:o,remoteBalance:r,balancedness:+(1-Math.abs((o-r)/(o+r))).toFixed(3)},this.channelsStatus.active.capacity=i.localRemoteBalance.localBalance||0,this.channelsStatus.pending.capacity=i.localRemoteBalance.pendingBalance||0,this.channelsStatus.inactive.capacity=i.localRemoteBalance.inactiveBalance||0,this.logger.info(i)})}onNavigateTo(i){this.router.navigateByUrl("/cln/"+i)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.activeChannelsCapacity=this.activeChannels.sort((i,o)=>{const r=(i.to_us_msat?+i.to_us_msat:0)+(i.to_them_msat?+i.to_them_msat:0),iA=(o.to_them_msat?+o.to_them_msat:0)+(o.to_them_msat?+o.to_them_msat:0);return r>iA?-1:r{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(L.h),A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-home"]],standalone:!1,decls:3,vars:2,consts:[["merchantDashboard",""],["menuOperator","matMenu"],["menuMerchant","matMenu"],["menuTransactions","matMenu"],["fxLayout","column",4,"ngIf","ngIfElse"],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-2"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan",4,"ngFor","ngForOf"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",3,"fxFlex","ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"balances","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","activeChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"balances","errorMessage"],["fxFlex","100",3,"sortBy","channelBalances","activeChannels","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-2"],["cols","6","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100","direction","In",3,"totalLiquidity","activeChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100","direction","Out",3,"totalLiquidity","activeChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["fxFlex","100",3,"information"],["fxFlex","100","direction","In",3,"totalLiquidity","activeChannels","errorMessage"],["fxFlex","100","direction","Out",3,"totalLiquidity","activeChannels","errorMessage"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["mat-stretch-tabs","false","mat-align-tabs","start","fxLayout","column",1,"dashboard-tabs-group"],["label","Receive"],["calledFrom","home",1,"h-100"],["label","Pay"],["calledFrom","home"],[1,"underline"]],template:function(o,r){if(1&o&&A.DNE(0,Oa,7,4,"div",4)(1,Hi,6,4,"ng-template",null,0,A.C5r),2&o){const iA=A.sdS(2);A.Y8G("ngIf",(null==r.selNode?null:r.selNode.settings.userPersona)===r.userPersonaEnum.OPERATOR)("ngIfElse",iA)}},dependencies:[de.YU,de.Sq,de.bT,de.ux,de.e1,de.fG,P.aY,rA.iY,QA.RN,QA.m2,QA.MM,QA.dh,NA.B_,NA.NS,oA.An,uA.kk,uA.fb,uA.Cp,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,RA.mq,RA.T8,Ot,Z,ge,me,it,zt,Zt,Ar],encapsulation:2}))}return n(),l})();var Va=We(4572),Wa=We(2852),js=We(5416),gi=We(9454),ji=We(6013);const _r=["form"],Ka=["formSweepAll"],Xa=["stepper"],bi=(n,l)=>({"mr-6":n,"mr-2":l});function Xe(n,l){if(1&n&&(A.j41(0,"div",16),A.nrm(1,"fa-icon",17),A.j41(2,"span",18)(3,"div"),A.EFF(4,"Fee rates recommended by mempool (sat/vByte):"),A.k0s(),A.j41(5,"span",19)(6,"span"),A.EFF(7),A.k0s(),A.j41(8,"span"),A.EFF(9),A.k0s(),A.j41(10,"span"),A.EFF(11),A.k0s(),A.j41(12,"span"),A.EFF(13),A.k0s(),A.j41(14,"span"),A.EFF(15),A.k0s()()()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faInfoCircle),A.R7$(6),A.SpI("- High: ",e.recommendedFee.fastestFee||"Unknown"),A.R7$(2),A.SpI("- Medium: ",e.recommendedFee.halfHourFee||"Unknown"),A.R7$(2),A.SpI("- Low: ",e.recommendedFee.hourFee||"Unknown"),A.R7$(2),A.SpI("- Economy: ",e.recommendedFee.economyFee||"Unknown"),A.R7$(2),A.SpI("- Minimum: ",e.recommendedFee.minimumFee||"Unknown")}}function ir(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Bitcoin address is required."),A.k0s())}function Oi(n,l){1&n&&(A.j41(0,"mat-hint"),A.EFF(1,"Amount replaced by UTXO balance"),A.k0s())}function Za(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.amountError)}}function Vr(n,l){if(1&n&&(A.j41(0,"mat-option",51),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e),A.R7$(),A.JRh(e)}}function qa(n,l){if(1&n&&(A.j41(0,"mat-option",51),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e.feeRateId),A.R7$(),A.SpI(" ",e.feeRateType," ")}}function Os(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fee Rate is required."),A.k0s())}function $a(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",52)(1,"mat-label"),A.EFF(2,"Fee Rate (Sats/vByte)"),A.k0s(),A.j41(3,"input",53,5),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG(2);return A.DH7(r.customFeeRate,o)||(r.customFeeRate=o),w.Njj(o)}),A.k0s(),A.DNE(5,Os,2,0,"mat-error",23),A.k0s()}if(2&n){const e=A.XpG(2);A.R7$(3),A.Y8G("step",1)("min",0)("required","customperkb"===e.selFeeRate&&!e.flgMinConf),A.R50("ngModel",e.customFeeRate),A.R7$(2),A.Y8G("ngIf","customperkb"===e.selFeeRate&&!e.flgMinConf&&!e.customFeeRate)}}function Mc(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Min Confirmation Blocks is required."),A.k0s())}function Wr(n,l){if(1&n&&(A.j41(0,"mat-option",51),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e),A.R7$(),A.SpI("",A.i5U(2,2,e.amount_msat/1e3,"1.0-0")," Sats")}}function Kr(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.sendFundError)}}function Xr(n,l){if(1&n&&(A.j41(0,"div",54),A.nrm(1,"fa-icon",17),A.DNE(2,Kr,2,1,"span",23),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.sendFundError)}}function pc(n,l){if(1&n){const e=A.RV6();A.j41(0,"form",20,1),A.bIt("submit",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onSendFunds())})("reset",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.resetData())}),A.j41(2,"mat-form-field",21)(3,"mat-label"),A.EFF(4,"Bitcoin Address"),A.k0s(),A.j41(5,"input",22,2),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.transaction.destination,o)||(r.transaction.destination=o),w.Njj(o)}),A.k0s(),A.DNE(7,ir,2,0,"mat-error",23),A.k0s(),A.j41(8,"mat-form-field",24)(9,"mat-label"),A.EFF(10,"Amount"),A.k0s(),A.j41(11,"input",25,3),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.transaction.satoshi,o)||(r.transaction.satoshi=o),w.Njj(o)}),A.k0s(),A.DNE(13,Oi,2,0,"mat-hint",23),A.j41(14,"span",26),A.EFF(15),A.k0s(),A.DNE(16,Za,2,1,"mat-error",23),A.k0s(),A.j41(17,"mat-form-field",27)(18,"mat-label"),A.EFF(19,"Amount Unit"),A.k0s(),A.j41(20,"mat-select",28),A.bIt("selectionChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onAmountUnitChange(o))}),A.DNE(21,Vr,2,2,"mat-option",29),A.k0s()(),A.j41(22,"div",30)(23,"div",31)(24,"div",32)(25,"mat-form-field",33)(26,"mat-label"),A.EFF(27,"Fee Rate"),A.k0s(),A.j41(28,"mat-select",34),A.mxI("valueChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFeeRate,o)||(r.selFeeRate=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.customFeeRate=null)}),A.DNE(29,qa,2,2,"mat-option",29),A.k0s()(),A.DNE(30,$a,6,5,"mat-form-field",35),A.k0s(),A.j41(31,"div",36)(32,"mat-checkbox",37),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.flgMinConf,o)||(r.flgMinConf=o),w.Njj(o)}),A.bIt("change",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.flgMinConf?o.selFeeRate=null:o.minConfValue=null)}),A.k0s(),A.j41(33,"mat-form-field",38)(34,"mat-label"),A.EFF(35,"Min Confirmation Blocks"),A.k0s(),A.j41(36,"input",39,4),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.minConfValue,o)||(r.minConfValue=o),w.Njj(o)}),A.k0s(),A.DNE(38,Mc,2,0,"mat-error",23),A.k0s()()(),A.j41(39,"mat-expansion-panel",40),A.bIt("closed",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onAdvancedPanelToggle(!0))})("opened",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onAdvancedPanelToggle(!1))}),A.j41(40,"mat-expansion-panel-header")(41,"mat-panel-title")(42,"span"),A.EFF(43),A.k0s()()(),A.j41(44,"div",30)(45,"div",41)(46,"mat-form-field",42)(47,"mat-label"),A.EFF(48,"Coin Selection"),A.k0s(),A.j41(49,"mat-select",43),A.mxI("valueChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selUTXOs,o)||(r.selUTXOs=o),w.Njj(o)}),A.bIt("selectionChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onUTXOSelectionChange(o))}),A.j41(50,"mat-select-trigger"),A.EFF(51),A.nI1(52,"number"),A.k0s(),A.DNE(53,Wr,3,5,"mat-option",29),A.k0s()(),A.j41(54,"div",44)(55,"mat-slide-toggle",45),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.flgUseAllBalance,o)||(r.flgUseAllBalance=o),w.Njj(o)}),A.bIt("change",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onUTXOAllBalanceChange())}),A.EFF(56," Use selected UTXOs balance "),A.k0s(),A.j41(57,"mat-icon",46),A.EFF(58,"info_outline"),A.k0s()()()()(),A.nrm(59,"div",30),A.DNE(60,Xr,3,2,"div",47),A.j41(61,"div",48)(62,"button",49),A.EFF(63,"Clear Fields"),A.k0s(),A.j41(64,"button",50),A.EFF(65,"Send Funds"),A.k0s()()()()}if(2&n){const e=A.XpG();A.R7$(5),A.R50("ngModel",e.transaction.destination),A.R7$(2),A.Y8G("ngIf",!e.transaction.destination),A.R7$(4),A.Y8G("type",e.flgUseAllBalance?"text":"number")("step",100)("min",0)("disabled",e.flgUseAllBalance),A.R50("ngModel",e.transaction.satoshi),A.R7$(2),A.Y8G("ngIf",e.flgUseAllBalance),A.R7$(2),A.SpI("",e.selAmountUnit," "),A.R7$(),A.Y8G("ngIf",!e.transaction.satoshi),A.R7$(4),A.Y8G("value",e.selAmountUnit)("disabled",e.flgUseAllBalance),A.R7$(),A.Y8G("ngForOf",e.amountUnits),A.R7$(4),A.Y8G("ngClass","customperkb"!==e.selFeeRate||e.flgMinConf?"flex-100":"flex-48"),A.R7$(3),A.Y8G("disabled",e.flgMinConf),A.R50("value",e.selFeeRate),A.R7$(),A.Y8G("ngForOf",e.feeRateTypes),A.R7$(),A.Y8G("ngIf","customperkb"===e.selFeeRate&&!e.flgMinConf),A.R7$(2),A.Y8G("ngClass",A.l_i(36,bi,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)),A.R50("ngModel",e.flgMinConf),A.R7$(4),A.Y8G("step",1)("min",0)("required",e.flgMinConf)("disabled",!e.flgMinConf),A.R50("ngModel",e.minConfValue),A.R7$(2),A.Y8G("ngIf",e.flgMinConf&&!e.minConfValue),A.R7$(5),A.JRh(e.advancedTitle),A.R7$(6),A.R50("value",e.selUTXOs),A.R7$(2),A.Lme("",A.bMT(52,34,e.totalSelectedUTXOAmount)," Sats (",e.selUTXOs.length>1?e.selUTXOs.length+" UTXOs":"1 UTXO",")"),A.R7$(2),A.Y8G("ngForOf",e.utxos),A.R7$(2),A.Y8G("disabled",e.selUTXOs.length<1),A.R50("ngModel",e.flgUseAllBalance),A.R7$(5),A.Y8G("ngIf",""!==e.sendFundError)}}function Ao(n,l){if(1&n&&A.EFF(0),2&n){const e=A.XpG(3);A.JRh(e.passwordFormLabel)}}function eo(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Password is required."),A.k0s())}function to(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-step",58)(1,"form",76),A.DNE(2,Ao,1,1,"ng-template",70),A.j41(3,"div",7)(4,"mat-form-field",18)(5,"mat-label"),A.EFF(6,"Password"),A.k0s(),A.nrm(7,"input",77),A.DNE(8,eo,2,0,"mat-error",23),A.k0s()(),A.j41(9,"div",78)(10,"button",73),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onAuthenticate())}),A.EFF(11,"Confirm"),A.k0s()()()()}if(2&n){const e=A.XpG(2);A.Y8G("stepControl",e.passwordFormGroup)("editable",e.flgEditable),A.R7$(),A.Y8G("formGroup",e.passwordFormGroup),A.R7$(7),A.Y8G("ngIf",null==e.passwordFormGroup.controls.password.errors?null:e.passwordFormGroup.controls.password.errors.required)}}function no(n,l){if(1&n&&A.EFF(0),2&n){const e=A.XpG(2);A.JRh(e.sendFundFormLabel)}}function io(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Bitcoin address is required."),A.k0s())}function Zr(n,l){if(1&n&&(A.j41(0,"mat-option",51),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e.feeRateId),A.R7$(),A.SpI(" ",e.feeRateType," ")}}function so(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fee Rate is required."),A.k0s())}function ro(n,l){if(1&n&&(A.j41(0,"mat-form-field",52)(1,"mat-label"),A.EFF(2,"Fee Rate (Sats/vByte)"),A.k0s(),A.nrm(3,"input",79),A.DNE(4,so,2,0,"mat-error",23),A.k0s()),2&n){const e=A.XpG(2);A.R7$(3),A.Y8G("step",1)("min",0),A.R7$(),A.Y8G("ngIf","customperkb"===e.sendFundFormGroup.controls.selFeeRate.value&&!e.sendFundFormGroup.controls.flgMinConf.value&&!e.sendFundFormGroup.controls.customFeeRate.value)}}function ao(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Min Confirmation Blocks is required."),A.k0s())}function oo(n,l){if(1&n&&A.EFF(0),2&n){const e=A.XpG(2);A.JRh(e.confirmFormLabel)}}function lo(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.sendFundError)}}function Ic(n,l){if(1&n&&(A.j41(0,"div",54),A.nrm(1,"fa-icon",17),A.DNE(2,lo,2,1,"span",23),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.sendFundError)}}function qr(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",55)(1,"mat-vertical-stepper",56,6),A.bIt("selectionChange",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.stepSelectionChanged(o))}),A.DNE(3,to,12,4,"mat-step",57),A.j41(4,"mat-step",58)(5,"form",59),A.DNE(6,no,1,1,"ng-template",60),A.j41(7,"div",30)(8,"mat-form-field",18)(9,"mat-label"),A.EFF(10,"Bitcoin Address"),A.k0s(),A.nrm(11,"input",61),A.DNE(12,io,2,0,"mat-error",23),A.k0s(),A.j41(13,"div",62)(14,"div",32)(15,"mat-form-field",33)(16,"mat-label"),A.EFF(17,"Fee Rate"),A.k0s(),A.j41(18,"mat-select",63),A.DNE(19,Zr,2,2,"mat-option",29),A.k0s()(),A.DNE(20,ro,5,3,"mat-form-field",35),A.k0s(),A.j41(21,"div",36),A.nrm(22,"mat-checkbox",64),A.j41(23,"mat-form-field",38)(24,"mat-label"),A.EFF(25,"Min Confirmation Blocks"),A.k0s(),A.nrm(26,"input",65),A.DNE(27,ao,2,0,"mat-error",23),A.k0s()()()(),A.j41(28,"div",66)(29,"button",67),A.EFF(30,"Next"),A.k0s()()()(),A.j41(31,"mat-step",68)(32,"form",69),A.DNE(33,oo,1,1,"ng-template",70),A.j41(34,"div",55)(35,"div",71),A.nrm(36,"fa-icon",72),A.j41(37,"span"),A.EFF(38,"You are about to sweep all funds from RTL. Are you sure?"),A.k0s()(),A.DNE(39,Ic,3,2,"div",47),A.j41(40,"div",66)(41,"button",73),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onSendFunds())}),A.EFF(42,"Sweep All Funds"),A.k0s()()()()()(),A.j41(43,"div",74)(44,"button",75),A.EFF(45),A.k0s()()()}if(2&n){const e=A.XpG();A.R7$(),A.Y8G("linear",!0),A.R7$(2),A.Y8G("ngIf",!e.appConfig.SSO.rtlSSO),A.R7$(),A.Y8G("stepControl",e.sendFundFormGroup)("editable",e.flgEditable),A.R7$(),A.Y8G("formGroup",e.sendFundFormGroup),A.R7$(7),A.Y8G("ngIf",null==e.sendFundFormGroup.controls.transactionAddress.errors?null:e.sendFundFormGroup.controls.transactionAddress.errors.required),A.R7$(3),A.Y8G("ngClass","customperkb"!==e.sendFundFormGroup.controls.selFeeRate.value||e.sendFundFormGroup.controls.flgMinConf.value?"flex-100":"flex-48"),A.R7$(4),A.Y8G("ngForOf",e.feeRateTypes),A.R7$(),A.Y8G("ngIf","customperkb"===e.sendFundFormGroup.controls.selFeeRate.value&&!e.sendFundFormGroup.controls.flgMinConf.value),A.R7$(2),A.Y8G("ngClass",A.l_i(20,bi,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)),A.R7$(4),A.Y8G("step",1)("min",0)("required",e.sendFundFormGroup.controls.flgMinConf.value),A.R7$(),A.Y8G("ngIf",e.sendFundFormGroup.controls.flgMinConf.value&&!e.sendFundFormGroup.controls.minConfValue.value),A.R7$(4),A.Y8G("stepControl",e.confirmFormGroup),A.R7$(),A.Y8G("formGroup",e.confirmFormGroup),A.R7$(4),A.Y8G("icon",e.faExclamationTriangle),A.R7$(3),A.Y8G("ngIf",""!==e.sendFundError),A.R7$(5),A.Y8G("mat-dialog-close",!1),A.R7$(),A.JRh(e.flgValidated?"Close":"Cancel")}}let co=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln,Qt,wn,Ow,Jw){this.dialogRef=i,this.data=o,this.logger=r,this.dataService=iA,this.store=ne,this.commonService=re,this.decimalPipe=ln,this.actions=Qt,this.formBuilder=wn,this.rtlEffects=Ow,this.snackBar=Jw,this.faExclamationTriangle=v.zpE,this.faInfoCircle=v.iW_,this.sweepAll=!1,this.addressTypes=[],this.utxos=[],this.selUTXOs=[],this.flgUseAllBalance=!1,this.totalSelectedUTXOAmount=null,this.selectedAddress=B.Ld[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.feeRateTypes=B.G,this.selFeeRate="",this.customFeeRate=null,this.flgMinConf=!1,this.minConfValue=null,this.sendFundError="",this.fiatConversion=!1,this.amountUnits=B.A0,this.selAmountUnit=B.A0[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=B.k,this.advancedTitle="Advanced Options",this.flgValidated=!1,this.flgEditable=!0,this.recommendedFee={fastestFee:0,halfHourFee:0,hourFee:0},this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds",this.confirmFormLabel="Confirm sweep",this.amountError="Amount is Required.",this.screenSize="",this.screenSizeEnum=B.f7,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.dataService.getRecommendedFeeRates().pipe((0,I.Q)(this.unSubs[0])).subscribe({next:i=>{this.recommendedFee=i},error:i=>{this.logger.error(i)}}),this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[hA.k0.required]],password:["",[hA.k0.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",hA.k0.required],selFeeRate:[null],customFeeRate:[null],flgMinConf:[!1],minConfValue:[{value:null,disabled:!0}]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.flgMinConf.valueChanges.pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{i?(this.sendFundFormGroup.controls.selFeeRate.disable(),this.sendFundFormGroup.controls.selFeeRate.setValue(null),this.sendFundFormGroup.controls.minConfValue.reset(),this.sendFundFormGroup.controls.minConfValue.enable(),this.sendFundFormGroup.controls.minConfValue.setValidators([hA.k0.required]),this.sendFundFormGroup.controls.minConfValue.setValue(null)):(this.sendFundFormGroup.controls.selFeeRate.enable(),this.sendFundFormGroup.controls.selFeeRate.setValue(null),this.sendFundFormGroup.controls.minConfValue.setValue(null),this.sendFundFormGroup.controls.minConfValue.disable(),this.sendFundFormGroup.controls.minConfValue.setValidators(null),this.sendFundFormGroup.controls.minConfValue.setErrors(null))}),this.sendFundFormGroup.controls.selFeeRate.valueChanges.pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.sendFundFormGroup.controls.customFeeRate.setValue(null),this.sendFundFormGroup.controls.customFeeRate.reset(),this.sendFundFormGroup.controls.customFeeRate.setValidators("customperkb"!==i||this.sendFundFormGroup.controls.flgMinConf.value?null:[hA.k0.required])}),(0,Va.z)([this.store.select(j._c),this.store.select(j.qv)]).pipe((0,I.Q)(this.unSubs[3])).subscribe(([i,o])=>{this.fiatConversion=i.settings.fiatConversion,this.amountUnits=i.settings.currencyUnits,this.appConfig=o}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{this.information=i}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[5])).subscribe(i=>{this.utxos=this.commonService.sortAscByKey(i.utxos?.filter(o=>"confirmed"===o.status),"value"),this.logger.info(i)}),this.actions.pipe((0,I.Q)(this.unSubs[6]),(0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN||i.type===B.TC.SET_CHANNEL_TRANSACTION_RES_CLN)).subscribe(i=>{i.type===B.TC.SET_CHANNEL_TRANSACTION_RES_CLN&&(this.store.dispatch((0,C.UI)({payload:"Fund Sent Successfully!"})),this.dialogRef.close()),i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&i.payload.status===B.wn.ERROR&&"SetChannelTransaction"===i.payload.action&&(this.sendFundError=i.payload.message)})}onAuthenticate(){if(!this.passwordFormGroup.controls.password.value)return!0;this.flgValidated=!1,this.store.dispatch((0,C.oz)({payload:Wa(this.passwordFormGroup.controls.password.value).toString()})),this.rtlEffects.isAuthorizedRes.pipe((0,bt.s)(1)).subscribe(i=>{"ERROR"!==i?(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.sendFundError="",this.flgUseAllBalance&&(this.transaction.satoshi="all"),this.selUTXOs.length&&this.selUTXOs.length>0&&(this.transaction.utxos=[],this.selUTXOs.forEach(i=>this.transaction.utxos?.push(i.txid+":"+i.output))),this.sweepAll){if(!this.sendFundFormGroup.controls.transactionAddress.value||""===this.sendFundFormGroup.controls.transactionAddress.value||this.sendFundFormGroup.controls.flgMinConf.value&&(!this.sendFundFormGroup.controls.minConfValue.value||this.sendFundFormGroup.controls.minConfValue.value<=0)||"customperkb"===this.selFeeRate&&!this.flgMinConf&&!this.customFeeRate)return!0;this.transaction.satoshi="all",this.transaction.destination=this.sendFundFormGroup.controls.transactionAddress.value,this.sendFundFormGroup.controls.flgMinConf.value?(delete this.transaction.feerate,this.transaction.minconf=this.sendFundFormGroup.controls.flgMinConf.value?this.sendFundFormGroup.controls.minConfValue.value:null):(delete this.transaction.minconf,this.transaction.feerate="customperkb"===this.sendFundFormGroup.controls.selFeeRate.value&&!this.sendFundFormGroup.controls.flgMinConf.value&&this.sendFundFormGroup.controls.customFeeRate.value?1e3*this.sendFundFormGroup.controls.customFeeRate.value+"perkb":this.sendFundFormGroup.controls.selFeeRate.value),delete this.transaction.utxos,this.store.dispatch((0,VA.aB)({payload:this.transaction}))}else{if(this.transaction.minconf=this.flgMinConf?this.minConfValue:null,this.transaction.feerate="customperkb"===this.selFeeRate&&!this.flgMinConf&&this.customFeeRate?1e3*this.customFeeRate+"perkb":""!==this.selFeeRate?this.selFeeRate:null,!this.transaction.destination||""===this.transaction.destination||!this.transaction.satoshi||+this.transaction.satoshi<=0||this.flgMinConf&&(!this.transaction.minconf||this.transaction.minconf<=0)||"customperkb"===this.selFeeRate&&!this.flgMinConf&&!this.customFeeRate)return!0;this.transaction.satoshi&&"all"!==this.transaction.satoshi&&this.selAmountUnit!==B.BQ.SATS?this.commonService.convertCurrency(+this.transaction.satoshi,this.selAmountUnit===this.amountUnits[2]?B.BQ.OTHER:this.selAmountUnit,B.BQ.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,I.Q)(this.unSubs[7])).subscribe({next:i=>{this.transaction.satoshi=i[B.BQ.SATS],this.selAmountUnit=B.BQ.SATS,this.store.dispatch((0,VA.aB)({payload:this.transaction}))},error:i=>{this.transaction.satoshi=null,this.selAmountUnit=B.BQ.SATS,this.amountError="Conversion Error: "+i}}):this.store.dispatch((0,VA.aB)({payload:this.transaction}))}}resetData(){this.sendFundError="",this.transaction={},this.flgMinConf=!1,this.totalSelectedUTXOAmount=null,this.selUTXOs=[],this.flgUseAllBalance=!1,this.selAmountUnit=B.A0[0]}stepSelectionChanged(i){switch(this.sendFundError="",i.selectedIndex){case 0:default:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds";break;case 1:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds";break;case 2:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds | Address: "+this.sendFundFormGroup.controls.transactionAddress.value+(this.sendFundFormGroup.controls.flgMinConf.value?" | Min Confirmation Blocks: "+this.sendFundFormGroup.controls.minConfValue.value:this.sendFundFormGroup.controls.selFeeRate.value?" | Fee Rate: "+this.feeRateTypes.find(o=>o.feeRateId===this.sendFundFormGroup.controls.selFeeRate.value)?.feeRateType:"")}i.selectedIndex0?(this.totalSelectedUTXOAmount=this.selUTXOs?.reduce((o,r)=>o+(r.amount_msat||0)/1e3,0),this.flgUseAllBalance&&this.onUTXOAllBalanceChange()):(this.totalSelectedUTXOAmount=null,this.transaction.satoshi=null,this.flgUseAllBalance=!1)}onUTXOAllBalanceChange(){this.flgUseAllBalance?(this.transaction.satoshi=this.totalSelectedUTXOAmount,this.selAmountUnit=B.A0[0]):this.transaction.satoshi=null}onAmountUnitChange(i){const o=this,r=this.selAmountUnit===this.amountUnits[2]?B.BQ.OTHER:this.selAmountUnit;let iA=i.value===this.amountUnits[2]?B.BQ.OTHER:i.value;this.transaction.satoshi&&this.selAmountUnit!==i.value&&this.commonService.convertCurrency(+this.transaction.satoshi,r,iA,this.amountUnits[2],this.fiatConversion).pipe((0,I.Q)(this.unSubs[8])).subscribe({next:ne=>{this.selAmountUnit=i.value,o.transaction.satoshi=o.decimalPipe.transform(ne[iA],o.currencyUnitFormats[iA])?.replace(/,/g,"")},error:ne=>{o.transaction.satoshi=null,this.amountError="Conversion Error: "+ne,this.selAmountUnit=r,iA=r}})}onAdvancedPanelToggle(i){this.advancedTitle=i&&this.selUTXOs.length&&this.selUTXOs.length>0?"Advanced Options | Selected UTXOs: "+this.selUTXOs.length+" | Selected UTXO Amount: "+this.decimalPipe.transform(this.totalSelectedUTXOAmount)+" Sats":"Advanced Options"}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(aA.gP),A.rXU(Dt.u),A.rXU(AA.il),A.rXU(L.h),A.rXU(de.QX),A.rXU(kA.En),A.rXU(hA.ze),A.rXU(b.H),A.rXU(js.UG))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-on-chain-send-modal"]],viewQuery:function(o,r){if(1&o&&(A.GBs(_r,7),A.GBs(Ka,5),A.GBs(Xa,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first),A.mGM(iA=A.lsd())&&(r.formSweepAll=iA.first),A.mGM(iA=A.lsd())&&(r.stepper=iA.first)}},standalone:!1,decls:13,vars:5,consts:[["sweepAllBlock",""],["form","ngForm"],["address","ngModel"],["amount","ngModel"],["blocks","ngModel"],["custFeeRate","ngModel"],["stepper",""],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["fxFlex","5","fxLayoutAlign","center center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],["fxLayout","column",1,"padding-gap-x-large"],["fxFlex","100","class","alert alert-info mb-2",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100","class","overflow-x-hidden",3,"submit","reset",4,"ngIf","ngIfElse"],["fxFlex","100",1,"alert","alert-info","mb-2"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","100"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"pr-2"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100",1,"overflow-x-hidden",3,"submit","reset"],["fxLayout","column","fxFlex","55"],["matInput","","autoFocus","","name","address","required","",3,"ngModelChange","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","30"],["matInput","","name","amount","required","",3,"ngModelChange","type","step","min","disabled","ngModel"],["matSuffix",""],["fxLayout","column","fxFlex","10","fxLayoutAlign","start end"],["required","","name","amountUnit",3,"selectionChange","value","disabled"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayoutAlign.gt-sm","space-between center","fxLayout.gt-sm","row wrap"],["fxFlex","48","fxLayoutAlign","space-between start"],["fxLayout","column","fxLayoutAlign","start center",3,"ngClass"],[3,"valueChange","selectionChange","disabled","value"],["fxFlex","48","fxLayoutAlign","end center",4,"ngIf"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","7","color","primary","name","flgMinConf","fxLayoutAlign","stretch start",3,"ngModelChange","change","ngClass","ngModel"],["fxLayout","column","fxFlex","93"],["matInput","","type","number","name","blocks",3,"ngModelChange","step","min","required","disabled","ngModel"],["fxLayout","column","fxFlex","100","expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxLayout","column","fxFlex","35","fxLayoutAlign","start end"],["multiple","",3,"valueChange","selectionChange","value"],["fxFlex","60","fxLayout","row","fxLayoutAlign","start center"],["color","primary","name","flgUseAllBalance",3,"ngModelChange","change","disabled","ngModel"],["matTooltip","Use selected UTXOs balance as the amount to be sent. Final amount sent will be less the mining fee.","matTooltipPosition","above",1,"info-icon"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit"],[3,"value"],["fxFlex","48","fxLayoutAlign","end center"],["matInput","","type","number","name","custFeeRate",3,"ngModelChange","step","min","required","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],["fxLayout","column"],[3,"selectionChange","linear"],[3,"stepControl","editable",4,"ngIf"],[3,"stepControl","editable"],["fxLayout","column",1,"my-1","pr-1",3,"formGroup"],["matStepLabel","","disabled","true"],["matInput","","formControlName","transactionAddress","name","address","required",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign.gt-sm","space-between center"],["formControlName","selFeeRate"],["fxFlex","7","color","primary","formControlName","flgMinConf","fxLayoutAlign","stretch start",3,"ngClass"],["matInput","","formControlName","minConfValue","type","number","name","blocks",3,"step","min","required"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","type","button ","matStepperNext",""],[3,"stepControl"],["fxLayout","column","fxLayoutAlign","start",1,"my-1","pr-1",3,"formGroup"],["matStepLabel",""],["fxFlex","100",1,"w-100","alert","alert-warn"],[1,"mt-1","mr-1","alert-icon",3,"icon"],["mat-button","","color","primary","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","type","button","default","",3,"mat-dialog-close"],["fxLayout","column","fxLayoutAlign","space-between",1,"my-1","pr-1",3,"formGroup"],["autoFocus","","matInput","","type","password","formControlName","password","required",""],["fxLayout","row",1,"mt-2"],["matInput","","formControlName","customFeeRate","type","number","name","custFeeRate",3,"step","min"]],template:function(o,r){if(1&o&&(A.j41(0,"div",7)(1,"div",8)(2,"mat-card-header",9)(3,"div",10)(4,"span",11),A.EFF(5),A.k0s()(),A.j41(6,"button",12),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",13),A.DNE(9,Xe,16,6,"div",14)(10,pc,66,39,"form",15),A.k0s()()(),A.DNE(11,qr,46,23,"ng-template",null,0,A.C5r)),2&o){const iA=A.sdS(12);A.R7$(5),A.JRh(r.sweepAll?"Sweep All Funds":"Send Funds"),A.R7$(),A.Y8G("mat-dialog-close",!1),A.R7$(3),A.Y8G("ngIf",r.recommendedFee.minimumFee),A.R7$(),A.Y8G("ngIf",!r.sweepAll)("ngIfElse",iA)}},dependencies:[de.YU,de.Sq,de.bT,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.vS,hA.cV,hA.j4,hA.JD,P.aY,wA.tx,fA.$z,QA.m2,QA.MM,Ze.So,gi.GK,gi.Z2,gi.WN,oA.An,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,yA.yw,Q.DJ,Q.sA,Q.UI,dA.PW,OA.VO,OA.$2,xA.wT,Ee.sG,HA.oV,ji.V5,ji.Ti,ji.M6,ji.F7,cA.N,J.V,de.QX],encapsulation:2}))}return n(),l})();var $r=We(5837),Aa=We(1975);const go=()=>["all"],Bo=n=>({"error-border":n}),fo=()=>["no_utxo"],br=n=>({width:n}),ea=n=>({"display-none":n});function Pn(n,l){if(1&n&&(A.j41(0,"mat-option",37),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function uo(n,l){1&n&&A.nrm(0,"mat-progress-bar",38)}function ho(n,l){1&n&&A.nrm(0,"th",39)}function Eo(n,l){1&n&&(A.j41(0,"span",42)(1,"mat-icon",43),A.EFF(2,"warning"),A.k0s()())}function wo(n,l){if(1&n&&(A.j41(0,"td",40),A.DNE(1,Eo,3,0,"span",41),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(),o=A.sdS(56);A.R7$(),A.Y8G("ngIf",i.numDustUTXOs>0&&!i.isDustUTXO&&(null==e?null:e.amount_msat)/1e30||0===e.amount_msat),A.R7$(),A.Y8G("ngIf",e.amount_msat<0)}}function kt(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Blockheight"),A.k0s())}function Do(n,l){if(1&n&&(A.j41(0,"td",40)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.bMT(3,1,null==e?null:e.blockheight)," ")}}function Si(n,l){1&n&&(A.j41(0,"th",49),A.EFF(1,"Reserved"),A.k0s())}function Fo(n,l){if(1&n&&(A.j41(0,"td",40)(1,"span"),A.EFF(2),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(e.reserved?"Yes":"No")}}function yo(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",57)(1,"div",58)(2,"mat-select",59),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",60),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function xo(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",61)(1,"button",62),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG();return w.Njj(iA.onUTXOClick(r,o))}),A.EFF(2,"View Info"),A.k0s()()}}function or(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No utxos available."),A.k0s())}function Kn(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting utxos..."),A.k0s())}function na(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function ls(n,l){if(1&n&&(A.j41(0,"td",63),A.DNE(1,or,2,0,"p",64)(2,Kn,2,0,"p",64)(3,na,2,1,"p",64),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function ia(n,l){if(1&n&&A.nrm(0,"tr",65),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,ea,(null==e.listUTXOs?null:e.listUTXOs.data)&&(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)>0))}}function Yo(n,l){1&n&&A.nrm(0,"tr",66)}function lr(n,l){1&n&&A.nrm(0,"tr",67)}function cr(n,l){1&n&&A.nrm(0,"mat-icon",68)}let Ni=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.commonService=o,this.store=r,this.camelCaseWithReplace=iA,this.numDustUTXOs=0,this.isDustUTXO=!1,this.dustAmount=1e3,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="on_chain",this.tableSetting={tableId:"utxos",recordsPerPage:B.md,sortBy:"status",sortOrder:B.oi.DESCENDING},this.displayedColumns=[],this.listUTXOs=new z.I6([]),this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.tableSetting.tableId=this.isDustUTXO?"dust_utxos":"utxos",this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),i.utxos&&i.utxos.length>0&&(this.dustUtxos=i.utxos?.filter(o=>+(o.amount_msat||0)/1e30&&this.loadUTXOsTable(this.dustUtxos):(this.displayedColumns.unshift("is_dust"),this.utxos&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadUTXOsTable(this.utxos))),this.logger.info(i)})}ngAfterViewInit(){setTimeout(()=>{this.isDustUTXO?this.dustUtxos&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadUTXOsTable(this.dustUtxos):this.utxos&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadUTXOsTable(this.utxos)},0)}onUTXOClick(i,o){const r=[[{key:"txid",value:i.txid,title:"Transaction ID",width:100,type:B.UN.STRING,explorerLink:"tx"}],[{key:"output",value:i.output,title:"Output",width:50,type:B.UN.NUMBER},{key:"amount_msat",value:(i.amount_msat||0)/1e3,title:"Value (Sats)",width:50,type:B.UN.NUMBER}],[{key:"status",value:this.commonService.titleCase(i.status||""),title:"Status",width:50,type:B.UN.STRING},{key:"blockheight",value:i.blockheight,title:"Blockheight",width:50,type:B.UN.NUMBER}],[{key:"address",value:i.address,title:"Address",width:100}]];this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"UTXO Information",message:r}}}))}applyFilter(){this.listUTXOs.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column||"","_"):"is_dust"===i?"Dust":this.commonService.titleCase(i)}setFilterPredicate(){this.listUTXOs.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=JSON.stringify(i).toLowerCase();break;case"is_dust":r=(i?.amount_msat||0)/1e3"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"is_dust"===this.selFilterBy||"status"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadUTXOsTable(i){this.listUTXOs=new z.I6([...i]),this.listUTXOs.sort=this.sort,this.listUTXOs.sortingDataAccessor=(o,r)=>{switch(r){case"is_dust":return(o.amount_msat||0)/1e30&&this.commonService.downloadFile(this.listUTXOs.data,"UTXOs")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-on-chain-utxos"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},inputs:{numDustUTXOs:"numDustUTXOs",isDustUTXO:"isDustUTXO",dustAmount:"dustAmount"},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("UTXOs")}])],decls:57,vars:18,consts:[["table",""],["emptySpace",""],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","row","fxLayoutAlign","start start"],["fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","is_dust"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Dust/Nondust",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["matColumnDef","txid"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","address"],["matColumnDef","scriptpubkey"],["matColumnDef","output"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","value"],["matColumnDef","blockheight"],["matColumnDef","reserved"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_utxo"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Dust/Nondust"],["mat-cell",""],["matTooltip","Risk of dust attack","matTooltipPosition","right",4,"ngIf","ngIfElse"],["matTooltip","Risk of dust attack","matTooltipPosition","right"],["fxLayoutAlign","start center","color","warn",1,"small-icon"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["class","dot green","matTooltip","Confirmed","matTooltipPosition","right",4,"ngIf"],["class","dot yellow","matTooltipPosition","right",3,"matTooltip",4,"ngIf"],["matTooltip","Confirmed","matTooltipPosition","right",1,"dot","green"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip"],["mat-header-cell","","mat-sort-header",""],["fxLayout.gt-xs","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],["fxLayoutAlign","start center","color","warn",1,"mr-1"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",2)(1,"div",3),A.nrm(2,"div",4),A.j41(3,"div",5)(4,"mat-form-field",6)(5,"mat-label"),A.EFF(6,"Filter By"),A.k0s(),A.j41(7,"mat-select",7),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(8,"perfect-scrollbar"),A.DNE(9,Pn,2,2,"mat-option",8),A.k0s()()(),A.j41(10,"mat-form-field",6)(11,"mat-label"),A.EFF(12,"Filter"),A.k0s(),A.j41(13,"input",9),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(14,"div",10)(15,"div",11),A.DNE(16,uo,1,0,"mat-progress-bar",12),A.j41(17,"table",13,0),A.qex(19,14),A.DNE(20,ho,1,0,"th",15)(21,wo,2,2,"td",16),A.bVm(),A.qex(22,17),A.DNE(23,Co,1,0,"th",18)(24,Dc,3,2,"td",16),A.bVm(),A.qex(25,19),A.DNE(26,Mo,2,0,"th",20)(27,vi,4,4,"td",16),A.bVm(),A.qex(28,21),A.DNE(29,po,2,0,"th",20)(30,ta,4,4,"td",16),A.bVm(),A.qex(31,22),A.DNE(32,vr,2,0,"th",20)(33,qt,4,4,"td",16),A.bVm(),A.qex(34,23),A.DNE(35,Ri,2,0,"th",24)(36,Rr,4,3,"td",16),A.bVm(),A.qex(37,25),A.DNE(38,Io,2,0,"th",24)(39,ar,3,2,"td",16),A.bVm(),A.qex(40,26),A.DNE(41,kt,2,0,"th",24)(42,Do,4,3,"td",16),A.bVm(),A.qex(43,27),A.DNE(44,Si,2,0,"th",20)(45,Fo,3,1,"td",16),A.bVm(),A.qex(46,28),A.DNE(47,yo,6,0,"th",29)(48,xo,3,0,"td",30),A.bVm(),A.qex(49,31),A.DNE(50,ls,4,3,"td",32),A.bVm(),A.DNE(51,ia,1,3,"tr",33)(52,Yo,1,0,"tr",34)(53,lr,1,0,"tr",35),A.k0s(),A.nrm(54,"mat-paginator",36),A.k0s()()(),A.DNE(55,cr,1,0,"ng-template",null,1,A.C5r)}2&o&&(A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(14,go).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(3),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.listUTXOs)("ngClass",A.eq3(15,Bo,""!==r.errorMessage)),A.R7$(34),A.Y8G("matFooterRowDef",A.lJ4(17,fo)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,fA.$z,oA.An,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,de.QX,de.PV],styles:[".mat-column-is_dust[_ngcontent-%COMP%]{max-width:3rem;width:3rem;text-overflow:unset}.mat-column-status[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}))}return n(),l})();function bo(n,l){if(1&n&&(A.j41(0,"span",4),A.EFF(1,"UTXOs"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.numUtxos))}}function gr(n,l){if(1&n&&(A.j41(0,"span",5),A.EFF(1,"Dust UTXOs"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.numDustUtxos))}}let Js=(()=>{var n;class l{constructor(i,o){this.logger=i,this.store=o,this.selectedTableIndex=0,this.selectedTableIndexChange=new A.bkB,this.numUtxos=0,this.numDustUtxos=0,this.DUST_AMOUNT=1e3,this.unSubs=[new g.B,new g.B]}ngOnInit(){this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{i.utxos&&i.utxos.length>0&&(this.numUtxos=i.utxos.length||0,this.numDustUtxos=i.utxos?.filter(o=>+(o.amount_msat||0)/1e3{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-utxo-tables"]],inputs:{selectedTableIndex:"selectedTableIndex"},outputs:{selectedTableIndexChange:"selectedTableIndexChange"},standalone:!1,decls:8,vars:7,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"bordered-box","my-2"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedIndexChange","selectedIndex"],["mat-tab-label",""],["fxLayout","row","fxFlex","100",3,"numDustUTXOs","isDustUTXO","dustAmount"],["matBadgeOverlap","false","matBadgeColor","primary",1,"tab-badge",3,"matBadge"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(o,r){1&o&&(A.j41(0,"div",0)(1,"mat-tab-group",1),A.bIt("selectedIndexChange",function(ne){return r.onSelectedIndexChanged(ne)}),A.j41(2,"mat-tab"),A.DNE(3,bo,2,2,"ng-template",2),A.nrm(4,"rtl-cln-on-chain-utxos",3),A.k0s(),A.j41(5,"mat-tab"),A.DNE(6,gr,2,2,"ng-template",2),A.nrm(7,"rtl-cln-on-chain-utxos",3),A.k0s()()()),2&o&&(A.R7$(),A.Y8G("selectedIndex",r.selectedTableIndex),A.R7$(3),A.Y8G("numDustUTXOs",r.numDustUtxos)("isDustUTXO",!1)("dustAmount",r.DUST_AMOUNT),A.R7$(3),A.Y8G("numDustUTXOs",r.numDustUtxos)("isDustUTXO",!0)("dustAmount",r.DUST_AMOUNT))},dependencies:[Q.DJ,Q.sA,Q.UI,Aa.k,RA.ES,RA.mq,RA.T8,Ni],encapsulation:2}))}return n(),l})();const vo=(n,l)=>[n,l];function Ro(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",13),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=null==o?null:o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("active",i.activeLink===(null==e?null:e.link))("routerLink",A.l_i(3,vo,null==e?null:e.link,null==i.selectedTable?null:i.selectedTable.name)),A.R7$(),A.JRh(null==e?null:e.name)}}let So=(()=>{var n;class l{constructor(i,o,r){this.store=i,this.router=o,this.activatedRoute=r,this.faExchangeAlt=v._qq,this.faChartPie=v.W1p,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:"dustUtxos"}],this.selectedTable=this.tables[0],this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.selectedTable=this.tables.find(o=>o.name===this.router.url.substring(this.router.url.lastIndexOf("/")+1))||this.tables[0],this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link,this.selectedTable=this.tables.find(iA=>iA.name===o.urlAfterRedirects.substring(o.urlAfterRedirects.lastIndexOf("/")+1))||this.tables[0]}}),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[1])).subscribe(o=>{this.selNode=o}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[2])).subscribe(o=>{this.balances=[{title:"Total Balance",dataValue:o.balance.totalBalance||0},{title:"Confirmed",dataValue:o.balance.confBalance||0},{title:"Unconfirmed",dataValue:o.balance.unconfBalance||0}]})}openSendFundsModal(i){this.store.dispatch((0,C.xO)({payload:{data:{sweepAll:i,component:co}}}))}onSelectedTableIndexChanged(i){this.selectedTable=this.tables.find(o=>o.id===i)||this.tables[0],this.router.navigate(["./",this.activeLink,this.selectedTable.name],{relativeTo:this.activatedRoute})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il),A.rXU(xt.Ix),A.rXU(xt.nX))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-on-chain"]],standalone:!1,decls:23,vars:6,consts:[["tabPanel",""],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["tabindex","1","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,"selectedTableIndexChange","selectedTableIndex"],["tabindex","1","role","tab","mat-tab-link","",1,"mat-tab-label",3,"click","active","routerLink"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1),A.nrm(1,"fa-icon",2),A.j41(2,"span",3),A.EFF(3,"On-chain Balance"),A.k0s()(),A.j41(4,"div",4)(5,"mat-card")(6,"mat-card-content",5),A.nrm(7,"rtl-currency-unit-converter",6),A.k0s()()(),A.j41(8,"div",1),A.nrm(9,"fa-icon",2),A.j41(10,"span",3),A.EFF(11,"On-chain Transactions"),A.k0s()(),A.j41(12,"div",7)(13,"mat-card")(14,"mat-card-content",5)(15,"nav",8),A.DNE(16,Ro,2,6,"div",9),A.k0s(),A.nrm(17,"mat-tab-nav-panel",null,0),A.j41(19,"div",10),A.nrm(20,"router-outlet"),A.k0s(),A.j41(21,"div",11)(22,"rtl-cln-utxo-tables",12),A.bIt("selectedTableIndexChange",function(re){return w.eBV(iA),w.Njj(r.onSelectedTableIndexChanged(re))}),A.k0s()()()()()}if(2&o){const iA=A.sdS(18);A.R7$(),A.Y8G("icon",r.faChartPie),A.R7$(6),A.Y8G("values",r.balances),A.R7$(2),A.Y8G("icon",r.faExchangeAlt),A.R7$(6),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links),A.R7$(6),A.Y8G("selectedTableIndex",null==r.selectedTable?null:r.selectedTable.id)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,RA.Bu,RA.hQ,RA.Ql,$r.f,xt.n3,Sn.Wk,Js],encapsulation:2}))}return n(),l})();function sa(n,l){if(1&n&&(A.j41(0,"span",10),A.EFF(1,"Channels"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.activeChannels))}}function No(n,l){if(1&n&&(A.j41(0,"span",10),A.EFF(1,"Peers"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.activePeers))}}let To=(()=>{var n;class l{constructor(i,o,r){this.store=i,this.logger=o,this.router=r,this.activePeers=0,this.activeChannels=0,this.faUsers=v.gdJ,this.faChartPie=v.W1p,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 g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.activeLink=this.links.findIndex(i=>i.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(i=>i instanceof xt.gx)).subscribe({next:i=>{this.activeLink=this.links.findIndex(o=>o.link===i.urlAfterRedirects.substring(i.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.activeChannels=i.activeChannels.length||0}),this.store.select(tA.os).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.activePeers=i.peers&&i.peers.length?i.peers.length:0,this.logger.info(i)}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.balances=[{title:"Total Balance",dataValue:i.balance.totalBalance||0},{title:"Confirmed",dataValue:i.balance.confBalance||0},{title:"Unconfirmed",dataValue:i.balance.unconfBalance||0}]})}onSelectedTabChange(i){this.router.navigateByUrl("/cln/connections/"+this.links[i.index].link)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il),A.rXU(aA.gP),A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-connections"]],standalone:!1,decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedIndexChange","selectedTabChange","selectedIndex"],["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(o,r){1&o&&(A.j41(0,"div",0),A.nrm(1,"fa-icon",1),A.j41(2,"span",2),A.EFF(3,"On-chain Balance"),A.k0s()(),A.j41(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),A.nrm(7,"rtl-currency-unit-converter",5),A.k0s()()(),A.j41(8,"div",0),A.nrm(9,"fa-icon",1),A.j41(10,"span",2),A.EFF(11,"Connections"),A.k0s()(),A.j41(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"mat-tab-group",7),A.mxI("selectedIndexChange",function(ne){return A.DH7(r.activeLink,ne)||(r.activeLink=ne),ne}),A.bIt("selectedTabChange",function(ne){return r.onSelectedTabChange(ne)}),A.j41(16,"mat-tab"),A.DNE(17,sa,2,2,"ng-template",8),A.k0s(),A.j41(18,"mat-tab"),A.DNE(19,No,2,2,"ng-template",8),A.k0s()(),A.j41(20,"div",9),A.nrm(21,"router-outlet"),A.k0s()()()()),2&o&&(A.R7$(),A.Y8G("icon",r.faChartPie),A.R7$(6),A.Y8G("values",r.balances),A.R7$(2),A.Y8G("icon",r.faUsers),A.R7$(6),A.R50("selectedIndex",r.activeLink))},dependencies:[P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,Aa.k,RA.ES,RA.mq,RA.T8,$r.f,xt.n3],encapsulation:2}))}return n(),l})();function Po(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",12),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("routerLink",A.mNQ(e.link))("active",i.activeLink===e.link),A.R7$(),A.JRh(e.name)}}let Uo=(()=>{var n;class l{constructor(i,o,r){this.logger=i,this.store=o,this.router=r,this.faExchangeAlt=v._qq,this.faChartPie=v.W1p,this.currencyUnits=[],this.routerUrl="",this.balances=[{title:"Local Capacity",dataValue:0,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:0,tooltip:"Amount you can receive"}],this.links=[{link:"payments",name:"Payments"},{link:"invoices",name:"Invoices"}],this.activeLink=this.links[0].link,this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link,this.routerUrl=o.urlAfterRedirects}}),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[1])).subscribe(o=>{if(this.selNode=o,this.selNode&&this.selNode.settings.enableOffers){this.store.dispatch((0,VA.Eb)()),this.store.dispatch((0,VA.Ml)()),this.links.push({link:"offers",name:"Offers"}),this.links.push({link:"offrBookmarks",name:"Paid Offer Bookmarks"});const r=this.links.find(iA=>this.router.url.includes(iA.link));this.activeLink=r?r.link:this.links[0].link}}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[2]),(0,N.E)(this.store.select(j._c))).subscribe(([o,r])=>{this.currencyUnits=r?.settings.currencyUnits||[],this.balances=r&&r.settings.userPersona===B.HW.OPERATOR?[{title:"Local Capacity",dataValue:o.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:o.localRemoteBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:o.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:o.localRemoteBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(o)})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-transactions"]],standalone:!1,decls:21,vars:5,consts:[["tabPanel",""],["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["tabindex","1","role","tab","mat-tab-link","","class","mat-tab-label",3,"routerLink","active","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["tabindex","1","role","tab","mat-tab-link","",1,"mat-tab-label",3,"click","routerLink","active"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1),A.nrm(1,"fa-icon",2),A.j41(2,"span",3),A.EFF(3,"Lightning Balance"),A.k0s()(),A.j41(4,"div",4)(5,"mat-card")(6,"mat-card-content",5),A.nrm(7,"rtl-currency-unit-converter",6),A.k0s()()(),A.j41(8,"div",7),A.nrm(9,"fa-icon",2),A.j41(10,"span",3),A.EFF(11,"Lightning Transactions"),A.k0s()(),A.j41(12,"div",8)(13,"mat-card")(14,"mat-card-content",5)(15,"nav",9),A.DNE(16,Po,2,4,"div",10),A.k0s(),A.nrm(17,"mat-tab-nav-panel",null,0),A.j41(19,"div",11),A.nrm(20,"router-outlet"),A.k0s()()()()),2&o){const iA=A.sdS(18);A.R7$(),A.Y8G("icon",r.faChartPie),A.R7$(6),A.Y8G("values",r.balances),A.R7$(2),A.Y8G("icon",r.faExchangeAlt),A.R7$(6),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,RA.Bu,RA.hQ,RA.Ql,$r.f,xt.n3,Sn.Wk],encapsulation:2}))}return n(),l})();function Lo(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",12),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("routerLink",A.mNQ(e.link))("active",i.activeLink===e.link),A.R7$(),A.JRh(e.name)}}let Go=(()=>{var n;class l{constructor(i){this.router=i,this.faMapSigns=v.knH,this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"routingpeers",name:"Routing Peers"},{link:"failedtransactions",name:"Failed Transactions"},{link:"localfail",name:"Local Failed Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new g.B,new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-routing"]],standalone:!1,decls:15,vars:3,consts:[["tabPanel",""],["fxLayout","column",1,"mb-2"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start","fxFlex","100",3,"tabPanel"],["tabindex","1","mat-tab-link","","role","tab","class","mat-tab-label",3,"routerLink","active","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["tabindex","1","mat-tab-link","","role","tab",1,"mat-tab-label",3,"click","routerLink","active"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1)(1,"div",2),A.nrm(2,"fa-icon",3),A.j41(3,"span",4),A.EFF(4,"Routing"),A.k0s()(),A.j41(5,"div",5)(6,"mat-card",6)(7,"mat-card-content",7)(8,"div",8)(9,"nav",9),A.DNE(10,Lo,2,4,"div",10),A.k0s(),A.nrm(11,"mat-tab-nav-panel",null,0),A.k0s(),A.j41(13,"div",11),A.nrm(14,"router-outlet"),A.k0s()()()()()),2&o){const iA=A.sdS(12);A.R7$(2),A.Y8G("icon",r.faMapSigns),A.R7$(7),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,RA.Bu,RA.hQ,RA.Ql,xt.n3,Sn.Wk],encapsulation:2}))}return n(),l})();function zo(n,l){1&n&&(A.j41(0,"h3",9),A.EFF(1,"Node 1"),A.k0s())}function ko(n,l){1&n&&(A.j41(0,"h3",9),A.EFF(1,"Node 1 (Your Node)"),A.k0s())}function Ho(n,l){1&n&&(A.j41(0,"h3",9),A.EFF(1,"Node 2"),A.k0s())}function jo(n,l){1&n&&(A.j41(0,"h3",9),A.EFF(1,"Node 2 (Your Node)"),A.k0s())}function Oo(n,l){if(1&n&&(A.j41(0,"div",1),A.nrm(1,"mat-divider"),A.j41(2,"div",2)(3,"div",3)(4,"div",4),A.DNE(5,zo,2,0,"h3",5)(6,ko,2,0,"h3",5),A.k0s(),A.nrm(7,"mat-divider",6),A.j41(8,"div",4)(9,"h4",7),A.EFF(10,"Short Channel ID"),A.k0s(),A.j41(11,"span",8),A.EFF(12),A.k0s()(),A.nrm(13,"mat-divider",6),A.j41(14,"div",4)(15,"h4",7),A.EFF(16,"Active"),A.k0s(),A.j41(17,"span",8),A.EFF(18),A.k0s()(),A.nrm(19,"mat-divider",6),A.j41(20,"div",4)(21,"h4",7),A.EFF(22,"Last Update"),A.k0s(),A.j41(23,"span",8),A.EFF(24),A.nI1(25,"date"),A.k0s()(),A.nrm(26,"mat-divider",6),A.j41(27,"div",4)(28,"h4",7),A.EFF(29,"Amount (Sats)"),A.k0s(),A.j41(30,"span",8),A.EFF(31),A.nI1(32,"number"),A.k0s()(),A.nrm(33,"mat-divider",6),A.j41(34,"div",4)(35,"h4",7),A.EFF(36,"Base Fee (mSats)"),A.k0s(),A.j41(37,"span",8),A.EFF(38),A.nI1(39,"number"),A.k0s()(),A.nrm(40,"mat-divider",6),A.j41(41,"div",4)(42,"h4",7),A.EFF(43,"Fee/Millionth"),A.k0s(),A.j41(44,"span",8),A.EFF(45),A.nI1(46,"number"),A.k0s()(),A.nrm(47,"mat-divider",6),A.j41(48,"div",4)(49,"h4",7),A.EFF(50,"Channel Flags"),A.k0s(),A.j41(51,"span",8),A.EFF(52),A.nI1(53,"number"),A.k0s()(),A.nrm(54,"mat-divider",6),A.j41(55,"div",4)(56,"h4",7),A.EFF(57,"Delay"),A.k0s(),A.j41(58,"span",8),A.EFF(59),A.nI1(60,"number"),A.k0s()(),A.nrm(61,"mat-divider",6),A.j41(62,"div",4)(63,"h4",7),A.EFF(64,"Max Htlc (mSat)"),A.k0s(),A.j41(65,"span",8),A.EFF(66),A.nI1(67,"number"),A.k0s()(),A.nrm(68,"mat-divider",6),A.j41(69,"div",4)(70,"h4",7),A.EFF(71,"Min Htlc (mSat)"),A.k0s(),A.j41(72,"span",8),A.EFF(73),A.nI1(74,"number"),A.k0s()(),A.nrm(75,"mat-divider",6),A.j41(76,"div",4)(77,"h4",7),A.EFF(78,"Message Flags"),A.k0s(),A.j41(79,"span",8),A.EFF(80),A.nI1(81,"number"),A.k0s()(),A.nrm(82,"mat-divider",6),A.j41(83,"div",4)(84,"h4",7),A.EFF(85,"Public"),A.k0s(),A.j41(86,"span",8),A.EFF(87),A.k0s()(),A.nrm(88,"mat-divider",6),A.j41(89,"div",4)(90,"h4",7),A.EFF(91,"Source"),A.k0s(),A.j41(92,"span",8),A.EFF(93),A.k0s()(),A.nrm(94,"mat-divider",6),A.j41(95,"div",4)(96,"h4",7),A.EFF(97,"Destination"),A.k0s(),A.j41(98,"span",8),A.EFF(99),A.k0s()()(),A.j41(100,"div",3)(101,"div"),A.DNE(102,Ho,2,0,"h3",5)(103,jo,2,0,"h3",5),A.k0s(),A.nrm(104,"mat-divider",6),A.j41(105,"div",4)(106,"h4",7),A.EFF(107,"Short Channel ID"),A.k0s(),A.j41(108,"span",8),A.EFF(109),A.k0s()(),A.nrm(110,"mat-divider",6),A.j41(111,"div",4)(112,"h4",7),A.EFF(113,"Active"),A.k0s(),A.j41(114,"span",8),A.EFF(115),A.k0s()(),A.nrm(116,"mat-divider",6),A.j41(117,"div",4)(118,"h4",7),A.EFF(119,"Last Update"),A.k0s(),A.j41(120,"span",8),A.EFF(121),A.nI1(122,"date"),A.k0s()(),A.nrm(123,"mat-divider",6),A.j41(124,"div",4)(125,"h4",7),A.EFF(126,"Amount (Sats)"),A.k0s(),A.j41(127,"span",8),A.EFF(128),A.nI1(129,"number"),A.k0s()(),A.nrm(130,"mat-divider",6),A.j41(131,"div",4)(132,"h4",7),A.EFF(133,"Base Fee (mSats)"),A.k0s(),A.j41(134,"span",8),A.EFF(135),A.nI1(136,"number"),A.k0s()(),A.nrm(137,"mat-divider",6),A.j41(138,"div",4)(139,"h4",7),A.EFF(140,"Fee/Millionth"),A.k0s(),A.j41(141,"span",8),A.EFF(142),A.nI1(143,"number"),A.k0s()(),A.nrm(144,"mat-divider",6),A.j41(145,"div",4)(146,"h4",7),A.EFF(147,"Channel Flags"),A.k0s(),A.j41(148,"span",8),A.EFF(149),A.nI1(150,"number"),A.k0s()(),A.nrm(151,"mat-divider",6),A.j41(152,"div",4)(153,"h4",7),A.EFF(154,"Delay"),A.k0s(),A.j41(155,"span",8),A.EFF(156),A.nI1(157,"number"),A.k0s()(),A.nrm(158,"mat-divider",6),A.j41(159,"div",4)(160,"h4",7),A.EFF(161,"Max Htlc (mSat)"),A.k0s(),A.j41(162,"span",8),A.EFF(163),A.nI1(164,"number"),A.k0s()(),A.nrm(165,"mat-divider",6),A.j41(166,"div",4)(167,"h4",7),A.EFF(168,"Min Htlc (mSat)"),A.k0s(),A.j41(169,"span",8),A.EFF(170),A.nI1(171,"number"),A.k0s()(),A.nrm(172,"mat-divider",6),A.j41(173,"div",4)(174,"h4",7),A.EFF(175,"Message Flags"),A.k0s(),A.j41(176,"span",8),A.EFF(177),A.nI1(178,"number"),A.k0s()(),A.nrm(179,"mat-divider",6),A.j41(180,"div",4)(181,"h4",7),A.EFF(182,"Public"),A.k0s(),A.j41(183,"span",8),A.EFF(184),A.k0s()(),A.nrm(185,"mat-divider",6),A.j41(186,"div",4)(187,"h4",7),A.EFF(188,"Source"),A.k0s(),A.j41(189,"span",8),A.EFF(190),A.k0s()(),A.nrm(191,"mat-divider",6),A.j41(192,"div",4)(193,"h4",7),A.EFF(194,"Destination"),A.k0s(),A.j41(195,"span",8),A.EFF(196),A.k0s()()()()()),2&n){const e=A.XpG();A.R7$(5),A.Y8G("ngIf",!e.node1_match),A.R7$(),A.Y8G("ngIf",e.node1_match),A.R7$(6),A.JRh(null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].short_channel_id),A.R7$(6),A.JRh(null!=e.lookupResult.channels[0]&&e.lookupResult.channels[0].active?"True":"False"),A.R7$(6),A.JRh(A.i5U(25,32,1e3*(null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].last_update),"dd/MMM/y HH:mm")),A.R7$(7),A.JRh(A.i5U(32,35,(null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].amount_msat)/1e3,"1.0-0")),A.R7$(7),A.JRh(A.bMT(39,38,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].base_fee_millisatoshi)),A.R7$(7),A.JRh(A.bMT(46,40,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].fee_per_millionth)),A.R7$(7),A.JRh(A.bMT(53,42,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].channel_flags)),A.R7$(7),A.JRh(A.bMT(60,44,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].delay)),A.R7$(7),A.JRh(A.bMT(67,46,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].htlc_maximum_msat)),A.R7$(7),A.JRh(A.bMT(74,48,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].htlc_minimum_msat)),A.R7$(7),A.JRh(A.bMT(81,50,null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].message_flags)),A.R7$(7),A.JRh(null!=e.lookupResult.channels[0]&&e.lookupResult.channels[0].public?"Yes":"No"),A.R7$(6),A.JRh(null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].source),A.R7$(6),A.JRh(null==e.lookupResult.channels[0]?null:e.lookupResult.channels[0].destination),A.R7$(3),A.Y8G("ngIf",!e.node2_match),A.R7$(),A.Y8G("ngIf",e.node2_match),A.R7$(6),A.JRh(null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].short_channel_id),A.R7$(6),A.JRh(null!=e.lookupResult.channels[1]&&e.lookupResult.channels[1].active?"True":"False"),A.R7$(6),A.JRh(A.i5U(122,52,1e3*(null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].last_update),"dd/MMM/y HH:mm")),A.R7$(7),A.JRh(A.i5U(129,55,(null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].amount_msat)/1e3,"1.0-0")),A.R7$(7),A.JRh(A.bMT(136,58,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].base_fee_millisatoshi)),A.R7$(7),A.JRh(A.bMT(143,60,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].fee_per_millionth)),A.R7$(7),A.JRh(A.bMT(150,62,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].channel_flags)),A.R7$(7),A.JRh(A.bMT(157,64,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].delay)),A.R7$(7),A.JRh(A.bMT(164,66,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].htlc_maximum_msat)),A.R7$(7),A.JRh(A.bMT(171,68,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].htlc_minimum_msat)),A.R7$(7),A.JRh(A.bMT(178,70,null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].message_flags)),A.R7$(7),A.JRh(null!=e.lookupResult.channels[1]&&e.lookupResult.channels[1].public?"Yes":"No"),A.R7$(6),A.JRh(null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].source),A.R7$(6),A.JRh(null==e.lookupResult.channels[1]?null:e.lookupResult.channels[1].destination)}}let Br=(()=>{var n;class l{constructor(i){this.store=i,this.lookupResult={},this.node1_match=!1,this.node2_match=!1,this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.lookupResult.channels&&this.lookupResult.channels.length>0&&this.lookupResult.channels[0].source===i.id&&(this.node1_match=!0),this.lookupResult.channels&&this.lookupResult.channels.length>1&&this.lookupResult.channels[1].source===i.id&&(this.node2_match=!0)})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-lookup"]],inputs:{lookupResult:"lookupResult"},standalone:!1,decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mt-1","bordered-box","padding-gap-large"],["fxLayout","column"],["class","page-title font-bold-500",4,"ngIf"],[1,"my-1"],[1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"page-title","font-bold-500"]],template:function(o,r){1&o&&A.DNE(0,Oo,197,72,"div",0),2&o&&A.Y8G("ngIf",r.lookupResult)},dependencies:[de.bT,sn.q,Q.DJ,Q.sA,Q.UI,de.QX,de.vh],styles:[".mat-list-base[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%], .mat-list-base[_ngcontent-%COMP%] .mat-list-option[_ngcontent-%COMP%]{height:38px!important}"]}))}return n(),l})();const Sr=["peersForm"],fr=["stepper"],ra=(n,l)=>({"mr-6":n,"mr-2":l});function Jo(n,l){if(1&n&&A.EFF(0),2&n){const e=A.XpG();A.JRh(e.peerFormLabel)}}function ur(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Address is required."),A.k0s())}function Gn(n,l){if(1&n&&(A.j41(0,"div",42),A.nrm(1,"fa-icon",43),A.j41(2,"span"),A.EFF(3),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(2),A.JRh(e.peerConnectionError)}}function Bi(n,l){if(1&n&&A.EFF(0),2&n){const e=A.XpG();A.JRh(e.channelFormLabel)}}function Nr(n,l){if(1&n&&(A.j41(0,"div",44),A.nrm(1,"fa-icon",43),A.j41(2,"span",13)(3,"div"),A.EFF(4,"Fee rates recommended by mempool (sat/vByte):"),A.k0s(),A.j41(5,"span",45)(6,"span"),A.EFF(7),A.k0s(),A.j41(8,"span"),A.EFF(9),A.k0s(),A.j41(10,"span"),A.EFF(11),A.k0s(),A.j41(12,"span"),A.EFF(13),A.k0s(),A.j41(14,"span"),A.EFF(15),A.k0s()()()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faInfoCircle),A.R7$(6),A.SpI("- High: ",e.recommendedFee.fastestFee||"Unknown"),A.R7$(2),A.SpI("- Medium: ",e.recommendedFee.halfHourFee||"Unknown"),A.R7$(2),A.SpI("- Low: ",e.recommendedFee.hourFee||"Unknown"),A.R7$(2),A.SpI("- Economy: ",e.recommendedFee.economyFee||"Unknown"),A.R7$(2),A.SpI("- Minimum: ",e.recommendedFee.minimumFee||"Unknown")}}function Tr(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Amount is required."),A.k0s())}function Pr(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Amount must be a positive number."),A.k0s())}function _o(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.SpI("Amount must be less than or equal to ",e.totalBalance,".")}}function _s(n,l){if(1&n&&(A.j41(0,"mat-option",46),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e.feeRateId),A.R7$(),A.SpI(" ",e.feeRateType," ")}}function aa(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fee Rate is required."),A.k0s())}function Vo(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.SpI("Lower than min feerate ",e.recommendedFee.minimumFee," in the mempool.")}}function Wo(n,l){if(1&n&&(A.j41(0,"mat-form-field",47)(1,"mat-label"),A.EFF(2,"Fee Rate (Sats/vByte)"),A.k0s(),A.nrm(3,"input",48),A.j41(4,"mat-hint"),A.EFF(5),A.k0s(),A.DNE(6,aa,2,0,"mat-error",15)(7,Vo,2,1,"mat-error",15),A.k0s()),2&n){const e=A.XpG();A.R7$(3),A.Y8G("step",1)("min",e.recommendedFee.minimumFee||0),A.R7$(2),A.SpI("Mempool Min: ",e.recommendedFee.minimumFee," (Sats/vByte)"),A.R7$(),A.Y8G("ngIf","customperkb"===e.channelFormGroup.controls.selFeeRate.value&&!e.channelFormGroup.controls.flgMinConf.value&&!e.channelFormGroup.controls.customFeeRate.value),A.R7$(),A.Y8G("ngIf",e.channelFormGroup.controls.customFeeRate.value&&(null==e.channelFormGroup.controls.customFeeRate.errors?null:e.channelFormGroup.controls.customFeeRate.errors.minimum))}}function Ko(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Min Confirmation Blocks is required."),A.k0s())}function Xo(n,l){if(1&n&&(A.j41(0,"div",42),A.nrm(1,"fa-icon",43),A.j41(2,"span"),A.EFF(3),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(2),A.JRh(e.channelConnectionError)}}let Ur=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln,Qt){this.dialogRef=i,this.data=o,this.store=r,this.formBuilder=iA,this.actions=ne,this.logger=re,this.commonService=ln,this.dataService=Qt,this.faExclamationTriangle=v.zpE,this.faInfoCircle=v.iW_,this.peerAddress="",this.totalBalance=0,this.feeRateTypes=B.G,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.screenSize="",this.screenSizeEnum=B.f7,this.recommendedFee={fastestFee:0,halfHourFee:0,hourFee:0},this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.data.message?(this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.id&&this.data.message.peer.netaddr?this.data.message.peer.id+"@"+this.data.message.peer.netaddr:this.data.message.peer&&this.data.message.peer.id&&!this.data.message.peer.netaddr?this.data.message.peer.id:""):(this.totalBalance=0,this.peerAddress=""),this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[hA.k0.required]],peerAddress:[this.peerAddress,[hA.k0.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[hA.k0.required,hA.k0.min(1),hA.k0.max(this.totalBalance)]],isPrivate:[!!this.selNode?.settings.unannouncedChannels],selFeeRate:[null],customFeeRate:[null],flgMinConf:[!1],minConfValue:[{value:null,disabled:!0}],hiddenAmount:["",[hA.k0.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i,this.channelFormGroup.controls.isPrivate.setValue(!!i?.settings.unannouncedChannels)}),this.channelFormGroup.controls.flgMinConf.valueChanges.pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{i?(this.channelFormGroup.controls.selFeeRate.setValue(null),this.channelFormGroup.controls.selFeeRate.disable(),this.channelFormGroup.controls.customFeeRate.setValue(null),this.channelFormGroup.controls.minConfValue.reset(),this.channelFormGroup.controls.minConfValue.enable(),this.channelFormGroup.controls.minConfValue.setValidators([hA.k0.required])):(this.channelFormGroup.controls.selFeeRate.enable(),this.channelFormGroup.controls.minConfValue.setValue(null),this.channelFormGroup.controls.minConfValue.disable(),this.channelFormGroup.controls.minConfValue.setValidators(null))}),this.channelFormGroup.controls.selFeeRate.valueChanges.pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.channelFormGroup.controls.customFeeRate.setValue(null),this.channelFormGroup.controls.customFeeRate.reset(),this.channelFormGroup.controls.customFeeRate.setValidators("customperkb"!==i||this.channelFormGroup.controls.flgMinConf.value?null:[hA.k0.required])}),this.actions.pipe((0,I.Q)(this.unSubs[3]),(0,nA.p)(i=>i.type===B.TC.NEWLY_ADDED_PEER_CLN||i.type===B.TC.FETCH_CHANNELS_CLN||i.type===B.TC.UPDATE_API_CALL_STATUS_CLN)).subscribe(i=>{i.type===B.TC.NEWLY_ADDED_PEER_CLN&&(this.logger.info(i.payload),this.flgEditable=!1,this.newlyAddedPeer=i.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),i.type===B.TC.FETCH_CHANNELS_CLN&&this.dialogRef.close(),i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&i.payload.status===B.wn.ERROR&&("SaveNewPeer"===i.payload.action?this.peerConnectionError=i.payload.message:"SaveNewChannel"===i.payload.action&&(this.channelConnectionError=i.payload.message))}),this.dataService.getRecommendedFeeRates().pipe((0,I.Q)(this.unSubs[4])).subscribe({next:i=>{this.recommendedFee=i},error:i=>{this.logger.error(i)}})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,VA.sq)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){return"customperkb"===this.channelFormGroup.controls.selFeeRate.value&&this.recommendedFee.minimumFee>this.channelFormGroup.controls.customFeeRate.value?(this.channelFormGroup.controls.customFeeRate.setErrors({minimum:!0}),!0):!!(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0||this.channelFormGroup.controls.flgMinConf.value&&!this.channelFormGroup.controls.minConfValue.value)||(this.channelConnectionError="",void this.store.dispatch((0,VA.vL)({payload:{peerId:this.newlyAddedPeer?.id,amount:this.channelFormGroup.controls.fundingAmount.value,announce:!this.channelFormGroup.controls.isPrivate.value,feeRate:"customperkb"===this.channelFormGroup.controls.selFeeRate.value&&!this.channelFormGroup.controls.flgMinConf.value&&this.channelFormGroup.controls.customFeeRate.value?1e3*this.channelFormGroup.controls.customFeeRate.value+"perkb":this.channelFormGroup.controls.selFeeRate.value,minconf:this.channelFormGroup.controls.flgMinConf.value?this.channelFormGroup.controls.minConfValue.value:null}})))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(i){switch(i.selectedIndex){case 0:default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.id):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer?.alias:this.newlyAddedPeer?.id):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}i.selectedIndex{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(hA.ze),A.rXU(kA.En),A.rXU(aA.gP),A.rXU(L.h),A.rXU(Dt.u))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-connect-peer"]],viewQuery:function(o,r){if(1&o&&(A.GBs(Sr,5),A.GBs(fr,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first),A.mGM(iA=A.lsd())&&(r.stepper=iA.first)}},standalone:!1,decls:67,vars:33,consts:[["stepper",""],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"selectionChange","linear"],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"ngSubmit","formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-info",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row","fxFlex","100","fxLayoutAlign.gt-sm","space-between center"],["fxLayout","column","fxFlex","53","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","45","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign.gt-sm","space-between center"],["fxFlex","53","fxLayoutAlign","space-between end"],["fxLayout","column","fxLayoutAlign","start center",3,"ngClass"],["tabindex","4","formControlName","selFeeRate"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","70","fxLayoutAlign","end center",4,"ngIf"],["fxFlex","45","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","7","tabindex","5","color","primary","formControlName","flgMinConf","fxLayoutAlign","stretch start",3,"ngClass"],["fxLayout","column","fxFlex","93"],["matInput","","formControlName","minConfValue","type","number","name","blocks","tabindex","8",3,"step","min","required"],["mat-button","","color","primary","tabindex","8","type","submit"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","100",1,"alert","alert-info"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"pr-2"],[3,"value"],["fxLayout","column","fxFlex","70","fxLayoutAlign","end center"],["matInput","","formControlName","customFeeRate","type","number","name","custFeeRate","tabindex","4",3,"step","min"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2)(2,"mat-card-header",3)(3,"div",4)(4,"span",5),A.EFF(5,"Connect to a new peer"),A.k0s()(),A.j41(6,"button",6),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onClose())}),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",7)(9,"div",8)(10,"mat-vertical-stepper",9,0),A.bIt("selectionChange",function(re){return w.eBV(iA),w.Njj(r.stepSelectionChanged(re))}),A.j41(12,"mat-step",10)(13,"form",11),A.DNE(14,Jo,1,1,"ng-template",12),A.j41(15,"mat-form-field",13)(16,"mat-label"),A.EFF(17,"Lightning Address (pubkey OR pubkey@ip:port)"),A.k0s(),A.nrm(18,"input",14),A.DNE(19,ur,2,0,"mat-error",15),A.k0s(),A.DNE(20,Gn,4,2,"div",16),A.j41(21,"div",17)(22,"button",18),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onConnectPeer())}),A.EFF(23),A.k0s()()()(),A.j41(24,"mat-step",10)(25,"form",19),A.bIt("ngSubmit",function(){return w.eBV(iA),w.Njj(r.onOpenChannel())}),A.DNE(26,Bi,1,1,"ng-template",20),A.j41(27,"div",21),A.DNE(28,Nr,16,6,"div",22),A.j41(29,"div",23)(30,"mat-form-field",24)(31,"mat-label"),A.EFF(32,"Amount"),A.k0s(),A.nrm(33,"input",25),A.j41(34,"mat-hint"),A.EFF(35),A.nI1(36,"number"),A.k0s(),A.j41(37,"span",26),A.EFF(38," Sats "),A.k0s(),A.DNE(39,Tr,2,0,"mat-error",15)(40,Pr,2,0,"mat-error",15)(41,_o,2,1,"mat-error",15),A.k0s(),A.j41(42,"div",27)(43,"mat-slide-toggle",28),A.EFF(44,"Private Channel"),A.k0s()()(),A.j41(45,"div",29)(46,"div",30)(47,"mat-form-field",31)(48,"mat-label"),A.EFF(49,"Fee Rate"),A.k0s(),A.j41(50,"mat-select",32),A.DNE(51,_s,2,2,"mat-option",33),A.k0s()(),A.DNE(52,Wo,8,5,"mat-form-field",34),A.k0s(),A.j41(53,"div",35),A.nrm(54,"mat-checkbox",36),A.j41(55,"mat-form-field",37)(56,"mat-label"),A.EFF(57,"Min Confirmation Blocks"),A.k0s(),A.nrm(58,"input",38),A.DNE(59,Ko,2,0,"mat-error",15),A.k0s()()()(),A.DNE(60,Xo,4,2,"div",16),A.j41(61,"div",17)(62,"button",39),A.EFF(63),A.k0s()()()()(),A.j41(64,"div",40)(65,"button",41),A.EFF(66),A.k0s()()()()()()}2&o&&(A.R7$(10),A.Y8G("linear",!0),A.R7$(2),A.Y8G("stepControl",r.peerFormGroup)("editable",r.flgEditable),A.R7$(),A.Y8G("formGroup",r.peerFormGroup),A.R7$(6),A.Y8G("ngIf",null==r.peerFormGroup.controls.peerAddress.errors?null:r.peerFormGroup.controls.peerAddress.errors.required),A.R7$(),A.Y8G("ngIf",""!==r.peerConnectionError),A.R7$(3),A.JRh(""!==r.peerConnectionError?"Retry":"Add Peer"),A.R7$(),A.Y8G("stepControl",r.channelFormGroup)("editable",r.flgEditable),A.R7$(),A.Y8G("formGroup",r.channelFormGroup),A.R7$(3),A.Y8G("ngIf",r.recommendedFee.minimumFee),A.R7$(5),A.Y8G("step",1e3),A.R7$(2),A.SpI("Remaining: ",A.bMT(36,28,r.totalBalance-(r.channelFormGroup.controls.fundingAmount.value?r.channelFormGroup.controls.fundingAmount.value:0))),A.R7$(4),A.Y8G("ngIf",null==r.channelFormGroup.controls.fundingAmount.errors?null:r.channelFormGroup.controls.fundingAmount.errors.required),A.R7$(),A.Y8G("ngIf",null==r.channelFormGroup.controls.fundingAmount.errors?null:r.channelFormGroup.controls.fundingAmount.errors.min),A.R7$(),A.Y8G("ngIf",null==r.channelFormGroup.controls.fundingAmount.errors?null:r.channelFormGroup.controls.fundingAmount.errors.max),A.R7$(6),A.Y8G("ngClass","customperkb"!==r.channelFormGroup.controls.selFeeRate.value||r.channelFormGroup.controls.flgMinConf.value?"flex-100":"flex-25"),A.R7$(4),A.Y8G("ngForOf",r.feeRateTypes),A.R7$(),A.Y8G("ngIf","customperkb"===r.channelFormGroup.controls.selFeeRate.value&&!r.channelFormGroup.controls.flgMinConf.value),A.R7$(2),A.Y8G("ngClass",A.l_i(30,ra,r.screenSize===r.screenSizeEnum.XS||r.screenSize===r.screenSizeEnum.SM,r.screenSize===r.screenSizeEnum.MD||r.screenSize===r.screenSizeEnum.LG||r.screenSize===r.screenSizeEnum.XL)),A.R7$(4),A.Y8G("step",1)("min",0)("required",r.channelFormGroup.controls.flgMinConf.value),A.R7$(),A.Y8G("ngIf",r.channelFormGroup.controls.flgMinConf.value&&!r.channelFormGroup.controls.minConfValue.value),A.R7$(),A.Y8G("ngIf",""!==r.channelConnectionError),A.R7$(3),A.JRh(""!==r.channelConnectionError?"Retry":"Open Channel"),A.R7$(2),A.Y8G("mat-dialog-close",!1),A.R7$(),A.JRh(null!=r.newlyAddedPeer&&r.newlyAddedPeer.id?"Do It Later":"Close"))},dependencies:[de.YU,de.Sq,de.bT,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.j4,hA.JD,P.aY,wA.tx,fA.$z,QA.m2,QA.MM,Ze.So,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,yA.yw,Q.DJ,Q.sA,Q.UI,dA.PW,OA.VO,xA.wT,Ee.sG,ji.V5,ji.Ti,ji.M6,cA.N,J.V,de.QX],encapsulation:2}))}return n(),l})();var Ji=We(9157);const Nt=n=>({"background-color":n});function ft(n,l){if(1&n&&(A.j41(0,"span",7),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(e)}}function Zo(n,l){1&n&&(A.j41(0,"th",27),A.EFF(1,"Type"),A.k0s())}function oa(n,l){if(1&n&&(A.j41(0,"td",28),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.type)}}function Vs(n,l){1&n&&(A.j41(0,"th",27),A.EFF(1,"Address"),A.k0s())}function la(n,l){if(1&n&&(A.j41(0,"td",28),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.address)}}function qo(n,l){1&n&&(A.j41(0,"th",27),A.EFF(1,"Port"),A.k0s())}function $o(n,l){if(1&n&&(A.j41(0,"td",28),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.port)}}function ca(n,l){1&n&&(A.j41(0,"th",29)(1,"div",30),A.EFF(2,"Actions"),A.k0s()())}function Al(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",31)(1,"div",32)(2,"mat-select",33),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",34),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onConnectNode(o))}),A.EFF(5,"Connect"),A.k0s(),A.j41(6,"mat-option",35),A.bIt("copied",function(o){w.eBV(e);const r=A.XpG(2);return w.Njj(r.onCopyNodeURI(o))}),A.EFF(7,"Copy URI"),A.k0s()()()()}if(2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(6),A.Y8G("payload",(null==i.lookupResult?null:i.lookupResult.nodeid)+"@"+e.address+":"+e.port)}}function hn(n,l){1&n&&A.nrm(0,"tr",36)}function Lr(n,l){1&n&&A.nrm(0,"tr",37)}function ga(n,l){if(1&n&&(A.j41(0,"div",2),A.nrm(1,"mat-divider",3),A.j41(2,"div",4)(3,"div",5)(4,"h4",6),A.EFF(5,"Alias"),A.k0s(),A.j41(6,"span",7),A.EFF(7),A.j41(8,"span",8),A.EFF(9),A.k0s()()(),A.j41(10,"div",9)(11,"h4",6),A.EFF(12,"Pub Key"),A.k0s(),A.j41(13,"span",10),A.EFF(14),A.k0s()()(),A.nrm(15,"mat-divider",11),A.j41(16,"div",4)(17,"div",5)(18,"h4",6),A.EFF(19,"Last Update"),A.k0s(),A.j41(20,"span",7),A.EFF(21),A.nI1(22,"date"),A.k0s()(),A.j41(23,"div",9)(24,"h4",6),A.EFF(25,"Features"),A.k0s(),A.DNE(26,ft,2,1,"span",12),A.k0s()(),A.nrm(27,"mat-divider",11),A.j41(28,"div",13)(29,"h4",14),A.EFF(30,"Addresses"),A.k0s(),A.j41(31,"div",15)(32,"table",16,0),A.qex(34,17),A.DNE(35,Zo,2,0,"th",18)(36,oa,2,1,"td",19),A.bVm(),A.qex(37,20),A.DNE(38,Vs,2,0,"th",18)(39,la,2,1,"td",19),A.bVm(),A.qex(40,21),A.DNE(41,qo,2,0,"th",18)(42,$o,2,1,"td",19),A.bVm(),A.qex(43,22),A.DNE(44,ca,3,0,"th",23)(45,Al,8,1,"td",24),A.bVm(),A.DNE(46,hn,1,0,"tr",25)(47,Lr,1,0,"tr",26),A.k0s()()()()),2&n){const e=A.XpG();A.R7$(7),A.JRh(null==e.lookupResult?null:e.lookupResult.alias),A.R7$(),A.Y8G("ngStyle",A.eq3(12,Nt,"#"+(null==e.lookupResult?null:e.lookupResult.color))),A.R7$(),A.JRh(null!=e.lookupResult&&e.lookupResult.color?"#"+(null==e.lookupResult?null:e.lookupResult.color):""),A.R7$(5),A.JRh(null==e.lookupResult?null:e.lookupResult.nodeid),A.R7$(7),A.JRh(A.i5U(22,9,1e3*(null==e.lookupResult?null:e.lookupResult.last_timestamp),"dd/MMM/y HH:mm")),A.R7$(5),A.Y8G("ngForOf",e.featureDescriptions),A.R7$(6),A.Y8G("dataSource",e.addresses),A.R7$(14),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)}}let hr=(()=>{var n;class l{constructor(i,o,r){this.logger=i,this.snackBar=o,this.store=r,this.featureDescriptions=[],this.addresses=new z.I6([]),this.displayedColumns=["type","address","port","actions"],this.information={},this.availableBalance=0,this.unSubs=[new g.B]}ngOnInit(){if(this.addresses=new z.I6(this.lookupResult&&this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.lookupResult.features&&""!==this.lookupResult.features.trim()){this.lookupResult.features=this.lookupResult.features.substring(this.lookupResult.features.length-40);const i=parseInt(this.lookupResult.features,16);B.TH.forEach(o=>{i&1<{this.information=i.information,this.availableBalance=i.balance.totalBalance||0})}onConnectNode(i){this.store.dispatch((0,C.xO)({payload:{data:{message:{peer:{id:this.lookupResult.nodeid+"@"+i.address+":"+i.port},information:this.information,balance:this.availableBalance},component:Ur}}}))}onCopyNodeURI(i){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+i)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(js.UG),A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-node-lookup"]],viewQuery:function(o,r){if(1&o&&A.GBs(pA.B4,5),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first)}},inputs:{lookupResult:"lookupResult"},standalone:!1,decls:1,vars:1,consts:[["table",""],["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],[1,"mb-1"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],[1,"my-1"],["class","foreground-secondary-text",4,"ngFor","ngForOf"],["fxLayout","column"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","port"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select","btn-action"],["mat-cell","","fxLayoutAlign","end center"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["rtlClipboard","",3,"copied","payload"],["mat-header-row",""],["mat-row",""]],template:function(o,r){1&o&&A.DNE(0,ga,48,14,"div",1),2&o&&A.Y8G("ngIf",r.lookupResult)},dependencies:[de.Sq,de.bT,de.B3,sn.q,Q.DJ,Q.sA,Q.UI,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.KS,z.$R,z.YZ,z.NB,M.Ld,Ji.U,de.vh],encapsulation:2}))}return n(),l})();const el=["form"],_i=n=>({"mt-1":!0,"mt-2":n});function Ai(n,l){if(1&n&&(A.j41(0,"mat-radio-button",17),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e.id)("checked",i.selectedFieldId===e.id),A.R7$(),A.SpI(" ",e.name," ")}}function fi(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.SpI("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function ui(n,l){if(1&n&&(A.j41(0,"div"),A.nrm(1,"rtl-cln-node-lookup",26),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.Y8G("lookupResult",e.nodeLookupValue)}}function tl(n,l){if(1&n&&(A.j41(0,"span",24),A.DNE(1,ui,2,1,"div",25),A.k0s()),2&n){const e=A.XpG(2),i=A.sdS(21);A.R7$(),A.Y8G("ngIf",""!==e.nodeLookupValue.nodeid)("ngIfElse",i)}}function nl(n,l){if(1&n&&(A.j41(0,"div"),A.nrm(1,"rtl-cln-channel-lookup",26),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.Y8G("lookupResult",e.channelLookupValue)}}function il(n,l){if(1&n&&(A.j41(0,"span",24),A.DNE(1,nl,2,1,"div",25),A.k0s()),2&n){const e=A.XpG(2),i=A.sdS(21);A.R7$(),A.Y8G("ngIf",e.channelLookupValue.channels&&e.channelLookupValue.channels.length>0)("ngIfElse",i)}}function Er(n,l){1&n&&(A.j41(0,"span"),A.EFF(1,' fxFlex="100"'),A.j41(2,"h3"),A.EFF(3,"Error! Unable to find details!"),A.k0s()())}function sl(n,l){if(1&n&&(A.j41(0,"div",18)(1,"div",19)(2,"span",20),A.EFF(3),A.k0s()(),A.j41(4,"div",21),A.DNE(5,tl,2,2,"span",22)(6,il,2,2,"span",22)(7,Er,4,0,"span",23),A.k0s()()),2&n){const e=A.XpG();A.R7$(3),A.SpI("",e.lookupFields[e.selectedFieldId].name," Details"),A.R7$(),A.Y8G("ngSwitch",e.selectedFieldId),A.R7$(),A.Y8G("ngSwitchCase",0),A.R7$(),A.Y8G("ngSwitchCase",1)}}function Ba(n,l){1&n&&(A.j41(0,"h3"),A.EFF(1,"Error! Unable to find details!"),A.k0s())}let rl=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.commonService=o,this.store=r,this.actions=iA,this.lookupKey="",this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Pubkey"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=v.MjD,this.screenSize="",this.screenSizeEnum=B.f7,this.unSubs=[new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){window.history.state&&(window.history.state.lookupType||window.history.state.lookupValue)&&(this.selectedFieldId=+window.history.state.lookupType||0,this.lookupKey=window.history.state.lookupValue||""),this.actions.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(i=>i.type===B.TC.SET_LOOKUP_CLN||i.type===B.TC.UPDATE_API_CALL_STATUS_CLN)).subscribe(i=>{if(i.type===B.TC.SET_LOOKUP_CLN){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue="object"!=typeof i.payload[0]?{nodeid:""}:JSON.parse(JSON.stringify(i.payload[0]));break;case 1:this.channelLookupValue=i.payload.channels&&"object"!=typeof i.payload.channels?{channels:[]}:JSON.parse(JSON.stringify(i.payload))}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&i.payload.status===B.wn.ERROR&&"Lookup"===i.payload.action&&(this.flgLoading[0]="error")})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.selectedFieldId){case 0:this.store.dispatch((0,VA.zU)({payload:this.lookupKey.trim()}));break;case 1:this.store.dispatch((0,VA.ij)({payload:{uiMessage:B.MZ.SEARCHING_CHANNEL,shortChannelID:this.lookupKey.trim(),showError:!1}}))}}onSelectChange(i){this.resetData(),this.selectedFieldId=i.value}resetData(){this.flgSetLookupValue=!1,this.selectedFieldId=0,this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(kA.En))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-lookups"]],viewQuery:function(o,r){if(1&o&&A.GBs(el,7),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first)}},standalone:!1,decls:22,vars:9,consts:[["form","ngForm"],["key",""],["errorBlock",""],["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField",3,"ngModelChange","change","ngModel"],["class","mr-4",3,"value","checked",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"ngModelChange","change","ngModel"],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],[1,"mr-4",3,"value","checked"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",3)(1,"div",4)(2,"mat-card-content",5)(3,"form",6,0)(5,"div",7)(6,"mat-radio-group",8),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selectedFieldId,re)||(r.selectedFieldId=re),w.Njj(re)}),A.bIt("change",function(re){return w.eBV(iA),w.Njj(r.onSelectChange(re))}),A.DNE(7,Ai,2,3,"mat-radio-button",9),A.k0s()(),A.j41(8,"mat-form-field",10)(9,"mat-label"),A.EFF(10),A.k0s(),A.j41(11,"input",11,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.lookupKey,re)||(r.lookupKey=re),w.Njj(re)}),A.bIt("change",function(){return w.eBV(iA),w.Njj(r.clearLookupValue())}),A.k0s(),A.DNE(13,fi,2,1,"mat-error",12),A.k0s(),A.j41(14,"div",13)(15,"button",14),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(16,"Clear"),A.k0s(),A.j41(17,"button",15),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onLookup())}),A.EFF(18,"Lookup"),A.k0s()()(),A.DNE(19,sl,8,4,"div",16),A.k0s()()(),A.DNE(20,Ba,2,0,"ng-template",null,2,A.C5r)}2&o&&(A.R7$(6),A.R50("ngModel",r.selectedFieldId),A.R7$(),A.Y8G("ngForOf",r.lookupFields),A.R7$(),A.Y8G("ngClass",A.eq3(7,_i,r.screenSize===r.screenSizeEnum.XS||r.screenSize===r.screenSizeEnum.SM)),A.R7$(2),A.JRh((null==r.lookupFields[r.selectedFieldId]?null:r.lookupFields[r.selectedFieldId].placeholder)||"Lookup Key"),A.R7$(),A.R50("ngModel",r.lookupKey),A.R7$(2),A.Y8G("ngIf",!r.lookupKey),A.R7$(6),A.Y8G("ngIf",r.flgSetLookupValue))},dependencies:[de.YU,de.Sq,de.bT,de.ux,de.e1,de.fG,hA.qT,hA.me,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,fA.$z,QA.m2,UA.fg,yA.rl,yA.nJ,yA.TL,qe.VT,qe._g,Q.DJ,Q.sA,Q.UI,dA.PW,Br,hr],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}"]}))}return n(),l})();var Gr=function(n){return n.KB="KB",n.KW="KW",n}(Gr||{});function Rt(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",5),A.EFF(2," 2 Blocks "),A.j41(3,"mat-icon",16),A.EFF(4,"info_outline"),A.k0s()(),A.j41(5,"div",7),A.EFF(6),A.nI1(7,"number"),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(6),A.JRh(A.bMT(7,1,null==e.perkbw?null:e.perkbw.estimates[0].smoothed_feerate))}}function fa(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",5),A.EFF(2," 6 Blocks "),A.j41(3,"mat-icon",17),A.EFF(4,"info_outline"),A.k0s()(),A.j41(5,"div",7),A.EFF(6),A.nI1(7,"number"),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(6),A.JRh(A.bMT(7,1,null==e.perkbw?null:e.perkbw.estimates[1].smoothed_feerate))}}function al(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",5),A.EFF(2," 12 Blocks "),A.j41(3,"mat-icon",18),A.EFF(4,"info_outline"),A.k0s()(),A.j41(5,"div",7),A.EFF(6),A.nI1(7,"number"),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(6),A.JRh(A.bMT(7,1,null==e.perkbw?null:e.perkbw.estimates[2].smoothed_feerate))}}function ol(n,l){if(1&n&&(A.j41(0,"div")(1,"h4",5),A.EFF(2," 100 Blocks "),A.j41(3,"mat-icon",19),A.EFF(4,"info_outline"),A.k0s()(),A.j41(5,"div",7),A.EFF(6),A.nI1(7,"number"),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(6),A.JRh(A.bMT(7,1,null==e.perkbw?null:e.perkbw.estimates[3].smoothed_feerate))}}function ua(n,l){if(1&n&&(A.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div")(4,"h4",5),A.EFF(5," Opening "),A.j41(6,"mat-icon",6),A.EFF(7,"info_outline"),A.k0s()(),A.j41(8,"div",7),A.EFF(9),A.nI1(10,"number"),A.k0s()(),A.j41(11,"div")(12,"h4",5),A.EFF(13," Mutual Close "),A.j41(14,"mat-icon",8),A.EFF(15,"info_outline"),A.k0s()(),A.j41(16,"div",7),A.EFF(17),A.nI1(18,"number"),A.k0s()(),A.j41(19,"div")(20,"h4",5),A.EFF(21," Unilateral Close "),A.j41(22,"mat-icon",9),A.EFF(23,"info_outline"),A.k0s()(),A.j41(24,"div",7),A.EFF(25),A.nI1(26,"number"),A.k0s()(),A.j41(27,"div")(28,"h4",5),A.EFF(29," Delayed To Us "),A.j41(30,"mat-icon",10),A.EFF(31,"info_outline"),A.k0s()(),A.j41(32,"div",7),A.EFF(33),A.nI1(34,"number"),A.k0s()(),A.j41(35,"div")(36,"h4",5),A.EFF(37," Minimum Acceptable "),A.j41(38,"mat-icon",11),A.EFF(39,"info_outline"),A.k0s()(),A.j41(40,"div",7),A.EFF(41),A.nI1(42,"number"),A.k0s()(),A.j41(43,"div")(44,"h4",5),A.EFF(45," Maximum Acceptable "),A.j41(46,"mat-icon",12),A.EFF(47,"info_outline"),A.k0s()(),A.j41(48,"div",7),A.EFF(49),A.nI1(50,"number"),A.k0s()()(),A.j41(51,"div",4)(52,"div")(53,"h4",5),A.EFF(54," HTLC Resolution "),A.j41(55,"mat-icon",13),A.EFF(56,"info_outline"),A.k0s()(),A.j41(57,"div",7),A.EFF(58),A.nI1(59,"number"),A.k0s()(),A.j41(60,"div")(61,"h4",5),A.EFF(62," Penalty "),A.j41(63,"mat-icon",14),A.EFF(64,"info_outline"),A.k0s()(),A.j41(65,"div",7),A.EFF(66),A.nI1(67,"number"),A.k0s()(),A.DNE(68,Rt,8,3,"div",15)(69,fa,8,3,"div",15)(70,al,8,3,"div",15)(71,ol,8,3,"div",15),A.k0s()()()),2&n){const e=A.XpG();A.R7$(9),A.JRh(A.bMT(10,12,null==e.perkbw?null:e.perkbw.opening)),A.R7$(8),A.JRh(A.bMT(18,14,null==e.perkbw?null:e.perkbw.mutual_close)),A.R7$(8),A.JRh(A.bMT(26,16,null==e.perkbw?null:e.perkbw.unilateral_close)),A.R7$(8),A.JRh(A.bMT(34,18,null==e.perkbw?null:e.perkbw.delayed_to_us)),A.R7$(8),A.JRh(A.bMT(42,20,null==e.perkbw?null:e.perkbw.min_acceptable)),A.R7$(8),A.JRh(A.bMT(50,22,null==e.perkbw?null:e.perkbw.max_acceptable)),A.R7$(9),A.JRh(A.bMT(59,24,null==e.perkbw?null:e.perkbw.htlc_resolution)),A.R7$(8),A.JRh(A.bMT(67,26,null==e.perkbw?null:e.perkbw.penalty)),A.R7$(2),A.Y8G("ngIf",(null==e.perkbw?null:e.perkbw.estimates)&&(null==e.perkbw?null:e.perkbw.estimates.length)&&(null==e.perkbw?null:e.perkbw.estimates.length)>3),A.R7$(),A.Y8G("ngIf",(null==e.perkbw?null:e.perkbw.estimates)&&(null==e.perkbw?null:e.perkbw.estimates.length)&&(null==e.perkbw?null:e.perkbw.estimates.length)>3),A.R7$(),A.Y8G("ngIf",(null==e.perkbw?null:e.perkbw.estimates)&&(null==e.perkbw?null:e.perkbw.estimates.length)&&(null==e.perkbw?null:e.perkbw.estimates.length)>3),A.R7$(),A.Y8G("ngIf",(null==e.perkbw?null:e.perkbw.estimates)&&(null==e.perkbw?null:e.perkbw.estimates.length)&&(null==e.perkbw?null:e.perkbw.estimates.length)>3)}}function ll(n,l){if(1&n&&(A.j41(0,"div",20)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let cl=(()=>{var n;class l{constructor(){this.perkbw={},this.displayedColumns=["blockcount","feerate"]}ngAfterContentChecked(){this.feeRateStyle===Gr.KB?this.perkbw=this.feeRates.perkb||{}:this.feeRateStyle===Gr.KW&&(this.perkbw=this.feeRates.perkw||{})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-fee-rates"]],inputs:{feeRateStyle:"feeRateStyle",feeRates:"feeRates",errorMessage:"errorMessage"},standalone:!1,decls:3,vars:2,consts:[["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","stretch stretch",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100","fxLayoutAlign","stretch stretch"],["fxLayout","column","fxLayout.gt-xs","row","fxFlex","100","fxLayoutAlign","stretch stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch",1,"mt-2"],["fxLayoutAlign","start start",1,"dashboard-info-title"],["matTooltip","Default feerate for fundchannel and withdraw","matTooltipPosition","below",1,"info-icon","info-icon-primary"],[1,"overflow-wrap","dashboard-info-value"],["matTooltip","Feerate to aim for in cooperative shutdown. Note that since mutual close is a negotiation, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Feerate for commitment transaction in a live channel which we originally funded","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Feerate for returning unilateral close funds to our wallet","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","The smallest feerate that you can use, usually the minimum relayed feerate of the backend","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Feerate for returning unilateral close HTLC outputs to our wallet","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Feerate to start at when penalizing a cheat attempt","matTooltipPosition","below",1,"info-icon","info-icon-primary"],[4,"ngIf"],["matTooltip","Fee rate estimate for 2 blocks","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Fee rate estimate for 6 blocks","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Fee rate estimate for 12 blocks","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Fee rate estimate for 100 blocks","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(o,r){if(1&o&&A.DNE(0,ua,72,28,"div",1)(1,ll,3,1,"ng-template",null,0,A.C5r),2&o){const iA=A.sdS(2);A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.bT,oA.An,Q.DJ,Q.sA,Q.UI,HA.oV,de.QX],styles:[".fee-rate-list[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%]{height:44px}"]}))}return n(),l})();function gl(n,l){if(1&n&&(A.j41(0,"div",3)(1,"div",4)(2,"div")(3,"h4",5),A.EFF(4," Opening Channel "),A.j41(5,"mat-icon",6),A.EFF(6,"info_outline"),A.k0s()(),A.j41(7,"div",7),A.EFF(8),A.nI1(9,"number"),A.k0s()(),A.j41(10,"div")(11,"h4",5),A.EFF(12," Mutual Close "),A.j41(13,"mat-icon",8),A.EFF(14,"info_outline"),A.k0s()(),A.j41(15,"div",7),A.EFF(16),A.nI1(17,"number"),A.k0s()(),A.j41(18,"div")(19,"h4",5),A.EFF(20," Unilateral Close "),A.j41(21,"mat-icon",9),A.EFF(22,"info_outline"),A.k0s()(),A.j41(23,"div",7),A.EFF(24),A.nI1(25,"number"),A.k0s()(),A.j41(26,"div",10),A.nrm(27,"h4",5)(28,"div",7),A.k0s()(),A.j41(29,"div",4)(30,"div")(31,"h4",5),A.EFF(32," HTLC Timeout "),A.j41(33,"mat-icon",11),A.EFF(34,"info_outline"),A.k0s()(),A.j41(35,"div",7),A.EFF(36),A.nI1(37,"number"),A.k0s()(),A.j41(38,"div")(39,"h4",5),A.EFF(40," HTLC Success "),A.j41(41,"mat-icon",12),A.EFF(42,"info_outline"),A.k0s()(),A.j41(43,"div",7),A.EFF(44),A.nI1(45,"number"),A.k0s()(),A.j41(46,"div",10),A.nrm(47,"h4",5)(48,"div",7),A.k0s(),A.j41(49,"div",10),A.nrm(50,"h4",5)(51,"div",7),A.k0s()()()),2&n){const e=A.XpG();A.R7$(8),A.JRh(A.bMT(9,5,null==e.feeRates||null==e.feeRates.onchain_fee_estimates?null:e.feeRates.onchain_fee_estimates.opening_channel_satoshis)),A.R7$(8),A.JRh(A.bMT(17,7,null==e.feeRates||null==e.feeRates.onchain_fee_estimates?null:e.feeRates.onchain_fee_estimates.mutual_close_satoshis)),A.R7$(8),A.JRh(A.bMT(25,9,null==e.feeRates||null==e.feeRates.onchain_fee_estimates?null:e.feeRates.onchain_fee_estimates.unilateral_close_satoshis)),A.R7$(12),A.JRh(A.bMT(37,11,null==e.feeRates||null==e.feeRates.onchain_fee_estimates?null:e.feeRates.onchain_fee_estimates.htlc_timeout_satoshis)),A.R7$(8),A.JRh(A.bMT(45,13,null==e.feeRates||null==e.feeRates.onchain_fee_estimates?null:e.feeRates.onchain_fee_estimates.htlc_success_satoshis))}}function ha(n,l){if(1&n&&(A.j41(0,"div",13)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG();A.R7$(2),A.JRh(e.errorMessage)}}let wr=(()=>{var n;class l{constructor(){}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-onchain-fee-estimates"]],inputs:{feeRates:"feeRates",errorMessage:"errorMessage"},standalone:!1,decls:4,vars:2,consts:[["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","stretch stretch"],["fxLayout","column","fxLayout.gt-xs","row","fxFlex","62","fxLayoutAlign","stretch stretch",4,"ngIf","ngIfElse"],["fxLayout","column","fxLayout.gt-xs","row","fxFlex","62","fxLayoutAlign","stretch stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch",1,"mt-2"],["fxLayoutAlign","start start",1,"dashboard-info-title"],["matTooltip","Estimated cost of typical channel open","matTooltipPosition","below",1,"info-icon","info-icon-primary"],[1,"overflow-wrap","dashboard-info-value"],["matTooltip","Estimated cost of typical channel close","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Estimated cost of typical unilateral close (without HTLCs)","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["fxFlex","12"],["matTooltip","Estimated cost of typical HTLC timeout transaction","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["matTooltip","Estimated cost of typical HTLC fulfillment transaction","matTooltipPosition","below",1,"info-icon","info-icon-primary"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1),A.DNE(1,gl,52,15,"div",2)(2,ha,3,1,"ng-template",null,0,A.C5r),A.k0s()),2&o){const iA=A.sdS(3);A.R7$(),A.Y8G("ngIf",""===(null==r.errorMessage?null:r.errorMessage.trim()))("ngIfElse",iA)}},dependencies:[de.bT,oA.An,Q.DJ,Q.sA,Q.UI,HA.oV,de.QX],styles:[".fee-rate-list[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%]{height:44px}"]}))}return n(),l})();const zr=n=>({"dashboard-card-content":!0,"error-border":n});function Bl(n,l){1&n&&A.nrm(0,"mat-progress-bar",20)}function fl(n,l){if(1&n&&A.nrm(0,"rtl-cln-node-info",21),2&n){const e=A.XpG(3);A.Y8G("information",e.information)("showColorFieldSeparately",!1)}}function ul(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-status-info",22),2&n){const e=A.XpG(3);A.Y8G("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[1])}}function hl(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-info",23),2&n){const e=A.XpG(3);A.Y8G("fees",e.fees)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[2]+" "+e.errorMessages[3])}}function El(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-rates",24),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKB)("errorMessage",e.errorMessages[4])}}function wl(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-rates",25),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKW)("errorMessage",e.errorMessages[5])}}function Cl(n,l){if(1&n&&A.nrm(0,"rtl-cln-onchain-fee-estimates",26),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKW)("errorMessage",e.errorMessages[4])}}function cs(n,l){if(1&n&&(A.j41(0,"mat-grid-tile",4)(1,"div",5)(2,"div",6)(3,"div",7),A.nrm(4,"fa-icon",8),A.j41(5,"span"),A.EFF(6),A.k0s()()(),A.j41(7,"div",9)(8,"mat-card",10)(9,"mat-card-content",11),A.DNE(10,Bl,1,0,"mat-progress-bar",12),A.j41(11,"div",13),A.DNE(12,fl,1,2,"rtl-cln-node-info",14)(13,ul,1,2,"rtl-cln-channel-status-info",15)(14,hl,1,2,"rtl-cln-fee-info",16)(15,El,1,2,"rtl-cln-fee-rates",17)(16,wl,1,2,"rtl-cln-fee-rates",18)(17,Cl,1,2,"rtl-cln-onchain-fee-estimates",19),A.k0s()()()()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("colspan",e.cols)("rowspan",e.rows),A.R7$(4),A.Y8G("icon",e.icon),A.R7$(2),A.JRh(e.title),A.R7$(3),A.Y8G("ngClass",A.eq3(13,zr,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusLRBal.status===i.apiCallStatusEnum.ERROR)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.ERROR)||"feeRatesKB"===e.id&&i.apiCallStatusPerKB.status===i.apiCallStatusEnum.ERROR||"feeRatesKW"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.ERROR||"onChainFeeEstimates"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.ERROR)),A.R7$(),A.Y8G("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusLRBal.status===i.apiCallStatusEnum.INITIATED)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.INITIATED)||"feeRatesKB"===e.id&&i.apiCallStatusPerKB.status===i.apiCallStatusEnum.INITIATED||"feeRatesKW"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.INITIATED||"onChainFeeEstimates"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngSwitch",e.id),A.R7$(),A.Y8G("ngSwitchCase","node"),A.R7$(),A.Y8G("ngSwitchCase","status"),A.R7$(),A.Y8G("ngSwitchCase","fee"),A.R7$(),A.Y8G("ngSwitchCase","feeRatesKB"),A.R7$(),A.Y8G("ngSwitchCase","feeRatesKW"),A.R7$(),A.Y8G("ngSwitchCase","onChainFeeEstimates")}}function Ws(n,l){if(1&n&&(A.j41(0,"mat-grid-list",2),A.DNE(1,cs,18,15,"mat-grid-tile",3),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngForOf",e.nodeCardsOperator)}}function ei(n,l){1&n&&A.nrm(0,"mat-progress-bar",20)}function Ea(n,l){if(1&n&&A.nrm(0,"rtl-cln-node-info",21),2&n){const e=A.XpG(3);A.Y8G("information",e.information)("showColorFieldSeparately",!1)}}function dl(n,l){if(1&n&&A.nrm(0,"rtl-cln-channel-status-info",22),2&n){const e=A.XpG(3);A.Y8G("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[1])}}function Ql(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-info",23),2&n){const e=A.XpG(3);A.Y8G("fees",e.fees)("errorMessage",e.errorMessages[0]+" "+e.errorMessages[2]+" "+e.errorMessages[3])}}function ml(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-rates",24),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKB)("errorMessage",e.errorMessages[4])}}function Ml(n,l){if(1&n&&A.nrm(0,"rtl-cln-fee-rates",25),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKW)("errorMessage",e.errorMessages[4])}}function pl(n,l){if(1&n&&A.nrm(0,"rtl-cln-onchain-fee-estimates",26),2&n){const e=A.XpG(3);A.Y8G("feeRates",e.feeRatesPerKW)("errorMessage",e.errorMessages[4])}}function Il(n,l){if(1&n&&(A.j41(0,"mat-grid-tile",4)(1,"div",5)(2,"div",6)(3,"div",27),A.nrm(4,"fa-icon",8),A.j41(5,"span"),A.EFF(6),A.k0s()()(),A.j41(7,"div",9)(8,"mat-card",10)(9,"mat-card-content",11),A.DNE(10,ei,1,0,"mat-progress-bar",12),A.j41(11,"div",13),A.DNE(12,Ea,1,2,"rtl-cln-node-info",14)(13,dl,1,2,"rtl-cln-channel-status-info",15)(14,Ql,1,2,"rtl-cln-fee-info",16)(15,ml,1,2,"rtl-cln-fee-rates",17)(16,Ml,1,2,"rtl-cln-fee-rates",18)(17,pl,1,2,"rtl-cln-onchain-fee-estimates",19),A.k0s()()()()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("colspan",e.cols)("rowspan",e.rows),A.R7$(4),A.Y8G("icon",e.icon),A.R7$(2),A.JRh(e.title),A.R7$(3),A.Y8G("ngClass",A.eq3(13,zr,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusLRBal.status===i.apiCallStatusEnum.ERROR)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.ERROR)||"feeRatesKB"===e.id&&i.apiCallStatusPerKB.status===i.apiCallStatusEnum.ERROR||"feeRatesKW"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.ERROR||"onChainFeeEstimates"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.ERROR)),A.R7$(),A.Y8G("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"status"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusLRBal.status===i.apiCallStatusEnum.INITIATED)||"fee"===e.id&&(i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusFHistory.status===i.apiCallStatusEnum.INITIATED)||"feeRatesKB"===e.id&&i.apiCallStatusPerKB.status===i.apiCallStatusEnum.INITIATED||"feeRatesKW"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.INITIATED||"onChainFeeEstimates"===e.id&&i.apiCallStatusPerKW.status===i.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngSwitch",e.id),A.R7$(),A.Y8G("ngSwitchCase","node"),A.R7$(),A.Y8G("ngSwitchCase","status"),A.R7$(),A.Y8G("ngSwitchCase","fee"),A.R7$(),A.Y8G("ngSwitchCase","feeRatesKB"),A.R7$(),A.Y8G("ngSwitchCase","feeRatesKW"),A.R7$(),A.Y8G("ngSwitchCase","onChainFeeEstimates")}}function Dl(n,l){if(1&n&&(A.j41(0,"mat-grid-list",2),A.DNE(1,Il,18,15,"mat-grid-tile",3),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngForOf",e.nodeCardsMerchant)}}let Fc=(()=>{var n;class l{constructor(i,o,r){this.logger=i,this.commonService=o,this.store=r,this.faBolt=v.zm_,this.faServer=v.D6w,this.faNetworkWired=v.eGi,this.faLink=v.CQO,this.information={},this.channelsStatus={active:{},pending:{},inactive:{}},this.feeRatesPerKB={},this.feeRatesPerKW={},this.nodeCardsOperator=[],this.nodeCardsMerchant=[],this.screenSize="",this.screenSizeEnum=B.f7,this.userPersonaEnum=B.HW,this.errorMessages=["","","","","",""],this.apiCallStatusNodeInfo=null,this.apiCallStatusLRBal=null,this.apiCallStatusChannels=null,this.apiCallStatusFHistory=null,this.apiCallStatusPerKB=null,this.apiCallStatusPerKW=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize(),this.screenSize===B.f7.XS?(this.nodeCardsMerchant=[{id:"node",icon:this.faServer,title:"Node Information",cols:6,rows:3},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:6,rows:3},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:6,rows:1},{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:4,rows:6},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:4,rows:6},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:4,rows:6}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:4,rows:6},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:4,rows:6},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:4,rows:6}]):(this.nodeCardsMerchant=[{id:"node",icon:this.faServer,title:"Node Information",cols:2,rows:3},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:2,rows:3},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:2,rows:3},{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:2,rows:6},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:2,rows:6},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:2,rows:6}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:2,rows:6},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:2,rows:6},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:2,rows:6}])}ngOnInit(){this.store.select(tA.RQ).pipe((0,I.Q)(this.unSubs[0]),(0,N.E)(this.store.select(j._c))).subscribe(([i,o])=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=i.apisCallStatus[0],this.apiCallStatusNodeInfo.status===B.wn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message?this.apiCallStatusNodeInfo.message:""),this.selNode=o,this.information=i.information,this.fees=i.fees,this.logger.info(i)}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[1]),(0,N.E)(this.store.select(tA.Al))).subscribe(([i,o])=>{this.errorMessages[1]="",this.errorMessages[2]="",this.apiCallStatusLRBal=o.apiCallStatus,this.apiCallStatusChannels=i.apiCallStatus,this.apiCallStatusLRBal.status===B.wn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusLRBal.message?JSON.stringify(this.apiCallStatusLRBal.message):this.apiCallStatusLRBal.message?this.apiCallStatusLRBal.message:""),this.apiCallStatusChannels.status===B.wn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusChannels.message?JSON.stringify(this.apiCallStatusChannels.message):this.apiCallStatusChannels.message?this.apiCallStatusChannels.message:""),this.channelsStatus.active.channels=i.activeChannels.length||0,this.channelsStatus.pending.channels=i.pendingChannels.length||0,this.channelsStatus.inactive.channels=i.inactiveChannels.length||0,this.channelsStatus.active.capacity=o.localRemoteBalance.localBalance||0,this.channelsStatus.pending.capacity=o.localRemoteBalance.pendingBalance||0,this.channelsStatus.inactive.capacity=o.localRemoteBalance.inactiveBalance||0}),this.store.select(tA.Ie).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.errorMessages[3]="",this.apiCallStatusFHistory=i.apiCallStatus,this.apiCallStatusFHistory.status===B.wn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusFHistory.message?JSON.stringify(this.apiCallStatusFHistory.message):this.apiCallStatusFHistory.message?this.apiCallStatusFHistory.message:""),i.forwardingHistory&&i.forwardingHistory.listForwards&&i.forwardingHistory.listForwards.length&&(this.fees.totalTxCount=i.forwardingHistory.listForwards.length)}),this.store.select(tA.kr).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{this.errorMessages[4]="",this.apiCallStatusPerKB=i.apiCallStatus,this.apiCallStatusPerKB.status===B.wn.ERROR&&(this.errorMessages[4]="object"==typeof this.apiCallStatusPerKB.message?JSON.stringify(this.apiCallStatusPerKB.message):this.apiCallStatusPerKB.message?this.apiCallStatusPerKB.message:""),this.feeRatesPerKB=i.feeRatesPerKB}),this.store.select(tA.RB).pipe((0,I.Q)(this.unSubs[5])).subscribe(i=>{this.errorMessages[5]="",this.apiCallStatusPerKW=i.apiCallStatus,this.apiCallStatusPerKW.status===B.wn.ERROR&&(this.errorMessages[5]="object"==typeof this.apiCallStatusPerKW.message?JSON.stringify(this.apiCallStatusPerKW.message):this.apiCallStatusPerKW.message?this.apiCallStatusPerKW.message:""),this.feeRatesPerKW=i.feeRatesPerKW})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-network-info"]],standalone:!1,decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch",1,"mb-4"],["cols","6","rowHeight","100px",4,"ngIf"],["cols","6","rowHeight","100px"],["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","pl-2"],[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"],["class","h-100","feeRateStyle","KB",3,"feeRates","errorMessage",4,"ngSwitchCase"],["class","h-100","feeRateStyle","KW",3,"feeRates","errorMessage",4,"ngSwitchCase"],["class","h-100",3,"feeRates","errorMessage",4,"ngSwitchCase"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["feeRateStyle","KB",1,"h-100",3,"feeRates","errorMessage"],["feeRateStyle","KW",1,"h-100",3,"feeRates","errorMessage"],[1,"h-100",3,"feeRates","errorMessage"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","pl-15px"]],template:function(o,r){1&o&&(A.j41(0,"div",0),A.DNE(1,Ws,2,1,"mat-grid-list",1)(2,Dl,2,1,"mat-grid-list",1),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",r.selNode.settings.userPersona===r.userPersonaEnum.OPERATOR),A.R7$(),A.Y8G("ngIf",r.selNode.settings.userPersona===r.userPersonaEnum.MERCHANT))},dependencies:[de.YU,de.Sq,de.bT,de.ux,de.e1,P.aY,QA.RN,QA.m2,NA.B_,NA.NS,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,ge,it,zt,cl,wr],encapsulation:2}))}return n(),l})();function yc(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",9),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("routerLink",A.mNQ(e.link))("active",i.activeLink===e.link),A.R7$(),A.JRh(e.name)}}let Fl=(()=>{var n;class l{constructor(i){this.router=i,this.faUserCheck=v.pCJ,this.links=[{link:"sign",name:"Sign"},{link:"verify",name:"Verify"}],this.activeLink=this.links[0].link,this.unSubs=[new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-sign-verify-message"]],standalone:!1,decls:13,vars:3,consts:[["tabPanel",""],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["tabindex","1","mat-tab-link","","role","tab","class","mat-tab-label",3,"routerLink","active","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper","mb-2"],["tabindex","1","mat-tab-link","","role","tab",1,"mat-tab-label",3,"click","routerLink","active"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1),A.nrm(1,"fa-icon",2),A.j41(2,"span",3),A.EFF(3,"Sign/Verify Message"),A.k0s()(),A.j41(4,"div",4)(5,"mat-card")(6,"mat-card-content",5)(7,"nav",6),A.DNE(8,yc,2,4,"div",7),A.k0s(),A.nrm(9,"mat-tab-nav-panel",null,0),A.j41(11,"div",8),A.nrm(12,"router-outlet"),A.k0s()()()()),2&o){const iA=A.sdS(10);A.R7$(),A.Y8G("icon",r.faUserCheck),A.R7$(6),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,RA.Bu,RA.hQ,RA.Ql,xt.n3,Sn.Wk],encapsulation:2}))}return n(),l})();var wa=We(396),kr=We(283);function yl(n,l){if(1&n&&(A.j41(0,"mat-option",6),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e),A.R7$(),A.SpI(" ",e.addressTp," ")}}let xl=(()=>{var n;class l{constructor(i,o){this.store=i,this.clnEffects=o,this.addressTypes=B.Ld,this.selectedAddressType=B.Ld[2],this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,VA.XT)({payload:this.selectedAddressType})),this.clnEffects.setNewAddressCL.pipe((0,bt.s)(1)).subscribe(i=>{this.newAddress=i,setTimeout(()=>{this.store.dispatch((0,C.xO)({payload:{data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:wa.f}}}))},0)})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il),A.rXU(kr.i))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-on-chain-receive"]],standalone:!1,decls:10,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","space-between center","fxLayoutAlign.gt-sm","start center"],["fxLayout","column","fxFlex","48","fxFlex.gt-md","25","fxLayoutAlign","start end",1,"mr-2"],["name","address_type","tabindex","1",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["mat-flat-button","","color","primary","tabindex","2",3,"click"],[3,"value"]],template:function(o,r){1&o&&(A.j41(0,"div",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),A.EFF(4,"Address Type"),A.k0s(),A.j41(5,"mat-select",3),A.mxI("ngModelChange",function(ne){return A.DH7(r.selectedAddressType,ne)||(r.selectedAddressType=ne),ne}),A.DNE(6,yl,2,2,"mat-option",4),A.k0s()(),A.j41(7,"div")(8,"button",5),A.bIt("click",function(){return r.onGenerateAddress()}),A.EFF(9,"Generate Address"),A.k0s()()()()),2&o&&(A.R7$(5),A.R50("ngModel",r.selectedAddressType),A.R7$(),A.Y8G("ngForOf",r.addressTypes))},dependencies:[de.Sq,hA.BC,hA.vS,fA.$z,yA.rl,yA.nJ,Q.DJ,Q.sA,Q.UI,OA.VO,xA.wT],encapsulation:2}))}return n(),l})(),Yl=(()=>{var n;class l{constructor(i,o){this.store=i,this.activatedRoute=o,this.sweepAll=!1,this.unSubs=[new g.B,new g.B]}ngOnInit(){this.activatedRoute.data.pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.sweepAll=i.sweepAll})}openSendFundsModal(){this.store.dispatch((0,C.xO)({payload:{data:{sweepAll:this.sweepAll,component:co}}}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il),A.rXU(xt.nX))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-on-chain-send"]],standalone:!1,decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(o,r){1&o&&(A.j41(0,"div",0)(1,"div",1)(2,"button",2),A.bIt("click",function(){return r.openSendFundsModal()}),A.EFF(3),A.k0s()()()),2&o&&(A.R7$(3),A.JRh(r.sweepAll?"Sweep All":"Send Funds"))},dependencies:[fA.$z,Q.DJ,Q.sA,Q.UI],encapsulation:2}))}return n(),l})();var xc=We(9172),bl=We(6354),vl=We(2628),Vn=We(92);const Rl=["form"],Cr=(n,l)=>({"mr-6":n,"mr-2":l});function Sl(n,l){if(1&n&&(A.j41(0,"mat-option",48),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e),A.R7$(),A.JRh(e.alias?e.alias:e.id?e.id:"")}}function Nl(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Peer alias is required."),A.k0s())}function Tl(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Peer not found in the list."),A.k0s())}function Ca(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",7)(1,"mat-label"),A.EFF(2,"Peer Alias"),A.k0s(),A.j41(3,"input",46),A.bIt("change",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onSelectedPeerChanged())}),A.k0s(),A.j41(4,"mat-autocomplete",47,4),A.bIt("optionSelected",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onSelectedPeerChanged())}),A.DNE(6,Sl,2,2,"mat-option",31),A.nI1(7,"async"),A.k0s(),A.DNE(8,Nl,2,0,"mat-error",21)(9,Tl,2,0,"mat-error",21),A.k0s()}if(2&n){const e=A.sdS(5),i=A.XpG();A.R7$(3),A.Y8G("formControl",i.selectedPeer)("matAutocomplete",e),A.R7$(),A.Y8G("displayWith",i.displayFn),A.R7$(2),A.Y8G("ngForOf",A.bMT(7,6,i.filteredPeers)),A.R7$(2),A.Y8G("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.required),A.R7$(),A.Y8G("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.notfound)}}function Pl(n,l){1&n&&A.eu8(0)}function Ul(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Amount is required."),A.k0s())}function Ll(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.SpI("Amount must be less than or equal to ",e.totalBalance,".")}}function Gl(n,l){if(1&n&&(A.j41(0,"div",49),A.nrm(1,"fa-icon",50),A.j41(2,"span",51)(3,"div"),A.EFF(4,"Fee rates recommended by mempool (sat/vByte):"),A.k0s(),A.j41(5,"span",52)(6,"span"),A.EFF(7),A.k0s(),A.j41(8,"span"),A.EFF(9),A.k0s(),A.j41(10,"span"),A.EFF(11),A.k0s(),A.j41(12,"span"),A.EFF(13),A.k0s(),A.j41(14,"span"),A.EFF(15),A.k0s()()()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faInfoCircle),A.R7$(6),A.SpI("- High: ",e.recommendedFee.fastestFee||"Unknown"),A.R7$(2),A.SpI("- Medium: ",e.recommendedFee.halfHourFee||"Unknown"),A.R7$(2),A.SpI("- Low: ",e.recommendedFee.hourFee||"Unknown"),A.R7$(2),A.SpI("- Economy: ",e.recommendedFee.economyFee||"Unknown"),A.R7$(2),A.SpI("- Minimum: ",e.recommendedFee.minimumFee||"Unknown")}}function da(n,l){if(1&n&&(A.j41(0,"mat-option",48),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.Y8G("value",e.feeRateId),A.R7$(),A.SpI(" ",e.feeRateType," ")}}function zl(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fee Rate is required."),A.k0s())}function Qa(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.SpI("Lower than min feerate ",e.recommendedFee.minimumFee," in the mempool.")}}function ma(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-form-field",53)(1,"mat-label"),A.EFF(2,"Fee Rate (Sats/vByte)"),A.k0s(),A.j41(3,"input",54,5),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.customFeeRate,o)||(r.customFeeRate=o),w.Njj(o)}),A.k0s(),A.j41(5,"mat-hint"),A.EFF(6),A.k0s(),A.DNE(7,zl,2,0,"mat-error",21)(8,Qa,2,1,"mat-error",21),A.k0s()}if(2&n){const e=A.XpG();A.R7$(3),A.Y8G("step",1)("min",e.recommendedFee.minimumFee)("required","customperkb"===e.selFeeRate&&!e.flgMinConf),A.R50("ngModel",e.customFeeRate),A.R7$(3),A.SpI("Mempool Min: ",e.recommendedFee.minimumFee," (Sats/vByte)"),A.R7$(),A.Y8G("ngIf","customperkb"===e.selFeeRate&&!e.flgMinConf&&!e.customFeeRate),A.R7$(),A.Y8G("ngIf","customperkb"===e.selFeeRate&&!e.flgMinConf&&e.customFeeRate&&e.customFeeRate{var n;class l{constructor(i,o,r,iA,ne,re,ln,Qt){this.logger=i,this.dialogRef=o,this.data=r,this.store=iA,this.actions=ne,this.decimalPipe=re,this.commonService=ln,this.dataService=Qt,this.selectedPeer=new hA.hs,this.faExclamationTriangle=v.zpE,this.faInfoCircle=v.iW_,this.utxos=[],this.selUTXOs=[],this.flgUseAllBalance=!1,this.totalSelectedUTXOAmount=0,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.fundingAmount=null,this.selectedPubkey="",this.isPrivate=!1,this.feeRateTypes=B.G,this.selFeeRate="",this.customFeeRate=null,this.flgMinConf=!1,this.minConfValue=null,this.screenSize="",this.screenSizeEnum=B.f7,this.recommendedFee={fastestFee:0,halfHourFee:0,hourFee:0},this.unSubs=[new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.data.message?(this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.utxos=this.data.message.utxos,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[]):(this.information={},this.totalBalance=0,this.utxos=[],this.peer=null,this.peers=[]),this.alertTitle=this.data.alertTitle||"Alert",this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(r=>{this.selNode=r,this.isPrivate=!!r?.settings.unannouncedChannels}),this.actions.pipe((0,I.Q)(this.unSubs[1]),(0,nA.p)(r=>r.type===B.TC.UPDATE_API_CALL_STATUS_CLN||r.type===B.TC.FETCH_CHANNELS_CLN)).subscribe(r=>{r.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&r.payload.status===B.wn.ERROR&&"SaveNewChannel"===r.payload.action&&(this.channelConnectionError=r.payload.message),r.type===B.TC.FETCH_CHANNELS_CLN&&this.dialogRef.close()});let i="",o="";this.sortedPeers=this.peers.sort((r,iA)=>(i=r.alias?r.alias.toLowerCase():r.id?r.id.toLowerCase():"",o=iA.alias?iA.alias.toLowerCase():r.id?r.id.toLowerCase():"",io?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,I.Q)(this.unSubs[2]),(0,xc.Z)(""),(0,bl.T)(r=>"string"==typeof r?r:r.alias?r.alias:r.id),(0,bl.T)(r=>r?this.filterPeers(r):this.sortedPeers.slice()))}filterPeers(i){return this.sortedPeers?.filter(o=>0===o.alias?.toLowerCase().indexOf(i?i.toLowerCase():""))}displayFn(i){return i&&i.alias?i.alias:i&&i.id?i.id:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.id?this.selectedPeer.value.id:null,"string"==typeof this.selectedPeer.value){const i=this.peers?.filter(o=>o.alias?.length===this.selectedPeer.value.length&&0===o.alias?.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===i.length&&i[0].id&&(this.selectedPubkey=i[0].id)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.flgMinConf=!1,this.selFeeRate="",this.minConfValue=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!!this.selNode?.settings.unannouncedChannels,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(i){i?this.flgMinConf||this.selFeeRate||this.selUTXOs.length&&0!==this.selUTXOs.length?(this.advancedTitle="Advanced Options",this.flgMinConf&&(this.advancedTitle=this.advancedTitle+" | Min Confirmation Blocks: "+this.minConfValue),this.selFeeRate&&(this.advancedTitle=this.advancedTitle+" | Fee Rate: "+(this.customFeeRate?this.customFeeRate+" (Sats/vByte)":this.feeRateTypes.find(o=>o.feeRateId===this.selFeeRate)?.feeRateType)),this.selUTXOs.length&&this.selUTXOs.length>0&&(this.advancedTitle=this.advancedTitle+" | Total Selected: "+this.selUTXOs.length+" | Selected UTXOs: "+this.decimalPipe.transform(this.totalSelectedUTXOAmount)+" Sats")):this.advancedTitle="Advanced Options":(this.advancedTitle="Advanced Options",this.dataService.getRecommendedFeeRates().pipe((0,I.Q)(this.unSubs[3])).subscribe({next:o=>{this.recommendedFee=o},error:o=>{this.logger.error(o)}}))}onUTXOSelectionChange(i){this.selUTXOs.length&&this.selUTXOs.length>0?(this.totalSelectedUTXOAmount=this.selUTXOs?.reduce((o,r)=>o+(r.amount_msat||0)/1e3,0),this.flgUseAllBalance&&this.onUTXOAllBalanceChange()):(this.totalSelectedUTXOAmount=0,this.fundingAmount=null,this.flgUseAllBalance=!1)}onUTXOAllBalanceChange(){this.fundingAmount=this.flgUseAllBalance?this.totalSelectedUTXOAmount:null}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0||this.flgMinConf&&!this.minConfValue||"customperkb"===this.selFeeRate&&!this.flgMinConf&&!this.customFeeRate||"customperkb"===this.selFeeRate&&this.recommendedFee.minimumFee>this.customFeeRate)return!0;const i={peerId:this.peer&&this.peer.id?this.peer.id:this.selectedPubkey,amount:this.flgUseAllBalance?"all":this.fundingAmount.toString(),announce:!this.isPrivate,minconf:this.flgMinConf?this.minConfValue:null};i.feeRate="customperkb"===this.selFeeRate&&!this.flgMinConf&&this.customFeeRate?1e3*this.customFeeRate+"perkb":this.selFeeRate,this.selUTXOs.length&&this.selUTXOs.length>0&&(i.utxos=[],this.selUTXOs.forEach(o=>i.utxos.push(o.txid+":"+o.output))),this.store.dispatch((0,VA.vL)({payload:i}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(kA.En),A.rXU(de.QX),A.rXU(L.h),A.rXU(Dt.u))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-open-channel"]],viewQuery:function(o,r){if(1&o&&A.GBs(Rl,7),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first)}},standalone:!1,decls:75,vars:42,consts:[["form","ngForm"],["amount","ngModel"],["blocks","ngModel"],["peerDetailsExpansionBlock",""],["auto","matAutocomplete"],["custFeeRate","ngModel"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxLayout","column","fxFlex","70","fxLayoutAlign","start end"],["matInput","","type","number","required","","name","amount",3,"ngModelChange","step","min","max","disabled","ngModel"],["matSuffix",""],[4,"ngIf"],["fxLayout","column","fxFlex","25","fxLayoutAlign","center start"],["fxLayout","column","fxLayoutAlign","center start","color","primary","name","isPrivate",3,"ngModelChange","ngModel"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-info",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayoutAlign.gt-sm","space-between center","fxLayout.gt-sm","row wrap"],["fxFlex","64","fxLayout","row","fxLayoutAlign","space-between center"],["fxLayout","column","fxLayoutAlign","start center",3,"ngClass"],[3,"valueChange","disabled","value"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","58","fxLayoutAlign","end center",4,"ngIf"],["fxFlex","32","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","7","color","primary","name","flgMinConf","fxLayoutAlign","stretch start",3,"ngModelChange","change","ngClass","ngModel"],["fxLayout","column","fxFlex","93"],["matInput","","type","number","name","blocks",3,"ngModelChange","step","min","required","disabled","ngModel"],["fxLayout","column","fxFlex","54","fxLayoutAlign","start end"],["multiple","",3,"valueChange","selectionChange","value"],["fxFlex","41","fxLayout","row","fxLayoutAlign","start center"],["color","primary","name","flgUseAllBalance",3,"ngModelChange","change","disabled","ngModel"],["matTooltip","Use selected UTXOs balance as the amount to be sent. Final amount sent will be less the mining fee.","matTooltipPosition","before",1,"info-icon"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit"],["type","text","aria-label","Peers","matInput","","required","",3,"change","formControl","matAutocomplete"],[3,"optionSelected","displayWith"],[3,"value"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","100"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"pr-2"],["fxLayout","column","fxFlex","58","fxLayoutAlign","end center"],["matInput","","type","number","name","custFeeRate",3,"ngModelChange","step","min","required","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],["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(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",6)(1,"div",7)(2,"mat-card-header",8)(3,"div",9)(4,"span",10),A.EFF(5),A.k0s()(),A.j41(6,"button",11),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onClose())}),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",12)(9,"form",13,0),A.bIt("submit",function(){return w.eBV(iA),w.Njj(r.onOpenChannel())})("reset",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.j41(11,"div",14),A.DNE(12,Ca,10,8,"mat-form-field",15),A.k0s(),A.DNE(13,Pl,1,0,"ng-container",16),A.j41(14,"div",14)(15,"div",17)(16,"mat-form-field",18)(17,"mat-label"),A.EFF(18,"Amount"),A.k0s(),A.j41(19,"input",19,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.fundingAmount,re)||(r.fundingAmount=re),w.Njj(re)}),A.k0s(),A.j41(21,"mat-hint"),A.EFF(22),A.nI1(23,"number"),A.k0s(),A.j41(24,"span",20),A.EFF(25," Sats "),A.k0s(),A.DNE(26,Ul,2,0,"mat-error",21)(27,Ll,2,1,"mat-error",21),A.k0s(),A.j41(28,"div",22)(29,"mat-slide-toggle",23),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.isPrivate,re)||(r.isPrivate=re),w.Njj(re)}),A.EFF(30,"Private Channel"),A.k0s()()(),A.j41(31,"mat-expansion-panel",24),A.bIt("closed",function(){return w.eBV(iA),w.Njj(r.onAdvancedPanelToggle(!0))})("opened",function(){return w.eBV(iA),w.Njj(r.onAdvancedPanelToggle(!1))}),A.j41(32,"mat-expansion-panel-header")(33,"mat-panel-title")(34,"span"),A.EFF(35),A.k0s()()(),A.j41(36,"div",25),A.DNE(37,Gl,16,6,"div",26),A.j41(38,"div",27)(39,"div",28)(40,"mat-form-field",29)(41,"mat-label"),A.EFF(42,"Fee Rate"),A.k0s(),A.j41(43,"mat-select",30),A.mxI("valueChange",function(re){return w.eBV(iA),A.DH7(r.selFeeRate,re)||(r.selFeeRate=re),w.Njj(re)}),A.DNE(44,da,2,2,"mat-option",31),A.k0s()(),A.DNE(45,ma,9,7,"mat-form-field",32),A.k0s(),A.j41(46,"div",33)(47,"mat-checkbox",34),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.flgMinConf,re)||(r.flgMinConf=re),w.Njj(re)}),A.bIt("change",function(){return w.eBV(iA),w.Njj(r.flgMinConf?r.selFeeRate=null:r.minConfValue=null)}),A.k0s(),A.j41(48,"mat-form-field",35)(49,"mat-label"),A.EFF(50,"Min Confirmation Blocks"),A.k0s(),A.j41(51,"input",36,2),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.minConfValue,re)||(r.minConfValue=re),w.Njj(re)}),A.k0s(),A.DNE(53,Ma,2,0,"mat-error",21),A.k0s()()(),A.j41(54,"mat-form-field",37)(55,"mat-label"),A.EFF(56,"Coin Selection"),A.k0s(),A.j41(57,"mat-select",38),A.mxI("valueChange",function(re){return w.eBV(iA),A.DH7(r.selUTXOs,re)||(r.selUTXOs=re),w.Njj(re)}),A.bIt("selectionChange",function(re){return w.eBV(iA),w.Njj(r.onUTXOSelectionChange(re))}),A.j41(58,"mat-select-trigger"),A.EFF(59),A.nI1(60,"number"),A.k0s(),A.DNE(61,kl,3,5,"mat-option",31),A.k0s()(),A.j41(62,"div",39)(63,"mat-slide-toggle",40),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.flgUseAllBalance,re)||(r.flgUseAllBalance=re),w.Njj(re)}),A.bIt("change",function(){return w.eBV(iA),w.Njj(r.onUTXOAllBalanceChange())}),A.EFF(64," Use selected UTXOs balance "),A.k0s(),A.j41(65,"mat-icon",41),A.EFF(66,"info_outline"),A.k0s()()()()(),A.DNE(67,jl,3,2,"div",42),A.j41(68,"div",43)(69,"button",44),A.EFF(70,"Clear Fields"),A.k0s(),A.j41(71,"button",45),A.EFF(72,"Open Channel"),A.k0s()()()()()(),A.DNE(73,Yc,1,1,"ng-template",null,3,A.C5r)}if(2&o){const iA=A.sdS(20),ne=A.sdS(74);A.R7$(5),A.JRh(r.alertTitle),A.R7$(7),A.Y8G("ngIf",!r.peer&&r.peers&&r.peers.length>0),A.R7$(),A.Y8G("ngTemplateOutlet",ne),A.R7$(6),A.Y8G("step",1e3)("min",1)("max",r.totalBalance)("disabled",r.flgUseAllBalance),A.R50("ngModel",r.fundingAmount),A.R7$(3),A.Lme("Remaining: ",A.bMT(23,35,r.totalBalance-(r.fundingAmount?r.fundingAmount:0)),"",r.flgUseAllBalance?". Amount replaced by UTXO balance":""),A.R7$(4),A.Y8G("ngIf",(null==iA.errors?null:iA.errors.required)||!r.fundingAmount),A.R7$(),A.Y8G("ngIf",null==iA.errors?null:iA.errors.max),A.R7$(2),A.R50("ngModel",r.isPrivate),A.R7$(6),A.JRh(r.advancedTitle),A.R7$(2),A.Y8G("ngIf",r.recommendedFee.minimumFee),A.R7$(3),A.Y8G("ngClass","customperkb"!==r.selFeeRate||r.flgMinConf?"flex-100":"flex-40"),A.R7$(3),A.Y8G("disabled",r.flgMinConf),A.R50("value",r.selFeeRate),A.R7$(),A.Y8G("ngForOf",r.feeRateTypes),A.R7$(),A.Y8G("ngIf","customperkb"===r.selFeeRate&&!r.flgMinConf),A.R7$(2),A.Y8G("ngClass",A.l_i(39,Cr,r.screenSize===r.screenSizeEnum.XS||r.screenSize===r.screenSizeEnum.SM,r.screenSize===r.screenSizeEnum.MD||r.screenSize===r.screenSizeEnum.LG||r.screenSize===r.screenSizeEnum.XL)),A.R50("ngModel",r.flgMinConf),A.R7$(4),A.Y8G("step",1)("min",0)("required",r.flgMinConf)("disabled",!r.flgMinConf),A.R50("ngModel",r.minConfValue),A.R7$(2),A.Y8G("ngIf",r.flgMinConf&&!r.minConfValue),A.R7$(4),A.R50("value",r.selUTXOs),A.R7$(2),A.Lme("",A.bMT(60,37,r.totalSelectedUTXOAmount)," Sats (",r.selUTXOs.length>1?r.selUTXOs.length+" UTXOs":"1 UTXO",")"),A.R7$(2),A.Y8G("ngForOf",r.utxos),A.R7$(2),A.Y8G("disabled",r.selUTXOs.length<1),A.R50("ngModel",r.flgUseAllBalance),A.R7$(4),A.Y8G("ngIf",""!==r.channelConnectionError)}},dependencies:[de.YU,de.Sq,de.bT,de.T3,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.zX,hA.vS,hA.cV,hA.l_,P.aY,fA.$z,QA.m2,QA.MM,Ze.So,gi.GK,gi.Z2,gi.WN,oA.An,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,yA.yw,sn.q,Q.DJ,Q.sA,Q.UI,dA.PW,OA.VO,OA.$2,xA.wT,Ee.sG,HA.oV,vl.$3,vl.pN,cA.N,Vn.z,J.V,de.Jj,de.QX],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}))}return n(),l})();function Jl(n,l){if(1&n&&(A.j41(0,"span",7),A.EFF(1,"Open"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.openChannels))}}function _l(n,l){if(1&n&&(A.j41(0,"span",7),A.EFF(1,"Pending/Inactive"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.pendingChannels))}}function Vl(n,l){if(1&n&&(A.j41(0,"span",7),A.EFF(1,"Active HTLCs"),A.k0s()),2&n){const e=A.XpG();A.Y8G("matBadge",A.mNQ(e.activeHTLCs))}}let Wl=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.store=o,this.commonService=r,this.router=iA,this.openChannels=0,this.pendingChannels=0,this.activeHTLCs=0,this.information={},this.peers=[],this.utxos=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending/Inactive"},{link:"activehtlcs",name:"Active HTLCs"}],this.activeLink=0,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.activeLink=this.links.findIndex(i=>i.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(i=>i instanceof xt.gx)).subscribe({next:i=>{this.activeLink=this.links.findIndex(o=>o.link===i.urlAfterRedirects.substring(i.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(tA.kQ).pipe((0,I.Q)(this.unSubs[1]),(0,N.E)(this.store.select(j._c))).subscribe(([i,o])=>{this.selNode=o,this.information=i.information,this.totalBalance=i.balance.totalBalance||0,this.logger.info(i)}),this.store.select(tA.os).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.peers=i.peers}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.utxos=this.commonService.sortAscByKey(i.utxos?.filter(o=>"confirmed"===o.status),"value")}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{this.openChannels=i.activeChannels.length||0,this.pendingChannels=i.pendingChannels.length+i.inactiveChannels.length||0;const o=[...i.activeChannels,...i.pendingChannels,...i.inactiveChannels];this.activeHTLCs=o?.reduce((r,iA)=>r+(iA.htlcs&&iA.htlcs.length>0?iA.htlcs.length:0),0),this.logger.info(i)})}onOpenChannel(){this.store.dispatch((0,C.xO)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance,utxos:this.utxos},component:Hr}}}))}onSelectedTabChange(i){this.router.navigateByUrl("/cln/connections/channels/"+this.links[i.index].link)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(L.h),A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channels-tables"]],standalone:!1,decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"bordered-box"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedIndexChange","selectedTabChange","selectedIndex"],["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(o,r){1&o&&(A.j41(0,"div",0)(1,"div",1)(2,"button",2),A.bIt("click",function(){return r.onOpenChannel()}),A.EFF(3,"Open Channel"),A.k0s()(),A.j41(4,"div",3)(5,"mat-tab-group",4),A.mxI("selectedIndexChange",function(ne){return A.DH7(r.activeLink,ne)||(r.activeLink=ne),ne}),A.bIt("selectedTabChange",function(ne){return r.onSelectedTabChange(ne)}),A.j41(6,"mat-tab"),A.DNE(7,Jl,2,2,"ng-template",5),A.k0s(),A.j41(8,"mat-tab"),A.DNE(9,_l,2,2,"ng-template",5),A.k0s(),A.j41(10,"mat-tab"),A.DNE(11,Vl,2,2,"ng-template",5),A.k0s()(),A.j41(12,"div",6),A.nrm(13,"router-outlet"),A.k0s()()()),2&o&&(A.R7$(5),A.R50("selectedIndex",r.activeLink))},dependencies:[fA.$z,Q.DJ,Q.sA,Q.UI,Aa.k,RA.ES,RA.mq,RA.T8,xt.n3],encapsulation:2}))}return n(),l})();const Kl=n=>({"xs-scroll-y":n}),Xl=(n,l)=>({"mt-2":n,"mt-1":l});function pa(n,l){if(1&n){const e=A.RV6();A.j41(0,"fa-icon",27),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onExplorerClicked())}),A.k0s()}if(2&n){const e=A.XpG();A.Y8G("matTooltip",A.mNQ("Link to "+(null==e.selNode||null==e.selNode.settings?null:e.selNode.settings.blockExplorerUrl)))("icon",e.faUpRightFromSquare)}}function Ia(n,l){if(1&n&&(A.j41(0,"div")(1,"div",10)(2,"div",11)(3,"h4",12),A.EFF(4,"Receivable (Sats)"),A.k0s(),A.j41(5,"span",19),A.EFF(6),A.nI1(7,"number"),A.k0s()(),A.j41(8,"div",11)(9,"h4",12),A.EFF(10,"Spendable (Sats)"),A.k0s(),A.j41(11,"span",19),A.EFF(12),A.nI1(13,"number"),A.k0s()()(),A.nrm(14,"mat-divider",15),A.j41(15,"div",10)(16,"div",11)(17,"h4",12),A.EFF(18,"Their Reserve (Sats)"),A.k0s(),A.j41(19,"span",19),A.EFF(20),A.nI1(21,"number"),A.k0s()(),A.j41(22,"div",11)(23,"h4",12),A.EFF(24,"Our Reserve (Sats)"),A.k0s(),A.j41(25,"span",19),A.EFF(26),A.nI1(27,"number"),A.k0s()()(),A.nrm(28,"mat-divider",15),A.k0s()),2&n){const e=A.XpG();A.R7$(6),A.JRh(A.i5U(7,4,e.channel.receivable_msat/1e3,"1.0-0")),A.R7$(6),A.JRh(A.i5U(13,7,e.channel.spendable_msat/1e3,"1.0-0")),A.R7$(8),A.JRh(A.i5U(21,10,e.channel.their_reserve_msat/1e3,"1.0-2")),A.R7$(6),A.JRh(A.i5U(27,13,e.channel.our_reserve_msat/1e3,"1.0-2"))}}function Zl(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Show Advanced"),A.k0s())}function ql(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Hide Advanced"),A.k0s())}function $l(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",28),A.bIt("copied",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onCopyChanID(o))}),A.EFF(1,"Copy Short Channel ID"),A.k0s()}if(2&n){const e=A.XpG();A.Y8G("payload",e.channel.short_channel_id)}}function Rn(n,l){if(1&n){const e=A.RV6();A.j41(0,"button",29),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onClose())}),A.EFF(1,"OK"),A.k0s()}}let Da=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.dialogRef=i,this.data=o,this.logger=r,this.commonService=iA,this.snackBar=ne,this.router=re,this.faReceipt=v.Mf0,this.faUpRightFromSquare=v.k02,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=B.f7}ngOnInit(){this.channel=this.data.channel,this.showCopy=!!this.data.showCopy,this.selNode=this.data.selNode,this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(i){this.snackBar.open("Short channel ID "+i+" copied."),this.logger.info("Copied Text: "+i)}onGoToLink(i,o){this.router.navigateByUrl("/cln/graph/lookups",{state:{lookupType:i,lookupValue:o}}),this.onClose()}onExplorerClicked(){this.selNode?.settings?.blockExplorerUrl&&window.open(this.selNode.settings.blockExplorerUrl+"/tx/"+this.channel.funding_txid,"_blank")}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(aA.gP),A.rXU(L.h),A.rXU(js.UG),A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-information"]],standalone:!1,decls:91,vars:37,consts:[["hideAdvancedText",""],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],["tabindex","4","matTooltip","Go To Graph Lookup",1,"foreground-secondary-text","go-to-link",3,"click"],[1,"foreground-secondary-text"],[1,"my-1"],["tabindex","5","matTooltip","Go To Graph Lookup",1,"foreground-secondary-text","go-to-link",3,"click"],["class","ml-1 fa-icon-primary",3,"matTooltip","icon","click",4,"ngIf"],["fxFlex","33"],[1,"overflow-wrap","foreground-secondary-text"],["fxFlex","34"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","6",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["autoFocus","","mat-button","","color","primary","tabindex","7","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","8","type","button",3,"click",4,"ngIf"],[1,"ml-1","fa-icon-primary",3,"click","matTooltip","icon"],["autoFocus","","mat-button","","color","primary","tabindex","7","type","submit","rtlClipboard","",3,"copied","payload"],["autoFocus","","mat-button","","color","primary","tabindex","8","type","button",3,"click"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2)(2,"mat-card-header",3)(3,"div",4),A.nrm(4,"fa-icon",5),A.j41(5,"span",6),A.EFF(6,"Channel Information"),A.k0s()(),A.j41(7,"button",7),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onClose())}),A.EFF(8,"X"),A.k0s()(),A.j41(9,"mat-card-content",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"h4",12),A.EFF(14,"Short Channel ID"),A.k0s(),A.j41(15,"span",13),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onGoToLink("1",r.channel.short_channel_id))}),A.EFF(16),A.k0s()(),A.j41(17,"div",11)(18,"h4",12),A.EFF(19,"Peer Alias"),A.k0s(),A.j41(20,"span",14),A.EFF(21),A.k0s()()(),A.nrm(22,"mat-divider",15),A.j41(23,"div",10)(24,"div",2)(25,"h4",12),A.EFF(26,"Channel ID"),A.k0s(),A.j41(27,"span",14),A.EFF(28),A.k0s()()(),A.nrm(29,"mat-divider",15),A.j41(30,"div",10)(31,"div",2)(32,"h4",12),A.EFF(33,"Peer Public Key"),A.k0s(),A.j41(34,"span",16),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onGoToLink("0",r.channel.peer_id))}),A.EFF(35),A.k0s()()(),A.nrm(36,"mat-divider",15),A.j41(37,"div",10)(38,"div",2)(39,"h4",12),A.EFF(40,"Funding Transaction ID"),A.k0s(),A.j41(41,"span",14),A.EFF(42),A.DNE(43,pa,1,3,"fa-icon",17),A.k0s()()(),A.nrm(44,"mat-divider",15),A.j41(45,"div",10)(46,"div",18)(47,"h4",12),A.EFF(48,"State"),A.k0s(),A.j41(49,"span",19),A.EFF(50),A.nI1(51,"camelcaseWithReplace"),A.k0s()(),A.j41(52,"div",18)(53,"h4",12),A.EFF(54,"Connected"),A.k0s(),A.j41(55,"span",19),A.EFF(56),A.k0s()(),A.j41(57,"div",20)(58,"h4",12),A.EFF(59,"Private"),A.k0s(),A.j41(60,"span",19),A.EFF(61),A.k0s()()(),A.nrm(62,"mat-divider",15),A.j41(63,"div",10)(64,"div",18)(65,"h4",12),A.EFF(66,"Remote Balance (Sats)"),A.k0s(),A.j41(67,"span",19),A.EFF(68),A.nI1(69,"number"),A.k0s()(),A.j41(70,"div",18)(71,"h4",12),A.EFF(72,"Local Balance (Sats)"),A.k0s(),A.j41(73,"span",19),A.EFF(74),A.nI1(75,"number"),A.k0s()(),A.j41(76,"div",20)(77,"h4",12),A.EFF(78,"Total (Sats)"),A.k0s(),A.j41(79,"span",19),A.EFF(80),A.nI1(81,"number"),A.k0s()()(),A.nrm(82,"mat-divider",15),A.DNE(83,Ia,29,16,"div",21),A.j41(84,"div",22)(85,"button",23),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onShowAdvanced())}),A.DNE(86,Zl,2,0,"p",24)(87,ql,2,0,"ng-template",null,0,A.C5r),A.k0s(),A.DNE(89,$l,2,1,"button",25)(90,Rn,2,0,"button",26),A.k0s()()()()()}if(2&o){const iA=A.sdS(88);A.R7$(4),A.Y8G("icon",r.faReceipt),A.R7$(5),A.Y8G("ngClass",A.eq3(32,Kl,r.screenSize===r.screenSizeEnum.XS)),A.R7$(7),A.SpI(" ",r.channel.short_channel_id," "),A.R7$(5),A.JRh(r.channel.alias),A.R7$(7),A.JRh(r.channel.channel_id),A.R7$(7),A.SpI(" ",r.channel.peer_id," "),A.R7$(7),A.SpI(" ",r.channel.funding_txid," "),A.R7$(),A.Y8G("ngIf",null==r.selNode||null==r.selNode.settings?null:r.selNode.settings.blockExplorerUrl),A.R7$(7),A.JRh(A.i5U(51,20,null==r.channel?null:r.channel.state,"_")),A.R7$(6),A.JRh(r.channel.peer_connected?"Yes":"No"),A.R7$(5),A.JRh(r.channel.private?"Yes":"No"),A.R7$(7),A.JRh(A.i5U(69,23,r.channel.to_them_msat/1e3,"1.0-0")),A.R7$(6),A.JRh(A.i5U(75,26,r.channel.to_us_msat/1e3,"1.0-0")),A.R7$(6),A.JRh(A.i5U(81,29,r.channel.total_msat/1e3,"1.0-0")),A.R7$(3),A.Y8G("ngIf",r.showAdvanced),A.R7$(),A.Y8G("ngClass",A.l_i(34,Xl,!r.showAdvanced,r.showAdvanced)),A.R7$(2),A.Y8G("ngIf",!r.showAdvanced)("ngIfElse",iA),A.R7$(3),A.Y8G("ngIf",r.showCopy),A.R7$(),A.Y8G("ngIf",!r.showCopy)}},dependencies:[de.YU,de.bT,P.aY,fA.$z,QA.m2,QA.MM,sn.q,Q.DJ,Q.sA,Q.UI,dA.PW,HA.oV,Ji.U,cA.N,de.QX,R.VD],encapsulation:2}))}return n(),l})();const Fa=()=>["all"],Ac=n=>({"error-border":n}),ec=()=>["no_peer"],Ks=n=>({width:n}),ya=n=>({"display-none":n});function tc(n,l){if(1&n&&(A.j41(0,"mat-option",39),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function nc(n,l){1&n&&A.nrm(0,"mat-progress-bar",40)}function xa(n,l){1&n&&A.nrm(0,"th",41)}function ic(n,l){if(1&n&&(A.j41(0,"span",45),A.nrm(1,"fa-icon",46),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faEyeSlash)}}function sc(n,l){if(1&n&&(A.j41(0,"span",47),A.nrm(1,"fa-icon",46),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faEye)}}function Vi(n,l){if(1&n&&(A.j41(0,"td",42),A.DNE(1,ic,2,1,"span",43)(2,sc,2,1,"span",44),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",e.private),A.R7$(),A.Y8G("ngIf",!e.private)}}function rc(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Short Channel ID"),A.k0s())}function ac(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Ks,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.short_channel_id)}}function oc(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Alias"),A.k0s())}function lc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Ks,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.alias)}}function Ya(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"ID"),A.k0s())}function jr(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Ks,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.id)}}function ti(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Channel ID"),A.k0s())}function cc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Ks,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.channel_id)}}function gc(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Funding Transaction ID"),A.k0s())}function Bc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Ks,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.funding_txid)}}function fc(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Connected"),A.k0s())}function bc(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null!=e&&e.peer_connected?"Connected":"Disconnected")}}function uc(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Local Reserve (Sats)"),A.k0s())}function hc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.our_reserve_msat)/1e3,"1.0-0")," ")}}function Ec(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Remote Reserve (Sats)"),A.k0s())}function wc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.their_reserve_msat)/1e3,"1.0-0")," ")}}function ba(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Total (Sats)"),A.k0s())}function Cc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.total_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function BA(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Spendable (Sats)"),A.k0s())}function a(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.spendable_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function u(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Local Balance (Sats)"),A.k0s())}function x(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.to_us_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function T(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Remote Balance (Sats)"),A.k0s())}function V(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",52),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.to_them_msat)/1e3,(null==e?null:e.to_them_msat)<1e3?"1.0-4":"1.0-0")," ")}}function G(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Balance Score"),A.k0s())}function TA(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",53)(2,"mat-hint",54),A.EFF(3),A.nI1(4,"number"),A.k0s()(),A.nrm(5,"mat-progress-bar",55),A.k0s()),2&n){const e=l.$implicit;A.R7$(3),A.JRh(A.bMT(4,3,e.balancedness||0)),A.R7$(2),A.Y8G("value",A.mNQ(e.to_us_msat&&e.to_us_msat>0?e.to_us_msat/(e.to_us_msat+e.to_them_msat)*100:0))}}function XA(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",56)(1,"div",57)(2,"mat-select",58),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",59),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onChannelUpdate("all"))}),A.EFF(5,"Update Fee Policy"),A.k0s(),A.j41(6,"mat-option",59),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(7,"Download CSV"),A.k0s()()()()}}function se(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",60)(1,"div",57)(2,"mat-select",61),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",59),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG();return w.Njj(iA.onChannelClick(r,o))}),A.EFF(5,"View Info"),A.k0s(),A.j41(6,"mat-option",59),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onViewRemotePolicy(o))}),A.EFF(7,"View Remote Fee"),A.k0s(),A.j41(8,"mat-option",59),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onChannelUpdate(o))}),A.EFF(9,"Update Fee Policy"),A.k0s(),A.j41(10,"mat-option",59),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onChannelClose(o))}),A.EFF(11,"Close Channel"),A.k0s()()()()}}function fe(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No peers connected. Add a peer in order to open a channel."),A.k0s())}function Be(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No channel available."),A.k0s())}function He(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting channels..."),A.k0s())}function nt(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function rt(n,l){if(1&n&&(A.j41(0,"td",62),A.DNE(1,fe,2,0,"p",63)(2,Be,2,0,"p",63)(3,He,2,0,"p",63)(4,nt,2,1,"p",63),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function Ft(n,l){if(1&n&&A.nrm(0,"tr",64),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,ya,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function rn(n,l){1&n&&A.nrm(0,"tr",65)}function dt(n,l){1&n&&A.nrm(0,"tr",66)}let Ut=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.logger=i,this.store=o,this.rtlEffects=r,this.clnEffects=iA,this.commonService=ne,this.camelCaseWithReplace=re,this.faEye=v.pS3,this.faEyeSlash=v.k6j,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"open_channels",recordsPerPage:B.md,sortBy:"alias",sortOrder:B.oi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.channels=new z.I6([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=B.G,this.selFilter="",this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){window.history.state&&(window.history.state.filterColumn||window.history.state.filterValue)&&(this.selFilterBy=window.history.state.filterColumn||"all",this.selFilter=window.history.state.filterValue||""),this.store.select(tA.GX).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.information=i.information,this.numPeers=i.numPeers,this.totalBalance=i.balance.totalBalance||0,this.logger.info(i)}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("private"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.channelsData=i.activeChannels,this.channelsData&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(i)}),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.selNode=i})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onViewRemotePolicy(i){this.store.dispatch((0,VA.ij)({payload:{uiMessage:B.MZ.GET_REMOTE_POLICY,shortChannelID:i.short_channel_id||"",showError:!0}})),this.clnEffects.setLookupCL.pipe((0,bt.s)(1)).subscribe(o=>{if(o.channels&&0===o.channels.length)return!1;let r={};r=o.channels[0].source!==this.information.id?o.channels[0]:o.channels[1];const iA=[[{key:"base_fee_millisatoshi",value:r.base_fee_millisatoshi,title:"Base Fees (mSats)",width:34,type:B.UN.NUMBER},{key:"fee_per_millionth",value:r.fee_per_millionth,title:"Fee/Millionth",width:33,type:B.UN.NUMBER},{key:"delay",value:r.delay,title:"Delay",width:33,type:B.UN.NUMBER}]],ne="Remote policy for Channel: "+(i.alias||i.short_channel_id?i.alias&&i.short_channel_id?i.alias+" ("+i.short_channel_id+")":i.alias?i.alias:i.short_channel_id:i.channel_id);setTimeout(()=>{this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Remote Channel Policy",titleMessage:ne,message:iA}}}))},0)})}onChannelUpdate(i){"all"!==i&&"ONCHAIN"===i.state||("all"===i?(this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update All",message:[],titleMessage:"Update fee policy for all channels",flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:B.UN.NUMBER,inputValue:1e3,step:100,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:B.UN.NUMBER,inputValue:1,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[4])).subscribe(o=>{o&&this.store.dispatch((0,VA.fy)({payload:{feebase:o[0].inputValue,feeppm:o[1].inputValue,id:"all"}}))})):(this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"Update fee policy for Channel: "+(i.alias||i.short_channel_id?i.alias&&i.short_channel_id?i.alias+" ("+i.short_channel_id+")":i.alias?i.alias:i.short_channel_id:i.channel_id),flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:B.UN.NUMBER,inputValue:""===i.fee_base_msat?0:i.fee_base_msat,step:100,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:B.UN.NUMBER,inputValue:i.fee_proportional_millionths,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[5])).subscribe(iA=>{iA&&this.store.dispatch((0,VA.fy)({payload:{feebase:iA[0].inputValue,feeppm:iA[1].inputValue,id:i.channel_id}}))})),this.applyFilter())}percentHintFunction(i){return(i/1e4).toString()+"%"}onChannelClose(i){this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Close Channel",titleMessage:"Closing channel: "+(i.alias||i.short_channel_id?i.alias&&i.short_channel_id?i.alias+" ("+i.short_channel_id+")":i.alias?i.alias:i.short_channel_id:i.channel_id),noBtnText:"Cancel",yesBtnText:"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[6])).subscribe(o=>{o&&this.store.dispatch((0,VA.w0)({payload:{id:i.id||"",channelId:i.channel_id||"",force:!1}}))})}onChannelClick(i,o){this.store.dispatch((0,C.xO)({payload:{data:{channel:i,selNode:this.selNode,showCopy:!0,component:Da}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column||"","_"):this.commonService.titleCase(i)}setFilterPredicate(){this.channels.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.peer_connected?"connected":"disconnected")+(i.channel_id?i.channel_id.toLowerCase():"")+(i.short_channel_id?i.short_channel_id.toLowerCase():"")+(i.id?i.id.toLowerCase():"")+(i.alias?i.alias.toLowerCase():"")+(i.private?"private":"public")+(i.state?i.state.toLowerCase():"")+(i.funding_txid?i.funding_txid.toLowerCase():"")+(i.to_them_msat?i.to_them_msat/1e3:"")+(i.to_us_msat?i.to_us_msat/1e3:"")+(i.total_msat?i.total_msat/1e3:"")+(i.their_reserve_msat?i.their_reserve_msat/1e3:"")+(i.our_reserve_msat?i.our_reserve_msat/1e3:"")+(i.spendable_msat?i.spendable_msat/1e3:"");break;case"private":r=i?.private?"private":"public";break;case"connected":r=i?.peer_connected?"connected":"disconnected";break;case"msatoshi_total":r=((i.total_msat||0)/1e3).toString()||"";break;case"spendable_msatoshi":r=((i.spendable_msat||0)/1e3).toString()||"";break;case"msatoshi_to_us":r=((i.to_us_msat||0)/1e3).toString()||"";break;case"msatoshi_to_them":r=((i.to_them_msat||0)/1e3).toString()||"";break;case"our_channel_reserve_satoshis":r=((i.our_reserve_msat||0)/1e3).toString()||"";break;case"their_channel_reserve_satoshis":r=((i.their_reserve_msat||0)/1e3).toString()||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"connected"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadChannelsTable(i){this.channels=new z.I6([...i]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(o,r)=>{switch(r){case"msatoshi_total":return o.total_msat;case"spendable_msatoshi":return o.spendable_msat;case"msatoshi_to_us":return o.to_us_msat;case"msatoshi_to_them":return o.to_them_msat;case"our_channel_reserve_satoshis":return o.our_reserve_msat;case"their_channel_reserve_satoshis":return o.their_reserve_msat;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"Open-channels")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(b.H),A.rXU(kr.i),A.rXU(L.h),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-open-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Channels")}])],decls:69,vars:18,consts:[["table",""],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","private"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","short_channel_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","alias"],["matColumnDef","id"],["matColumnDef","channel_id"],["matColumnDef","funding_txid"],["matColumnDef","connected"],["matColumnDef","our_channel_reserve_satoshis"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","their_channel_reserve_satoshis"],["matColumnDef","msatoshi_total"],["matColumnDef","spendable_msatoshi"],["matColumnDef","msatoshi_to_us"],["matColumnDef","msatoshi_to_them"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","5",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","5"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2),A.nrm(2,"div",3),A.j41(3,"div",4)(4,"mat-form-field",5)(5,"mat-label"),A.EFF(6,"Filter By"),A.k0s(),A.j41(7,"mat-select",6),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(8,"perfect-scrollbar"),A.DNE(9,tc,2,2,"mat-option",7),A.k0s()()(),A.j41(10,"mat-form-field",5)(11,"mat-label"),A.EFF(12,"Filter"),A.k0s(),A.j41(13,"input",8),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.DNE(14,nc,1,0,"mat-progress-bar",9),A.j41(15,"div",10)(16,"table",11,0),A.qex(18,12),A.DNE(19,xa,1,0,"th",13)(20,Vi,3,2,"td",14),A.bVm(),A.qex(21,15),A.DNE(22,rc,2,0,"th",16)(23,ac,4,4,"td",14),A.bVm(),A.qex(24,17),A.DNE(25,oc,2,0,"th",16)(26,lc,4,4,"td",14),A.bVm(),A.qex(27,18),A.DNE(28,Ya,2,0,"th",16)(29,jr,4,4,"td",14),A.bVm(),A.qex(30,19),A.DNE(31,ti,2,0,"th",16)(32,cc,4,4,"td",14),A.bVm(),A.qex(33,20),A.DNE(34,gc,2,0,"th",16)(35,Bc,4,4,"td",14),A.bVm(),A.qex(36,21),A.DNE(37,fc,2,0,"th",16)(38,bc,2,1,"td",14),A.bVm(),A.qex(39,22),A.DNE(40,uc,2,0,"th",23)(41,hc,4,4,"td",14),A.bVm(),A.qex(42,24),A.DNE(43,Ec,2,0,"th",23)(44,wc,4,4,"td",14),A.bVm(),A.qex(45,25),A.DNE(46,ba,2,0,"th",23)(47,Cc,4,4,"td",14),A.bVm(),A.qex(48,26),A.DNE(49,BA,2,0,"th",23)(50,a,4,4,"td",14),A.bVm(),A.qex(51,27),A.DNE(52,u,2,0,"th",23)(53,x,4,4,"td",14),A.bVm(),A.qex(54,28),A.DNE(55,T,2,0,"th",23)(56,V,4,4,"td",14),A.bVm(),A.qex(57,29),A.DNE(58,G,2,0,"th",16)(59,TA,6,5,"td",14),A.bVm(),A.qex(60,30),A.DNE(61,XA,8,0,"th",31)(62,se,12,0,"td",32),A.bVm(),A.qex(63,33),A.DNE(64,rt,5,4,"td",34),A.bVm(),A.DNE(65,Ft,1,3,"tr",35)(66,rn,1,0,"tr",36)(67,dt,1,0,"tr",37),A.k0s()(),A.nrm(68,"mat-paginator",38),A.k0s()}2&o&&(A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(14,Fa).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(),A.Y8G("ngIf",r.apiCallStatus.status===r.apiCallStatusEnum.INITIATED),A.R7$(2),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.channels)("ngClass",A.eq3(15,Ac,""!==r.errorMessage)),A.R7$(49),A.Y8G("matFooterRowDef",A.lJ4(17,ec)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,UA.fg,yA.rl,yA.nJ,yA.MV,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,de.QX],styles:[".mat-column-private[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]}))}return n(),l})();const Ge=["outputIdx"];function gt(n,l){if(1&n&&(A.j41(0,"div",27),A.nrm(1,"fa-icon",15),A.j41(2,"span"),A.EFF(3,"Change output balance "),A.j41(4,"strong"),A.EFF(5),A.nI1(6,"number"),A.k0s(),A.EFF(7," (Sats) may be insufficient for fee bumping, depending on the prevailing fee rates."),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(4),A.JRh(A.bMT(6,2,e.dustOutputValue))}}function yt(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Output Index required."),A.k0s())}function En(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Invalid index value."),A.k0s())}function bn(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fees is required."),A.k0s())}function Kt(n,l){if(1&n&&(A.j41(0,"div",28),A.nrm(1,"fa-icon",15),A.j41(2,"span"),A.EFF(3),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(2),A.JRh(e.bumpFeeError)}}let jn=(()=>{var n;class l{set outputIndx(i){i&&(this.outputIdx=i)}constructor(i,o,r,iA,ne,re){this.actions=i,this.dialogRef=o,this.data=r,this.store=iA,this.logger=ne,this.dataService=re,this.faUpRightFromSquare=v.k02,this.newAddress="",this.fees=null,this.outputIndex=null,this.faCopy=v.jPR,this.faInfoCircle=v.iW_,this.faExclamationTriangle=v.zpE,this.bumpFeeError="",this.flgShowDustWarning=!1,this.dustOutputValue=0,this.recommendedFee={fastestFee:0,halfHourFee:0,hourFee:0},this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.bumpFeeChannel=this.data.channel,this.logger.info(this.bumpFeeChannel),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i,this.logger.info(this.selNode)}),this.dataService.getRecommendedFeeRates().pipe((0,I.Q)(this.unSubs[1])).subscribe({next:i=>{this.recommendedFee=i},error:i=>{this.logger.error(i)}}),this.dataService.getBlockExplorerTransaction(this.bumpFeeChannel.funding_txid).pipe((0,I.Q)(this.unSubs[2])).subscribe({next:i=>{this.outputIndex=0===i.vout.findIndex(o=>o.value===this.bumpFeeChannel.to_us_msat)?1:0,this.dustOutputValue=i.vout[this.outputIndex].value,this.flgShowDustWarning=this.dustOutputValue<1e3},error:i=>{this.logger.error(i)}})}onBumpFee(){if(!this.outputIndex&&0!==this.outputIndex||!this.fees)return!0;this.bumpFeeError="",this.store.dispatch((0,VA.XT)({payload:B.Ld[0]})),this.actions.pipe((0,nA.p)(i=>i.type===B.TC.SET_NEW_ADDRESS_CLN),(0,bt.s)(1)).subscribe(i=>{this.store.dispatch((0,VA.aB)({payload:{destination:i.payload,satoshi:"all",feerate:(1e3*+(this.fees||0)).toString()+"perkb",utxos:[this.bumpFeeChannel.funding_txid+":"+(this.outputIndex||"").toString()]}}))}),this.actions.pipe((0,nA.p)(i=>i.type===B.TC.SET_CHANNEL_TRANSACTION_RES_CLN),(0,bt.s)(1)).subscribe(i=>{this.store.dispatch((0,C.UI)({payload:"Successfully bumped the fee. Use the block explorer to verify transaction."})),this.dialogRef.close()}),this.actions.pipe((0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN),(0,I.Q)(this.unSubs[3])).subscribe(i=>{i.payload.status===B.wn.ERROR&&("SetChannelTransaction"===i.payload.action||"GenerateNewAddress"===i.payload.action)&&(this.logger.error(i.payload.message),this.bumpFeeError=i.payload.message)})}onExplorerClicked(i){window.open(this.selNode.settings.blockExplorerUrl+"/tx/"+i,"_blank")}resetData(){this.bumpFeeError="",this.fees=null,this.outputIndex=null,this.flgShowDustWarning=!1,this.outputIdx.control.setErrors(null)}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(kA.En),A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(aA.gP),A.rXU(Dt.u))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-bump-fee"]],viewQuery:function(o,r){if(1&o&&A.GBs(Ge,5),2&o){let iA;A.mGM(iA=A.lsd())&&(r.outputIndx=iA.first)}},standalone:!1,decls:47,vars:20,consts:[["outputIndx","ngModel"],["fee","ngModel"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["fxFlex","5","fxLayoutAlign","center 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"],[1,"ml-1","fa-icon-primary",3,"click","matTooltip","icon"],["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"],["fxFlex","100","class","alert alert-warn",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxLayout","column","fxFlex","49"],["autoFocus","","matInput","","type","number","required","","name","outputIndx",3,"ngModelChange","step","min","ngModel"],[4,"ngIf"],["matInput","","type","number","name","fees","required","",3,"ngModelChange","step","min","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-button","","color","primary","type","reset","default","",1,"mr-1",3,"click"],["mat-button","","color","primary","type","submit",3,"click"],["fxFlex","100",1,"alert","alert-warn"],["fxFlex","100",1,"alert","alert-danger","mt-1"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",2)(1,"div",3)(2,"mat-card-header",4)(3,"div",5)(4,"span",6),A.EFF(5,"Bump Fee"),A.k0s()(),A.j41(6,"button",7),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onClose())}),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",8)(9,"form",9)(10,"div",10)(11,"p",11),A.EFF(12),A.j41(13,"fa-icon",12),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onExplorerClicked(null==r.bumpFeeChannel?null:r.bumpFeeChannel.funding_txid))}),A.k0s()(),A.j41(14,"div",13)(15,"div",14),A.nrm(16,"fa-icon",15),A.j41(17,"span",16)(18,"div"),A.EFF(19,"Fee rates recommended by mempool (sat/vByte):"),A.k0s(),A.j41(20,"div"),A.EFF(21),A.k0s(),A.j41(22,"div"),A.EFF(23),A.k0s(),A.j41(24,"div"),A.EFF(25),A.k0s()()(),A.DNE(26,gt,8,4,"div",17),A.j41(27,"div",18)(28,"mat-form-field",19)(29,"mat-label"),A.EFF(30,"Output Index"),A.k0s(),A.j41(31,"input",20,0),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.outputIndex,re)||(r.outputIndex=re),w.Njj(re)}),A.k0s(),A.DNE(33,yt,2,0,"mat-error",21)(34,En,2,0,"mat-error",21),A.k0s(),A.j41(35,"mat-form-field",19)(36,"mat-label"),A.EFF(37,"Fees (Sats/vByte)"),A.k0s(),A.j41(38,"input",22,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.fees,re)||(r.fees=re),w.Njj(re)}),A.k0s(),A.DNE(40,bn,2,0,"mat-error",21),A.k0s()(),A.DNE(41,Kt,4,2,"div",23),A.k0s()(),A.j41(42,"div",24)(43,"button",25),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(44,"Clear"),A.k0s(),A.j41(45,"button",26),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onBumpFee())}),A.EFF(46),A.k0s()()()()()()}if(2&o){const iA=A.sdS(32);A.R7$(12),A.SpI("Bump fee for transaction id: ",null==r.bumpFeeChannel?null:r.bumpFeeChannel.funding_txid," "),A.R7$(),A.Y8G("matTooltip",A.mNQ("Link to "+r.selNode.settings.blockExplorerUrl))("icon",r.faUpRightFromSquare),A.R7$(3),A.Y8G("icon",r.faInfoCircle),A.R7$(5),A.SpI("- High: ",r.recommendedFee.fastestFee||"Unknown"),A.R7$(2),A.SpI("- Medium: ",r.recommendedFee.halfHourFee||"Unknown"),A.R7$(2),A.SpI("- Low: ",r.recommendedFee.hourFee||"Unknown"),A.R7$(),A.Y8G("ngIf",r.flgShowDustWarning),A.R7$(5),A.Y8G("step",1)("min",0),A.R50("ngModel",r.outputIndex),A.R7$(2),A.Y8G("ngIf",null==iA.errors?null:iA.errors.required),A.R7$(),A.Y8G("ngIf",null==iA.errors?null:iA.errors.pendingChannelOutputIndex),A.R7$(4),A.Y8G("step",1)("min",0),A.R50("ngModel",r.fees),A.R7$(2),A.Y8G("ngIf",!r.fees),A.R7$(),A.Y8G("ngIf",""!==r.bumpFeeError),A.R7$(5),A.JRh(""!==r.bumpFeeError?"Retry Bump Fee":"Bump Fee")}},dependencies:[de.bT,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.vS,hA.cV,P.aY,fA.$z,QA.m2,QA.MM,UA.fg,yA.rl,yA.nJ,yA.TL,Q.DJ,Q.sA,Q.UI,HA.oV,cA.N,J.V,de.QX],encapsulation:2}))}return n(),l})();const $t=()=>["all"],Xn=n=>({"error-border":n}),ni=()=>["no_peer"],yn=n=>({width:n}),gs=n=>({"display-none":n});function ii(n,l){if(1&n&&(A.j41(0,"mat-option",39),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function Ti(n,l){1&n&&A.nrm(0,"mat-progress-bar",40)}function An(n,l){1&n&&A.nrm(0,"th",41)}function en(n,l){if(1&n&&(A.j41(0,"span",45),A.nrm(1,"fa-icon",46),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faEyeSlash)}}function tn(n,l){if(1&n&&(A.j41(0,"span",47),A.nrm(1,"fa-icon",46),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("icon",e.faEye)}}function nn(n,l){if(1&n&&(A.j41(0,"td",42),A.DNE(1,en,2,1,"span",43)(2,tn,2,1,"span",44),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",e.private),A.R7$(),A.Y8G("ngIf",!e.private)}}function Bs(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Alias"),A.k0s())}function fs(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,yn,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.alias)}}function us(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"ID"),A.k0s())}function hs(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,yn,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.id)}}function Es(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Channel ID"),A.k0s())}function ws(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,yn,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.channel_id)}}function Cs(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Funding Transaction ID"),A.k0s())}function ds(n,l){if(1&n&&(A.j41(0,"td",42)(1,"div",49)(2,"span",50),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,yn,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.funding_txid)}}function hi(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"Connected"),A.k0s())}function jt(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null!=e&&e.peer_connected?"Connected":"Disconnected")}}function on(n,l){1&n&&(A.j41(0,"th",48),A.EFF(1,"State"),A.k0s())}function dr(n,l){if(1&n&&(A.j41(0,"td",51),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("ngStyle",A.eq3(2,yn,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(),A.JRh(i.CLNChannelPendingState[null==e?null:e.state])}}function Wn(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Local Reserve (Sats)"),A.k0s())}function Qr(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.our_reserve_msat)/1e3,"1.0-0")," ")}}function Qs(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Remote Reserve (Sats)"),A.k0s())}function mr(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.their_reserve_msat)/1e3,"1.0-0")," ")}}function Xs(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Total (Sats)"),A.k0s())}function Mr(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.total_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function Zs(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Spendable (Sats)"),A.k0s())}function va(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.spendable_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function Ra(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Local Balance (Sats)"),A.k0s())}function si(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.to_us_msat)/1e3,(null==e?null:e.to_us_msat)<1e3?"1.0-4":"1.0-0")," ")}}function pr(n,l){1&n&&(A.j41(0,"th",52),A.EFF(1,"Remote Balance (Sats)"),A.k0s())}function Vc(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",53),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.to_them_msat)/1e3,(null==e?null:e.to_them_msat)<1e3?"1.0-4":"1.0-0")," ")}}function Wc(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",54)(1,"div",55)(2,"mat-select",56),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",57),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function Kc(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",57),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onChannelClose(o))}),A.EFF(1,"Close Channel"),A.k0s()}}function Xc(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",57),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onBumpFee(o))}),A.EFF(1,"Bump Fee"),A.k0s()}}function Zc(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",58)(1,"div",55)(2,"mat-select",59),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",57),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG();return w.Njj(iA.onChannelClick(r,o))}),A.EFF(5,"View Info"),A.k0s(),A.DNE(6,Kc,2,0,"mat-option",60)(7,Xc,2,0,"mat-option",60),A.k0s()()()}if(2&n){const e=l.$implicit;A.R7$(6),A.Y8G("ngIf","CHANNELD_SHUTTING_DOWN"===e.state||"CLOSINGD_SIGEXCHANGE"===e.state||!e.peer_connected&&"CHANNELD_NORMAL"===e.state),A.R7$(),A.Y8G("ngIf","CHANNELD_AWAITING_LOCKIN"===e.state)}}function qc(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No peers connected. Add a peer in order to open a channel."),A.k0s())}function $c(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No pending/inactive channel available."),A.k0s())}function A0(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting pending/inactive channels..."),A.k0s())}function e0(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function t0(n,l){if(1&n&&(A.j41(0,"td",61),A.DNE(1,qc,2,0,"p",62)(2,$c,2,0,"p",62)(3,A0,2,0,"p",62)(4,e0,2,1,"p",62),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function n0(n,l){if(1&n&&A.nrm(0,"tr",63),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,gs,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function i0(n,l){1&n&&A.nrm(0,"tr",64)}function s0(n,l){1&n&&A.nrm(0,"tr",65)}let r0=(()=>{var n;class l{constructor(i,o,r,iA,ne){this.logger=i,this.store=o,this.rtlEffects=r,this.commonService=iA,this.camelCaseWithReplace=ne,this.faEye=v.pS3,this.faEyeSlash=v.k6j,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"pending_inactive_channels",recordsPerPage:B.md,sortBy:"alias",sortOrder:B.oi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.channels=new z.I6([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=B.G,this.selFilter="",this.CLNChannelPendingState=B.Zb,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.selNode=null,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.GX).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.information=i.information,this.numPeers=i.numPeers,this.totalBalance=i.balance.totalBalance||0,this.logger.info(i)}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("private"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.channelsData=[...i.pendingChannels,...i.inactiveChannels],this.channelsData=this.channelsData.sort((o,r)=>this.CLNChannelPendingState[o.state||""]>=this.CLNChannelPendingState[r.state||""]?1:-1),this.channelsData&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(i)}),this.store.select(j._c).pipe((0,I.Q)(this.unSubs[4])).subscribe(i=>{this.selNode=i})}ngAfterViewInit(){this.channelsData&&this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onBumpFee(i){this.store.dispatch((0,C.xO)({payload:{data:{channel:i,component:jn}}}))}onChannelClick(i,o){this.store.dispatch((0,C.xO)({payload:{data:{channel:i,selNode:this.selNode,showCopy:!0,component:Da}}}))}onChannelClose(i){this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Force Close Channel",titleMessage:"Force closing channel: "+(i.alias||i.short_channel_id?i.alias&&i.short_channel_id?i.alias+" ("+i.short_channel_id+")":i.alias?i.alias:i.short_channel_id:i.channel_id),noBtnText:"Cancel",yesBtnText:"Force Close"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[3])).subscribe(o=>{o&&this.store.dispatch((0,VA.w0)({payload:{id:i.id,channelId:i.channel_id,force:!0}}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column||"","_"):this.commonService.titleCase(i)}setFilterPredicate(){this.channels.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.peer_connected?"connected":"disconnected")+(i.channel_id?i.channel_id.toLowerCase():"")+(i.short_channel_id?i.short_channel_id.toLowerCase():"")+(i.id?i.id.toLowerCase():"")+(i.alias?i.alias.toLowerCase():"")+(i.private?"private":"public")+(i.state&&this.CLNChannelPendingState[i.state]?this.CLNChannelPendingState[i.state].toLowerCase():"")+(i.funding_txid?i.funding_txid.toLowerCase():"")+(i.to_us_msat?i.to_us_msat:"")+(i.to_them_msat?i.to_them_msat/1e3:"")+(i.total_msat?i.total_msat/1e3:"")+(i.their_reserve_msat?i.their_reserve_msat/1e3:"")+(i.our_reserve_msat?i.our_reserve_msat/1e3:"")+(i.spendable_msat?i.spendable_msat/1e3:"");break;case"private":r=i?.private?"private":"public";break;case"connected":r=i?.peer_connected?"connected":"disconnected";break;case"msatoshi_total":r=((i.total_msat||0)/1e3).toString()||"";break;case"spendable_msatoshi":r=((i.spendable_msat||0)/1e3).toString()||"";break;case"msatoshi_to_us":r=((i.to_us_msat||0)/1e3).toString()||"";break;case"msatoshi_to_them":r=((i.to_them_msat||0)/1e3).toString()||"";break;case"our_channel_reserve_satoshis":r=((i.our_reserve_msat||0)/1e3).toString()||"";break;case"their_channel_reserve_satoshis":r=((i.their_reserve_msat||0)/1e3).toString()||"";break;case"state":r=i?.state?this.CLNChannelPendingState[i?.state]:"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"connected"===this.selFilterBy||"state"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadChannelsTable(i){this.channels=new z.I6([...i]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(o,r)=>{switch(r){case"msatoshi_total":return o.total_msat;case"spendable_msatoshi":return o.spendable_msat;case"msatoshi_to_us":return o.to_us_msat;case"msatoshi_to_them":return o.to_them_msat;case"our_channel_reserve_satoshis":return o.our_reserve_msat;case"their_channel_reserve_satoshis":return o.their_reserve_msat;case"state":return this.CLNChannelPendingState[o.state];default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"Pending-inactive-channels")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(b.H),A.rXU(L.h),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-pending-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Channels")}])],decls:66,vars:18,consts:[["table",""],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","private"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","id"],["matColumnDef","channel_id"],["matColumnDef","funding_txid"],["matColumnDef","connected"],["matColumnDef","state"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","our_channel_reserve_satoshis"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","their_channel_reserve_satoshis"],["matColumnDef","msatoshi_total"],["matColumnDef","spendable_msatoshi"],["matColumnDef","msatoshi_to_us"],["matColumnDef","msatoshi_to_them"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","5",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","5"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2),A.nrm(2,"div",3),A.j41(3,"div",4)(4,"mat-form-field",5)(5,"mat-label"),A.EFF(6,"Filter By"),A.k0s(),A.j41(7,"mat-select",6),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(8,"perfect-scrollbar"),A.DNE(9,ii,2,2,"mat-option",7),A.k0s()()(),A.j41(10,"mat-form-field",5)(11,"mat-label"),A.EFF(12,"Filter"),A.k0s(),A.j41(13,"input",8),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.DNE(14,Ti,1,0,"mat-progress-bar",9),A.j41(15,"div",10)(16,"table",11,0),A.qex(18,12),A.DNE(19,An,1,0,"th",13)(20,nn,3,2,"td",14),A.bVm(),A.qex(21,15),A.DNE(22,Bs,2,0,"th",16)(23,fs,4,4,"td",14),A.bVm(),A.qex(24,17),A.DNE(25,us,2,0,"th",16)(26,hs,4,4,"td",14),A.bVm(),A.qex(27,18),A.DNE(28,Es,2,0,"th",16)(29,ws,4,4,"td",14),A.bVm(),A.qex(30,19),A.DNE(31,Cs,2,0,"th",16)(32,ds,4,4,"td",14),A.bVm(),A.qex(33,20),A.DNE(34,hi,2,0,"th",16)(35,jt,2,1,"td",14),A.bVm(),A.qex(36,21),A.DNE(37,on,2,0,"th",16)(38,dr,2,4,"td",22),A.bVm(),A.qex(39,23),A.DNE(40,Wn,2,0,"th",24)(41,Qr,4,4,"td",14),A.bVm(),A.qex(42,25),A.DNE(43,Qs,2,0,"th",24)(44,mr,4,4,"td",14),A.bVm(),A.qex(45,26),A.DNE(46,Xs,2,0,"th",24)(47,Mr,4,4,"td",14),A.bVm(),A.qex(48,27),A.DNE(49,Zs,2,0,"th",24)(50,va,4,4,"td",14),A.bVm(),A.qex(51,28),A.DNE(52,Ra,2,0,"th",24)(53,si,4,4,"td",14),A.bVm(),A.qex(54,29),A.DNE(55,pr,2,0,"th",24)(56,Vc,4,4,"td",14),A.bVm(),A.qex(57,30),A.DNE(58,Wc,6,0,"th",31)(59,Zc,8,2,"td",32),A.bVm(),A.qex(60,33),A.DNE(61,t0,5,4,"td",34),A.bVm(),A.DNE(62,n0,1,3,"tr",35)(63,i0,1,0,"tr",36)(64,s0,1,0,"tr",37),A.k0s()(),A.nrm(65,"mat-paginator",38),A.k0s()}2&o&&(A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(14,$t).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(),A.Y8G("ngIf",r.apiCallStatus.status===r.apiCallStatusEnum.INITIATED),A.R7$(2),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.channels)("ngClass",A.eq3(15,Xn,""!==r.errorMessage)),A.R7$(46),A.Y8G("matFooterRowDef",A.lJ4(17,ni)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,de.QX],styles:[".mat-column-private[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}))}return n(),l})();const a0=()=>["all"],o0=n=>({"error-border":n}),l0=()=>["no_peer"],vc=n=>({"mr-0":n}),dc=n=>({width:n}),c0=n=>({"display-none":n});function g0(n,l){if(1&n&&(A.j41(0,"mat-option",34),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function B0(n,l){1&n&&A.nrm(0,"mat-progress-bar",35)}function f0(n,l){1&n&&A.nrm(0,"th",36)}function u0(n,l){if(1&n&&A.nrm(0,"span",40),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,vc,e.screenSize===e.screenSizeEnum.XS))}}function h0(n,l){if(1&n&&A.nrm(0,"span",41),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,vc,e.screenSize===e.screenSizeEnum.XS))}}function E0(n,l){if(1&n&&(A.j41(0,"td",37),A.DNE(1,u0,1,3,"span",38)(2,h0,1,3,"span",39),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",null==e?null:e.connected),A.R7$(),A.Y8G("ngIf",!(null!=e&&e.connected))}}function w0(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Alias"),A.k0s())}function C0(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,dc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.alias)}}function d0(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"ID"),A.k0s())}function Q0(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,dc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.id)}}function m0(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Network Address"),A.k0s())}function M0(n,l){1&n&&(A.j41(0,"span"),A.EFF(1,","),A.nrm(2,"br"),A.k0s())}function p0(n,l){if(1&n&&(A.j41(0,"span",44),A.EFF(1),A.DNE(2,M0,3,0,"span",46),A.k0s()),2&n){const e=l.$implicit,i=l.last;A.R7$(),A.JRh(e),A.R7$(),A.Y8G("ngIf",!i)}}function I0(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",43),A.DNE(2,p0,3,2,"span",45),A.k0s()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,dc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(),A.Y8G("ngForOf",null==e?null:e.netaddr)}}function D0(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",47)(1,"div",48)(2,"mat-select",49),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",50),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function F0(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",50),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onPeerDetach(o))}),A.EFF(1,"Disconnect"),A.k0s()}}function y0(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",50),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onConnectPeer(o))}),A.EFF(1,"Reconnect"),A.k0s()}}function x0(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",51)(1,"div",48)(2,"mat-select",49),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",50),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG();return w.Njj(iA.onPeerClick(r,o))}),A.EFF(5,"View Info"),A.k0s(),A.j41(6,"mat-option",50),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onOpenChannel(o))}),A.EFF(7,"Open Channel"),A.k0s(),A.DNE(8,F0,2,0,"mat-option",52)(9,y0,2,0,"mat-option",52),A.k0s()()()}if(2&n){const e=l.$implicit;A.R7$(8),A.Y8G("ngIf",e.connected),A.R7$(),A.Y8G("ngIf",!e.connected)}}function Y0(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No connected peer."),A.k0s())}function b0(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting peers..."),A.k0s())}function v0(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function R0(n,l){if(1&n&&(A.j41(0,"td",53),A.DNE(1,Y0,2,0,"p",46)(2,b0,2,0,"p",46)(3,v0,2,1,"p",46),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function S0(n,l){if(1&n&&A.nrm(0,"tr",54),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,c0,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function N0(n,l){1&n&&A.nrm(0,"tr",55)}function T0(n,l){1&n&&A.nrm(0,"tr",56)}let P0=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.logger=i,this.store=o,this.rtlEffects=r,this.actions=iA,this.commonService=ne,this.camelCaseWithReplace=re,this.faUsers=v.gdJ,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"peers",recordsPerPage:B.md,sortBy:"alias",sortOrder:B.oi.DESCENDING},this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.peers=new z.I6([]),this.utxos=[],this.information={},this.availableBalance=0,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.kQ).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.information=i.information,this.availableBalance=i.balance.totalBalance||0}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("connected"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.os).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.peersData=i.peers||[],this.peersData&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPeersTable(this.peersData),this.logger.info(i)}),this.store.select(tA.Al).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.utxos=this.commonService.sortAscByKey(i.utxos?.filter(o=>"confirmed"===o.status),"value")}),this.actions.pipe((0,I.Q)(this.unSubs[4]),(0,nA.p)(i=>i.type===B.TC.SET_PEERS_CLN)).subscribe(i=>{this.peerAddress=null})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(i,o){this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Peer Information",goToFieldValue:i.id,goToName:"Graph lookup",goToLink:"/cln/graph/lookups",showQRName:"Public Key",showQRField:i.id,message:[[{key:"id",value:i.id,title:"Public Key",width:100}],[{key:"netaddr",value:i.netaddr,title:"Address",width:100}],[{key:"alias",value:i.alias,title:"Alias",width:50},{key:"connected",value:i.connected?"True":"False",title:"Connected",width:50}]]}}}))}onConnectPeer(i){this.store.dispatch((0,C.xO)({payload:{data:{message:{peer:i.id?i:null,information:this.information,balance:this.availableBalance},component:Ur}}}))}onOpenChannel(i){this.store.dispatch((0,C.xO)({payload:{data:{alertTitle:"Open Channel",message:{peer:i,information:this.information,balance:this.availableBalance,utxos:this.utxos},newlyAdded:!1,component:Hr}}}))}onPeerDetach(i){this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(i.alias?i.alias:i.id),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[5])).subscribe(r=>{r&&this.store.dispatch((0,VA.ed)({payload:{id:i.id,force:!1}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.peers.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=JSON.stringify(i).toLowerCase();break;case"connected":r=i?.connected?"connected":"disconnected";break;case"netaddr":r=i.netaddr?i.netaddr.reduce((iA,ne)=>iA+ne," "):"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"connected"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadPeersTable(i){this.peers=new z.I6([...i]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(o,r)=>{if("netaddr"===r){if(o.netaddr&&o.netaddr[0]){const iA=o.netaddr[0].toString().split(".");return iA[0]?+iA[0]:o.netaddr[0]}return""}return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null},this.peers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(b.H),A.rXU(kA.En),A.rXU(L.h),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-peers"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Peers")}])],decls:47,vars:19,consts:[["peersForm","ngForm"],["table",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-x-hidden","overflow-y-hidden",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","connected"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Connected",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","id"],["matColumnDef","netaddr"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Connected"],["mat-cell",""],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["class","ellipsis-child",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",2)(1,"form",3,0)(3,"button",4),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onConnectPeer({}))}),A.EFF(4,"Add Peer"),A.k0s()(),A.j41(5,"div",5)(6,"div",6)(7,"div",7),A.nrm(8,"fa-icon",8),A.j41(9,"span",9),A.EFF(10,"Connected Peers"),A.k0s()(),A.j41(11,"div",10)(12,"mat-form-field",11)(13,"mat-label"),A.EFF(14,"Filter By"),A.k0s(),A.j41(15,"mat-select",12),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(16,"perfect-scrollbar"),A.DNE(17,g0,2,2,"mat-option",13),A.k0s()()(),A.j41(18,"mat-form-field",11)(19,"mat-label"),A.EFF(20,"Filter"),A.k0s(),A.j41(21,"input",14),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(22,"div",15),A.DNE(23,B0,1,0,"mat-progress-bar",16),A.j41(24,"table",17,1),A.qex(26,18),A.DNE(27,f0,1,0,"th",19)(28,E0,3,2,"td",20),A.bVm(),A.qex(29,21),A.DNE(30,w0,2,0,"th",22)(31,C0,4,4,"td",20),A.bVm(),A.qex(32,23),A.DNE(33,d0,2,0,"th",22)(34,Q0,4,4,"td",20),A.bVm(),A.qex(35,24),A.DNE(36,m0,2,0,"th",22)(37,I0,3,4,"td",20),A.bVm(),A.qex(38,25),A.DNE(39,D0,6,0,"th",26)(40,x0,10,2,"td",27),A.bVm(),A.qex(41,28),A.DNE(42,R0,4,3,"td",29),A.bVm(),A.DNE(43,S0,1,3,"tr",30)(44,N0,1,0,"tr",31)(45,T0,1,0,"tr",32),A.k0s()(),A.nrm(46,"mat-paginator",33),A.k0s()()}2&o&&(A.R7$(8),A.Y8G("icon",r.faUsers),A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(15,a0).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(2),A.Y8G("ngIf",r.apiCallStatus.status===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.peers)("ngClass",A.eq3(16,o0,""!==r.errorMessage)),A.R7$(19),A.Y8G("matFooterRowDef",A.lJ4(18,l0)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.qT,hA.me,hA.BC,hA.cb,hA.vS,hA.cV,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld],styles:[".mat-column-connected[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}))}return n(),l})();const U0=["queryRoutesForm"],L0=n=>({"overflow-auto error-border":n,"overflow-auto":!0}),Rc=n=>({width:n});function G0(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Destination pubkey is required."),A.k0s())}function z0(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Amount is required."),A.k0s())}function k0(n,l){1&n&&A.nrm(0,"mat-progress-bar",36)}function H0(n,l){1&n&&(A.j41(0,"th",37),A.EFF(1,"ID"),A.k0s())}function j0(n,l){if(1&n&&(A.j41(0,"td",38)(1,"div",39)(2,"span",40),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Rc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.id)}}function O0(n,l){1&n&&(A.j41(0,"th",37),A.EFF(1,"Alias"),A.k0s())}function J0(n,l){if(1&n&&(A.j41(0,"td",38)(1,"div",39)(2,"span",40),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Rc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.alias)}}function _0(n,l){1&n&&(A.j41(0,"th",37),A.EFF(1,"Channel"),A.k0s())}function V0(n,l){if(1&n&&(A.j41(0,"td",38),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.channel)}}function W0(n,l){1&n&&(A.j41(0,"th",37),A.EFF(1,"Direction"),A.k0s())}function K0(n,l){if(1&n&&(A.j41(0,"td",38),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.direction)}}function X0(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Delay"),A.k0s())}function Z0(n,l){if(1&n&&(A.j41(0,"td",38)(1,"span",42),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI("",A.bMT(3,1,null==e?null:e.delay)," ")}}function q0(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Amount (Sats)"),A.k0s())}function $0(n,l){if(1&n&&(A.j41(0,"td",38)(1,"span",42),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.bMT(3,1,(null==e?null:e.amount_msat)/1e3))}}function Ag(n,l){1&n&&(A.j41(0,"th",43)(1,"div",44),A.EFF(2,"Actions"),A.k0s()())}function eg(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",45)(1,"button",46),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG();return w.Njj(iA.onHopClick(r,o))}),A.EFF(2,"View Info"),A.k0s()()}}function tg(n,l){1&n&&A.nrm(0,"tr",47)}function ng(n,l){1&n&&A.nrm(0,"tr",48)}let ig=(()=>{var n;class l{constructor(i,o,r){this.store=i,this.clnEffects=o,this.commonService=r,this.PAGE_ID="graph_lookup",this.tableSetting={tableId:"query_routes",recordsPerPage:B.md,sortBy:"id",sortOrder:B.oi.ASCENDING},this.destinationPubkey="",this.amount=null,this.qrHops=new z.I6([]),this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=v.TBz,this.faExclamationTriangle=v.zpE,this.screenSize="",this.screenSizeEnum=B.f7,this.unSubs=[new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions")}),this.clnEffects.setQueryRoutesCL.pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.qrHops.data=[],i.route&&i.route.length&&i.route.length>0?(this.flgLoading[0]=!1,this.qrHops=new z.I6([...i.route])):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(o,r)=>o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null})}onQueryRoutes(){if(!this.destinationPubkey||!this.amount)return!0;this.flgLoading[0]=!0,this.store.dispatch((0,VA.T4)({payload:{destPubkey:this.destinationPubkey,amount:1e3*this.amount}}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(i,o){this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Route Information",message:[[{key:"id",value:i.id,title:"ID",width:100,type:B.UN.STRING}],[{key:"channel",value:i.channel,title:"Channel",width:50,type:B.UN.STRING},{key:"alias",value:i.alias,title:"Peer Alias",width:50,type:B.UN.STRING}],[{key:"amount_msat",value:i.amount_msat,title:"Amount (mSat)",width:34,type:B.UN.NUMBER},{key:"direction",value:i.direction,title:"Direction",width:33,type:B.UN.STRING},{key:"delay",value:i.delay,title:"Delay",width:33,type:B.UN.NUMBER}]]}}}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(AA.il),A.rXU(kr.i),A.rXU(L.h))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-query-routes"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(U0,7)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.form=iA.first)}},standalone:!1,decls:55,vars:17,consts:[["queryRoutesForm","ngForm"],["destPubkey","ngModel"],["table",""],["fxLayout","column","fxFlex","100",1,"padding-gap"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","69","fxLayoutAlign","start end"],["matInput","","name","destinationPubkey","tabindex","1","required","",3,"ngModelChange","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","29","fxLayoutAlign","start end"],["matInput","","name","amount","tabindex","2","type","number","required","",3,"ngModelChange","step","min","ngModel"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxLayoutAlign","start center",1,"page-sub-title-container","mt-2","mb-1"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],[1,"table-container","mb-6",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","channel"],["matColumnDef","direction"],["matColumnDef","delay"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",3)(1,"form",4,0),A.bIt("ngSubmit",function(){w.eBV(iA);const re=A.sdS(2);return w.Njj(re.form.valid&&r.onQueryRoutes())}),A.j41(3,"div",5),A.nrm(4,"fa-icon",6),A.j41(5,"span"),A.EFF(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),A.k0s()(),A.j41(7,"mat-form-field",7)(8,"mat-label"),A.EFF(9,"Destination Pubkey"),A.k0s(),A.j41(10,"input",8,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.destinationPubkey,re)||(r.destinationPubkey=re),w.Njj(re)}),A.k0s(),A.DNE(12,G0,2,0,"mat-error",9),A.k0s(),A.j41(13,"mat-form-field",10)(14,"mat-label"),A.EFF(15,"Amount (Sats)"),A.k0s(),A.j41(16,"input",11),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.amount,re)||(r.amount=re),w.Njj(re)}),A.k0s(),A.DNE(17,z0,2,0,"mat-error",9),A.k0s(),A.j41(18,"div",12)(19,"button",13),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(20,"Clear"),A.k0s(),A.j41(21,"button",14),A.EFF(22,"Query Route"),A.k0s()()(),A.j41(23,"div",15)(24,"div",16),A.nrm(25,"fa-icon",17),A.j41(26,"span",18),A.EFF(27,"Transaction Route"),A.k0s()()(),A.j41(28,"div",19),A.DNE(29,k0,1,0,"mat-progress-bar",20),A.j41(30,"table",21,2),A.qex(32,22),A.DNE(33,H0,2,0,"th",23)(34,j0,4,4,"td",24),A.bVm(),A.qex(35,25),A.DNE(36,O0,2,0,"th",23)(37,J0,4,4,"td",24),A.bVm(),A.qex(38,26),A.DNE(39,_0,2,0,"th",23)(40,V0,2,1,"td",24),A.bVm(),A.qex(41,27),A.DNE(42,W0,2,0,"th",23)(43,K0,2,1,"td",24),A.bVm(),A.qex(44,28),A.DNE(45,X0,2,0,"th",29)(46,Z0,4,3,"td",24),A.bVm(),A.qex(47,30),A.DNE(48,q0,2,0,"th",29)(49,$0,4,3,"td",24),A.bVm(),A.qex(50,31),A.DNE(51,Ag,3,0,"th",32)(52,eg,3,0,"td",33),A.bVm(),A.DNE(53,tg,1,0,"tr",34)(54,ng,1,0,"tr",35),A.k0s()()()}2&o&&(A.R7$(4),A.Y8G("icon",r.faExclamationTriangle),A.R7$(6),A.R50("ngModel",r.destinationPubkey),A.R7$(2),A.Y8G("ngIf",!r.destinationPubkey),A.R7$(4),A.Y8G("step",1e3)("min",0),A.R50("ngModel",r.amount),A.R7$(),A.Y8G("ngIf",!r.amount),A.R7$(8),A.Y8G("icon",r.faRoute),A.R7$(4),A.Y8G("ngIf",!0===r.flgLoading[0]),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.qrHops)("ngClass",A.eq3(15,L0,"error"===r.flgLoading[0])),A.R7$(23),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns))},dependencies:[de.YU,de.bT,de.B3,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.vS,hA.cV,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,yA.TL,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.KS,z.$R,z.YZ,z.NB,M.Ld,J.V,de.QX],encapsulation:2}))}return n(),l})();function sg(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Message is required."),A.k0s())}let rg=(()=>{var n;class l{constructor(i,o,r){this.dataService=i,this.snackBar=o,this.logger=r,this.message="",this.signedMessage="",this.signature="",this.unSubs=[new g.B,new g.B]}onSign(){if(!this.message||""===this.message)return!0;this.dataService.signMessage(this.message).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.signedMessage=this.message,this.signature=i.zbase})}onMessageChange(){this.signedMessage!==this.message&&(this.signature="")}onCopyField(i){this.snackBar.open("Signature copied."),this.logger.info("Copied Text: "+i)}resetData(){this.message="",this.signature="",this.signedMessage=""}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(Dt.u),A.rXU(js.UG),A.rXU(aA.gP))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-sign"]],standalone:!1,decls:22,vars:4,consts:[["form","ngForm"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","required","","tabindex","1","name","message",3,"ngModelChange","keyup","ngModel"],[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"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","row","fxLayoutAlign","start center",1,"signature-box","bordered-box","read-only"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","4","rtlClipboard","","type","button",3,"copied","payload"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"form",2,0)(3,"mat-form-field",3)(4,"mat-label"),A.EFF(5,"Message to sign"),A.k0s(),A.j41(6,"textarea",4),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.message,re)||(r.message=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onMessageChange())}),A.k0s(),A.DNE(7,sg,2,0,"mat-error",5),A.k0s(),A.j41(8,"div",6)(9,"button",7),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(10,"Clear Field"),A.k0s(),A.j41(11,"button",8),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onSign())}),A.EFF(12,"Sign"),A.k0s()(),A.nrm(13,"mat-divider",9),A.j41(14,"div",10)(15,"p"),A.EFF(16,"Generated Signature"),A.k0s()(),A.j41(17,"div",11),A.EFF(18),A.k0s(),A.j41(19,"div",12)(20,"button",13),A.bIt("copied",function(re){return w.eBV(iA),w.Njj(r.onCopyField(re))}),A.EFF(21,"Copy Signature"),A.k0s()()()()}2&o&&(A.R7$(6),A.R50("ngModel",r.message),A.R7$(),A.Y8G("ngIf",!r.message),A.R7$(11),A.JRh(r.signature),A.R7$(2),A.Y8G("payload",r.signature))},dependencies:[de.bT,hA.qT,hA.me,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,fA.$z,UA.fg,yA.rl,yA.nJ,yA.TL,sn.q,Q.DJ,Q.sA,Q.UI,Ji.U,cA.N],styles:[".signature-box[_ngcontent-%COMP%]{padding:1rem}"]}))}return n(),l})();function ag(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Message is required."),A.k0s())}function og(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Signature is required."),A.k0s())}function lg(n,l){1&n&&(A.j41(0,"p",13)(1,"mat-icon",14),A.EFF(2,"close"),A.k0s(),A.EFF(3,"Verification failed, please check message and signature"),A.k0s())}function cg(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Pubkey Used"),A.k0s())}function gg(n,l){if(1&n&&(A.j41(0,"div",20)(1,"p"),A.EFF(2),A.k0s()()),2&n){const e=A.XpG(2);A.R7$(2),A.JRh(null==e.verifyRes?null:e.verifyRes.pubkey)}}function Bg(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",21)(1,"button",22),A.bIt("copied",function(o){w.eBV(e);const r=A.XpG(2);return w.Njj(r.onCopyField(o))}),A.EFF(2,"Copy Pubkey"),A.k0s()()}if(2&n){const e=A.XpG(2);A.R7$(),A.Y8G("payload",null==e.verifyRes?null:e.verifyRes.pubkey)}}function fg(n,l){if(1&n&&(A.j41(0,"div",15),A.nrm(1,"mat-divider",16),A.j41(2,"div",17),A.DNE(3,cg,2,0,"p",6),A.k0s(),A.DNE(4,gg,3,1,"div",18)(5,Bg,3,1,"div",19),A.k0s()),2&n){const e=A.XpG();A.R7$(3),A.Y8G("ngIf",e.verifyRes.verified),A.R7$(),A.Y8G("ngIf",e.verifyRes.verified),A.R7$(),A.Y8G("ngIf",e.verifyRes.verified)}}let ug=(()=>{var n;class l{constructor(i,o,r){this.dataService=i,this.snackBar=o,this.logger=r,this.message="",this.verifiedMessage="",this.signature="",this.verifiedSignature="",this.showVerifyStatus=!1,this.verifyRes={pubkey:"",verified:null},this.unSubs=[new g.B,new g.B]}onVerify(){if(!this.message||""===this.message||!this.signature||""===this.signature)return!0;this.dataService.verifyMessage(this.message,this.signature).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.verifyRes=i,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:"",verified:null})}resetData(){this.message="",this.signature="",this.verifyRes=null,this.showVerifyStatus=!1}onCopyField(i){this.snackBar.open("Pubkey copied."),this.logger.info("Copied Text: "+i)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(Dt.u),A.rXU(js.UG),A.rXU(aA.gP))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-verify"]],standalone:!1,decls:21,vars:6,consts:[["form","ngForm"],["sign","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","required","","tabindex","1","name","message",3,"ngModelChange","keyup","ngModel"],[4,"ngIf"],["matInput","","name","signature","tabindex","2","required","",3,"ngModelChange","keyup","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"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start","class","bordered-box read-only padding-gap",4,"ngIf"],["fxLayout","row","class","mt-2",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",1,"bordered-box","read-only","padding-gap"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","5","rtlClipboard","","type","button",3,"copied","payload"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",2)(1,"form",3,0)(3,"mat-form-field",4)(4,"mat-label"),A.EFF(5,"Message to verify"),A.k0s(),A.j41(6,"textarea",5),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.message,re)||(r.message=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onChange())}),A.k0s(),A.DNE(7,ag,2,0,"mat-error",6),A.k0s(),A.j41(8,"mat-form-field",4)(9,"mat-label"),A.EFF(10,"Signature provided"),A.k0s(),A.j41(11,"input",7,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.signature,re)||(r.signature=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onChange())}),A.k0s(),A.DNE(13,og,2,0,"mat-error",6),A.k0s(),A.DNE(14,lg,4,0,"p",8),A.j41(15,"div",9)(16,"button",10),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(17,"Clear Fields"),A.k0s(),A.j41(18,"button",11),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onVerify())}),A.EFF(19,"Verify"),A.k0s()(),A.DNE(20,fg,6,3,"div",12),A.k0s()()}2&o&&(A.R7$(6),A.R50("ngModel",r.message),A.R7$(),A.Y8G("ngIf",!r.message),A.R7$(4),A.R50("ngModel",r.signature),A.R7$(2),A.Y8G("ngIf",!r.signature),A.R7$(),A.Y8G("ngIf",r.showVerifyStatus&&!r.verifyRes.verified),A.R7$(6),A.Y8G("ngIf",r.showVerifyStatus&&r.verifyRes.verified))},dependencies:[de.bT,hA.qT,hA.me,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,fA.$z,oA.An,UA.fg,yA.rl,yA.nJ,yA.TL,sn.q,Q.DJ,Q.sA,Q.UI,Ji.U,cA.N],encapsulation:2}))}return n(),l})();const hg=()=>["all"],Eg=()=>["no_event"],Qc=n=>({width:n}),wg=n=>({"display-none":n});function Cg(n,l){if(1&n&&(A.j41(0,"div",6),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.JRh(e.errorMessage)}}function dg(n,l){if(1&n&&(A.j41(0,"mat-option",14),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function Qg(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",7),A.nrm(1,"div",8),A.j41(2,"div",9)(3,"mat-form-field",10)(4,"mat-label"),A.EFF(5,"Filter By"),A.k0s(),A.j41(6,"mat-select",11),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilterBy,o)||(r.selFilterBy=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return o.selFilter="",w.Njj(o.applyFilter())}),A.j41(7,"perfect-scrollbar"),A.DNE(8,dg,2,2,"mat-option",12),A.k0s()()(),A.j41(9,"mat-form-field",10)(10,"mat-label"),A.EFF(11,"Filter"),A.k0s(),A.j41(12,"input",13),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilter,o)||(r.selFilter=o),w.Njj(o)}),A.bIt("input",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())})("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())}),A.k0s()()()()}if(2&n){const e=A.XpG();A.R7$(6),A.R50("ngModel",e.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(3,hg).concat(e.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",e.selFilter)}}function mg(n,l){1&n&&A.nrm(0,"mat-progress-bar",39)}function Mg(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Received Time"),A.k0s())}function pg(n,l){if(1&n&&(A.j41(0,"td",41),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.received_time),"dd/MMM/y HH:mm"))}}function Ig(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Resolved Time"),A.k0s())}function Dg(n,l){if(1&n&&(A.j41(0,"td",41),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.resolved_time),"dd/MMM/y HH:mm"))}}function Fg(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"In Channel ID"),A.k0s())}function yg(n,l){if(1&n&&(A.j41(0,"td",41),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.in_channel)}}function xg(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"In Channel"),A.k0s())}function Yg(n,l){if(1&n&&(A.j41(0,"td",41)(1,"div",42)(2,"span",43),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Qc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.in_channel_alias)}}function bg(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Out Channel ID"),A.k0s())}function vg(n,l){if(1&n&&(A.j41(0,"td",41),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.out_channel)}}function Rg(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Out Channel"),A.k0s())}function Sg(n,l){if(1&n&&(A.j41(0,"td",41)(1,"div",42)(2,"span",43),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Qc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.out_channel_alias)}}function Ng(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Payment Hash"),A.k0s())}function Tg(n,l){if(1&n&&(A.j41(0,"td",41)(1,"div",42)(2,"span",43),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Qc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.payment_hash)}}function Pg(n,l){1&n&&(A.j41(0,"th",44),A.EFF(1,"Amount In (Sats)"),A.k0s())}function Ug(n,l){if(1&n&&(A.j41(0,"td",41)(1,"span",45),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.in_msat)/1e3,(null==e?null:e.in_msat)<1e3?"1.0-4":"1.0-0")," ")}}function Lg(n,l){1&n&&(A.j41(0,"th",44),A.EFF(1,"Amount Out (Sats)"),A.k0s())}function Gg(n,l){if(1&n&&(A.j41(0,"td",41)(1,"span",45),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.out_msat)/1e3,(null==e?null:e.out_msat)<1e3?"1.0-4":"1.0-0")," ")}}function zg(n,l){1&n&&(A.j41(0,"th",44),A.EFF(1,"Fee (mSat)"),A.k0s())}function kg(n,l){if(1&n&&(A.j41(0,"span",45),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.SpI(" ",A.bMT(2,1,null==e?null:e.fee)," ")}}function Hg(n,l){if(1&n&&(A.j41(0,"span",45),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.SpI(" ",A.bMT(2,1,null==e?null:e.fee_msat)," ")}}function jg(n,l){if(1&n&&(A.j41(0,"td",41),A.DNE(1,kg,3,3,"span",46)(2,Hg,3,3,"span",46),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",null==e?null:e.fee),A.R7$(),A.Y8G("ngIf",!(null!=e&&e.fee)&&(null==e?null:e.fee_msat))}}function Og(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",47)(1,"div",48)(2,"mat-select",49),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",50),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function Jg(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",51)(1,"button",52),A.bIt("click",function(o){const r=w.eBV(e).$implicit,iA=A.XpG(2);return w.Njj(iA.onForwardingEventClick(r,o))}),A.EFF(2,"View Info"),A.k0s()()}}function _g(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No forwarding history available."),A.k0s())}function Vg(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting forwarding history..."),A.k0s())}function Wg(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function Kg(n,l){if(1&n&&(A.j41(0,"td",53),A.DNE(1,_g,2,0,"p",54)(2,Vg,2,0,"p",54)(3,Wg,2,1,"p",54),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function Xg(n,l){if(1&n&&A.nrm(0,"tr",55),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,wg,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Zg(n,l){1&n&&A.nrm(0,"tr",56)}function qg(n,l){1&n&&A.nrm(0,"tr",57)}function $g(n,l){if(1&n&&(A.j41(0,"div",15),A.DNE(1,mg,1,0,"mat-progress-bar",16),A.j41(2,"table",17,0),A.qex(4,18),A.DNE(5,Mg,2,0,"th",19)(6,pg,3,4,"td",20),A.bVm(),A.qex(7,21),A.DNE(8,Ig,2,0,"th",19)(9,Dg,3,4,"td",20),A.bVm(),A.qex(10,22),A.DNE(11,Fg,2,0,"th",19)(12,yg,2,1,"td",20),A.bVm(),A.qex(13,23),A.DNE(14,xg,2,0,"th",19)(15,Yg,4,4,"td",20),A.bVm(),A.qex(16,24),A.DNE(17,bg,2,0,"th",19)(18,vg,2,1,"td",20),A.bVm(),A.qex(19,25),A.DNE(20,Rg,2,0,"th",19)(21,Sg,4,4,"td",20),A.bVm(),A.qex(22,26),A.DNE(23,Ng,2,0,"th",19)(24,Tg,4,4,"td",20),A.bVm(),A.qex(25,27),A.DNE(26,Pg,2,0,"th",28)(27,Ug,4,4,"td",20),A.bVm(),A.qex(28,29),A.DNE(29,Lg,2,0,"th",28)(30,Gg,4,4,"td",20),A.bVm(),A.qex(31,30),A.DNE(32,zg,2,0,"th",28)(33,jg,3,2,"td",20),A.bVm(),A.qex(34,31),A.DNE(35,Og,6,0,"th",32)(36,Jg,3,0,"td",33),A.bVm(),A.qex(37,34),A.DNE(38,Kg,4,3,"td",35),A.bVm(),A.DNE(39,Xg,1,3,"tr",36)(40,Zg,1,0,"tr",37)(41,qg,1,0,"tr",38),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.forwardingHistoryEvents),A.R7$(37),A.Y8G("matFooterRowDef",A.lJ4(7,Eg)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)}}function AB(n,l){if(1&n&&A.nrm(0,"mat-paginator",58),2&n){const e=A.XpG();A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Sc=(()=>{var n;class l{constructor(i,o,r,iA,ne){this.logger=i,this.commonService=o,this.store=r,this.datePipe=iA,this.camelCaseWithReplace=ne,this.pageId="routing",this.tableId="forwarding_history",this.eventsData=[],this.selFilter="",this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.tableSetting={tableId:"forwarding_history",recordsPerPage:B.md,sortBy:"received_time",sortOrder:B.oi.DESCENDING},this.successfulEvents=[],this.displayedColumns=[],this.forwardingHistoryEvents=new z.I6([]),this.totalForwardedTransactions=0,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnChanges(i){i.eventsData&&(this.apiCallStatus={status:B.wn.COMPLETED,action:"FetchForwardingHistory"},this.eventsData=i.eventsData.currentValue,this.successfulEvents=this.eventsData,this.totalForwardedTransactions=this.eventsData.length,this.paginator&&this.paginator.firstPage(),i.eventsData.firstChange||this.loadForwardingEventsTable(this.successfulEvents)),i.selFilter&&!i.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}ngOnInit(){this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting.tableId=this.tableId,this.tableSetting=i.pageSettings.find(o=>o.pageId===this.pageId)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.pageId)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.pipe((0,bt.s)(1)).subscribe(i=>{i.cln.apisCallStatus.FetchForwardingHistoryS.status===B.wn.UN_INITIATED&&!i.cln.forwardingHistory.listForwards?.length&&this.store.dispatch((0,VA.uK)({payload:{status:B.xk.SETTLED}}))}),this.store.select(tA.Ie).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.eventsData.length<=0&&i.forwardingHistory.listForwards&&(this.totalForwardedTransactions=i.forwardingHistory.totalForwards||0,this.successfulEvents=i.forwardingHistory.listForwards||[],this.successfulEvents&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadForwardingEventsTable(this.successfulEvents),this.logger.info(i))})}ngAfterViewInit(){setTimeout(()=>{this.successfulEvents.length>0&&this.loadForwardingEventsTable(this.successfulEvents)},0)}onForwardingEventClick(i,o){const r=[[{key:"status",value:"Settled",title:"Status",width:50,type:B.UN.STRING},{key:"fee",value:i.fee_msat,title:"Fee (mSats)",width:50,type:B.UN.NUMBER}],[{key:"received_time",value:i.received_time,title:"Received Time",width:50,type:B.UN.DATE_TIME},{key:"resolved_time",value:i.resolved_time,title:"Resolved Time",width:50,type:B.UN.DATE_TIME}],[{key:"in_channel",value:i.in_channel_alias,title:"Inbound Channel",width:50,type:B.UN.STRING},{key:"out_channel",value:i.out_channel_alias,title:"Outbound Channel",width:50,type:B.UN.STRING}],[{key:"in_msatoshi",value:i.in_msat,title:"In (mSats)",width:50,type:B.UN.NUMBER},{key:"out_msatoshi",value:i.out_msat,title:"Out (mSats)",width:50,type:B.UN.NUMBER}]];i.payment_hash&&r.unshift([{key:"payment_hash",value:i.payment_hash,title:"Payment Hash",width:100,type:B.UN.STRING}]),this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Event Information",message:r}}}))}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.selFilter.trim().toLowerCase())}getLabel(i){const o=this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.forwardingHistoryEvents.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.received_time?this.datePipe.transform(new Date(1e3*i.received_time),"dd/MMM/y HH:mm")?.toLowerCase()+" ":"")+(i.resolved_time?this.datePipe.transform(new Date(1e3*i.resolved_time),"dd/MMM/y HH:mm")?.toLowerCase()+" ":"")+(i.in_channel?i.in_channel.toLowerCase()+" ":"")+(i.out_channel?i.out_channel.toLowerCase()+" ":"")+(i.in_channel_alias?i.in_channel_alias.toLowerCase()+" ":"")+(i.out_channel_alias?i.out_channel_alias.toLowerCase()+" ":"")+(i.in_msat?+i.in_msat/1e3+" ":"")+(i.out_msat?+i.out_msat/1e3+" ":"")+(i.fee_msat?i.fee_msat+" ":"");break;case"received_time":case"resolved_time":r=this.datePipe.transform(new Date(1e3*(i[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"fee":r=(+(i.fee_msat||0)).toString()||"";break;case"in_msatoshi":r=(+(i.in_msat||0)/1e3).toString()||"";break;case"out_msatoshi":r=(+(i.out_msat||0)/1e3).toString()||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return r.includes(o)}}loadForwardingEventsTable(i){this.forwardingHistoryEvents=new z.I6([...i]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(o,r)=>{switch(r){case"in_msatoshi":return o.in_msat;case"out_msatoshi":return o.out_msat;case"fee":return o.fee_msat;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.forwardingHistoryEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(de.vh),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-forwarding-history"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Events")}]),A.OA$],decls:5,vars:4,consts:[["table",""],["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"matSortActive","matSortDirection","dataSource"],["matColumnDef","received_time"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","resolved_time"],["matColumnDef","in_channel"],["matColumnDef","in_channel_alias"],["matColumnDef","out_channel"],["matColumnDef","out_channel_alias"],["matColumnDef","payment_hash"],["matColumnDef","in_msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","out_msatoshi"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",4,"ngIf"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(o,r){1&o&&(A.j41(0,"div",1),A.DNE(1,Cg,2,1,"div",2)(2,Qg,13,4,"div",3)(3,$g,42,8,"div",4)(4,AB,1,3,"mat-paginator",5),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",""!==r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.ZF,M.Ld,de.QX,de.vh],encapsulation:2}))}return n(),l})();const eB=()=>["all"],tB=()=>["no_event"],Nc=n=>({width:n}),nB=n=>({"display-none":n});function iB(n,l){if(1&n&&(A.j41(0,"div",6),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.JRh(e.errorMessage)}}function sB(n,l){if(1&n&&(A.j41(0,"mat-option",17),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function rB(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",7)(1,"div",8),A.nrm(2,"fa-icon",9),A.j41(3,"span"),A.EFF(4,"Maximum 1,000 failed transactions only."),A.k0s()(),A.j41(5,"div",10),A.nrm(6,"div",11),A.j41(7,"div",12)(8,"mat-form-field",13)(9,"mat-label"),A.EFF(10,"Filter By"),A.k0s(),A.j41(11,"mat-select",14),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilterBy,o)||(r.selFilterBy=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return o.selFilter="",w.Njj(o.applyFilter())}),A.j41(12,"perfect-scrollbar"),A.DNE(13,sB,2,2,"mat-option",15),A.k0s()()(),A.j41(14,"mat-form-field",13)(15,"mat-label"),A.EFF(16,"Filter"),A.k0s(),A.j41(17,"input",16),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilter,o)||(r.selFilter=o),w.Njj(o)}),A.bIt("input",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())})("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())}),A.k0s()()()()()}if(2&n){const e=A.XpG();A.R7$(2),A.Y8G("icon",e.faExclamationTriangle),A.R7$(9),A.R50("ngModel",e.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(4,eB).concat(e.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",e.selFilter)}}function aB(n,l){1&n&&A.nrm(0,"mat-progress-bar",41)}function oB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Received Time"),A.k0s())}function lB(n,l){if(1&n&&(A.j41(0,"td",43),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.received_time),"dd/MMM/y HH:mm"))}}function cB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Resolved Time"),A.k0s())}function gB(n,l){if(1&n&&(A.j41(0,"td",43),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.resolved_time),"dd/MMM/y HH:mm"))}}function BB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"In Channel ID"),A.k0s())}function fB(n,l){if(1&n&&(A.j41(0,"td",43),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.in_channel)}}function uB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"In Channel"),A.k0s())}function hB(n,l){if(1&n&&(A.j41(0,"td",43)(1,"span",44)(2,"span",45),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Nc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.in_channel_alias)}}function EB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Out Channel ID"),A.k0s())}function wB(n,l){if(1&n&&(A.j41(0,"td",43),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.out_channel)}}function CB(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Out Channel"),A.k0s())}function dB(n,l){if(1&n&&(A.j41(0,"td",43)(1,"span",44)(2,"span",45),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Nc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.out_channel_alias)}}function QB(n,l){1&n&&(A.j41(0,"th",46),A.EFF(1,"Amount In (Sats)"),A.k0s())}function mB(n,l){if(1&n&&(A.j41(0,"td",43)(1,"span",47),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.in_msat)/1e3,(null==e?null:e.in_msat)<1e3?"1.0-4":"1.0-0")," ")}}function MB(n,l){1&n&&(A.j41(0,"th",46),A.EFF(1,"Amount Out (Sats)"),A.k0s())}function pB(n,l){if(1&n&&(A.j41(0,"td",43)(1,"span",47),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.out_msat)/1e3,(null==e?null:e.out_msat)<1e3?"1.0-4":"1.0-0")," ")}}function IB(n,l){1&n&&(A.j41(0,"th",46),A.EFF(1,"Fee (mSat)"),A.k0s())}function DB(n,l){if(1&n&&(A.j41(0,"span",47),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,null==e?null:e.fee,"1.0-0")," ")}}function FB(n,l){if(1&n&&(A.j41(0,"span",47),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,null==e?null:e.fee_msat,"1.0-0")," ")}}function yB(n,l){if(1&n&&(A.j41(0,"td",43),A.DNE(1,DB,3,4,"span",48)(2,FB,3,4,"span",48),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",null==e?null:e.fee),A.R7$(),A.Y8G("ngIf",!(null!=e&&e.fee)&&(null==e?null:e.fee_msat))}}function xB(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",49)(1,"div",50)(2,"mat-select",51),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",52),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function YB(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",53)(1,"button",54),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onFailedEventClick(o))}),A.EFF(2,"View Info"),A.k0s()()}}function bB(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No failed transaction available."),A.k0s())}function vB(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting failed transactions..."),A.k0s())}function RB(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function SB(n,l){if(1&n&&(A.j41(0,"td",55),A.DNE(1,bB,2,0,"p",56)(2,vB,2,0,"p",56)(3,RB,2,1,"p",56),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.failedForwardingEvents&&e.failedForwardingEvents.data)||(null==e.failedForwardingEvents||null==e.failedForwardingEvents.data?null:e.failedForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.failedForwardingEvents&&e.failedForwardingEvents.data)||(null==e.failedForwardingEvents||null==e.failedForwardingEvents.data?null:e.failedForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.failedForwardingEvents&&e.failedForwardingEvents.data)||(null==e.failedForwardingEvents||null==e.failedForwardingEvents.data?null:e.failedForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function NB(n,l){if(1&n&&A.nrm(0,"tr",57),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,nB,(null==e.failedForwardingEvents?null:e.failedForwardingEvents.data)&&(null==e.failedForwardingEvents||null==e.failedForwardingEvents.data?null:e.failedForwardingEvents.data.length)>0))}}function TB(n,l){1&n&&A.nrm(0,"tr",58)}function PB(n,l){1&n&&A.nrm(0,"tr",59)}function UB(n,l){if(1&n&&(A.j41(0,"div",18),A.DNE(1,aB,1,0,"mat-progress-bar",19),A.j41(2,"table",20,0),A.qex(4,21),A.DNE(5,oB,2,0,"th",22)(6,lB,3,4,"td",23),A.bVm(),A.qex(7,24),A.DNE(8,cB,2,0,"th",22)(9,gB,3,4,"td",23),A.bVm(),A.qex(10,25),A.DNE(11,BB,2,0,"th",22)(12,fB,2,1,"td",23),A.bVm(),A.qex(13,26),A.DNE(14,uB,2,0,"th",22)(15,hB,4,4,"td",23),A.bVm(),A.qex(16,27),A.DNE(17,EB,2,0,"th",22)(18,wB,2,1,"td",23),A.bVm(),A.qex(19,28),A.DNE(20,CB,2,0,"th",22)(21,dB,4,4,"td",23),A.bVm(),A.qex(22,29),A.DNE(23,QB,2,0,"th",30)(24,mB,4,4,"td",23),A.bVm(),A.qex(25,31),A.DNE(26,MB,2,0,"th",30)(27,pB,4,4,"td",23),A.bVm(),A.qex(28,32),A.DNE(29,IB,2,0,"th",30)(30,yB,3,2,"td",23),A.bVm(),A.qex(31,33),A.DNE(32,xB,6,0,"th",34)(33,YB,3,0,"td",35),A.bVm(),A.qex(34,36),A.DNE(35,SB,4,3,"td",37),A.bVm(),A.DNE(36,NB,1,3,"tr",38)(37,TB,1,0,"tr",39)(38,PB,1,0,"tr",40),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.failedForwardingEvents),A.R7$(34),A.Y8G("matFooterRowDef",A.lJ4(7,tB)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)}}function LB(n,l){if(1&n&&A.nrm(0,"mat-paginator",60),2&n){const e=A.XpG();A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let GB=(()=>{var n;class l{constructor(i,o,r,iA,ne){this.logger=i,this.commonService=o,this.store=r,this.datePipe=iA,this.camelCaseWithReplace=ne,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"failed",recordsPerPage:B.md,sortBy:"received_time",sortOrder:B.oi.DESCENDING},this.faExclamationTriangle=v.zpE,this.failedEvents=[],this.errorMessage="",this.displayedColumns=[],this.failedForwardingEvents=new z.I6([]),this.selFilter="",this.totalFailedTransactions=0,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,VA.uK)({payload:{status:B.xk.FAILED}})),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.Dv).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.totalFailedTransactions=i.failedForwardingHistory.totalForwards||0,this.failedEvents=i.failedForwardingHistory.listForwards||[],this.failedEvents&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadFailedEventsTable(this.failedEvents),this.logger.info(i)})}ngAfterViewInit(){this.failedEvents.length>0&&this.loadFailedEventsTable(this.failedEvents)}onFailedEventClick(i){const o=[[{key:"received_time",value:i.received_time,title:"Received Time",width:50,type:B.UN.DATE_TIME},{key:"resolved_time",value:i.resolved_time,title:"Resolved Time",width:50,type:B.UN.DATE_TIME}],[{key:"in_channel_alias",value:i.in_channel_alias,title:"Inbound Channel",width:50,type:B.UN.STRING},{key:"out_channel_alias",value:i.out_channel_alias,title:"Outbound Channel",width:50,type:B.UN.STRING}],[{key:"in_msatoshi",value:i.in_msat,title:"Amount In (mSats)",width:33,type:B.UN.NUMBER},{key:"out_msatoshi",value:i.out_msat,title:"Amount Out (mSats)",width:33,type:B.UN.NUMBER},{key:"fee",value:i.fee_msat,title:"Fee (mSats)",width:34,type:B.UN.NUMBER}]];i.payment_hash&&o?.unshift([{key:"payment_hash",value:i.payment_hash,title:"Payment Hash",width:100,type:B.UN.STRING}]),this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Failed Event Information",message:o}}}))}applyFilter(){this.failedForwardingEvents.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.failedForwardingEvents.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.received_time?this.datePipe.transform(new Date(1e3*i.received_time),"dd/MMM/y HH:mm")?.toLowerCase()+" ":"")+(i.resolved_time?this.datePipe.transform(new Date(1e3*i.resolved_time),"dd/MMM/y HH:mm")?.toLowerCase()+" ":"")+(i.in_channel?i.in_channel.toLowerCase()+" ":"")+(i.out_channel?i.out_channel.toLowerCase()+" ":"")+(i.in_channel_alias?i.in_channel_alias.toLowerCase()+" ":"")+(i.out_channel_alias?i.out_channel_alias.toLowerCase()+" ":"")+(i.fee_msat?i.fee_msat+" ":"")+(i.in_msat?+i.in_msat/1e3+" ":"")+(i.out_msat?+i.out_msat/1e3+" ":"")+(i.fee_msat?i.fee_msat+" ":"");break;case"received_time":case"resolved_time":r=this.datePipe.transform(new Date(1e3*(i[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"fee":r=(i.fee_msat||0)?.toString()||"";break;case"in_msatoshi":r=(+(i.in_msat||0)/1e3).toString()||"";break;case"out_msatoshi":r=(+(i.out_msat||0)/1e3).toString()||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return r.includes(o)}}loadFailedEventsTable(i){this.failedForwardingEvents=new z.I6([...i]),this.failedForwardingEvents.sort=this.sort,this.failedForwardingEvents.sortingDataAccessor=(o,r)=>{switch(r){case"in_msatoshi":return o.in_msat;case"out_msatoshi":return o.out_msat;case"fee":return o.fee_msat;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.failedForwardingEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.failedForwardingEvents)}onDownloadCSV(){this.failedForwardingEvents&&this.failedForwardingEvents.data&&this.failedForwardingEvents.data.length>0&&this.commonService.downloadFile(this.failedForwardingEvents.data,"Failed-transactions")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(de.vh),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-failed-history"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Failed events")}])],decls:5,vars:4,consts:[["table",""],["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","100",1,"alert","alert-warn","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","100"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"matSortActive","matSortDirection","dataSource"],["matColumnDef","received_time"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","resolved_time"],["matColumnDef","in_channel"],["matColumnDef","in_channel_alias"],["matColumnDef","out_channel"],["matColumnDef","out_channel_alias"],["matColumnDef","in_msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","out_msatoshi"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayout.gt-xs","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",4,"ngIf"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(o,r){1&o&&(A.j41(0,"div",1),A.DNE(1,iB,2,1,"div",2)(2,rB,18,5,"div",3)(3,UB,39,8,"div",4)(4,LB,1,3,"mat-paginator",5),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",""!==r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.ZF,M.Ld,de.QX,de.vh],encapsulation:2}))}return n(),l})();const zB=["tableIn"],kB=["tableOut"],HB=["paginatorIn"],jB=["paginatorOut"],OB=(n,l)=>({"mt-2":n,"mt-1":l}),JB=()=>["no_incoming_event"],_B=n=>({"mt-2":n}),VB=()=>["no_outgoing_event"],Sa=n=>({width:n}),Tc=n=>({"display-none":n});function WB(n,l){if(1&n&&(A.j41(0,"div",7),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.JRh(e.errorMessage)}}function KB(n,l){1&n&&A.nrm(0,"mat-progress-bar",34)}function XB(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Channel ID"),A.k0s())}function ZB(n,l){if(1&n&&(A.j41(0,"td",36)(1,"div",37)(2,"span",38),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Sa,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.channel_id)}}function qB(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Peer Alias"),A.k0s())}function $B(n,l){if(1&n&&(A.j41(0,"td",36)(1,"div",37)(2,"span",38),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Sa,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.alias)}}function Af(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Events"),A.k0s())}function ef(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.bMT(3,1,e.events))}}function tf(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Amount (Sats)"),A.k0s())}function nf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.total_amount)/1e3,(null==e?null:e.total_amount)<1e3?"1.0-4":"1.0-0"))}}function sf(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Fee (Sats)"),A.k0s())}function rf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.total_fee)/1e3,(null==e?null:e.total_fee)<1e3?"1.0-4":"1.0-0"))}}function af(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No incoming routing peer available."),A.k0s())}function of(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting incoming routing peers..."),A.k0s())}function lf(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function cf(n,l){if(1&n&&(A.j41(0,"td",41),A.DNE(1,af,2,0,"p",42)(2,of,2,0,"p",42)(3,lf,2,1,"p",42),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function gf(n,l){if(1&n&&A.nrm(0,"tr",43),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,Tc,(null==e.routingPeersIncoming?null:e.routingPeersIncoming.data)&&(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)>0))}}function Bf(n,l){1&n&&A.nrm(0,"tr",44)}function ff(n,l){1&n&&A.nrm(0,"tr",45)}function uf(n,l){1&n&&A.nrm(0,"mat-progress-bar",34)}function hf(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Channel ID"),A.k0s())}function Ef(n,l){if(1&n&&(A.j41(0,"td",36)(1,"div",37)(2,"span",38),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Sa,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.channel_id)}}function wf(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Peer Alias"),A.k0s())}function Cf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"div",37)(2,"span",38),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,Sa,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.alias)}}function df(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Events"),A.k0s())}function Qf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.bMT(3,1,e.events))}}function mf(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Amount (Sats)"),A.k0s())}function Mf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.total_amount)/1e3,(null==e?null:e.total_amount)<1e3?"1.0-4":"1.0-0"))}}function pf(n,l){1&n&&(A.j41(0,"th",39),A.EFF(1,"Fee (Sats)"),A.k0s())}function If(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(A.i5U(3,1,(null==e?null:e.total_fee)/1e3,(null==e?null:e.total_fee)<1e3?"1.0-4":"1.0-0"))}}function Df(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No outgoing routing peer available."),A.k0s())}function Ff(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting outgoing routing peers..."),A.k0s())}function yf(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function xf(n,l){if(1&n&&(A.j41(0,"td",41),A.DNE(1,Df,2,0,"p",42)(2,Ff,2,0,"p",42)(3,yf,2,1,"p",42),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function Yf(n,l){if(1&n&&A.nrm(0,"tr",43),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,Tc,(null==e.routingPeersOutgoing?null:e.routingPeersOutgoing.data)&&(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)>0))}}function bf(n,l){1&n&&A.nrm(0,"tr",44)}function vf(n,l){1&n&&A.nrm(0,"tr",45)}function Rf(n,l){if(1&n&&(A.j41(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11),A.EFF(4,"Incoming"),A.k0s(),A.nrm(5,"div",12),A.k0s(),A.j41(6,"div",13),A.DNE(7,KB,1,0,"mat-progress-bar",14),A.j41(8,"table",15,0),A.qex(10,16),A.DNE(11,XB,2,0,"th",17)(12,ZB,4,4,"td",18),A.bVm(),A.qex(13,19),A.DNE(14,qB,2,0,"th",17)(15,$B,4,4,"td",18),A.bVm(),A.qex(16,20),A.DNE(17,Af,2,0,"th",21)(18,ef,4,3,"td",18),A.bVm(),A.qex(19,22),A.DNE(20,tf,2,0,"th",21)(21,nf,4,4,"td",18),A.bVm(),A.qex(22,23),A.DNE(23,sf,2,0,"th",21)(24,rf,4,4,"td",18),A.bVm(),A.qex(25,24),A.DNE(26,cf,4,3,"td",25),A.bVm(),A.DNE(27,gf,1,3,"tr",26)(28,Bf,1,0,"tr",27)(29,ff,1,0,"tr",28),A.k0s()(),A.nrm(30,"mat-paginator",29,1),A.k0s(),A.j41(32,"div",30)(33,"div",10)(34,"div",11),A.EFF(35,"Outgoing"),A.k0s(),A.nrm(36,"div",12),A.k0s(),A.j41(37,"div",31),A.DNE(38,uf,1,0,"mat-progress-bar",14),A.j41(39,"table",32,2),A.qex(41,16),A.DNE(42,hf,2,0,"th",17)(43,Ef,4,4,"td",18),A.bVm(),A.qex(44,19),A.DNE(45,wf,2,0,"th",17)(46,Cf,4,4,"td",18),A.bVm(),A.qex(47,20),A.DNE(48,df,2,0,"th",21)(49,Qf,4,3,"td",18),A.bVm(),A.qex(50,22),A.DNE(51,mf,2,0,"th",21)(52,Mf,4,4,"td",18),A.bVm(),A.qex(53,23),A.DNE(54,pf,2,0,"th",21)(55,If,4,4,"td",18),A.bVm(),A.qex(56,33),A.DNE(57,xf,4,3,"td",25),A.bVm(),A.DNE(58,Yf,1,3,"tr",26)(59,bf,1,0,"tr",27)(60,vf,1,0,"tr",28),A.k0s(),A.nrm(61,"mat-paginator",29,3),A.k0s()()()),2&n){const e=A.XpG();A.R7$(2),A.Y8G("ngClass",A.l_i(22,OB,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),A.R7$(5),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersIncoming),A.R7$(19),A.Y8G("matFooterRowDef",A.lJ4(25,JB)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns),A.R7$(),A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),A.R7$(3),A.Y8G("ngClass",A.eq3(26,_B,e.screenSize!==e.screenSizeEnum.LG)),A.R7$(5),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersOutgoing),A.R7$(19),A.Y8G("matFooterRowDef",A.lJ4(28,VB)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns),A.R7$(),A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Sf=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.commonService=o,this.store=r,this.camelCaseWithReplace=iA,this.eventsData=[],this.selFilter="",this.nodePageDefs=B.Jd,this.selFilterByIn="all",this.selFilterByOut="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"routing_peers",recordsPerPage:B.md,sortBy:"total_fee",sortOrder:B.oi.DESCENDING},this.successfulEvents=[],this.displayedColumns=[],this.routingPeersIncoming=new z.I6([]),this.routingPeersOutgoing=new z.I6([]),this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnChanges(i){i.eventsData&&(this.apiCallStatus={status:B.wn.COMPLETED,action:"FetchForwardingHistory"},this.eventsData=i.eventsData.currentValue,this.successfulEvents=this.eventsData,i.eventsData.firstChange||this.loadRoutingPeersTable(this.successfulEvents))}ngOnInit(){this.store.pipe((0,bt.s)(1)).subscribe(i=>{i.cln.apisCallStatus.FetchForwardingHistoryS.status===B.wn.UN_INITIATED&&!i.cln.forwardingHistory.listForwards?.length&&this.store.dispatch((0,VA.uK)({payload:{status:B.xk.SETTLED}}))}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/(2*this.displayedColumns.length)/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.Ie).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.eventsData.length<=0&&(this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.successfulEvents=i.forwardingHistory.listForwards||[],this.successfulEvents.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.successfulEvents),this.logger.info(i))})}ngAfterViewInit(){this.successfulEvents.length>0&&this.loadRoutingPeersTable(this.successfulEvents)}applyIncomingFilter(){this.routingPeersIncoming.filter=this.filterIn.toLowerCase()}applyOutgoingFilter(){this.routingPeersOutgoing.filter=this.filterOut.toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):"all"}setFilterPredicate(){this.routingPeersIncoming.filterPredicate=(i,o)=>JSON.stringify(i).toLowerCase().includes(o),this.routingPeersOutgoing.filterPredicate=(i,o)=>JSON.stringify(i).toLowerCase().includes(o)}loadRoutingPeersTable(i){if(i.length>0){const o=this.groupRoutingPeers(i);this.routingPeersIncoming=new z.I6(o[0]),this.routingPeersIncoming.sort=this.sortIn,this.routingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new z.I6(o[1]),this.routingPeersOutgoing.sort=this.sortOut,this.routingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.routingPeersOutgoing)}else this.routingPeersIncoming=new z.I6([]),this.routingPeersOutgoing=new z.I6([]);this.setFilterPredicate(),this.applyIncomingFilter(),this.applyOutgoingFilter(),this.logger.info(this.routingPeersIncoming),this.logger.info(this.routingPeersOutgoing)}groupRoutingPeers(i){const o=[],r=[];return i.forEach(iA=>{const ne=o?.find(ln=>ln.channel_id===iA.in_channel),re=r?.find(ln=>ln.channel_id===iA.out_channel);ne?(ne.events++,ne.total_amount=+ne.total_amount+ +(iA.in_msat||0),ne.total_fee=+(iA.in_msat||0)-+(iA.out_msat||0)+ +ne.total_fee):o.push({channel_id:iA.in_channel,alias:iA.in_channel_alias,events:1,total_amount:+(iA.in_msat||0),total_fee:+(iA.in_msat||0)-+(iA.out_msat||0)}),re?(re.events++,re.total_amount=+re.total_amount+ +(iA.out_msat||0),re.total_fee=+(iA.in_msat||0)-+(iA.out_msat||0)+ +re.total_fee):r.push({channel_id:iA.out_channel,alias:iA.out_channel_alias,events:1,total_amount:+(iA.out_msat||0),total_fee:+(iA.in_msat||0)-+(iA.out_msat||0)})}),[this.commonService.sortDescByKey(o,"total_fee"),this.commonService.sortDescByKey(r,"total_fee")]}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-routing-peers"]],viewQuery:function(o,r){if(1&o&&(A.GBs(zB,5,pA.B4),A.GBs(kB,5,pA.B4),A.GBs(HB,5),A.GBs(jB,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sortIn=iA.first),A.mGM(iA=A.lsd())&&(r.sortOut=iA.first),A.mGM(iA=A.lsd())&&(r.paginatorIn=iA.first),A.mGM(iA=A.lsd())&&(r.paginatorOut=iA.first)}},inputs:{eventsData:"eventsData",selFilter:"selFilter"},standalone:!1,features:[A.Jv_([{provide:H.xX,useValue:(0,B.on)("Peers")}]),A.OA$],decls:3,vars:2,consts:[["tableIn",""],["paginatorIn",""],["tableOut",""],["paginatorOut",""],["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 stretch","class","page-sub-title-container mt-2",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container","mt-2"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"matSortActive","matSortDirection","dataSource"],["matColumnDef","channel_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","total_amount"],["matColumnDef","total_fee"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"matSortActive","matSortDirection","dataSource"],["matColumnDef","no_outgoing_event"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){1&o&&(A.j41(0,"div",4),A.DNE(1,WB,2,1,"div",5)(2,Rf,63,29,"div",6),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",""!==r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage))},dependencies:[de.YU,de.bT,de.B3,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.Ld,de.QX],encapsulation:2}))}return n(),l})();const Nf=()=>["all"],Tf=n=>({"error-border":n}),Pf=()=>["no_channel"],Pc=n=>({width:n}),Uf=n=>({"display-none":n});function Lf(n,l){if(1&n&&(A.j41(0,"mat-option",33),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function Gf(n,l){1&n&&A.nrm(0,"mat-progress-bar",34)}function zf(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Amount (Sats)"),A.k0s())}function kf(n,l){if(1&n&&(A.j41(0,"span",40),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,(null==e?null:e.amount_msat)/1e3,"1.0-2")," ")}}function Hf(n,l){if(1&n&&(A.qex(0),A.DNE(1,kf,3,4,"span",39),A.bVm()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function jf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",37),A.EFF(2),A.k0s(),A.DNE(3,Hf,2,1,"ng-container",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" Active HTLCs: ",null==e||null==e.htlcs?null:e.htlcs.length," "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Of(n,l){1&n&&(A.j41(0,"th",35),A.EFF(1,"Alias/Direction"),A.k0s())}function Jf(n,l){if(1&n&&(A.j41(0,"span",37),A.EFF(1),A.nI1(2,"titlecase"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.bMT(2,1,null==e?null:e.direction)," ")}}function _f(n,l){if(1&n&&(A.qex(0),A.DNE(1,Jf,3,3,"span",41),A.bVm()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function Vf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",37),A.EFF(2),A.k0s(),A.DNE(3,_f,2,1,"ng-container",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(null==e?null:e.alias),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Wf(n,l){1&n&&(A.j41(0,"th",42)(1,"span",40),A.EFF(2,"HTLC ID"),A.k0s()())}function Kf(n,l){if(1&n&&(A.j41(0,"span",40),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.bMT(2,1,null==e?null:e.id)," ")}}function Xf(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,Kf,3,3,"span",39),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function Zf(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.k0s(),A.DNE(3,Xf,2,1,"span",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(null==e?null:e.id),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function qf(n,l){1&n&&(A.j41(0,"th",42)(1,"span",40),A.EFF(2,"Expiry"),A.k0s()())}function $f(n,l){if(1&n&&(A.j41(0,"span",40),A.EFF(1),A.nI1(2,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,null==e?null:e.expiry,"1.0-0")," ")}}function Au(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,$f,3,4,"span",39),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function eu(n,l){if(1&n&&(A.j41(0,"td",36)(1,"span",40),A.EFF(2),A.k0s(),A.DNE(3,Au,2,1,"span",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(" "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function tu(n,l){1&n&&(A.j41(0,"th",43)(1,"span",40),A.EFF(2,"State"),A.k0s()())}function nu(n,l){if(1&n&&(A.j41(0,"span",40),A.EFF(1),A.nI1(2,"camelcaseWithReplace"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",A.i5U(2,1,null==e?null:e.state,"_")," ")}}function iu(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,nu,3,4,"span",39),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function su(n,l){if(1&n&&(A.j41(0,"td",44)(1,"span",40),A.EFF(2),A.k0s(),A.DNE(3,iu,2,1,"span",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(" "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function ru(n,l){1&n&&(A.j41(0,"th",43)(1,"span",40),A.EFF(2,"Local Trimmed"),A.k0s()())}function au(n,l){if(1&n&&(A.j41(0,"span",40),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",null!=e&&e.local_trimmed?"Yes":"No"," ")}}function ou(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,au,2,1,"span",39),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function lu(n,l){if(1&n&&(A.j41(0,"td",44)(1,"span",40),A.EFF(2),A.k0s(),A.DNE(3,ou,2,1,"span",38),A.k0s()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(" "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function cu(n,l){1&n&&(A.j41(0,"th",43)(1,"span",40),A.EFF(2,"Payment Hash"),A.k0s()())}function gu(n,l){if(1&n&&(A.j41(0,"span",48)(1,"span",49),A.EFF(2),A.k0s()()),2&n){const e=l.$implicit,i=A.XpG(3);A.Y8G("ngStyle",A.eq3(2,Pc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.payment_hash)}}function Bu(n,l){if(1&n&&(A.j41(0,"span"),A.DNE(1,gu,3,4,"span",47),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function fu(n,l){if(1&n&&(A.j41(0,"td",44)(1,"span",45)(2,"span",46),A.EFF(3),A.k0s()(),A.DNE(4,Bu,2,1,"span",38),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(3,Pc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(" "),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function uu(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",50)(1,"div",51)(2,"mat-select",52),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",53),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function hu(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",58)(1,"button",59),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2).$implicit,iA=A.XpG();return w.Njj(iA.onHTLCClick(o,r))}),A.EFF(2),A.k0s()()}if(2&n){const e=l.index;A.R7$(2),A.SpI("View ",e+1)}}function Eu(n,l){if(1&n&&(A.j41(0,"div"),A.DNE(1,hu,3,1,"div",57),A.k0s()),2&n){const e=A.XpG().$implicit;A.R7$(),A.Y8G("ngForOf",null==e?null:e.htlcs)}}function wu(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",54)(1,"span",55)(2,"button",56),A.bIt("click",function(){const o=w.eBV(e).$implicit;return w.Njj(o.is_expanded=!o.is_expanded)}),A.EFF(3),A.k0s()(),A.DNE(4,Eu,2,1,"div",38),A.k0s()}if(2&n){const e=l.$implicit;A.R7$(3),A.JRh(e.is_expanded?"Hide":"Show"),A.R7$(),A.Y8G("ngIf",e.is_expanded)}}function Cu(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No active htlc available."),A.k0s())}function du(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting active htlcs..."),A.k0s())}function Qu(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function mu(n,l){if(1&n&&(A.j41(0,"td",60),A.DNE(1,Cu,2,0,"p",38)(2,du,2,0,"p",38)(3,Qu,2,1,"p",38),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function Mu(n,l){if(1&n&&A.nrm(0,"tr",61),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,Uf,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function pu(n,l){1&n&&A.nrm(0,"tr",62)}function Iu(n,l){1&n&&A.nrm(0,"tr",63)}let Du=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.commonService=o,this.store=r,this.camelCaseWithReplace=iA,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"active_HTLCs",recordsPerPage:B.md,sortBy:"expiry",sortOrder:B.oi.DESCENDING},this.channels=new z.I6([]),this.channelsJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.BM).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:"");const o=[...i.activeChannels,...i.pendingChannels,...i.inactiveChannels];this.channelsJSONArr=o?.filter(r=>r.htlcs&&r.htlcs.length>0)||[],this.channelsJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadHTLCsTable(this.channelsJSONArr),this.logger.info(i)})}ngAfterViewInit(){this.channelsJSONArr.length>0&&this.loadHTLCsTable(this.channelsJSONArr)}onHTLCClick(i,o){const r=[[{key:"alias",value:o.alias,title:"Alias",width:100,type:B.UN.STRING}],[{key:"amount_msat",value:(i.amount_msat||0)/1e3,title:"Amount (Sats)",width:50,type:B.UN.NUMBER},{key:"direction",value:this.commonService.titleCase(i.direction||""),title:"Direction",width:50,type:B.UN.STRING}],[{key:"expiry",value:i.expiry,title:"Expiry",width:50,type:B.UN.NUMBER},{key:"state",value:this.camelCaseWithReplace.transform(i.state||"","_"),title:"State",width:50,type:B.UN.STRING}],[{key:"id",value:i.id,title:"HTLC ID",width:50,type:B.UN.STRING},{key:"local_trimmed",value:i.local_trimmed,title:"Local Trimmed",width:50,type:B.UN.BOOLEAN}],[{key:"payment_hash",value:i.payment_hash,title:"Payment Hash",width:100,type:B.UN.STRING}]];this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"HTLC Information",message:r}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column||"","_"):this.commonService.titleCase(i)}setFilterPredicate(){this.channels.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.alias?i.alias.toLowerCase():"")+i.htlcs?.map(iA=>JSON.stringify(iA).toLowerCase()+(iA.local_trimmed?" yes ":" no "));break;case"direction":r=i.htlcs?.map(iA=>iA.direction+" ").toString()||"";break;case"id":r=i.htlcs?.map(iA=>iA.id+" ").toString()||"";break;case"expiry":r=i.htlcs?.map(iA=>iA.expiry+" ").toString()||"";break;case"state":r=i.htlcs?.map(iA=>this.camelCaseWithReplace.transform(iA.state||"","_").toLowerCase()+" ").toString()||"";break;case"payment_hash":r=i.htlcs?.map(iA=>iA.payment_hash+" ").toString()||"";break;case"local_trimmed":r=i.htlcs?.map(iA=>iA.local_trimmed?" yes ":" no ").toString()||"";break;case"amount_msat":r=i.htlcs?.map(iA=>(iA.amount_msat||0)/1e3)?.toString()||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return r.includes(o)}}loadHTLCsTable(i){this.channels=new z.I6(i?[...i]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(o,r)=>{switch(r){case"amount_msat":return this.commonService.sortByKey(o.htlcs,r,"number",this.sort?.direction),o.htlcs&&o.htlcs.length?o.htlcs.length:null;case"id":case"payment_hash":case"state":return this.commonService.sortByKey(o.htlcs,r,"string",this.sort?.direction),o;case"direction":return this.commonService.sortByKey(o.htlcs,r,"string",this.sort?.direction),o.alias?o.alias:o.id?o.id:null;case"expiry":return this.commonService.sortByKey(o.htlcs,r,"number",this.sort?.direction),o;case"local_trimmed":return this.commonService.sortByKey(o.htlcs,r,"boolean",this.sort?.direction),o;default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.flattenHTLCs(),"ActiveHTLCs")}flattenHTLCs(){return JSON.parse(JSON.stringify(this.channels.data))?.reduce((r,iA)=>r.concat(iA.htlcs?iA.htlcs:iA),[])}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-channel-active-htlcs-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("HTLCs")}])],decls:48,vars:18,consts:[["table",""],["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","amount_msat"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","direction"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","expiry"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pl-3 htlc-row-span",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","local_trimmed"],["matColumnDef","payment_hash"],["matColumnDef","actions"],["mat-header-cell","","class","px-2",4,"matHeaderCellDef"],["mat-cell","","class","px-2","fxLayout","column","fxLayoutAlign","center end",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayoutAlign","start center",1,"htlc-row-span"],[4,"ngIf"],["fxLayoutAlign","end center","class","htlc-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"htlc-row-span"],["fxLayoutAlign","start center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pl-3","htlc-row-span"],["mat-cell","",1,"pl-3"],["fxLayout","row",1,"ellipsis-parent","htlc-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"ellipsis-child"],["fxLayoutAlign","start center","class","ellipsis-parent htlc-row-span",3,"ngStyle",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","htlc-row-span",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","",1,"px-2"],["fxLayoutAlign","end center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayout","column","fxLayoutAlign","center end",1,"px-2"],["fxLayoutAlign","end center",1,"htlc-group-head"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-htlc-expand",3,"click"],["class","htlc-group-details","fxLayoutAlign","end center",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"htlc-group-details"],["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(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2),A.nrm(2,"div",3),A.j41(3,"div",4)(4,"mat-form-field",5)(5,"mat-label"),A.EFF(6,"Filter By"),A.k0s(),A.j41(7,"mat-select",6),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(8,"perfect-scrollbar"),A.DNE(9,Lf,2,2,"mat-option",7),A.k0s()()(),A.j41(10,"mat-form-field",5)(11,"mat-label"),A.EFF(12,"Filter"),A.k0s(),A.j41(13,"input",8),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(14,"div",9),A.DNE(15,Gf,1,0,"mat-progress-bar",10),A.j41(16,"table",11,0),A.qex(18,12),A.DNE(19,zf,2,0,"th",13)(20,jf,4,2,"td",14),A.bVm(),A.qex(21,15),A.DNE(22,Of,2,0,"th",13)(23,Vf,4,2,"td",14),A.bVm(),A.qex(24,16),A.DNE(25,Wf,3,0,"th",17)(26,Zf,4,2,"td",14),A.bVm(),A.qex(27,18),A.DNE(28,qf,3,0,"th",17)(29,eu,4,2,"td",14),A.bVm(),A.qex(30,19),A.DNE(31,tu,3,0,"th",20)(32,su,4,2,"td",21),A.bVm(),A.qex(33,22),A.DNE(34,ru,3,0,"th",20)(35,lu,4,2,"td",21),A.bVm(),A.qex(36,23),A.DNE(37,cu,3,0,"th",20)(38,fu,5,5,"td",21),A.bVm(),A.qex(39,24),A.DNE(40,uu,6,0,"th",25)(41,wu,5,2,"td",26),A.bVm(),A.qex(42,27),A.DNE(43,mu,4,3,"td",28),A.bVm(),A.DNE(44,Mu,1,3,"tr",29)(45,pu,1,0,"tr",30)(46,Iu,1,0,"tr",31),A.k0s()(),A.nrm(47,"mat-paginator",32),A.k0s()}2&o&&(A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(14,Nf).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(2),A.Y8G("ngIf",r.apiCallStatus.status===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.channels)("ngClass",A.eq3(15,Tf,""!==r.errorMessage)),A.R7$(28),A.Y8G("matFooterRowDef",A.lJ4(17,Pf)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.ZF,M.Ld,de.QX,de.PV,R.VD],styles:[".mat-column-amount_msat[_ngcontent-%COMP%] .htlc-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:2rem;padding-right:2rem}.htlc-row-span[_ngcontent-%COMP%]{min-height:3rem}.htlc-row-span.ellipsis-parent[_ngcontent-%COMP%]{display:flex;align-items:center}.mat-column-actions[_ngcontent-%COMP%] .htlc-group-head[_ngcontent-%COMP%], .mat-column-actions[_ngcontent-%COMP%] .htlc-group-details[_ngcontent-%COMP%]{min-height:3rem}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-expand[_ngcontent-%COMP%]{min-width:8rem;width:8rem;margin:0}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-info[_ngcontent-%COMP%]{min-width:7rem;margin:0}"]}))}return n(),l})();function Fu(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",8),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("routerLink",A.mNQ(e.link))("active",i.activeLink===e.link),A.R7$(),A.JRh(e.name)}}let yu=(()=>{var n;class l{constructor(i){this.router=i,this.faChartBar=v.$Fj,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-reports"]],standalone:!1,decls:12,vars:3,consts:[["tabPanel",""],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["tabindex","1","role","tab","mat-tab-link","","class","mat-tab-label",3,"routerLink","active","click",4,"ngFor","ngForOf"],["tabindex","1","role","tab","mat-tab-link","",1,"mat-tab-label",3,"click","routerLink","active"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1),A.nrm(1,"fa-icon",2),A.j41(2,"span",3),A.EFF(3,"Reports"),A.k0s()(),A.j41(4,"div",4)(5,"mat-card")(6,"mat-card-content",5)(7,"nav",6),A.DNE(8,Fu,2,4,"div",7),A.k0s(),A.nrm(9,"mat-tab-nav-panel",null,0)(11,"router-outlet"),A.k0s()()()),2&o){const iA=A.sdS(10);A.R7$(),A.Y8G("icon",r.faChartBar),A.R7$(6),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,RA.Bu,RA.hQ,RA.Ql,xt.n3,Sn.Wk],encapsulation:2}))}return n(),l})();var Uc=We(1001),Lc=We(1993),Gc=We(4655);function xu(n,l){1&n&&(A.j41(0,"div",15),A.nrm(1,"mat-progress-bar",16),A.j41(2,"p"),A.EFF(3,"Getting Forwarding History..."),A.k0s()())}function Yu(n,l){if(1&n&&(A.j41(0,"div",17),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.JRh(e.errorMessage)}}function bu(n,l){if(1&n&&(A.j41(0,"div",18),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=A.XpG();A.Y8G("@fadeIn",e.totalFeeMsat),A.R7$(),A.Lme("",A.i5U(2,3,e.totalFeeMsat/1e3||0,"1.0-2")," Sats/",A.bMT(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function vu(n,l){1&n&&(A.j41(0,"div",15),A.EFF(1,"No routing report for the selected period"),A.k0s())}function Ru(n,l){if(1&n&&(A.j41(0,"span")(1,"span",20),A.EFF(2),A.nI1(3,"number"),A.k0s(),A.j41(4,"span",20),A.EFF(5),A.nI1(6,"number"),A.k0s()()),2&n){const e=l.model,i=A.XpG(2);A.R7$(2),A.SpI("Events: ",A.bMT(3,2,(i.selReportBy===i.reportBy.EVENTS?e.value:e.extra.totalEvents)||0)),A.R7$(3),A.SpI("Fee: ",A.i5U(6,4,(i.selReportBy===i.reportBy.EVENTS?e.extra.totalFees:e.value)||0,"1.0-2"))}}function Su(n,l){if(1&n){const e=A.RV6();A.j41(0,"ngx-charts-bar-vertical",19),A.bIt("select",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onChartBarSelected(o))})("mouseup",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onChartMouseUp(o))}),A.DNE(1,Ru,7,7,"ng-template",null,0,A.C5r),A.k0s()}if(2&n){const e=A.XpG();A.Y8G("view",e.view)("results",e.routingReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function Nu(n,l){if(1&n&&A.nrm(0,"rtl-cln-forwarding-history",21),2&n){const e=A.XpG();A.Y8G("eventsData",e.filteredEventsBySelectedPeriod)("selFilter",e.eventFilterValue)}}let Tu=(()=>{var n;class l{constructor(i,o,r,iA){this.logger=i,this.commonService=o,this.store=r,this.dataService=iA,this.reportPeriod=B.rs[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.reportBy=B.aR,this.selReportBy=B.aR.FEES,this.totalFeeMsat=null,this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.routingReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===B.f7.XS||this.screenSize===B.f7.SM),this.store.pipe((0,bt.s)(1)).subscribe(i=>{i.cln.apisCallStatus.FetchForwardingHistoryS.status===B.wn.UN_INITIATED&&!i.cln.forwardingHistory.listForwards?.length&&this.store.dispatch((0,VA.uK)({payload:{status:B.xk.SETTLED}}))}),this.store.select(tA.Ie).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{i.forwardingHistory.status===B.xk.SETTLED&&(this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR?this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:"":this.apiCallStatus.status===B.wn.COMPLETED&&(this.events=i.forwardingHistory.listForwards||[],this.filterForwardingEvents(this.startDate,this.endDate)),this.logger.info(i))}),this.commonService.containerSizeUpdated.pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{switch(this.screenSize){case B.f7.MD:this.screenPaddingX=i.width/10;break;case B.f7.LG:this.screenPaddingX=i.width/16;break;default:this.screenPaddingX=i.width/20}this.view=[i.width-this.screenPaddingX,i.height/2.2],this.logger.info("Container Size: "+JSON.stringify(i)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(i,o){const r=Math.round(i.getTime()/1e3),iA=Math.round(o.getTime()/1e3);this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeMsat=null,this.events&&this.events.length>0&&(this.events.forEach(ne=>{ne.received_time&&ne.received_time>=r&&ne.received_time0&&"ngx-charts"===i.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(i){this.eventFilterValue=this.reportPeriod===B.rs[1]?i.name+"/"+this.startDate.getFullYear():i.name.toString().padStart(2,"0")+"/"+B.KR[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(i){const o=Math.round(i.getTime()/1e3),r=[];if(this.totalFeeMsat=0,this.reportPeriod===B.rs[1]){for(let iA=0;iA<12;iA++)r.push({name:B.KR[iA].name,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod?.map(iA=>{const ne=iA.received_time?new Date(1e3*+iA.received_time).getMonth():12;return r[ne].extra.totalEvents=r[ne].extra.totalEvents+1,r[ne].value=r[ne].value+ +(iA.fee_msat||0)/1e3,this.totalFeeMsat=(this.totalFeeMsat||0)+ +(iA.fee_msat||0),this.filteredEventsBySelectedPeriod})}else{for(let iA=0;iA{const ne=iA.received_time?Math.floor((+iA.received_time-o)/this.secondsInADay):0;return r[ne].extra.totalEvents=r[ne].extra.totalEvents+1,r[ne].value=r[ne].value+ +(iA.fee_msat||0)/1e3,this.totalFeeMsat=(this.totalFeeMsat||0)+ +(iA.fee_msat||0),this.filteredEventsBySelectedPeriod})}return r}prepareEventsReport(i){const o=Math.round(i.getTime()/1e3),r=[];if(this.totalFeeMsat=0,this.reportPeriod===B.rs[1]){for(let iA=0;iA<12;iA++)r.push({name:B.KR[iA].name,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod?.map(iA=>{const ne=iA.received_time?new Date(1e3*+iA.received_time).getMonth():12;return r[ne].value=r[ne].value+1,r[ne].extra.totalFees=r[ne].extra.totalFees+ +(iA.fee_msat||0)/1e3,this.totalFeeMsat=(this.totalFeeMsat||0)+ +(iA.fee_msat||0),this.filteredEventsBySelectedPeriod})}else{for(let iA=0;iA{const ne=iA.received_time?Math.floor((+iA.received_time-o)/this.secondsInADay):0;return r[ne].value=r[ne].value+1,r[ne].extra.totalFees=r[ne].extra.totalFees+ +(iA.fee_msat||0)/1e3,this.totalFeeMsat=(this.totalFeeMsat||0)+ +(iA.fee_msat||0),this.filteredEventsBySelectedPeriod})}return r}onSelectionChange(i){const o=i.selDate.getMonth(),r=i.selDate.getFullYear();this.reportPeriod=i.selScrollRange,this.reportPeriod===B.rs[1]?(this.startDate=new Date(r,0,1,0,0,0),this.endDate=new Date(r,11,31,23,59,59)):(this.startDate=new Date(r,o,1,0,0,0),this.endDate=new Date(r,o,this.getMonthDays(o,r),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(i,o){return 1===i&&o%4==0?B.KR[i].days+1:B.KR[i].days}onSelReportByChange(){this.yAxisLabel=this.selReportBy===this.reportBy.EVENTS?"Events":"Fee (Sats)",this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(this.startDate):this.prepareFeeReport(this.startDate)}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(Dt.u))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-routing-report"]],hostBindings:function(o,r){1&o&&A.bIt("mouseup",function(ne){return r.onChartMouseUp(ne)})},standalone:!1,decls:19,vars:11,consts:[["tooltipTemplate",""],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start center",1,"my-1",3,"ngModelChange","change","ngModel"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1 error-border",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],["pageId","reports","tableId","routing",3,"eventsData","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],["mode","indeterminate"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1","error-border"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],[1,"one-color",3,"select","mouseup","view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel"],[1,"tooltip-label"],["pageId","reports","tableId","routing",3,"eventsData","selFilter"]],template:function(o,r){1&o&&(A.j41(0,"div",1)(1,"rtl-horizontal-scroller",2),A.bIt("stepChanged",function(ne){return r.onSelectionChange(ne)}),A.k0s(),A.j41(2,"div",3)(3,"mat-radio-group",4),A.mxI("ngModelChange",function(ne){return A.DH7(r.selReportBy,ne)||(r.selReportBy=ne),ne}),A.bIt("change",function(){return r.onSelReportByChange()}),A.j41(4,"span",5),A.EFF(5,"Report By: "),A.k0s(),A.j41(6,"mat-radio-button",6),A.EFF(7,"Fees"),A.k0s(),A.j41(8,"mat-radio-button",7),A.EFF(9,"Events"),A.k0s()()(),A.j41(10,"div",8),A.DNE(11,xu,4,0,"div",9)(12,Yu,2,1,"div",10)(13,bu,4,8,"div",11)(14,vu,2,0,"div",9),A.j41(15,"div",12),A.DNE(16,Su,3,11,"ngx-charts-bar-vertical",13),A.k0s(),A.j41(17,"div",12),A.DNE(18,Nu,1,2,"rtl-cln-forwarding-history",14),A.k0s()()()),2&o&&(A.R7$(3),A.R50("ngModel",r.selReportBy),A.R7$(3),A.Y8G("value",A.mNQ(r.reportBy.FEES)),A.R7$(2),A.Y8G("value",A.mNQ(r.reportBy.EVENTS)),A.R7$(3),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.ERROR),A.R7$(),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.COMPLETED&&r.routingReportData.length>0&&r.filteredEventsBySelectedPeriod.length>0),A.R7$(),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.COMPLETED&&(r.routingReportData.length<=0||r.filteredEventsBySelectedPeriod.length<=0)),A.R7$(2),A.Y8G("ngIf",r.routingReportData.length>0&&r.filteredEventsBySelectedPeriod.length>0),A.R7$(2),A.Y8G("ngIf",r.filteredEventsBySelectedPeriod&&r.filteredEventsBySelectedPeriod.length>0))},dependencies:[de.bT,hA.BC,hA.vS,eA.HM,qe.VT,qe._g,Q.DJ,Q.sA,Q.UI,Lc.L8,Gc.m,Sc,de.QX],encapsulation:2,data:{animation:[Uc.q]}}))}return n(),l})();var Pu=We(5085);function Uu(n,l){if(1&n&&(A.j41(0,"div",11),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Lme(" Paid ",A.i5U(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod/1e3||0,"1.0-2")," Sats/",A.bMT(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function Lu(n,l){if(1&n&&(A.j41(0,"div",11),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Lme(" Received ",A.i5U(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod/1e3||0,"1.0-2")," Sats/",A.bMT(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Gu(n,l){if(1&n&&(A.j41(0,"div",9),A.DNE(1,Uu,4,7,"div",10)(2,Lu,4,7,"div",10),A.k0s()),2&n){const e=A.XpG();A.Y8G("@fadeIn",e.transactionsReportSummary),A.R7$(),A.Y8G("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),A.R7$(),A.Y8G("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function zu(n,l){1&n&&(A.j41(0,"div",12),A.EFF(1,"No transactions report for the selected period"),A.k0s())}function ku(n,l){if(1&n&&(A.j41(0,"span",14),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=l.model;A.R7$(),A.LHq("",e.name,": ",A.i5U(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",A.bMT(3,7,(null==e.extra?null:e.extra.total)||0))}}function Hu(n,l){if(1&n){const e=A.RV6();A.j41(0,"ngx-charts-bar-vertical-2d",13),A.bIt("select",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onChartBarSelected(o))})("mouseup",function(o){w.eBV(e);const r=A.XpG();return w.Njj(r.onChartMouseUp(o))}),A.DNE(1,ku,4,9,"ng-template",null,0,A.C5r),A.k0s()}if(2&n){const e=A.XpG();A.Y8G("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:4)}}function ju(n,l){if(1&n&&A.nrm(0,"rtl-transactions-report-table",15),2&n){const e=A.XpG();A.Y8G("displayedColumns",e.displayedColumns)("tableSetting",e.tableSetting)("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("selFilter",e.transactionFilterValue)}}let Ou=(()=>{var n;class l{constructor(i,o,r){this.logger=i,this.commonService=o,this.store=r,this.scrollRanges=B.rs,this.reportPeriod=B.rs[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.colWidth="20rem",this.PAGE_ID="reports",this.tableSetting={tableId:"transactions",recordsPerPage:B.md,sortBy:"date",sortOrder:B.oi.DESCENDING},this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.transactionsReportData=[],this.transactionsNonZeroReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=B.f7,this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===B.f7.XS||this.screenSize===B.f7.SM),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.KT).pipe((0,I.Q)(this.unSubs[1]),(0,N.E)(this.store.select(tA.Pj))).subscribe(([i,o])=>{this.payments=i.payments,this.invoices=o.listInvoices.invoices||[],this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData()}),this.commonService.containerSizeUpdated.pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{switch(this.screenSize){case B.f7.MD:this.screenPaddingX=i.width/10;break;case B.f7.LG:this.screenPaddingX=i.width/16;break;default:this.screenPaddingX=i.width/20}this.view=[i.width-this.screenPaddingX,i.height/2.2],this.logger.info("Container Size: "+JSON.stringify(i)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(i){"svg"===i.srcElement.tagName&&i.srcElement.classList.length>0&&"ngx-charts"===i.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(i){this.transactionFilterValue=this.reportPeriod===B.rs[1]?i.series+"/"+this.startDate.getFullYear():i.series.toString().padStart(2,"0")+"/"+B.KR[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(i,o){const r=Math.round(i.getTime()/1e3),iA=Math.round(o.getTime()/1e3),ne=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const re=this.payments?.filter(Qt=>"complete"===Qt.status&&Qt.created_at&&Qt.created_at>=r&&Qt.created_at"paid"===Qt.status&&Qt.paid_at&&Qt.paid_at>=r&&Qt.paid_at{const wn=new Date(1e3*(Qt.created_at||0)).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(Qt.amount_sent_msat||0),ne[wn].series[0].value=ne[wn].series[0].value+(Qt.amount_sent_msat||0)/1e3,ne[wn].series[0].extra.total=ne[wn].series[0].extra.total+1,this.transactionsReportSummary}),ln?.map(Qt=>{const wn=new Date(1e3*+(Qt.paid_at||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(Qt.amount_received_msat||0),ne[wn].series[1].value=ne[wn].series[1].value+(Qt.amount_received_msat||0)/1e3,ne[wn].series[1].extra.total=ne[wn].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let Qt=0;Qt{const wn=Math.floor((+(Qt.created_at||0)-r)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(Qt.amount_sent_msat||0),ne[wn].series[0].value=ne[wn].series[0].value+(Qt.amount_sent_msat||0)/1e3,ne[wn].series[0].extra.total=ne[wn].series[0].extra.total+1,this.transactionsReportSummary}),ln?.map(Qt=>{const wn=Math.floor((+(Qt.paid_at||0)-r)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(Qt.amount_received_msat||0),ne[wn].series[1].value=ne[wn].series[1].value+(Qt.amount_received_msat||0)/1e3,ne[wn].series[1].extra.total=ne[wn].series[1].extra.total+1,this.transactionsReportSummary})}return ne}prepareTableData(){return this.transactionsReportData?.reduce((i,o)=>o.series[0].extra.total>0||o.series[1].extra.total>0?i.concat({date:o.date,amount_paid:o.series[0].value,num_payments:o.series[0].extra.total,amount_received:o.series[1].value,num_invoices:o.series[1].extra.total}):i,[])}onSelectionChange(i){const o=i.selDate.getMonth(),r=i.selDate.getFullYear();this.reportPeriod=i.selScrollRange,this.reportPeriod===B.rs[1]?(this.startDate=new Date(r,0,1,0,0,0),this.endDate=new Date(r,11,31,23,59,59)):(this.startDate=new Date(r,o,1,0,0,0),this.endDate=new Date(r,o,this.getMonthDays(o,r),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(i,o){return 1===i&&o%4==0?B.KR[i].days+1:B.KR[i].days}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-transactions-report"]],hostBindings:function(o,r){1&o&&A.bIt("mouseup",function(ne){return r.onChartMouseUp(ne)})},standalone:!1,decls:9,vars:4,consts:[["tooltipTemplate",""],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"select","mouseup","view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding"],[1,"tooltip-label"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter"]],template:function(o,r){1&o&&(A.j41(0,"div",1)(1,"rtl-horizontal-scroller",2),A.bIt("stepChanged",function(ne){return r.onSelectionChange(ne)}),A.k0s(),A.j41(2,"div",3),A.DNE(3,Gu,3,3,"div",4)(4,zu,2,0,"div",5),A.j41(5,"div",6),A.DNE(6,Hu,3,13,"ngx-charts-bar-vertical-2d",7),A.k0s(),A.j41(7,"div",6),A.DNE(8,ju,1,5,"rtl-transactions-report-table",8),A.k0s()()()),2&o&&(A.R7$(3),A.Y8G("ngIf",r.transactionsNonZeroReportData.length>0),A.R7$(),A.Y8G("ngIf",r.transactionsNonZeroReportData.length<=0),A.R7$(2),A.Y8G("ngIf",r.transactionsNonZeroReportData.length>0),A.R7$(2),A.Y8G("ngIf",r.transactionsNonZeroReportData.length>0))},dependencies:[de.bT,Q.DJ,Q.sA,Q.UI,Lc.Dl,Gc.m,Pu.T,de.QX],encapsulation:2,data:{animation:[Uc.q]}}))}return n(),l})();var Vt=We(7186),Ju=We(13);function _u(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",9),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.activeLink=o.link)}),A.EFF(1),A.k0s()}if(2&n){const e=l.$implicit,i=A.XpG();A.Y8G("routerLink",A.mNQ(e.link))("active",i.activeLink===e.link),A.R7$(),A.JRh(e.name)}}let Vu=(()=>{var n;class l{constructor(i){this.router=i,this.faSearch=v.MjD,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new g.B,new g.B,new g.B,new g.B]}ngOnInit(){const i=this.links.find(o=>this.router.url.includes(o.link));this.activeLink=i?i.link:this.links[0].link,this.router.events.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(o=>o instanceof xt.gx)).subscribe({next:o=>{const r=this.links.find(iA=>o.urlAfterRedirects.includes(iA.link));this.activeLink=r?r.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(xt.Ix))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-graph"]],standalone:!1,decls:13,vars:3,consts:[["tabPanel",""],["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["tabindex","1","role","tab","mat-tab-link","","class","mat-tab-label",3,"routerLink","active","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["tabindex","1","role","tab","mat-tab-link","",1,"mat-tab-label",3,"click","routerLink","active"]],template:function(o,r){if(1&o&&(A.j41(0,"div",1),A.nrm(1,"fa-icon",2),A.j41(2,"span",3),A.EFF(3,"Graph Lookups"),A.k0s()(),A.j41(4,"div",4)(5,"mat-card")(6,"mat-card-content",5)(7,"nav",6),A.DNE(8,_u,2,4,"div",7),A.k0s(),A.nrm(9,"mat-tab-nav-panel",null,0),A.j41(11,"div",8),A.nrm(12,"router-outlet"),A.k0s()()()()),2&o){const iA=A.sdS(10);A.R7$(),A.Y8G("icon",r.faSearch),A.R7$(6),A.Y8G("tabPanel",iA),A.R7$(),A.Y8G("ngForOf",r.links)}},dependencies:[de.Sq,P.aY,QA.RN,QA.m2,Q.DJ,Q.sA,Q.UI,RA.Bu,RA.hQ,RA.Ql,xt.n3,Sn.Wk],encapsulation:2}))}return n(),l})();var Wu=We(2643),Ku=We(7235);function Xu(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.offerError)}}function Zu(n,l){if(1&n&&(A.j41(0,"div",21),A.nrm(1,"fa-icon",22),A.DNE(2,Xu,2,1,"span",23),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.offerError)}}let qu=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.dialogRef=i,this.data=o,this.store=r,this.decimalPipe=iA,this.commonService=ne,this.actions=re,this.faExclamationTriangle=v.zpE,this.description="",this.issuer="",this.offerValueHint="",this.information={},this.pageSize=B.md,this.offerError="",this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.information=i,this.issuer=this.information.alias}),this.actions.pipe((0,I.Q)(this.unSubs[2]),(0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN)).subscribe(i=>{i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&"SaveNewOffer"===i.payload.action&&(i.payload.status===B.wn.ERROR&&(this.offerError=i.payload.message),i.payload.status===B.wn.COMPLETED&&this.dialogRef.close())})}onAddOffer(){this.offerError="";const i=this.offerValue?(1e3*this.offerValue).toString():"any";this.store.dispatch((0,VA.y0)({payload:{amount:i,description:this.description,issuer:this.issuer}}))}resetData(){this.description="",this.issuer=this.information.alias,this.offerValue=null,this.offerValueHint="",this.offerError=""}onOfferValueChange(){this.selNode&&this.selNode.settings.fiatConversion&&this.offerValue&&this.offerValue>99&&(this.offerValueHint="",this.commonService.convertCurrency(this.offerValue,B.BQ.SATS,B.BQ.OTHER,this.selNode.settings.currencyUnits&&this.selNode.settings.currencyUnits.length>2?this.selNode.settings.currencyUnits[2]:"",this.selNode.settings.fiatConversion).pipe((0,I.Q)(this.unSubs[3])).subscribe({next:i=>{this.offerValueHint="= "+this.decimalPipe.transform(i.OTHER,B.k.OTHER)+" "+i.unit},error:i=>{this.offerValueHint="Conversion Error: "+i}}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(AA.il),A.rXU(de.QX),A.rXU(L.h),A.rXU(kA.En))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-create-offer"]],standalone:!1,decls:34,vars:8,consts:[["addOfferForm","ngForm"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","6","fxFlex","5","fxLayoutAlign","center center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","tabindex","1","name","description",3,"ngModelChange","ngModel"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxLayout","column","fxFlex","40"],["matInput","","type","number","tabindex","2","name","offerValue",3,"ngModelChange","keyup","step","min","ngModel"],["matSuffix",""],["fxLayout","column","fxFlex","58","fxLayoutAlign","start end"],["matInput","","tabindex","3","name","issuer",3,"ngModelChange","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-1"],["mat-button","","color","primary","tabindex","4","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","5",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2)(2,"mat-card-header",3)(3,"div",4)(4,"span",5),A.EFF(5,"Create Offer"),A.k0s()(),A.j41(6,"button",6),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",7)(9,"form",8,0)(11,"mat-form-field",9)(12,"mat-label"),A.EFF(13,"Description"),A.k0s(),A.j41(14,"input",10),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.description,re)||(r.description=re),w.Njj(re)}),A.k0s()(),A.j41(15,"div",11)(16,"mat-form-field",12)(17,"mat-label"),A.EFF(18,"Amount"),A.k0s(),A.j41(19,"input",13),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.offerValue,re)||(r.offerValue=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onOfferValueChange())}),A.k0s(),A.j41(20,"span",14),A.EFF(21,"Sats "),A.k0s(),A.j41(22,"mat-hint"),A.EFF(23),A.k0s()(),A.j41(24,"mat-form-field",15)(25,"mat-label"),A.EFF(26,"Issuer"),A.k0s(),A.j41(27,"input",16),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.issuer,re)||(r.issuer=re),w.Njj(re)}),A.k0s()()(),A.DNE(28,Zu,3,2,"div",17),A.j41(29,"div",18)(30,"button",19),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(31,"Clear Field"),A.k0s(),A.j41(32,"button",20),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onAddOffer())}),A.EFF(33,"Create Offer"),A.k0s()()()()()()}2&o&&(A.R7$(6),A.Y8G("mat-dialog-close",!1),A.R7$(8),A.R50("ngModel",r.description),A.R7$(5),A.Y8G("step",100)("min",1),A.R50("ngModel",r.offerValue),A.R7$(4),A.JRh(r.offerValueHint),A.R7$(4),A.R50("ngModel",r.issuer),A.R7$(),A.Y8G("ngIf",""!==r.offerError))},dependencies:[de.bT,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.VZ,hA.vS,hA.cV,P.aY,wA.tx,fA.$z,QA.m2,QA.MM,UA.fg,yA.rl,yA.nJ,yA.MV,yA.yw,Q.DJ,Q.sA,Q.UI,cA.N,J.V],encapsulation:2}))}return n(),l})();var zc=We(2142);const $u=()=>["all"],Ah=n=>({"error-border":n}),eh=()=>["no_offer"],kc=n=>({"mr-0":n}),Hc=n=>({width:n}),th=n=>({"display-none":n});function nh(n,l){if(1&n&&(A.j41(0,"mat-option",34),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function ih(n,l){1&n&&A.nrm(0,"mat-progress-bar",35)}function sh(n,l){1&n&&A.nrm(0,"th",36)}function rh(n,l){if(1&n&&A.nrm(0,"span",40),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,kc,e.screenSize===e.screenSizeEnum.XS))}}function ah(n,l){if(1&n&&A.nrm(0,"span",41),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,kc,e.screenSize===e.screenSizeEnum.XS))}}function oh(n,l){if(1&n&&(A.j41(0,"td",37),A.DNE(1,rh,1,3,"span",38)(2,ah,1,3,"span",39),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Y8G("ngIf",e.active),A.R7$(),A.Y8G("ngIf",!e.active)}}function lh(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Offer ID"),A.k0s())}function ch(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Hc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.SpI(" ",e.offer_id," ")}}function gh(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Single Use"),A.k0s())}function Bh(n,l){if(1&n&&(A.j41(0,"td",37),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(e.single_use?"Yes":"No")}}function fh(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Used"),A.k0s())}function uh(n,l){if(1&n&&(A.j41(0,"td",37),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ",e.used?"Yes":"No"," ")}}function hh(n,l){1&n&&(A.j41(0,"th",42),A.EFF(1,"Invoice"),A.k0s())}function Eh(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Hc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.SpI(" ",e.bolt12," ")}}function wh(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",45)(1,"div",46)(2,"mat-select",47),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",48),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function Ch(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",48),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onDisableOffer(o))}),A.EFF(1,"Disable Offer"),A.k0s()}}function dh(n,l){if(1&n){const e=A.RV6();A.j41(0,"mat-option",48),A.bIt("click",function(){w.eBV(e);const o=A.XpG().$implicit,r=A.XpG();return w.Njj(r.onPrintOffer(o))}),A.EFF(1,"Export QR code"),A.k0s()}}function Qh(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",49)(1,"div",46)(2,"mat-select",50),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",48),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onOfferClick(o))}),A.EFF(5,"View Info"),A.k0s(),A.DNE(6,Ch,2,0,"mat-option",51)(7,dh,2,0,"mat-option",51),A.k0s()()()}if(2&n){const e=l.$implicit;A.R7$(6),A.Y8G("ngIf",e.active),A.R7$(),A.Y8G("ngIf",e.active)}}function mh(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No offer available."),A.k0s())}function Mh(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting offers..."),A.k0s())}function ph(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function Ih(n,l){if(1&n&&(A.j41(0,"td",52),A.DNE(1,mh,2,0,"p",53)(2,Mh,2,0,"p",53)(3,ph,2,1,"p",53),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.offers&&e.offers.data)||(null==e.offers||null==e.offers.data?null:e.offers.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.offers&&e.offers.data)||(null==e.offers||null==e.offers.data?null:e.offers.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.offers&&e.offers.data)||(null==e.offers||null==e.offers.data?null:e.offers.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function Dh(n,l){if(1&n&&A.nrm(0,"tr",54),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,th,(null==e.offers?null:e.offers.data)&&(null==e.offers||null==e.offers.data?null:e.offers.data.length)>0))}}function Fh(n,l){1&n&&A.nrm(0,"tr",55)}function yh(n,l){1&n&&A.nrm(0,"tr",56)}let xh=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln){this.logger=i,this.store=o,this.commonService=r,this.rtlEffects=iA,this.dataService=ne,this.decimalPipe=re,this.camelCaseWithReplace=ln,this.faHistory=v.Int,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"offers",recordsPerPage:B.md,sortBy:"offer_id",sortOrder:B.oi.DESCENDING},this.newlyAddedOfferMemo="",this.newlyAddedOfferValue=0,this.description="",this.offerValue=null,this.offerValueHint="",this.displayedColumns=[],this.offerPaymentReq="",this.offerJSONArr=[],this.information={},this.private=!1,this.expiryStep=100,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(j._c).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.selNode=i}),this.store.select(tA.mH).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.information=i}),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[2])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("active"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.O5).pipe((0,I.Q)(this.unSubs[3])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.offerJSONArr=i.offers||[],this.offerJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadOffersTable(this.offerJSONArr),this.logger.info(i)})}ngAfterViewInit(){this.offerJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadOffersTable(this.offerJSONArr)}openCreateOfferModal(){this.store.dispatch((0,C.xO)({payload:{data:{pageSize:this.pageSize,component:qu}}}))}onOfferClick(i){this.store.dispatch((0,C.xO)({payload:{data:{offer:{used:i.used,single_use:i.single_use,active:i.active,offer_id:i.offer_id,bolt12:i.bolt12,created:i.created,label:i.label},newlyAdded:!1,component:zc.f}}}))}onDisableOffer(i){this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Disable Offer",titleMessage:"Disabling Offer: "+(i.offer_id||i.bolt12),noBtnText:"Cancel",yesBtnText:"Disable"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[4])).subscribe(o=>{o&&this.store.dispatch((0,VA.jQ)({payload:{offer_id:i.offer_id}}))})}onPrintOffer(i){this.dataService.decodePayment(i.bolt12,!1).pipe((0,bt.s)(1)).subscribe(o=>{o.offer_id&&!o.offer_amount_msat&&(o.offer_amount_msat=0);const r={pageSize:"A5",pageOrientation:"portrait",pageMargins:[10,50,10,50],background:{svg:'\n \n \n \n \n \n ',width:249,height:333,absolutePosition:{x:84,y:160}},header:{text:o.offer_issuer||"",alignment:"center",fontSize:25,color:"#272727",margin:[0,20,0,0]},content:[{svg:'',width:249,height:40,alignment:"center"},{text:o.offer_description?o.offer_description.substring(0,160):"",alignment:"center",fontSize:16,color:"#5C5C5C"},{qr:i.bolt12,eccLevel:"M",fit:"227",alignment:"center",absolutePosition:{x:7,y:205}},{text:o?.offer_amount_msat&&0!==o?.offer_amount_msat?this.decimalPipe.transform((o.offer_amount_msat||0)/1e3)+" SATS":"Open amount",fontSize:20,bold:!1,color:"white",alignment:"center",absolutePosition:{x:0,y:430}},{text:"SCAN TO PAY",fontSize:22,bold:!0,color:"white",alignment:"center",absolutePosition:{x:0,y:455}}],footer:{svg:'\n \n \n \n \n ',alignment:"center"}};Wu.createPdf(r,null,null,Ku.pdfMake.vfs).download("Offer-"+(o&&o.offer_description?o.offer_description:i.bolt12))})}applyFilter(){this.offers.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.offers.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.active?" active":" inactive")+(i.used?" yes":" no")+(i.single_use?" single":" multiple")+JSON.stringify(i).toLowerCase(),("active"===o||"inactive"===o||"single"===o||"multiple"===o)&&(o=" "+o);break;case"active":r=i?.active?"active":"inactive";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"active"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadOffersTable(i){this.offers=new z.I6(i?[...i]:[]),this.offers.sort=this.sort,this.offers.sortingDataAccessor=(o,r)=>o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null,this.offers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.offers.data&&this.offers.data.length>0&&this.commonService.downloadFile(this.offers.data,"Offers")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(L.h),A.rXU(b.H),A.rXU(Dt.u),A.rXU(de.QX),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-offers-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Offers")}])],decls:49,vars:19,consts:[["table",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","active"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Active",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","offer_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","single_use"],["matColumnDef","used"],["matColumnDef","bolt12"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_offer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Active"],["mat-cell",""],["class","dot green","matTooltip","Active","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Inactive","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Active","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Inactive","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",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(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1)(1,"div",2)(2,"button",3),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.openCreateOfferModal())}),A.EFF(3,"Create Offer"),A.k0s()(),A.j41(4,"div",4)(5,"div",5)(6,"div",6),A.nrm(7,"fa-icon",7),A.j41(8,"span",8),A.EFF(9,"Offers History"),A.k0s()(),A.j41(10,"div",9)(11,"mat-form-field",10)(12,"mat-label"),A.EFF(13,"Filter By"),A.k0s(),A.j41(14,"mat-select",11),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(15,"perfect-scrollbar"),A.DNE(16,nh,2,2,"mat-option",12),A.k0s()()(),A.j41(17,"mat-form-field",10)(18,"mat-label"),A.EFF(19,"Filter"),A.k0s(),A.j41(20,"input",13),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(21,"div",14),A.DNE(22,ih,1,0,"mat-progress-bar",15),A.j41(23,"table",16,0),A.qex(25,17),A.DNE(26,sh,1,0,"th",18)(27,oh,3,2,"td",19),A.bVm(),A.qex(28,20),A.DNE(29,lh,2,0,"th",21)(30,ch,4,4,"td",19),A.bVm(),A.qex(31,22),A.DNE(32,gh,2,0,"th",21)(33,Bh,2,1,"td",19),A.bVm(),A.qex(34,23),A.DNE(35,fh,2,0,"th",21)(36,uh,2,1,"td",19),A.bVm(),A.qex(37,24),A.DNE(38,hh,2,0,"th",21)(39,Eh,4,4,"td",19),A.bVm(),A.qex(40,25),A.DNE(41,wh,6,0,"th",26)(42,Qh,8,2,"td",27),A.bVm(),A.qex(43,28),A.DNE(44,Ih,4,3,"td",29),A.bVm(),A.DNE(45,Dh,1,3,"tr",30)(46,Fh,1,0,"tr",31)(47,yh,1,0,"tr",32),A.k0s()(),A.nrm(48,"mat-paginator",33),A.k0s()()}2&o&&(A.R7$(7),A.Y8G("icon",r.faHistory),A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(15,$u).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(2),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.offers)("ngClass",A.eq3(16,Ah,""!==r.errorMessage)),A.R7$(22),A.Y8G("matFooterRowDef",A.lJ4(18,eh)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld],styles:[".mat-column-active[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}))}return n(),l})();const Yh=()=>["all"],bh=n=>({"error-border":n}),vh=()=>["no_offer"],mc=n=>({width:n}),Rh=n=>({"display-none":n});function Sh(n,l){if(1&n&&(A.j41(0,"mat-option",34),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function Nh(n,l){1&n&&A.nrm(0,"mat-progress-bar",35)}function Th(n,l){1&n&&(A.j41(0,"th",36),A.EFF(1,"Updated At"),A.k0s())}function Ph(n,l){if(1&n&&(A.j41(0,"td",37),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,e.lastUpdatedAt,"dd/MMM/y HH:mm"))}}function Uh(n,l){1&n&&(A.j41(0,"th",36),A.EFF(1,"Title"),A.k0s())}function Lh(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",38)(2,"span",39),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,mc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.title)}}function Gh(n,l){1&n&&(A.j41(0,"th",36),A.EFF(1,"Description"),A.k0s())}function zh(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",38)(2,"span",39),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,mc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.description)}}function kh(n,l){1&n&&(A.j41(0,"th",36),A.EFF(1,"Issuer"),A.k0s())}function Hh(n,l){if(1&n&&(A.j41(0,"td",37),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(e.issuer)}}function jh(n,l){1&n&&(A.j41(0,"th",36),A.EFF(1,"Invoice"),A.k0s())}function Oh(n,l){if(1&n&&(A.j41(0,"td",37)(1,"div",38)(2,"span",39),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,mc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(e.bolt12)}}function Jh(n,l){1&n&&(A.j41(0,"th",40),A.EFF(1,"Amount (Sats)"),A.k0s())}function _h(n,l){if(1&n&&(A.j41(0,"td",37)(1,"span",41),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.JRh(0===e.amountMSat?"Open":A.bMT(3,1,e.amountMSat/1e3))}}function Vh(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",42)(1,"div",43)(2,"mat-select",44),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",45),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function Wh(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",46)(1,"div",43)(2,"mat-select",47),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",45),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onOfferBookmarkClick(o))}),A.EFF(5,"View Info"),A.k0s(),A.j41(6,"mat-option",45),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onRePayOffer(o))}),A.EFF(7,"Pay Again"),A.k0s(),A.j41(8,"mat-option",45),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onDeleteBookmark(o))}),A.EFF(9,"Delete Bookmark"),A.k0s()()()()}}function Kh(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No offer bookmarked."),A.k0s())}function Xh(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting offer bookmarks..."),A.k0s())}function Zh(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function qh(n,l){if(1&n&&(A.j41(0,"td",48),A.DNE(1,Kh,2,0,"p",49)(2,Xh,2,0,"p",49)(3,Zh,2,1,"p",49),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.offersBookmarks&&e.offersBookmarks.data)||(null==e.offersBookmarks||null==e.offersBookmarks.data?null:e.offersBookmarks.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.offersBookmarks&&e.offersBookmarks.data)||(null==e.offersBookmarks||null==e.offersBookmarks.data?null:e.offersBookmarks.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.offersBookmarks&&e.offersBookmarks.data)||(null==e.offersBookmarks||null==e.offersBookmarks.data?null:e.offersBookmarks.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function $h(n,l){if(1&n&&A.nrm(0,"tr",50),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,Rh,(null==e.offersBookmarks?null:e.offersBookmarks.data)&&(null==e.offersBookmarks||null==e.offersBookmarks.data?null:e.offersBookmarks.data.length)>0))}}function AE(n,l){1&n&&A.nrm(0,"tr",51)}function eE(n,l){1&n&&A.nrm(0,"tr",52)}let tE=(()=>{var n;class l{constructor(i,o,r,iA,ne,re){this.logger=i,this.store=o,this.commonService=r,this.rtlEffects=iA,this.datePipe=ne,this.camelCaseWithReplace=re,this.faHistory=v.Int,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"offer_bookmarks",recordsPerPage:B.md,sortBy:"lastUpdatedAt",sortOrder:B.oi.DESCENDING},this.displayedColumns=[],this.offersBookmarks=new z.I6([]),this.offersBookmarksJSONArr=[],this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.selFilter="",this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.ip).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.offersBookmarksJSONArr=i.offersBookmarks||[],this.offersBookmarksJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadOffersTable(this.offersBookmarksJSONArr),this.logger.info(i)})}ngAfterViewInit(){this.offersBookmarksJSONArr&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadOffersTable(this.offersBookmarksJSONArr)}onOfferBookmarkClick(i){this.store.dispatch((0,C.xO)({payload:{data:{offer:{bolt12:i.bolt12},newlyAdded:!1,component:zc.f}}}))}onDeleteBookmark(i){this.store.dispatch((0,C.I1)({payload:{data:{type:B.A$.CONFIRM,alertTitle:"Delete Bookmark",titleMessage:"Deleting Bookmark: "+(i.title||i.description),noBtnText:"Cancel",yesBtnText:"Delete"}}})),this.rtlEffects.closeConfirm.pipe((0,I.Q)(this.unSubs[2])).subscribe(o=>{o&&this.store.dispatch((0,VA.ED)({payload:{bolt12:i.bolt12}}))})}onRePayOffer(i){this.store.dispatch((0,C.xO)({payload:{data:{paymentType:B.Y0.OFFER,bolt12:i.bolt12,offerTitle:i.title,component:Bn}}}))}applyFilter(){this.offersBookmarks.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.offersBookmarks.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=JSON.stringify(i).toLowerCase();break;case"lastUpdatedAt":r=this.datePipe.transform(new Date(i.lastUpdatedAt||0),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"amountMSat":r=(i.amountMSat&&0!==i.amountMSat?(i.amountMSat/1e3).toString():"Open")||"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return r.includes(o)}}loadOffersTable(i){this.offersBookmarks=new z.I6(i?[...i]:[]),this.offersBookmarks.sort=this.sort,this.offersBookmarks.sortingDataAccessor=(o,r)=>o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null,this.offersBookmarks.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.offersBookmarks.data&&this.offersBookmarks.data.length>0&&this.commonService.downloadFile(this.offersBookmarks.data,"OfferBookmarks")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(L.h),A.rXU(b.H),A.rXU(de.vh),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-offer-bookmarks-table"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Offer Bookmarks")}])],decls:50,vars:19,consts:[["table",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","lastUpdatedAt"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","title"],["matColumnDef","description"],["matColumnDef","issuer"],["matColumnDef","bolt12"],["matColumnDef","amountMSat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_offer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",1),A.nrm(1,"div",2),A.j41(2,"div",3)(3,"div",4)(4,"div",5),A.nrm(5,"fa-icon",6),A.j41(6,"span",7),A.EFF(7,"Offer Bookmarks"),A.k0s()(),A.j41(8,"div",8)(9,"mat-form-field",9)(10,"mat-label"),A.EFF(11,"Filter By"),A.k0s(),A.j41(12,"mat-select",10),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(13,"perfect-scrollbar"),A.DNE(14,Sh,2,2,"mat-option",11),A.k0s()()(),A.j41(15,"mat-form-field",9)(16,"mat-label"),A.EFF(17,"Filter"),A.k0s(),A.j41(18,"input",12),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(19,"div",13),A.DNE(20,Nh,1,0,"mat-progress-bar",14),A.j41(21,"table",15,0),A.qex(23,16),A.DNE(24,Th,2,0,"th",17)(25,Ph,3,4,"td",18),A.bVm(),A.qex(26,19),A.DNE(27,Uh,2,0,"th",17)(28,Lh,4,4,"td",18),A.bVm(),A.qex(29,20),A.DNE(30,Gh,2,0,"th",17)(31,zh,4,4,"td",18),A.bVm(),A.qex(32,21),A.DNE(33,kh,2,0,"th",17)(34,Hh,2,1,"td",18),A.bVm(),A.qex(35,22),A.DNE(36,jh,2,0,"th",17)(37,Oh,4,4,"td",18),A.bVm(),A.qex(38,23),A.DNE(39,Jh,2,0,"th",24)(40,_h,4,3,"td",18),A.bVm(),A.qex(41,25),A.DNE(42,Vh,6,0,"th",26)(43,Wh,10,0,"td",27),A.bVm(),A.qex(44,28),A.DNE(45,qh,4,3,"td",29),A.bVm(),A.DNE(46,$h,1,3,"tr",30)(47,AE,1,0,"tr",31)(48,eE,1,0,"tr",32),A.k0s()(),A.nrm(49,"mat-paginator",33),A.k0s()()}2&o&&(A.R7$(5),A.Y8G("icon",r.faHistory),A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(15,Yh).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(2),A.Y8G("ngIf",(null==r.apiCallStatus?null:r.apiCallStatus.status)===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.offersBookmarks)("ngClass",A.eq3(16,bh,""!==r.errorMessage)),A.R7$(25),A.Y8G("matFooterRowDef",A.lJ4(18,vh)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.ZF,M.Ld,de.QX,de.vh],encapsulation:2}))}return n(),l})();const nE=()=>["all"],iE=()=>["no_event"],jc=n=>({width:n}),sE=n=>({"display-none":n});function rE(n,l){if(1&n&&(A.j41(0,"div",6),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.JRh(e.errorMessage)}}function aE(n,l){if(1&n&&(A.j41(0,"mat-option",17),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function oE(n,l){if(1&n){const e=A.RV6();A.j41(0,"div",7)(1,"div",8),A.nrm(2,"fa-icon",9),A.j41(3,"span"),A.EFF(4,"Maximum 1,000 local failed transactions only."),A.k0s()(),A.j41(5,"div",10),A.nrm(6,"div",11),A.j41(7,"div",12)(8,"mat-form-field",13)(9,"mat-label"),A.EFF(10,"Filter By"),A.k0s(),A.j41(11,"mat-select",14),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilterBy,o)||(r.selFilterBy=o),w.Njj(o)}),A.bIt("selectionChange",function(){w.eBV(e);const o=A.XpG();return o.selFilter="",w.Njj(o.applyFilter())}),A.j41(12,"perfect-scrollbar"),A.DNE(13,aE,2,2,"mat-option",15),A.k0s()()(),A.j41(14,"mat-form-field",13)(15,"mat-label"),A.EFF(16,"Filter"),A.k0s(),A.j41(17,"input",16),A.mxI("ngModelChange",function(o){w.eBV(e);const r=A.XpG();return A.DH7(r.selFilter,o)||(r.selFilter=o),w.Njj(o)}),A.bIt("input",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())})("keyup",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.applyFilter())}),A.k0s()()()()()}if(2&n){const e=A.XpG();A.R7$(2),A.Y8G("icon",e.faExclamationTriangle),A.R7$(9),A.R50("ngModel",e.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(4,nE).concat(e.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",e.selFilter)}}function lE(n,l){1&n&&A.nrm(0,"mat-progress-bar",40)}function cE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Received Time"),A.k0s())}function gE(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.received_time),"dd/MMM/y HH:mm"))}}function BE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"In Channel ID"),A.k0s())}function fE(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.in_channel)}}function uE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"In Channel"),A.k0s())}function hE(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,jc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.in_channel_alias)}}function EE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Out Channel ID"),A.k0s())}function wE(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.out_channel)}}function CE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Out Channel"),A.k0s())}function dE(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",43)(2,"span",44),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.Y8G("ngStyle",A.eq3(2,jc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.out_channel_alias)}}function QE(n,l){1&n&&(A.j41(0,"th",45),A.EFF(1,"Amount In (Sats)"),A.k0s())}function mE(n,l){if(1&n&&(A.j41(0,"td",42)(1,"span",46),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,(null==e?null:e.in_msat)/1e3,(null==e?null:e.in_msat)<1e3?"1.0-4":"1.0-0")," ")}}function ME(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Style"),A.k0s())}function pE(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.style)}}function IE(n,l){1&n&&(A.j41(0,"th",41),A.EFF(1,"Fail Reason"),A.k0s())}function DE(n,l){if(1&n&&(A.j41(0,"td",42),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG(2);A.R7$(),A.JRh(i.CLNFailReason[null==e?null:e.failreason])}}function FE(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",47)(1,"div",48)(2,"mat-select",49),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",50),A.bIt("click",function(){w.eBV(e);const o=A.XpG(2);return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function yE(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",51)(1,"button",52),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG(2);return w.Njj(r.onFailedLocalEventClick(o))}),A.EFF(2,"View Info"),A.k0s()()}}function xE(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No failed transaction available."),A.k0s())}function YE(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting failed transactions..."),A.k0s())}function bE(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(3);A.R7$(),A.JRh(e.errorMessage)}}function vE(n,l){if(1&n&&(A.j41(0,"td",53),A.DNE(1,xE,2,0,"p",54)(2,YE,2,0,"p",54)(3,bE,2,1,"p",54),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.Y8G("ngIf",(!(null!=e.failedLocalForwardingEvents&&e.failedLocalForwardingEvents.data)||(null==e.failedLocalForwardingEvents||null==e.failedLocalForwardingEvents.data?null:e.failedLocalForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.failedLocalForwardingEvents&&e.failedLocalForwardingEvents.data)||(null==e.failedLocalForwardingEvents||null==e.failedLocalForwardingEvents.data?null:e.failedLocalForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.failedLocalForwardingEvents&&e.failedLocalForwardingEvents.data)||(null==e.failedLocalForwardingEvents||null==e.failedLocalForwardingEvents.data?null:e.failedLocalForwardingEvents.data.length)<1)&&(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.ERROR)}}function RE(n,l){if(1&n&&A.nrm(0,"tr",55),2&n){const e=A.XpG(2);A.Y8G("ngClass",A.eq3(1,sE,(null==e.failedLocalForwardingEvents?null:e.failedLocalForwardingEvents.data)&&(null==e.failedLocalForwardingEvents||null==e.failedLocalForwardingEvents.data?null:e.failedLocalForwardingEvents.data.length)>0))}}function SE(n,l){1&n&&A.nrm(0,"tr",56)}function NE(n,l){1&n&&A.nrm(0,"tr",57)}function TE(n,l){if(1&n&&(A.j41(0,"div",18),A.DNE(1,lE,1,0,"mat-progress-bar",19),A.j41(2,"table",20,0),A.qex(4,21),A.DNE(5,cE,2,0,"th",22)(6,gE,3,4,"td",23),A.bVm(),A.qex(7,24),A.DNE(8,BE,2,0,"th",22)(9,fE,2,1,"td",23),A.bVm(),A.qex(10,25),A.DNE(11,uE,2,0,"th",22)(12,hE,4,4,"td",23),A.bVm(),A.qex(13,26),A.DNE(14,EE,2,0,"th",22)(15,wE,2,1,"td",23),A.bVm(),A.qex(16,27),A.DNE(17,CE,2,0,"th",22)(18,dE,4,4,"td",23),A.bVm(),A.qex(19,28),A.DNE(20,QE,2,0,"th",29)(21,mE,4,4,"td",23),A.bVm(),A.qex(22,30),A.DNE(23,ME,2,0,"th",22)(24,pE,2,1,"td",23),A.bVm(),A.qex(25,31),A.DNE(26,IE,2,0,"th",22)(27,DE,2,1,"td",23),A.bVm(),A.qex(28,32),A.DNE(29,FE,6,0,"th",33)(30,yE,3,0,"td",34),A.bVm(),A.qex(31,35),A.DNE(32,vE,4,3,"td",36),A.bVm(),A.DNE(33,RE,1,3,"tr",37)(34,SE,1,0,"tr",38)(35,NE,1,0,"tr",39),A.k0s()()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(null==e.apiCallStatus?null:e.apiCallStatus.status)===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.failedLocalForwardingEvents),A.R7$(31),A.Y8G("matFooterRowDef",A.lJ4(7,iE)),A.R7$(),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)}}function PE(n,l){if(1&n&&A.nrm(0,"mat-paginator",58),2&n){const e=A.XpG();A.Y8G("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let UE=(()=>{var n;class l{constructor(i,o,r,iA,ne){this.logger=i,this.commonService=o,this.store=r,this.datePipe=iA,this.camelCaseWithReplace=ne,this.faExclamationTriangle=v.zpE,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"local_failed",recordsPerPage:B.md,sortBy:"received_time",sortOrder:B.oi.DESCENDING},this.CLNFailReason=B.iI,this.failedLocalEvents=[],this.errorMessage="",this.displayedColumns=[],this.failedLocalForwardingEvents=new z.I6([]),this.selFilter="",this.totalLocalFailedTransactions=0,this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.apiCallStatus=null,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,VA.uK)({payload:{status:B.xk.LOCAL_FAILED}})),this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(tA.aJ).pipe((0,I.Q)(this.unSubs[1])).subscribe(i=>{this.errorMessage="",this.apiCallStatus=i.apiCallStatus,this.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.totalLocalFailedTransactions=i.localFailedForwardingHistory.totalForwards||0,this.failedLocalEvents=i.localFailedForwardingHistory.listForwards||[],this.failedLocalEvents&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadLocalfailedLocalEventsTable(this.failedLocalEvents),this.logger.info(i)})}ngAfterViewInit(){this.failedLocalEvents.length>0&&this.loadLocalfailedLocalEventsTable(this.failedLocalEvents)}onFailedLocalEventClick(i){this.store.dispatch((0,C.xO)({payload:{data:{type:B.A$.INFORMATION,alertTitle:"Local Failed Event Information",message:[[{key:"received_time",value:i.received_time,title:"Received Time",width:50,type:B.UN.DATE_TIME},{key:"in_channel_alias",value:i.in_channel_alias,title:"Inbound Channel",width:50,type:B.UN.STRING}],[{key:"in_msatoshi",value:i.in_msat,title:"Amount In (mSats)",width:100,type:B.UN.NUMBER}],[{key:"failreason",value:i.failreason?this.CLNFailReason[i.failreason]:"",title:"Reason for Failure",width:100,type:B.UN.STRING}]]}}}))}applyFilter(){this.failedLocalForwardingEvents.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column,"_"):this.commonService.titleCase(i)}setFilterPredicate(){this.failedLocalForwardingEvents.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.received_time?this.datePipe.transform(new Date(1e3*i.received_time),"dd/MMM/y HH:mm")?.toLowerCase():"")+(i.in_channel_alias?i.in_channel_alias.toLowerCase():"")+(i.failreason&&this.CLNFailReason[i.failreason]?this.CLNFailReason[i.failreason].toLowerCase():"")+(i.in_msat?i.in_msat:"");break;case"received_time":r=this.datePipe.transform(new Date(1e3*(i.received_time||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"in_msatoshi":r=(+(i.in_msat||0)/1e3).toString()||"";break;case"failreason":r=i?.failreason?this.CLNFailReason[i?.failreason]:"";break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return"failreason"===this.selFilterBy?0===r.indexOf(o):r.includes(o)}}loadLocalfailedLocalEventsTable(i){this.failedLocalForwardingEvents=new z.I6([...i]),this.failedLocalForwardingEvents.sort=this.sort,this.failedLocalForwardingEvents.sortingDataAccessor=(o,r)=>{switch(r){case"in_msatoshi":return o.in_msat;case"failreason":return o.failreason?this.CLNFailReason[o.failreason]:"";default:return o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null}},this.failedLocalForwardingEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.failedLocalForwardingEvents)}onDownloadCSV(){this.failedLocalForwardingEvents&&this.failedLocalForwardingEvents.data&&this.failedLocalForwardingEvents.data.length>0&&this.commonService.downloadFile(this.failedLocalForwardingEvents.data,"Local-failed-transactions")}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(L.h),A.rXU(AA.il),A.rXU(de.vh),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-local-failed-history"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Local failed events")}])],decls:5,vars:4,consts:[["table",""],["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","100",1,"alert","alert-warn","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","100"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"matSortActive","matSortDirection","dataSource"],["matColumnDef","received_time"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","in_channel"],["matColumnDef","in_channel_alias"],["matColumnDef","out_channel"],["matColumnDef","out_channel_alias"],["matColumnDef","in_msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","style"],["matColumnDef","failreason"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayout.gt-xs","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(o,r){1&o&&(A.j41(0,"div",1),A.DNE(1,rE,2,1,"div",2)(2,oE,18,5,"div",3)(3,TE,36,8,"div",4)(4,PE,1,3,"mat-paginator",5),A.k0s()),2&o&&(A.R7$(),A.Y8G("ngIf",""!==r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage),A.R7$(),A.Y8G("ngIf",""===r.errorMessage))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.me,hA.BC,hA.vS,P.aY,fA.$z,UA.fg,yA.rl,yA.nJ,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,H.iy,M.ZF,M.Ld,de.QX,de.vh],encapsulation:2}))}return n(),l})();const LE=["form"];function GE(n,l){1&n&&A.eu8(0)}function zE(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Requested amount is required."),A.k0s())}function kE(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Fee rate is required."),A.k0s())}function HE(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Local amount is required."),A.k0s())}function jE(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Local amount must be greater than or equal to 20,000 Sats. It's required to cover the channel force close fee, if needed."),A.k0s())}function OE(n,l){if(1&n&&(A.j41(0,"mat-error"),A.EFF(1),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.SpI("Local amount must be less than or equal to ",e.totalBalance,".")}}function JE(n,l){if(1&n&&(A.j41(0,"span"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.channelConnectionError)}}function _E(n,l){if(1&n&&(A.j41(0,"div",27),A.nrm(1,"fa-icon",28),A.DNE(2,JE,2,1,"span",19),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("icon",e.faExclamationTriangle),A.R7$(),A.Y8G("ngIf",""!==e.channelConnectionError)}}function VE(n,l){1&n&&(A.j41(0,"th",47),A.EFF(1,"Type"),A.k0s())}function WE(n,l){if(1&n&&(A.j41(0,"td",48),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.type)}}function KE(n,l){1&n&&(A.j41(0,"th",47),A.EFF(1,"Address"),A.k0s())}function XE(n,l){if(1&n&&(A.j41(0,"td",48),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.address)}}function ZE(n,l){1&n&&(A.j41(0,"th",47),A.EFF(1,"Port"),A.k0s())}function qE(n,l){if(1&n&&(A.j41(0,"td",48),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e?null:e.port)}}function $E(n,l){1&n&&A.nrm(0,"tr",49)}function Aw(n,l){1&n&&A.nrm(0,"tr",50)}function ew(n,l){if(1&n&&(A.j41(0,"mat-expansion-panel",30)(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"span"),A.EFF(4,"Node: \xa0"),A.k0s(),A.j41(5,"strong",31),A.EFF(6),A.k0s()()(),A.j41(7,"div",13)(8,"div",6)(9,"div",7)(10,"h4",32),A.EFF(11,"Pubkey"),A.k0s(),A.j41(12,"span",33),A.EFF(13),A.k0s()()(),A.nrm(14,"mat-divider",34),A.j41(15,"div",6)(16,"div",7)(17,"h4",32),A.EFF(18,"Last Timestamp"),A.k0s(),A.j41(19,"span",35),A.EFF(20),A.nI1(21,"date"),A.k0s()()(),A.nrm(22,"mat-divider",34),A.j41(23,"div",36)(24,"h4",37),A.EFF(25,"Addresses"),A.k0s(),A.j41(26,"div",38)(27,"table",39,5),A.qex(29,40),A.DNE(30,VE,2,0,"th",41)(31,WE,2,1,"td",42),A.bVm(),A.qex(32,43),A.DNE(33,KE,2,0,"th",41)(34,XE,2,1,"td",42),A.bVm(),A.qex(35,44),A.DNE(36,ZE,2,0,"th",41)(37,qE,2,1,"td",42),A.bVm(),A.DNE(38,$E,1,0,"tr",45)(39,Aw,1,0,"tr",46),A.k0s()()()()()),2&n){const e=A.XpG(2);A.R7$(6),A.JRh((null==e.node?null:e.node.alias)||(null==e.node?null:e.node.nodeid)),A.R7$(7),A.JRh(e.node.nodeid),A.R7$(7),A.JRh(A.i5U(21,6,1e3*e.node.last_timestamp,"dd/MMM/y HH:mm")),A.R7$(7),A.Y8G("dataSource",e.node.addresses),A.R7$(11),A.Y8G("matHeaderRowDef",e.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",e.displayedColumns)}}function tw(n,l){if(1&n&&A.DNE(0,ew,40,9,"mat-expansion-panel",29),2&n){const e=A.XpG();A.Y8G("ngIf",e.node)}}let nw=(()=>{var n;class l{constructor(i,o,r,iA){this.dialogRef=i,this.data=o,this.actions=r,this.store=iA,this.faExclamationTriangle=v.zpE,this.totalBalance=0,this.node={},this.requestedAmount=0,this.feeRate=0,this.localAmount=0,this.channelConnectionError="",this.displayedColumns=["type","address","port"],this.unSubs=[new g.B,new g.B]}ngOnInit(){this.alertTitle=this.data.alertTitle||"",this.totalBalance=this.data.message?.balance||0,this.node=this.data.message?.node||{},this.requestedAmount=this.data.message?.requestedAmount||0,this.feeRate=this.data.message?.feeRate||0,this.localAmount=this.data.message?.localAmount||0,this.actions.pipe((0,I.Q)(this.unSubs[0]),(0,nA.p)(i=>i.type===B.TC.UPDATE_API_CALL_STATUS_CLN||i.type===B.TC.FETCH_CHANNELS_CLN)).subscribe(i=>{i.type===B.TC.UPDATE_API_CALL_STATUS_CLN&&i.payload.status===B.wn.ERROR&&"SaveNewChannel"===i.payload.action&&(this.channelConnectionError=i.payload.message),i.type===B.TC.FETCH_CHANNELS_CLN&&this.dialogRef.close()})}onClose(){this.dialogRef.close(!1)}resetData(){this.form.resetForm(),this.form.controls.ramount.setValue(this.data.message?.requestedAmount),this.form.controls.feerate.setValue(this.data.message?.feeRate),this.form.controls.lamount.setValue(this.data.message?.localAmount),this.calculateFee(),this.channelConnectionError=""}calculateFee(){this.node.channel_opening_fee=+(this.node.option_will_fund?.lease_fee_base_msat||0)/1e3+this.requestedAmount*+(this.node.option_will_fund?.lease_fee_basis||0)/1e4+ +(this.node.option_will_fund?.funding_weight||0)/4*this.feeRate}onOpenChannel(){if(!this.node||!this.node.option_will_fund||!this.requestedAmount||!this.feeRate||!this.localAmount||this.localAmount<2e4)return!0;const i={peerId:this.node.nodeid||"",amount:this.localAmount.toString(),feeRate:this.feeRate+"perkb",requestAmount:this.requestedAmount.toString(),compactLease:this.node.option_will_fund.compact_lease,announce:!0};this.store.dispatch((0,VA.vL)({payload:i}))}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(wA.CP),A.rXU(wA.Vh),A.rXU(kA.En),A.rXU(AA.il))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-open-liquidity-channel"]],viewQuery:function(o,r){if(1&o&&A.GBs(LE,7),2&o){let iA;A.mGM(iA=A.lsd())&&(r.form=iA.first)}},standalone:!1,decls:54,vars:24,consts:[["form","ngForm"],["ramount","ngModel"],["feeRt","ngModel"],["lamount","ngModel"],["nodeDetailsExpansionBlock",""],["table",""],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","6","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[4,"ngTemplateOutlet"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayoutAlign.gt-sm","space-between center","fxLayout.gt-sm","row wrap"],["fxLayout","column","fxFlex","30","fxLayoutAlign","start end"],["autoFocus","","matInput","","type","number","tabindex","1","required","","name","ramount",3,"ngModelChange","keyup","step","min","ngModel"],["matSuffix",""],[4,"ngIf"],["matInput","","type","number","tabindex","2","required","","name","feerate",3,"ngModelChange","keyup","step","min","ngModel"],["matInput","","type","number","tabindex","3","required","","name","lamount",3,"ngModelChange","step","min","max","ngModel"],["fxFlex","100",1,"alert","alert-info","mt-4"],["fxFlex","100","class","alert alert-danger mt-2",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","4",1,"mr-1",3,"click"],["autoFocus","","mat-button","","color","primary","tabindex","5",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-2"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel mt-1 mb-2","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","mt-1","mb-2"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],[1,"overflow-wrap","foreground-secondary-text"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxFlex","100",1,"font-bold-500","mb-1"],[1,"table-container"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","port"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",6)(1,"div",7)(2,"mat-card-header",8)(3,"div",9)(4,"span",10),A.EFF(5),A.k0s()(),A.j41(6,"button",11),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onClose())}),A.EFF(7,"X"),A.k0s()(),A.j41(8,"mat-card-content",12)(9,"form",13,0),A.DNE(11,GE,1,0,"ng-container",14),A.j41(12,"div",15)(13,"mat-form-field",16)(14,"mat-label"),A.EFF(15,"Requested Amount"),A.k0s(),A.j41(16,"input",17,1),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.requestedAmount,re)||(r.requestedAmount=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.calculateFee())}),A.k0s(),A.j41(18,"span",18),A.EFF(19," Sats "),A.k0s(),A.DNE(20,zE,2,0,"mat-error",19),A.k0s(),A.j41(21,"mat-form-field",16)(22,"mat-label"),A.EFF(23,"Fee Rate"),A.k0s(),A.j41(24,"input",20,2),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.feeRate,re)||(r.feeRate=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.calculateFee())}),A.k0s(),A.j41(26,"span",18),A.EFF(27," Sats/vByte "),A.k0s(),A.DNE(28,kE,2,0,"mat-error",19),A.k0s(),A.j41(29,"mat-form-field",16)(30,"mat-label"),A.EFF(31,"Local Amount"),A.k0s(),A.j41(32,"input",21,3),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.localAmount,re)||(r.localAmount=re),w.Njj(re)}),A.k0s(),A.j41(34,"mat-hint"),A.EFF(35),A.nI1(36,"number"),A.k0s(),A.j41(37,"span",18),A.EFF(38," Sats "),A.k0s(),A.DNE(39,HE,2,0,"mat-error",19)(40,jE,2,0,"mat-error",19)(41,OE,2,1,"mat-error",19),A.k0s()(),A.j41(42,"div",22)(43,"span"),A.EFF(44),A.nI1(45,"number"),A.k0s()(),A.DNE(46,_E,3,2,"div",23),A.j41(47,"div",24)(48,"button",25),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.resetData())}),A.EFF(49,"Clear"),A.k0s(),A.j41(50,"button",26),A.bIt("click",function(){return w.eBV(iA),w.Njj(r.onOpenChannel())}),A.EFF(51,"Execute"),A.k0s()()()()()(),A.DNE(52,tw,1,1,"ng-template",null,4,A.C5r)}if(2&o){const iA=A.sdS(17),ne=A.sdS(25),re=A.sdS(33),ln=A.sdS(53);A.R7$(5),A.JRh(r.alertTitle),A.R7$(6),A.Y8G("ngTemplateOutlet",ln),A.R7$(5),A.Y8G("step",1e4)("min",0),A.R50("ngModel",r.requestedAmount),A.R7$(4),A.Y8G("ngIf",null==iA.errors?null:iA.errors.required),A.R7$(4),A.Y8G("step",10)("min",0),A.R50("ngModel",r.feeRate),A.R7$(4),A.Y8G("ngIf",null==ne.errors?null:ne.errors.required),A.R7$(4),A.Y8G("step",1e4)("min",2e4)("max",r.totalBalance),A.R50("ngModel",r.localAmount),A.R7$(3),A.SpI("Remaining: ",A.bMT(36,20,r.totalBalance-(r.localAmount?r.localAmount:0))),A.R7$(4),A.Y8G("ngIf",null==re.errors?null:re.errors.required),A.R7$(),A.Y8G("ngIf",null==re.errors?null:re.errors.min),A.R7$(),A.Y8G("ngIf",null==re.errors?null:re.errors.max),A.R7$(3),A.SpI("Total cost to lease ",A.bMT(45,22,r.node.channel_opening_fee)," (Sats)"),A.R7$(2),A.Y8G("ngIf",""!==r.channelConnectionError)}},dependencies:[de.bT,de.T3,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.VZ,hA.zX,hA.vS,hA.cV,P.aY,fA.$z,QA.m2,QA.MM,gi.GK,gi.Z2,gi.WN,UA.fg,yA.rl,yA.nJ,yA.MV,yA.TL,yA.yw,sn.q,Q.DJ,Q.sA,Q.UI,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.KS,z.$R,z.YZ,z.NB,cA.N,Vn.z,J.V,de.QX,de.vh],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}))}return n(),l})();var iw=We(6471);const sw=()=>["all"],rw=n=>({"error-border":n}),aw=()=>["no_lqNode"],Oc=n=>({width:n}),ow=n=>({"display-none":n});function lw(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Channel amount is required."),A.k0s())}function cw(n,l){1&n&&(A.j41(0,"mat-error"),A.EFF(1,"Channel opening fee rate is required."),A.k0s())}function gw(n,l){if(1&n&&(A.j41(0,"mat-option",49),A.EFF(1),A.k0s()),2&n){const e=l.$implicit,i=A.XpG();A.Y8G("value",e),A.R7$(),A.JRh(i.getLabel(e))}}function Bw(n,l){1&n&&A.nrm(0,"mat-progress-bar",50)}function fw(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Alias"),A.k0s())}function uw(n,l){if(1&n&&(A.j41(0,"mat-chip",57),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.SpI(" ","tor"===e?"Tor":"ipv"===e?"Clearnet":e," ")}}function hw(n,l){if(1&n&&(A.j41(0,"td",52)(1,"div",53)(2,"span",54),A.EFF(3),A.j41(4,"mat-chip-list",55),A.DNE(5,uw,2,1,"mat-chip",56),A.k0s()()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(3,Oc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.SpI(" ",null==e?null:e.alias," "),A.R7$(2),A.Y8G("ngForOf",e.address_types)}}function Ew(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Node ID"),A.k0s())}function ww(n,l){if(1&n&&(A.j41(0,"td",52)(1,"div",53)(2,"span",58),A.EFF(3),A.k0s()()()),2&n){const e=l.$implicit,i=A.XpG();A.R7$(),A.Y8G("ngStyle",A.eq3(2,Oc,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),A.R7$(2),A.JRh(null==e?null:e.nodeid)}}function Cw(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Last Announcement At"),A.k0s())}function dw(n,l){if(1&n&&(A.j41(0,"td",52),A.EFF(1),A.nI1(2,"date"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(A.i5U(2,1,1e3*(null==e?null:e.last_timestamp),"dd/MMM/y HH:mm")||"-")}}function Qw(n,l){1&n&&(A.j41(0,"th",51),A.EFF(1,"Compact Lease"),A.k0s())}function mw(n,l){if(1&n&&(A.j41(0,"td",52),A.EFF(1),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.JRh(null==e||null==e.option_will_fund?null:e.option_will_fund.compact_lease)}}function Mw(n,l){1&n&&(A.j41(0,"th",59),A.EFF(1," Lease Fee"),A.k0s())}function pw(n,l){if(1&n&&(A.j41(0,"td",52),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Lme(" ",A.i5U(2,2,(null==e||null==e.option_will_fund?null:e.option_will_fund.lease_fee_base_msat)/1e3,"1.0-0")," Sats + ",A.i5U(3,5,(null==e||null==e.option_will_fund?null:e.option_will_fund.lease_fee_basis)/100,"1.2-2"),"% ")}}function Iw(n,l){1&n&&(A.j41(0,"th",59),A.EFF(1," Routing Fee"),A.k0s())}function Dw(n,l){if(1&n&&(A.j41(0,"td",52),A.EFF(1),A.nI1(2,"number"),A.nI1(3,"number"),A.k0s()),2&n){const e=l.$implicit;A.R7$(),A.Lme(" ",A.i5U(2,2,(null==e||null==e.option_will_fund?null:e.option_will_fund.channel_fee_max_base_msat)/1e3,"1.0-0")," Sats + ",A.i5U(3,5,1e3*(null==e||null==e.option_will_fund?null:e.option_will_fund.channel_fee_max_proportional_thousandths),"1.0-0")," ppm ")}}function Fw(n,l){1&n&&(A.j41(0,"th",60),A.EFF(1,"Channel Opening Fee (Sats)"),A.k0s())}function yw(n,l){if(1&n&&(A.j41(0,"td",52)(1,"span",61),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,e.channel_opening_fee,"1.0-0")," ")}}function xw(n,l){1&n&&(A.j41(0,"th",60),A.EFF(1,"Funding Weight"),A.k0s())}function Yw(n,l){if(1&n&&(A.j41(0,"td",52)(1,"span",61),A.EFF(2),A.nI1(3,"number"),A.k0s()()),2&n){const e=l.$implicit;A.R7$(2),A.SpI(" ",A.i5U(3,1,null==e||null==e.option_will_fund?null:e.option_will_fund.funding_weight,"1.0-0")," ")}}function bw(n,l){if(1&n){const e=A.RV6();A.j41(0,"th",59)(1,"div",62)(2,"mat-select",63),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",64),A.bIt("click",function(){w.eBV(e);const o=A.XpG();return w.Njj(o.onDownloadCSV())}),A.EFF(5,"Download CSV"),A.k0s()()()()}}function vw(n,l){if(1&n){const e=A.RV6();A.j41(0,"td",65)(1,"div",62)(2,"mat-select",63),A.nrm(3,"mat-select-trigger"),A.j41(4,"mat-option",64),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onViewLeaseInfo(o))}),A.EFF(5,"View Info"),A.k0s(),A.j41(6,"mat-option",64),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.onOpenChannel(o))}),A.EFF(7,"Open Channel"),A.k0s(),A.j41(8,"mat-option",64),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.viewLeaseOn(o,"LN"))}),A.EFF(9,"View on Lnrouter"),A.k0s(),A.j41(10,"mat-option",64),A.bIt("click",function(){const o=w.eBV(e).$implicit,r=A.XpG();return w.Njj(r.viewLeaseOn(o,"AM"))}),A.EFF(11,"View on Amboss"),A.k0s()()()()}}function Rw(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"No node with liquidity."),A.k0s())}function Sw(n,l){1&n&&(A.j41(0,"p"),A.EFF(1,"Getting nodes with liquidity..."),A.k0s())}function Nw(n,l){if(1&n&&(A.j41(0,"p"),A.EFF(1),A.k0s()),2&n){const e=A.XpG(2);A.R7$(),A.JRh(e.errorMessage)}}function Tw(n,l){if(1&n&&(A.j41(0,"td",66),A.DNE(1,Rw,2,0,"p",17)(2,Sw,2,0,"p",17)(3,Nw,2,1,"p",17),A.k0s()),2&n){const e=A.XpG();A.R7$(),A.Y8G("ngIf",(!(null!=e.liquidityNodes&&e.liquidityNodes.data)||(null==e.liquidityNodes||null==e.liquidityNodes.data?null:e.liquidityNodes.data.length)<1)&&e.listNodesCallStatus===e.apiCallStatusEnum.COMPLETED),A.R7$(),A.Y8G("ngIf",(!(null!=e.liquidityNodes&&e.liquidityNodes.data)||(null==e.liquidityNodes||null==e.liquidityNodes.data?null:e.liquidityNodes.data.length)<1)&&e.listNodesCallStatus===e.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("ngIf",(!(null!=e.liquidityNodes&&e.liquidityNodes.data)||(null==e.liquidityNodes||null==e.liquidityNodes.data?null:e.liquidityNodes.data.length)<1)&&e.listNodesCallStatus===e.apiCallStatusEnum.ERROR)}}function Pw(n,l){if(1&n&&A.nrm(0,"tr",67),2&n){const e=A.XpG();A.Y8G("ngClass",A.eq3(1,ow,(null==e.liquidityNodes?null:e.liquidityNodes.data)&&(null==e.liquidityNodes||null==e.liquidityNodes.data?null:e.liquidityNodes.data.length)>0))}}function Uw(n,l){1&n&&A.nrm(0,"tr",68)}function Lw(n,l){1&n&&A.nrm(0,"tr",69)}let Gw=(()=>{var n;class l{constructor(i,o,r,iA,ne,re,ln){this.logger=i,this.store=o,this.dataService=r,this.commonService=iA,this.rtlEffects=ne,this.datePipe=re,this.camelCaseWithReplace=ln,this.nodePageDefs=B.Jd,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="liquidity_ads",this.tableSetting={tableId:"liquidity_ads",recordsPerPage:B.md,sortBy:"channel_opening_fee",sortOrder:B.oi.ASCENDING},this.askTooltipMsg="",this.nodesTooltipMsg="",this.displayedColumns=[],this.faBullhorn=v.e4L,this.faExclamationTriangle=v.zpE,this.faUsers=v.gdJ,this.totalBalance=0,this.channelAmount=1e5,this.channel_opening_feeRate=10,this.node_capacity=5e5,this.channel_count=5,this.liquidityNodesData=[],this.liquidityNodes=new z.I6([]),this.pageSize=B.md,this.pageSizeOptions=B.xp,this.screenSize="",this.screenSizeEnum=B.f7,this.errorMessage="",this.selFilter="",this.listNodesCallStatus=B.wn.INITIATED,this.apiCallStatusEnum=B.wn,this.unSubs=[new g.B,new g.B,new g.B,new g.B,new g.B,new g.B],this.askTooltipMsg="Specify the liquidity requirements for your node: \n 1. Channel Amount - Amount in Sats you need on the channel opened to your node \n 2. Channel opening fee rate - Rate in Sats/vByte that you are willing to pay to open the channel to you",this.nodesTooltipMsg="These nodes are advertising their liquidity offering on the network.\nYou should pay attention to the following aspects to evaluate each node offer: \n- The total bitcoin deployed on the node, the more the better\n",this.nodesTooltipMsg=this.nodesTooltipMsg+"- The number of channels open on the node, the more the better\n- The channel open fee which the node will charge from you\n- The routing fee which the node will charge on the payments, the lesser the better\n- The reliability of the node, ideally uptime. Refer to the information being provided by the node explorers",this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(tA.av).pipe((0,I.Q)(this.unSubs[0])).subscribe(i=>{this.errorMessage="",i.apiCallStatus.status===B.wn.ERROR&&(this.errorMessage=i.apiCallStatus.message||""),this.tableSetting=i.pageSettings.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId)||B.mu.find(o=>o.pageId===this.PAGE_ID)?.tables.find(o=>o.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===B.f7.XS||this.screenSize===B.f7.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:B.md,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),(0,Va.z)([this.store.select(tA.kQ),this.dataService.listNetworkNodes({liquidity_ads:!0})]).pipe((0,I.Q)(this.unSubs[1])).subscribe({next:([i,o])=>{this.information=i.information,this.totalBalance=i.balance.totalBalance||0,this.logger.info(i),o&&!o.length&&(o=[]),this.logger.info("Received Liquidity Ads Enabled Nodes: "+JSON.stringify(o)),this.listNodesCallStatus=B.wn.COMPLETED,o.forEach(r=>{r.address_types=Array.from(new Set(r.addresses?.reduce((ne,re)=>((re.type?.includes("ipv")||re.type?.includes("tor"))&&ne.push(re.type?.substring(0,3)),ne),[])))}),this.liquidityNodesData=o.filter(r=>r.nodeid!==this.information.id),this.onCalculateOpeningFee(),this.loadLiqNodesTable(this.liquidityNodesData)},error:i=>{this.logger.error("Liquidity Ads Nodes Error: "+JSON.stringify(i)),this.listNodesCallStatus=B.wn.ERROR,this.errorMessage=JSON.stringify(i)}})}onCalculateOpeningFee(){this.liquidityNodesData.forEach(i=>{i.option_will_fund&&(i.channel_opening_fee=+(i.option_will_fund.lease_fee_base_msat||0)/1e3+this.channelAmount*+(i.option_will_fund.lease_fee_basis||0)/1e4+ +(i.option_will_fund.funding_weight||0)/4*this.channel_opening_feeRate)}),this.paginator&&this.paginator.firstPage()}onFilter(){}applyFilter(){this.liquidityNodes.filter=this.selFilter.trim().toLowerCase()}getLabel(i){const o=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(r=>r.column===i);return o?o.label?o.label:this.camelCaseWithReplace.transform(o.column||"","_"):this.commonService.titleCase(i)}setFilterPredicate(){this.liquidityNodes.filterPredicate=(i,o)=>{let r="";switch(this.selFilterBy){case"all":r=(i.alias?i.alias.toLocaleLowerCase():"")+(i.channel_opening_fee?i.channel_opening_fee+" Sats":"")+(i.option_will_fund?.lease_fee_base_msat?i.option_will_fund?.lease_fee_base_msat/1e3+" Sats":"")+(i.option_will_fund?.lease_fee_basis?i.option_will_fund?.lease_fee_basis/100+"%":"")+(i.option_will_fund?.channel_fee_max_base_msat?i.option_will_fund?.channel_fee_max_base_msat/1e3+" Sats":"")+(i.option_will_fund?.channel_fee_max_proportional_thousandths?1e3*i.option_will_fund?.channel_fee_max_proportional_thousandths+" ppm":"")+(i.address_types?i.address_types.reduce((iA,ne)=>iA+("tor"===ne?" tor":"ipv"===ne?" clearnet":" "+ne.toLowerCase()),""):"");break;case"alias":r=(i?.alias?.toLowerCase()||" ")+i?.address_types?.reduce((iA,ne)=>iA+(ne?"ipv"===ne?"clearnet":ne:"")," ")||"";break;case"last_timestamp":r=this.datePipe.transform(new Date(1e3*(i.last_timestamp||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"compact_lease":r=i?.option_will_fund?.compact_lease?.toLowerCase()||"";break;case"lease_fee":r=((i.option_will_fund?.lease_fee_base_msat||0)/1e3+" sats "||0)+((i.option_will_fund?.lease_fee_basis||0)/100+"%")||0;break;case"routing_fee":r=((i.option_will_fund?.channel_fee_max_base_msat||0)/1e3+" sats "||0)+(1e3*(i.option_will_fund?.channel_fee_max_proportional_thousandths||0)+" ppm")||0;break;default:r=typeof i[this.selFilterBy]>"u"?"":"string"==typeof i[this.selFilterBy]?i[this.selFilterBy].toLowerCase():"boolean"==typeof i[this.selFilterBy]?i[this.selFilterBy]?"yes":"no":i[this.selFilterBy].toString()}return r.includes(o)}}loadLiqNodesTable(i){this.liquidityNodes=new z.I6([...i]),this.liquidityNodes.sort=this.sort,this.liquidityNodes.sortingDataAccessor=(o,r)=>o[r]&&isNaN(o[r])?o[r].toLocaleLowerCase():o[r]?+o[r]:null,this.setFilterPredicate(),this.applyFilter(),this.liquidityNodes.paginator=this.paginator}viewLeaseOn(i,o){"LN"===o?window.open("https://lnrouter.app/node/"+i.nodeid,"_blank"):"AM"===o&&window.open("https://amboss.space/node/"+i.nodeid,"_blank")}onOpenChannel(i){this.store.dispatch((0,C.xO)({payload:{data:{alertTitle:"Open Channel",message:{node:i,balance:this.totalBalance,requestedAmount:this.channelAmount,feeRate:this.channel_opening_feeRate,localAmount:2e4},component:nw}}}))}onViewLeaseInfo(i){const o=i.addresses?.reduce((ne,re)=>(re.address&&re.address.length>40&&(re.address=re.address.substring(0,39)+"..."),ne.concat(JSON.stringify(re).replace("{","").replace("}","").replace(/:/g,": ").replace(/,/g,"        ").replace(/"/g,""))),[]),r=[];if(i.features&&""!==i.features.trim()){const ne=parseInt(i.features,16);B.TH.forEach(re=>{ne&1<{ne&&this.onOpenChannel(i)})}onDownloadCSV(){this.liquidityNodes.data&&this.liquidityNodes.data.length>0&&this.commonService.downloadFile(this.liquidityNodes.data,"LiquidityNodes")}onFilterReset(){this.node_capacity=0,this.channel_count=0}ngOnDestroy(){this.unSubs.forEach(i=>{i.next(null),i.complete()})}static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)(A.rXU(aA.gP),A.rXU(AA.il),A.rXU(Dt.u),A.rXU(L.h),A.rXU(b.H),A.rXU(de.vh),A.rXU(R.VD))},this.\u0275cmp=A.VBU({type:l,selectors:[["rtl-cln-liquidity-ads-list"]],viewQuery:function(o,r){if(1&o&&(A.GBs(pA.B4,5),A.GBs(H.iy,5)),2&o){let iA;A.mGM(iA=A.lsd())&&(r.sort=iA.first),A.mGM(iA=A.lsd())&&(r.paginator=iA.first)}},standalone:!1,features:[A.Jv_([{provide:OA.JO,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:H.xX,useValue:(0,B.on)("Liquidity Ads")}])],decls:83,vars:26,consts:[["formAsk","ngForm"],["table",""],["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"],[1,"padding-gap-large"],["fxLayout","column","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex.gt-xs","100","fxLayout","row",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","mt-1"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","30"],[1,"page-text"],["matTooltipPosition","above","matTooltipClass","pre-wrap",1,"info-icon","info-icon-primary",3,"matTooltip"],["fxLayout","column","fxFlex","34"],["autoFocus","","matInput","","name","channelAmount","tabindex","1","type","number","step","10000","required","",3,"ngModelChange","keyup","ngModel"],[4,"ngIf"],["matInput","","name","channel_opening_feeRate","type","number","step","10","tabindex","2","required","",3,"ngModelChange","keyup","ngModel"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container","mt-2"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModelChange","input","keyup","ngModel"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeid"],["matColumnDef","last_timestamp"],["matColumnDef","compact_lease"],["matColumnDef","lease_fee"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","routing_fee"],["matColumnDef","channel_opening_fee"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","funding_weight"],["matColumnDef","actions"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_lqNode"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center",1,"ellipsis-child"],["aria-label","Address Types",1,"ml-half"],["color","primary","selected","",4,"ngFor","ngForOf"],["color","primary","selected",""],[1,"ellipsis-child"],["mat-header-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(o,r){if(1&o){const iA=A.RV6();A.j41(0,"div",2),A.nrm(1,"fa-icon",3),A.j41(2,"span",4),A.EFF(3,"Liquidity Ads"),A.k0s()(),A.j41(4,"div",5)(5,"mat-card")(6,"mat-card-content",6)(7,"div",7)(8,"form",8,0)(10,"div",9),A.nrm(11,"fa-icon",10),A.j41(12,"span"),A.EFF(13,"Ads should be supplemented with additional research of the node, before buying liquidity."),A.k0s()(),A.j41(14,"div",11)(15,"div",12)(16,"span",13),A.EFF(17,"Liquidity Ask"),A.k0s(),A.j41(18,"mat-icon",14),A.EFF(19,"info_outline"),A.k0s()(),A.j41(20,"mat-form-field",15)(21,"mat-label"),A.EFF(22,"Channel Amount (Sats)"),A.k0s(),A.j41(23,"input",16),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.channelAmount,re)||(r.channelAmount=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onCalculateOpeningFee())}),A.k0s(),A.DNE(24,lw,2,0,"mat-error",17),A.k0s(),A.j41(25,"mat-form-field",15)(26,"mat-label"),A.EFF(27,"Channel Opening Fee Rate (Sats/vByte)"),A.k0s(),A.j41(28,"input",18),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.channel_opening_feeRate,re)||(r.channel_opening_feeRate=re),w.Njj(re)}),A.bIt("keyup",function(){return w.eBV(iA),w.Njj(r.onCalculateOpeningFee())}),A.k0s(),A.DNE(29,cw,2,0,"mat-error",17),A.k0s()()(),A.j41(30,"div",19)(31,"div",20),A.nrm(32,"fa-icon",3),A.j41(33,"span",4),A.EFF(34,"Liquidity Providing Peers"),A.k0s()(),A.j41(35,"div",21)(36,"mat-form-field",22)(37,"mat-label"),A.EFF(38,"Filter By"),A.k0s(),A.j41(39,"mat-select",23),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilterBy,re)||(r.selFilterBy=re),w.Njj(re)}),A.bIt("selectionChange",function(){return w.eBV(iA),r.selFilter="",w.Njj(r.applyFilter())}),A.j41(40,"perfect-scrollbar"),A.DNE(41,gw,2,2,"mat-option",24),A.k0s()()(),A.j41(42,"mat-form-field",22)(43,"mat-label"),A.EFF(44,"Filter"),A.k0s(),A.j41(45,"input",25),A.mxI("ngModelChange",function(re){return w.eBV(iA),A.DH7(r.selFilter,re)||(r.selFilter=re),w.Njj(re)}),A.bIt("input",function(){return w.eBV(iA),w.Njj(r.applyFilter())})("keyup",function(){return w.eBV(iA),w.Njj(r.applyFilter())}),A.k0s()()()(),A.j41(46,"div",26),A.DNE(47,Bw,1,0,"mat-progress-bar",27),A.j41(48,"table",28,1),A.qex(50,29),A.DNE(51,fw,2,0,"th",30)(52,hw,6,5,"td",31),A.bVm(),A.qex(53,32),A.DNE(54,Ew,2,0,"th",30)(55,ww,4,4,"td",31),A.bVm(),A.qex(56,33),A.DNE(57,Cw,2,0,"th",30)(58,dw,3,4,"td",31),A.bVm(),A.qex(59,34),A.DNE(60,Qw,2,0,"th",30)(61,mw,2,1,"td",31),A.bVm(),A.qex(62,35),A.DNE(63,Mw,2,0,"th",36)(64,pw,4,8,"td",31),A.bVm(),A.qex(65,37),A.DNE(66,Iw,2,0,"th",36)(67,Dw,4,8,"td",31),A.bVm(),A.qex(68,38),A.DNE(69,Fw,2,0,"th",39)(70,yw,4,4,"td",31),A.bVm(),A.qex(71,40),A.DNE(72,xw,2,0,"th",39)(73,Yw,4,4,"td",31),A.bVm(),A.qex(74,41),A.DNE(75,bw,6,0,"th",36)(76,vw,12,0,"td",42),A.bVm(),A.qex(77,43),A.DNE(78,Tw,4,3,"td",44),A.bVm(),A.DNE(79,Pw,1,3,"tr",45)(80,Uw,1,0,"tr",46)(81,Lw,1,0,"tr",47),A.k0s()(),A.nrm(82,"mat-paginator",48),A.k0s()()()()}2&o&&(A.R7$(),A.Y8G("icon",r.faBullhorn),A.R7$(10),A.Y8G("icon",r.faExclamationTriangle),A.R7$(7),A.Y8G("matTooltip",r.askTooltipMsg),A.R7$(5),A.R50("ngModel",r.channelAmount),A.R7$(),A.Y8G("ngIf",!r.channelAmount),A.R7$(4),A.R50("ngModel",r.channel_opening_feeRate),A.R7$(),A.Y8G("ngIf",!r.channel_opening_feeRate),A.R7$(3),A.Y8G("icon",r.faUsers),A.R7$(7),A.R50("ngModel",r.selFilterBy),A.R7$(2),A.Y8G("ngForOf",A.lJ4(22,sw).concat(r.displayedColumns.slice(0,-1))),A.R7$(4),A.R50("ngModel",r.selFilter),A.R7$(2),A.Y8G("ngIf",r.listNodesCallStatus===r.apiCallStatusEnum.INITIATED),A.R7$(),A.Y8G("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.liquidityNodes)("ngClass",A.eq3(23,rw,""!==r.errorMessage)),A.R7$(31),A.Y8G("matFooterRowDef",A.lJ4(25,aw)),A.R7$(),A.Y8G("matHeaderRowDef",r.displayedColumns),A.R7$(),A.Y8G("matRowDefColumns",r.displayedColumns),A.R7$(),A.Y8G("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[de.YU,de.Sq,de.bT,de.B3,hA.qT,hA.me,hA.Q0,hA.BC,hA.cb,hA.YS,hA.vS,hA.cV,P.aY,QA.RN,QA.m2,oA.An,UA.fg,yA.rl,yA.nJ,yA.TL,eA.HM,Q.DJ,Q.sA,Q.UI,dA.PW,dA.eI,iw.Jl,OA.VO,OA.$2,xA.wT,pA.B4,pA.aE,z.Zl,z.tL,z.ji,z.cC,z.YV,z.iL,z.Zq,z.xW,z.KS,z.$R,z.Qo,z.YZ,z.NB,z.iF,HA.oV,H.iy,M.ZF,M.Ld,cA.N,de.QX,de.vh],encapsulation:2}))}return n(),l})();const zw=[{path:"",component:t,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:Yr,canActivate:[(0,Vt.Wz)()]},{path:"onchain",component:So,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:xl,canActivate:[(0,Vt.Wz)()]},{path:"send/:selTab",component:Yl,data:{sweepAll:!1},canActivate:[(0,Vt.Wz)()]},{path:"sweep/:selTab",component:Yl,data:{sweepAll:!0},canActivate:[(0,Vt.Wz)()]}]},{path:"connections",component:To,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:Wl,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Ut,canActivate:[(0,Vt.Wz)()]},{path:"pending",component:r0,canActivate:[(0,Vt.Wz)()]},{path:"activehtlcs",component:Du,canActivate:[(0,Vt.Wz)()]}]},{path:"peers",component:P0,data:{sweepAll:!1},canActivate:[(0,Vt.Wz)()]}]},{path:"liquidityads",component:Gw,canActivate:[(0,Vt.Wz)()]},{path:"transactions",component:Uo,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:Z,canActivate:[(0,Vt.Wz)()]},{path:"invoices",component:Ot,canActivate:[(0,Vt.Wz)()]},{path:"offers",component:xh,canActivate:[(0,Vt.Wz)()]},{path:"offrBookmarks",component:tE,canActivate:[(0,Vt.Wz)()]}]},{path:"messages",component:Fl,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:rg,canActivate:[(0,Vt.Wz)()]},{path:"verify",component:ug,canActivate:[(0,Vt.Wz)()]}]},{path:"routing",component:Go,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Sc,canActivate:[(0,Vt.Wz)()]},{path:"failedtransactions",component:GB,canActivate:[(0,Vt.Wz)()]},{path:"localfail",component:UE,canActivate:[(0,Vt.Wz)()]},{path:"routingpeers",component:Sf,canActivate:[(0,Vt.Wz)()]}]},{path:"reports",component:yu,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:Tu,canActivate:[(0,Vt.Wz)()]},{path:"transactions",component:Ou,canActivate:[(0,Vt.Wz)()]}]},{path:"graph",component:Vu,canActivate:[(0,Vt.Wz)()],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:rl,canActivate:[(0,Vt.Wz)()]},{path:"queryroutes",component:ig,canActivate:[(0,Vt.Wz)()]}]},{path:"rates",component:Fc,canActivate:[(0,Vt.Wz)()]},{path:"**",component:Ju.X},{path:"network",redirectTo:"rates"},{path:"wallet",redirectTo:"home"},{path:"backup",redirectTo:"home"}]}],kw=Sn.iI.forChild(zw);var Hw=We(9029);let jw=(()=>{var n;class l{static#A=n=()=>(this.\u0275fac=function(o){return new(o||l)},this.\u0275mod=A.$C({type:l,bootstrap:[t]}),this.\u0275inj=w.G2t({imports:[de.MD,Hw.G,kw]}))}return n(),l})()},2643(Pi,Wi,We){var Mn,de=We(9293).default;Object(typeof self<"u"?self:this),Mn=()=>(()=>{var Sn={7133(eA,Q,f){"use strict";f.d(Q,{default:()=>xe}),f(187);var g=f(1771);function I($){return"string"==typeof $||$ instanceof String}function N($){return("number"==typeof $||$ instanceof Number)&&!Number.isNaN($)}function K($){return!(!N($)||!Number.isInteger($)||$<=0)}function v($){return null!==$&&!Array.isArray($)&&!I($)&&!N($)&&"object"==typeof $}function B($){return v($)&&0===Object.keys($).length}function j($){return null!=$}var tA=f(783).Buffer;const AA=class aA extends g.A{constructor(s,d,F,W,Z,EA,PA){void 0===s&&(s={}),void 0===d&&(d={}),void 0===F&&(F={}),void 0===W&&(W={}),void 0===Z&&(Z={}),void 0===EA&&(EA=null),void 0===PA&&(PA=void 0),super(Z),this.fonts={},this.fontCache={};for(let FA in s)if(s.hasOwnProperty(FA)){let te=s[FA];this.fonts[FA]={normal:te.normal,bold:te.bold,italics:te.italics,bolditalics:te.bolditalics}}this.patterns={};for(let FA in F)if(F.hasOwnProperty(FA)){let te=F[FA];this.patterns[FA]=this.pattern(te.boundingBox,te.xStep,te.yStep,te.pattern,te.colored)}this.images=d,this.attachments=W,this.virtualfs=EA,this.localAccessPolicy=PA}getFontType(s,d){return(($,s)=>{let d="normal";return $&&s?d="bolditalics":$?d="bold":s&&(d="italics"),d})(s,d)}getFontFile(s,d,F){let W=this.getFontType(d,F);return this.fonts[s]&&this.fonts[s][W]?this.fonts[s][W]:null}provideFont(s,d,F){let W=this.getFontType(d,F);if(null===this.getFontFile(s,d,F))throw new Error(`Font '${s}' in style '${W}' is not defined in the font section of the document definition.`);if(this.fontCache[s]=this.fontCache[s]||{},!this.fontCache[s][W]){let Z=this.fonts[s][W];Array.isArray(Z)||(Z=[Z]),this.virtualfs&&this.virtualfs.existsSync(Z[0])?Z[0]=this.virtualfs.readFileSync(Z[0]):this.validateLocalFile(Z[0]),this.fontCache[s][W]=this.font(...Z)._font}return this.fontCache[s][W]}provideImage(s){if(this._imageRegistry[s])return this._imageRegistry[s];let F,W=(Z=>{let EA=this.images[Z];if(!EA)return Z;if(this.virtualfs&&this.virtualfs.existsSync(EA))return this.virtualfs.readFileSync(EA);let PA=EA.indexOf("base64,");return PA<0?this.images[Z]:tA.from(EA.substring(PA+7),"base64")})(s);this.validateLocalFile(W);try{if(F=this.openImage(W),!F)throw new Error("No image")}catch(Z){throw new Error(`Invalid image: ${Z.toString()}\nImages dictionary should contain dataURL entries (or local file paths in node.js)`,{cause:Z})}return F.embed(this),this._imageRegistry[s]=F,F}providePattern(s){return Array.isArray(s)&&2===s.length?[this.patterns[s[0]],s[1]]:null}provideAttachment(s){const d=W=>{if(!W)throw new Error("No attachment");if(!W.src)throw new Error('The "src" key is required for attachments');return W};if("object"==typeof s)return d(s);let F=d(this.attachments[s]);return this.virtualfs&&this.virtualfs.existsSync(F.src)?this.virtualfs.readFileSync(F.src):(this.validateLocalFile(F.src),F)}resolveColor(s,d){return s=s||d,"function"==typeof this._normalizeColor&&I(s)&&null===this._normalizeColor(s)?d:s}setOpenActionAsPrint(){let s=this.ref({Type:"Action",S:"Named",N:"Print"});this._root.data.OpenAction=s,s.end()}file(s,d){return void 0===d&&(d={}),this.validateLocalFile(s),super.file(s,d)}validateLocalFile(s){if(!(typeof this.localAccessPolicy>"u")&&I(s)&&!/^data:/.test(s)&&!0!==this.localAccessPolicy(s))throw new Error(`Access to local file denied by resource access policy: ${s}`)}};function L($,s){return"font"===$?"font":s}function P($){return JSON.stringify($,L)}function rA($){if($.id)return $.id;if(Array.isArray($.text))for(let s of $.text){let d=rA(s);if(d)return d}return null}var NA=f(783).Buffer;const oA=$=>I($)?$.replace(/\t/g," "):N($)||"boolean"==typeof $?$.toString():!j($)||B($)?"":$,dA=class uA{preprocessDocument(s){return this.parentNode=null,this.tocs=[],this.nodeReferences=[],this.preprocessNode(s,!0)}preprocessBlock(s){return this.parentNode=null,this.tocs=[],this.nodeReferences=[],this.preprocessNode(s)}preprocessNode(s,d){if(void 0===d&&(d=!1),Array.isArray(s)?s={stack:s}:I(s)||N(s)||"boolean"==typeof s||!j(s)||B(s)?s={text:oA(s)}:"text"in s&&(s.text=oA(s.text)),s.section){if(!d)throw new Error(`Incorrect document structure, section node is only allowed at the root level of document structure: ${P(s)}`);return this.preprocessSection(s)}if(s.columns)return this.preprocessColumns(s);if(s.stack)return this.preprocessVerticalContainer(s,d);if(s.ul)return this.preprocessList(s);if(s.ol)return this.preprocessList(s);if(s.table)return this.preprocessTable(s);if(void 0!==s.text)return this.preprocessText(s);if(s.toc)return this.preprocessToc(s);if(s.image)return this.preprocessImage(s);if(s.svg)return this.preprocessSVG(s);if(s.canvas)return this.preprocessCanvas(s);if(s.qr)return this.preprocessQr(s);if(s.attachment)return this.preprocessAttachment(s);if(s.pageReference||s.textReference)return this.preprocessText(s);throw new Error(`Unrecognized document structure: ${P(s)}`)}preprocessSection(s){return s.section=this.preprocessNode(s.section),s}preprocessColumns(s){let d=s.columns;for(let F=0,W=d.length;F{s.styleOverrides.push(d)}),s}push(s){this.styleOverrides.push(s)}pop(s){for(void 0===s&&(s=1);s-- >0;)this.styleOverrides.pop()}autopush(s){if(I(s)||typeof s.section<"u")return 0;let d=[];s.style&&(d=Array.isArray(s.style)?s.style:[s.style]);for(let F=0,W=d.length;F0&&this.pop(F),W}getProperty(s){var d=this;const F=function(W,Z,EA){if(void 0===EA&&(EA=new Set),EA.has(W))return;EA.add(W);const PA=d.styleDictionary[W];if(PA){if(j(PA[Z]))return PA[Z];if(PA.extends){let FA=Array.isArray(PA.extends)?PA.extends:[PA.extends];for(let te=FA.length-1;te>=0;te--){let ge=F(FA[te],Z,EA);if(j(ge))return ge}}}};if(this.styleOverrides)for(let W=this.styleOverrides.length-1;W>=0;W--){let Z=this.styleOverrides[W];if(I(Z)){let EA=F(Z,s);if(j(EA))return EA}else if(j(Z[s]))return Z[s]}return this.defaultStyle&&this.defaultStyle[s]}static getStyleProperty(s,d,F,W){let Z;return j(s[F])?s[F]:d?(d.auto(s,()=>{Z=d.getProperty(F)}),j(Z)?Z:W):W}static copyStyle(s,d){void 0===s&&(s={}),void 0===d&&(d={});for(let F in s)"text"!=F&&s.hasOwnProperty(F)&&(d[F]=s[F]);return d}}const SA=Re,we=function($,s,d){void 0===d&&(d=!1);let F=[];if($=null==$?"":String($),s)return F.push({text:$}),F;if(d)return $.split("").map(PA=>PA.match(/^\n$|^\r$/)?{text:"",lineEnd:!0}:{text:PA});if(0===$.length)return F.push({text:""}),F;let EA,W=new H($),Z=0;for(;EA=W.nextBreak();){let PA=$.slice(Z,EA.position);EA.required||PA.match(/\r?\n$|\r$/)?(PA=PA.replace(/\r?\n$|\r$/,""),F.push({text:PA,lineEnd:!0})):F.push({text:PA}),Z=EA.position}return F},Fe=($,s)=>{let d=$[0];if(void 0===d)return null;if(s){let F=we(d.text,!1);if(void 0===F[0])return null;d=F[0]}return d.text},et=($,s)=>{let d=$[$.length-1];if(void 0===d||d.lineEnd)return null;if(s){let F=we(d.text,!1);if(void 0===F[F.length-1])return null;d=F[F.length-1]}return d.text},$e=class Ke{getBreaks(s,d){let F=[];Array.isArray(s)||(s=[s]);let W=null;for(let Z=0,EA=s.length;ZMath.max(0,Me.width-Me.leadingCut-Me.trailingCut);let EA,W=0,Z=0,PA=($=s,Array.isArray($)||($=[$]),$=function s(d){return d.reduce((F,W)=>{let Z=Array.isArray(W.text)?s(W.text):W,EA=[].concat(Z).some(Array.isArray);return F.concat(EA?s(Z):Z)},[])}($),$),te=(new $e).getBreaks(PA,d),ge=this.measure(te,d);var $;return ge.forEach(Me=>{W=Math.max(W,F(Me)),EA||(EA={width:0,leadingCut:Me.leadingCut,trailingCut:0}),EA.width+=Me.width,EA.trailingCut=Me.trailingCut,Z=Math.max(Z,F(EA)),Me.lineEnd&&(EA=null)}),SA.getStyleProperty({},d,"noWrap",!1)&&(W=Z),{items:ge,minWidth:W,maxWidth:Z}}measure(s,d){if(s.length){let F=SA.getStyleProperty(s[0],d,"leadingIndent",0);F&&(s[0].leadingCut=-F,s[0].leadingIndent=F)}return s.forEach(F=>{let W=SA.getStyleProperty(F,d,"font","Roboto"),Z=SA.getStyleProperty(F,d,"bold",!1),EA=SA.getStyleProperty(F,d,"italics",!1);F.font=this.pdfDocument.provideFont(W,Z,EA),F.alignment=SA.getStyleProperty(F,d,"alignment","left"),F.fontSize=SA.getStyleProperty(F,d,"fontSize",12),F.fontFeatures=SA.getStyleProperty(F,d,"fontFeatures",null),F.characterSpacing=SA.getStyleProperty(F,d,"characterSpacing",0),F.color=SA.getStyleProperty(F,d,"color","black"),F.decoration=SA.getStyleProperty(F,d,"decoration",null),F.decorationColor=SA.getStyleProperty(F,d,"decorationColor",null),F.decorationStyle=SA.getStyleProperty(F,d,"decorationStyle",null),F.decorationThickness=SA.getStyleProperty(F,d,"decorationThickness",null),F.background=SA.getStyleProperty(F,d,"background",null),F.link=SA.getStyleProperty(F,d,"link",null),F.linkToPage=SA.getStyleProperty(F,d,"linkToPage",null),F.linkToDestination=SA.getStyleProperty(F,d,"linkToDestination",null),F.noWrap=SA.getStyleProperty(F,d,"noWrap",null),F.opacity=SA.getStyleProperty(F,d,"opacity",1),F.sup=SA.getStyleProperty(F,d,"sup",!1),F.sub=SA.getStyleProperty(F,d,"sub",!1),(F.sup||F.sub)&&(F.fontSize*=.58);let PA=SA.getStyleProperty(F,d,"lineHeight",1);if(F.width=this.widthOfText(F.text,F),F.height=F.font.lineHeight(F.fontSize)*PA,F.leadingCut||(F.leadingCut=0),!SA.getStyleProperty(F,d,"preserveLeadingSpaces",!1)){let ge=F.text.match(ht);ge&&(F.leadingCut+=this.widthOfText(ge[0],F))}if(F.trailingCut=0,!SA.getStyleProperty(F,d,"preserveTrailingSpaces",!1)){let ge=F.text.match(cn);ge&&(F.trailingCut=this.widthOfText(ge[0],F))}},this),s}widthOfText(s,d){return d.font.widthOfString(s,d.fontSize,d.fontFeatures)+(d.characterSpacing||0)*(s.length-1)}sizeOfText(s,d){let F=SA.getStyleProperty({},d,"font","Roboto"),W=SA.getStyleProperty({},d,"fontSize",12),Z=SA.getStyleProperty({},d,"fontFeatures",null),EA=SA.getStyleProperty({},d,"bold",!1),PA=SA.getStyleProperty({},d,"italics",!1),FA=SA.getStyleProperty({},d,"lineHeight",1),te=SA.getStyleProperty({},d,"characterSpacing",0),ge=this.pdfDocument.provideFont(F,EA,PA);return{width:this.widthOfText(s,{font:ge,fontSize:W,characterSpacing:te,fontFeatures:Z}),height:ge.lineHeight(W)*FA,fontSize:W,lineHeight:FA,ascender:ge.ascender/1e3*W,descender:ge.descender/1e3*W}}sizeOfRotatedText(s,d,F){let W=d*Math.PI/-180,Z=this.sizeOfText(s,F);return{width:Math.abs(Z.height*Math.sin(W))+Math.abs(Z.width*Math.cos(W)),height:Math.abs(Z.width*Math.sin(W))+Math.abs(Z.height*Math.cos(W))}}};function Lt($){return"auto"===$.width}function Qn($){return null==$.width||"*"===$.width||"star"===$.width}const Gt_buildColumnWidths=function Tt($,s,d,F){void 0===d&&(d=0);let W=[],Z=0,EA=0,PA=[],FA=0,te=0,ge=[],Me=s;$.forEach(Ye=>{Lt(Ye)?(W.push(Ye),Z+=Ye._minWidth,EA+=Ye._maxWidth):Qn(Ye)?(PA.push(Ye),FA=Math.max(FA,Ye._minWidth),te=Math.max(te,Ye._maxWidth)):ge.push(Ye)}),ge.forEach((Ye,Ue)=>{if(I(Ye.width)&&/\d+%/.test(Ye.width)){let De=0;if(F){const Se=F._layout.paddingLeft(Ue,F),it=F._layout.paddingRight(Ue,F),Ve=F._layout.vLineWidth(Ue,F),vt=F._layout.vLineWidth(Ue+1,F);De=0===Ue?Se+it+Ve+vt/2:Ue===ge.length-1?Se+it+Ve/2+vt:Se+it+Ve/2+vt/2}const Le=Me+d;Ye.width=parseFloat(Ye.width)*Le/100-De}Ye._calcWidth=Ye.width=s)W.forEach(Ye=>{Ye._calcWidth=Ye._minWidth}),PA.forEach(Ye=>{Ye._calcWidth=FA});else{if(me{Ye._calcWidth=Ye._maxWidth,s-=Ye._calcWidth});else{let Ye=s-Qe,Ue=me-Qe;W.forEach(De=>{De._calcWidth=De._minWidth+(De._maxWidth-De._minWidth)*Ye/Ue,s-=De._calcWidth})}if(PA.length>0){let Ye=s/PA.length;PA.forEach(Ue=>{Ue._calcWidth=Ye})}}},Gt_measureMinMax=function pn($){let s={min:0,max:0},d={min:0,max:0},F=0;for(let W=0,Z=$.length;W0,vLineWidth:$=>0,paddingLeft:$=>$?4:0,paddingRight:($,s)=>$0===$||$===s.table.body.length?0:$===s.table.headerRows?2:0,vLineWidth:$=>0,paddingLeft:$=>0===$?0:8,paddingRight:($,s)=>$===s.table.widths.length-1?0:8},lightHorizontalLines:{hLineWidth:($,s)=>0===$||$===s.table.body.length?0:$===s.table.headerRows?2:1,vLineWidth:$=>0,hLineColor:$=>1===$?"black":"#aaa",paddingLeft:$=>0===$?0:8,paddingRight:($,s)=>$===s.table.widths.length-1?0:8}},Ot={hLineWidth:($,s)=>1,vLineWidth:($,s)=>1,hLineColor:($,s)=>"black",vLineColor:($,s)=>"black",hLineStyle:($,s)=>null,vLineStyle:($,s)=>null,paddingLeft:($,s)=>4,paddingRight:($,s)=>4,paddingTop:($,s)=>2,paddingBottom:($,s)=>2,fillColor:($,s)=>null,fillOpacity:($,s)=>1,defaultBorder:!0};function bt(){let $={};for(let s=0,d=arguments.length;sJSON.parse(JSON.stringify($))}for(var qe=[null,[[10,7,17,13],[1,1,1,1],[]],[[16,10,28,22],[1,1,1,1],[4,16]],[[26,15,22,18],[1,1,2,2],[4,20]],[[18,20,16,26],[2,1,4,2],[4,24]],[[24,26,22,18],[2,1,4,4],[4,28]],[[16,18,28,24],[4,2,4,4],[4,32]],[[18,20,26,18],[4,2,5,6],[4,20,36]],[[22,24,26,22],[4,2,6,6],[4,22,40]],[[22,30,24,20],[5,2,8,8],[4,24,44]],[[26,18,28,24],[5,4,8,8],[4,26,48]],[[30,20,24,28],[5,4,11,8],[4,28,52]],[[22,24,28,26],[8,4,11,10],[4,30,56]],[[22,26,22,24],[9,4,16,12],[4,32,60]],[[24,30,24,20],[9,4,16,16],[4,24,44,64]],[[24,22,24,30],[10,6,18,12],[4,24,46,68]],[[28,24,30,24],[10,6,16,17],[4,24,48,72]],[[28,28,28,28],[11,6,19,16],[4,28,52,76]],[[26,30,28,28],[13,6,21,18],[4,28,54,80]],[[26,28,26,26],[14,7,25,21],[4,28,56,84]],[[26,28,28,30],[16,8,25,20],[4,32,60,88]],[[26,28,30,28],[17,8,25,23],[4,26,48,70,92]],[[28,28,24,30],[17,9,34,23],[4,24,48,72,96]],[[28,30,30,30],[18,9,30,25],[4,28,52,76,100]],[[28,30,30,30],[20,10,32,27],[4,26,52,78,104]],[[28,26,30,30],[21,12,35,29],[4,30,56,82,108]],[[28,28,30,28],[23,12,37,34],[4,28,56,84,112]],[[28,30,30,30],[25,12,40,34],[4,32,60,88,116]],[[28,30,30,30],[26,13,42,35],[4,24,48,72,96,120]],[[28,30,30,30],[28,14,45,38],[4,28,52,76,100,124]],[[28,30,30,30],[29,15,48,40],[4,24,50,76,102,128]],[[28,30,30,30],[31,16,51,43],[4,28,54,80,106,132]],[[28,30,30,30],[33,17,54,45],[4,32,58,84,110,136]],[[28,30,30,30],[35,18,57,48],[4,28,56,84,112,140]],[[28,30,30,30],[37,19,60,51],[4,32,60,88,116,144]],[[28,30,30,30],[38,19,63,53],[4,28,52,76,100,124,148]],[[28,30,30,30],[40,20,66,56],[4,22,48,74,100,126,152]],[[28,30,30,30],[43,21,70,59],[4,26,52,78,104,130,156]],[[28,30,30,30],[45,22,74,62],[4,30,56,82,108,134,160]],[[28,30,30,30],[47,24,77,65],[4,24,52,80,108,136,164]],[[28,30,30,30],[49,25,81,68],[4,28,56,84,112,140,168]]],zA=/^\d*$/,vA=/^[A-Za-z0-9 $%*+\-./:]*$/,qA=/^[A-Z0-9 $%*+\-./:]*$/,ae=[],ce=[-1],ye=0,ke=1;ye<255;++ye)ae.push(ke),ce[ke]=ye,ke=2*ke^(ke>=128?285:0);var Je=[[]];for(ye=0;ye<30;++ye){for(var tt=Je[ye],je=[],Ce=0;Ce<=ye;++Ce)je.push(ce[(Ce6},ut=function($,s){var d=-8&function($){var s=qe[$],d=16*$*$+128*$+64;return Bt($)&&(d-=36),s[2].length&&(d-=25*s[2].length*s[2].length-10*s[2].length-55),d}($),F=qe[$];return d-8*F[0][s]*F[1][s]},an=function($,s){switch(s){case 1:return $<10?10:$<27?12:14;case 2:return $<10?9:$<27?11:13;case 4:return $<10?8:16;case 8:return $<10?8:$<27?10:12}},Wt=function($,s,d){var F=ut($,d)-4-an($,s);switch(s){case 1:return 3*(F/10|0)+(F%10<4?0:F%10<7?1:2);case 2:return 2*(F/11|0)+(F%11<6?0:1);case 4:return F/8|0;case 8:return F/13|0}},Bn=function($,s){for(var d=$.slice(0),F=$.length,W=s.length,Z=0;Z=0)for(var PA=0;PA=0;--Z)W>>F+Z&1&&(W^=d<>EA&1;return $},Un=function($){for(var Z=function(De){for(var Le=0,Se=0;Se=5&&(Le+=De[Se]-5+3);for(Se=5;Se=4*it||De[Se+1]>=4*it)&&(Le+=40)}return Le},EA=$.length,PA=0,FA=0,te=0;te>6,128|63&W):W<65536?d.push(224|W>>12,128|W>>6&63,128|63&W):d.push(240|W>>18,128|W>>12&63,128|W>>6&63,128|63&W)}return d}return s}}(EA,$),null===$)throw"invalid data format";if(Z<0||Z>3)throw"invalid ECC level";if(W<0){for(W=1;W<=40&&!($.length<=Wt(W,EA,Z));++W);if(W>40)throw"too large data for the Qr format"}else if(W<1||W>40)throw"invalid Qr version! should be between 1 and 40";if(-1!=PA&&(PA<0||PA>8))throw"invalid mask";return function($,s,d,F,W){var Z=qe[s],EA=function($,s,d,F){var W=[],Z=0,EA=8,PA=d.length,FA=function(Me,Qe){if(Qe>=EA){for(W.push(Z|Me>>(Qe-=EA));Qe>=8;)W.push(Me>>(Qe-=8)&255);Z=0,EA=8}Qe>0&&(Z|=(Me&(1<>3);EA=function($,s,d){for(var F=[],W=$.length/s|0,Z=0,EA=s-$.length%s,PA=0;PA>Ve&1,W[Ye+it][Ue+Ve]=1};for(EA(0,0,9,9,[127,65,93,93,93,65,383,0,64]),EA(d-8,0,8,9,[256,127,65,93,93,93,65,127]),EA(0,d-8,9,8,[254,130,186,186,186,130,254,0,0]),Z=9;Z>me++&1,W[Z][d-11+Me]=W[d-11+Me][Z]=1}return{matrix:F,reserved:W}}(s),FA=PA.matrix,te=PA.reserved;if(function($,s,d){for(var F=$.length,W=0,Z=-1,EA=F-1;EA>=0;EA-=2){6==EA&&--EA;for(var PA=Z<0?F-1:0,FA=0;FAEA-2;--te)s[PA][te]||($[PA][te]=d[W>>3]>>(7&~W)&1,++W);PA+=Z}Z=-Z}}(FA,te,EA),W<0){St(FA,te,0),vn(FA,0,F,0);var ge=0,Me=Un(FA);for(St(FA,te,0),W=1;W<8;++W){St(FA,te,W),vn(FA,0,F,W);var Qe=Un(FA);Me>Qe&&(Me=Qe,ge=W),St(FA,te,W)}W=ge}return St(FA,te,W),vn(FA,0,F,W),FA}($,W,EA,Z,PA)}const wi_measure=function Ei($){var s=function On($,s){var d=[],F=s.background||"#fff",W=s.foreground||"#000",Z=s.padding||0,EA=Fn($,s),PA=EA.length,FA=Math.floor(s.fit?s.fit/PA:5),te=PA*FA+FA*Z*2,ge=FA*Z;d.push({type:"rect",x:0,y:0,w:te,h:te,lineWidth:0,color:F});for(var Me=0;Me{if(s._margin=function QA($,s){function d(EA,PA,FA){return void 0===FA&&(FA=0),void 0!==EA.marginLeft||void 0!==EA.marginTop||void 0!==EA.marginRight||void 0!==EA.marginBottom?[EA.marginLeft??PA[0]??FA,EA.marginTop??PA[1]??FA,EA.marginRight??PA[2]??FA,EA.marginBottom??PA[3]??FA]:PA}function W(EA){return N(EA)?EA=[EA,EA,EA,EA]:Array.isArray(EA)&&2===EA.length&&(EA=[EA[0],EA[1],EA[0],EA[1]]),EA}let Z=[void 0,void 0,void 0,void 0];if($.style){let PA=function F(EA,PA,FA){if(void 0===FA&&(FA=new Set),!(EA=Array.isArray(EA)?EA:[EA]).every(ge=>I(ge)))return{};let te={};for(let ge=0;ges.fit[0]/s.fit[1]?s.fit[0]/d.width:s.fit[1]/d.height;s._width=s._minWidth=s._maxWidth=d.width*F,s._height=d.height*F}else if(s.cover)s._width=s._minWidth=s._maxWidth=s.cover.width,s._height=s._minHeight=s._maxHeight=s.cover.height;else{let F=N(s.width)?s.width:void 0,W=N(s.height)?s.height:void 0,Z=d.width/d.height;s._width=s._minWidth=s._maxWidth=F||(W?W*Z:d.width),s._height=W||(F?F/Z:d.height),N(s.maxWidth)&&s.maxWidths._width&&(s._width=s._minWidth=s._maxWidth=s.minWidth,s._height=s._width*d.height/d.width),N(s.minHeight)&&s.minHeight>s._height&&(s._height=s.minHeight,s._width=s._minWidth=s._maxWidth=s._height*d.width/d.height)}s._alignment=this.styleStack.getProperty("alignment")}convertIfBase64Image(s){if(/^data:image\/(jpeg|jpg|png);base64,/.test(s.image)){let d="$$pdfmake$$"+this.autoImageIndex++;this.pdfDocument.images[d]=s.image,s.image=d}}measureImage(s){this.convertIfBase64Image(s);let d=this.pdfDocument.provideImage(s.image),F={width:d.width,height:d.height};return d.orientation>4&&(F={width:d.height,height:d.width}),this.measureImageWithDimensions(s,F),s}measureSVG(s){let d=this.svgMeasure.measureSVG(s.svg);if(this.measureImageWithDimensions(s,d),s.font=this.styleStack.getProperty("font"),!N(s._width)&&!N(s._height))throw new Error("SVG is missing defined width and height.");if(!N(s._width))throw new Error("SVG is missing defined width.");if(!N(s._height))throw new Error("SVG is missing defined height.");return s.svg=this.svgMeasure.writeDimensions(s.svg,{width:s._width,height:s._height}),s}measureLeaf(s){s._textRef&&s._textRef._textNodeRef.text&&(s.text=s._textRef._textNodeRef.text);let d=this.styleStack.clone();d.push(s);let F=this.textInlines.buildInlines(s.text,d);return s._inlines=F.items,s._minWidth=F.minWidth,s._maxWidth=F.maxWidth,s}measureToc(s){if(s.toc.title&&(s.toc.title=this.measureNode(s.toc.title)),s.toc._items.length>0){let d=[],F=s.toc.textStyle||{},W=s.toc.numberStyle||F,Z=s.toc.textMargin||[0,0,0,0];"title"===s.toc.sortBy&&s.toc._items.sort((EA,PA)=>EA._textNodeRef.text.localeCompare(PA._textNodeRef.text,s.toc.sortLocale));for(let EA=0,PA=s.toc._items.length;EA=26?me((Ye/26|0)-1):"")+"abcdefghijklmnopqrstuvwxyz"[Ye%26|0]}(Qe-1)}function PA(Qe){if(Qe<1||Qe>4999)return Qe.toString();let me=Qe,Ye={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},Ue="";for(let De in Ye)for(;me>=Ye[De];)Ue+=De,me-=Ye[De];return Ue}let te;switch(W){case"none":te=null;break;case"upper-alpha":te=EA(d).toUpperCase();break;case"lower-alpha":te=EA(d);break;case"upper-roman":te=PA(d);break;case"lower-roman":te=PA(d).toLowerCase();break;default:te=function FA(Qe){return Qe.toString()}(d)}if(null===te)return{};Z&&(Array.isArray(Z)?(Z[0]&&(te=Z[0]+te),Z[1]&&(te+=Z[1]),te+=" "):te+=`${Z} `);let ge=SA.getStyleProperty(s,F,"markerColor",void 0)||F.getProperty("color")||"black";return{_inlines:this.textInlines.buildInlines({text:te,color:ge},F).items}}measureUnorderedList(s){let d=this.styleStack.clone(),F=s.ul;s.type=s.type||"disc",s._gapSize=this.gapSizeForList(),s._minWidth=0,s._maxWidth=0;for(let W=0,Z=F.length;W0?d.length-1:0;return s._minWidth=F.min+s._gap*W,s._maxWidth=F.max+s._gap*W,s}measureTable(s){(function Ue(De){if(De.table.widths||(De.table.widths="auto"),I(De.table.widths))for(De.table.widths=[De.table.widths];De.table.widths.length1?(me(Le,F,Se.colSpan),d.push({col:F,span:Se.colSpan,minWidth:Se._minWidth,maxWidth:Se._maxWidth})):(De._minWidth=Math.max(De._minWidth,Se._minWidth),De._maxWidth=Math.max(De._maxWidth,Se._maxWidth))),Se.rowSpan&&Se.rowSpan>1&&Ye(s.table,W,F,Se.rowSpan)}}!function Me(){let De,Le;for(let Se=0,it=d.length;Se0)for(De=zt/Ve.span,Le=0;Le0)for(De=sn/Ve.span,Le=0;Le(v(Le)&&(Le.fillColor=De.styleStack.getProperty("fillColor"),Le.fillOpacity=De.styleStack.getProperty("fillOpacity")),De.measureNode(Le))}function Qe(De,Le,Se){let it={minWidth:0,maxWidth:0};for(let Ve=0;Ves.page?$:s.page>$.page?s:$.y>s.y?$:s,{page:d.page,x:d.x,y:d.y,availableHeight:d.availableHeight,availableWidth:d.availableWidth}}const Xi=class xn extends ri.EventEmitter{constructor(){super(),this.pages=[],this.pageMargins=void 0,this.x=void 0,this.availableWidth=void 0,this.availableHeight=void 0,this.page=-1,this.snapshots=[],this.backgroundLength=[]}beginColumnGroup(s,d,F,W,Z){void 0===d&&(d={}),void 0===F&&(F=!1),void 0===W&&(W=0),void 0===Z&&(Z=null),this.snapshots.push({x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,page:this.page,bottomByPage:d||{},bottomMost:{x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,page:this.page},lastColumnWidth:this.lastColumnWidth,snakingColumns:F,gap:W,columnWidths:Z}),this.lastColumnWidth=0,s&&(this.marginXTopParent=s)}updateBottomByPage(){const s=this.snapshots[this.snapshots.length-1];if(!s)return;const d=this.page;let F=-Number.MIN_VALUE;s.bottomByPage&&s.bottomByPage[d]&&(F=s.bottomByPage[d]),s.bottomByPage&&(s.bottomByPage[d]=Math.max(F,this.y))}resetMarginXTopParent(){this.marginXTopParent=null}getSnakingSnapshot(){for(let s=this.snapshots.length-1;s>=0;s--)if(this.snapshots[s].snakingColumns)return this.snapshots[s];return null}inSnakingColumns(){return!!this.getSnakingSnapshot()}isInNestedNonSnakingGroup(){for(let s=this.snapshots.length-1;s>=0;s--){let d=this.snapshots[s];if(d.snakingColumns)return!1;if(!d.overflowed)return!0}return!1}beginColumn(s,d,F){let W=this.snapshots[this.snapshots.length-1];if(W&&W.overflowed)for(let Z=this.snapshots.length-1;Z>=0;Z--)if(!this.snapshots[Z].overflowed){W=this.snapshots[Z];break}this.calculateBottomMost(W,F),this.page=W.page,this.x=this.x+this.lastColumnWidth+(d||0),this.y=W.y,this.availableWidth=s,this.availableHeight=W.availableHeight,this.lastColumnWidth=s}calculateBottomMost(s,d){d?this.saveContextInEndingCell(d):s.bottomMost=Qi(this,s.bottomMost)}markEnding(s,d,F){this.page=s._columnEndingContext.page,this.x=s._columnEndingContext.x+d,this.y=s._columnEndingContext.y-F,this.availableWidth=s._columnEndingContext.availableWidth,this.availableHeight=s._columnEndingContext.availableHeight,this.lastColumnWidth=s._columnEndingContext.lastColumnWidth}saveContextInEndingCell(s){s._columnEndingContext={page:this.page,x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,lastColumnWidth:this.lastColumnWidth}}completeColumnGroup(s,d){let F=this.snapshots.pop(),W=this.y,Z=this.page,EA=this.availableHeight,PA=F.overflowed;for(;F&&F.overflowed;){let te=Qi({page:Z,y:W,availableHeight:EA},F.bottomMost||{});Z=te.page,W=te.y,EA=te.availableHeight,F=this.snapshots.pop()}if(!F)return{};PA&&(Z>F.bottomMost.page||Z===F.bottomMost.page&&W>F.bottomMost.y)&&(F.bottomMost={x:F.x,y:W,page:Z,availableHeight:EA,availableWidth:F.availableWidth}),this.calculateBottomMost(F,d),this.x=F.x;let FA=F.bottomMost.y;return s&&(F.page===F.bottomMost.page?F.y+s>FA&&(FA=F.y+s):FA+=s),this.y=FA,this.page=F.bottomMost.page,this.availableWidth=F.availableWidth,this.availableHeight=F.bottomMost.availableHeight,s&&(this.availableHeight-=FA-F.bottomMost.y),this.height=s&&F.bottomMost.y-F.y=0&&this.snapshots[FA].overflowed;FA--)F++;let W=d.columnWidths&&d.columnWidths[F]||this.lastColumnWidth||this.availableWidth,Z=d.columnWidths&&d.columnWidths[F+1]||W;this.lastColumnWidth=Z;let EA=this.x+(W||0)+(d.gap||0),PA=d.y;this.snapshots.push({x:EA,y:PA,availableHeight:d.availableHeight,availableWidth:Z,page:this.page,overflowed:!0,bottomMost:{x:EA,y:PA,availableHeight:d.availableHeight,availableWidth:Z,page:this.page},lastColumnWidth:Z,snakingColumns:!0,gap:d.gap,columnWidths:d.columnWidths}),this.x=EA,this.y=PA,this.availableHeight=d.availableHeight,this.availableWidth=Z;for(let FA=this.snapshots.length-2;FA>=0;FA--){let te=this.snapshots[FA];if(te.overflowed||te.snakingColumns)break;te.x=EA,te.y=PA,te.page=this.page,te.availableHeight=d.availableHeight,te.bottomMost&&(te.bottomMost.x=EA,te.bottomMost.y=PA,te.bottomMost.page=this.page,te.bottomMost.availableHeight=d.availableHeight)}return{prevY:s,y:this.y}}resetSnakingColumnsForNewPage(){let s=this.getSnakingSnapshot();if(!s)return;let d=this.pageMargins.top,F=this.getCurrentPage().pageSize.height-this.pageMargins.top-this.pageMargins.bottom,W=s.columnWidths?s.columnWidths[0]:this.lastColumnWidth||this.availableWidth;for(;this.snapshots.length>1&&this.snapshots[this.snapshots.length-1].overflowed;)this.snapshots.pop();this.x=this.marginXTopParent?this.pageMargins.left+this.marginXTopParent[0]:this.pageMargins.left,this.availableWidth=W,this.lastColumnWidth=W;for(let Z=0;Z0}initializePage(){this.y=this.pageMargins.top,this.availableHeight=this.getCurrentPage().pageSize.height-this.pageMargins.top-this.pageMargins.bottom;const s=this.pageSnapshot(),d=s.pageCtx,F=s.isSnapshot;d.availableWidth=this.getCurrentPage().pageSize.width-this.pageMargins.left-this.pageMargins.right,F&&this.marginXTopParent&&(d.availableWidth-=this.marginXTopParent[0],d.availableWidth-=this.marginXTopParent[1])}pageSnapshot(){return this.snapshots[0]?{pageCtx:this.snapshots[0],isSnapshot:!0}:{pageCtx:this,isSnapshot:!1}}moveTo(s,d){null!=s&&(this.x=s,this.availableWidth=this.getCurrentPage().pageSize.width-this.x-this.pageMargins.right),null!=d&&(this.y=d,this.availableHeight=this.getCurrentPage().pageSize.height-this.y-this.pageMargins.bottom)}moveToRelative(s,d){null!=s&&(this.x=this.x+s),null!=d&&(this.y=this.y+d)}beginDetachedBlock(){this.snapshots.push({x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,page:this.page,lastColumnWidth:this.lastColumnWidth})}endDetachedBlock(){let s=this.snapshots.pop();this.x=s.x,this.y=s.y,this.availableWidth=s.availableWidth,this.availableHeight=s.availableHeight,this.page=s.page,this.lastColumnWidth=s.lastColumnWidth}moveToNextPage(s){let d=this.page+1,F=this.page,W=this.y;if(this.snapshots.length>0){let EA=this.snapshots[this.snapshots.length-1];EA.bottomMost&&EA.bottomMost.y&&(W=Math.max(this.y,EA.bottomMost.y))}let Z=d>=this.pages.length;if(Z){let EA=this.availableWidth,PA=this.getCurrentPage().pageSize.orientation,FA=(($,s)=>(s=function ai($,s){return void 0===$?s:I($)&&"landscape"===$.toLowerCase()?"landscape":"portrait"}(s,$.pageSize.orientation),s!==$.pageSize.orientation?{orientation:s,width:$.pageSize.height,height:$.pageSize.width}:{orientation:$.pageSize.orientation,width:$.pageSize.width,height:$.pageSize.height}))(this.getCurrentPage(),s);this.addPage(FA,null,this.getCurrentPage().customProperties),PA===FA.orientation&&(this.availableWidth=EA)}else this.page=d,this.initializePage();return{newPageCreated:Z,prevPage:F,prevY:W,y:this.y}}addPage(s,d,F){void 0===d&&(d=null),void 0===F&&(F={}),null!==d&&(this.pageMargins=d,this.x=d.left,this.availableWidth=s.width-d.left-d.right);let W={items:[],pageSize:s,pageMargins:this.pageMargins,customProperties:F};return this.pages.push(W),this.backgroundLength.push(0),this.page=this.pages.length-1,this.initializePage(),this.emit("pageAdded",W),W}getCurrentPage(){return this.page<0||this.page>=this.pages.length?null:this.pages[this.page]}getCurrentPosition(){let s=this.getCurrentPage().pageSize,d=s.height-this.pageMargins.top-this.pageMargins.bottom,F=s.width-this.pageMargins.left-this.pageMargins.right;return{pageNumber:this.page+1,pageOrientation:s.orientation,pageInnerHeight:d,pageInnerWidth:F,left:this.x,top:this.y,verticalRatio:(this.y-this.pageMargins.top)/d,horizontalRatio:(this.x-this.pageMargins.left)/F}}};function fn($,s,d){null==d||d<0||d>$.items.length?$.items.push(s):$.items.splice(d,0,s)}const ms=class mi extends ri.EventEmitter{constructor(s){super(),this._context=s,this.contextStack=[]}context(){return this._context}addLine(s,d,F){let W=s.getHeight(),Z=this.context(),EA=Z.getCurrentPage(),PA=this.getCurrentPositionOnPage();return!(Z.availableHeight0&&s.inlines[0].alignment,Z=0;switch(W){case"right":Z=d-F;break;case"center":Z=(d-F)/2}if(Z&&(s.x=(s.x||0)+Z),"justify"===W&&!s.newLineForced&&!s.lastLineInParagraph&&s.inlines.length>1){let EA=(d-F)/(s.inlines.length-1);for(let PA=1,FA=s.inlines.length;PA0)&&(void 0===s._x&&(s._x=s.x||0),s.x=F.x+s._x,s.y=F.y,this.alignImage(s),fn(W,{type:"image",item:s},d),F.moveDown(s._height),Z)}addCanvas(s,d){let F=this.context(),W=F.getCurrentPage(),Z=[],EA=s._minHeight;return!(!W||void 0===s.absolutePosition&&F.availableHeight0)&&(void 0===s._x&&(s._x=s.x||0),s.x=F.x+s._x,s.y=F.y,this.alignImage(s),fn(W,{type:"svg",item:s},d),F.moveDown(s._height),Z)}addQr(s,d){let F=this.context(),W=F.getCurrentPage(),Z=this.getCurrentPositionOnPage();if(!W||void 0===s.absolutePosition&&F.availableHeight0)&&(void 0===s._x&&(s._x=s.x||0),s.x=F.x+s._x,s.y=F.y,fn(W,{type:"attachment",item:s},d),F.moveDown(s._height),Z)}alignImage(s){let d=this.context().availableWidth,F=s._minWidth,W=0;switch(s._alignment){case"right":W=d-F;break;case"center":W=(d-F)/2}W&&(s.x=(s.x||0)+W)}alignCanvas(s){let d=this.context().availableWidth,F=s._minWidth,W=0;switch(s._alignment){case"right":W=d-F;break;case"center":W=(d-F)/2}W&&s.canvas.forEach(Z=>{Dt(Z,W,0)})}addVector(s,d,F,W,Z){let EA=this.context(),PA=EA.getCurrentPage();N(Z)&&(PA=EA.pages[Z]);let FA=this.getCurrentPositionOnPage();if(PA)return Dt(s,d?0:EA.x,F?0:EA.y),fn(PA,{type:"vector",item:s},W),FA}beginClip(s,d){let F=this.context();return F.getCurrentPage().items.push({type:"beginClip",item:{x:F.x,y:F.y,width:s,height:d}}),!0}endClip(){return this.context().getCurrentPage().items.push({type:"endClip"}),!0}beginVerticalAlignment(s){let F={type:"beginVerticalAlignment",item:{verticalAlignment:s}};return this.context().getCurrentPage().items.push(F),F}endVerticalAlignment(s){let F={type:"endVerticalAlignment",item:{verticalAlignment:s}};return this.context().getCurrentPage().items.push(F),F}addFragment(s,d,F,W){let Z=this.context(),EA=Z.getCurrentPage();return!(!d&&s.height>Z.availableHeight||(s.items.forEach(PA=>{switch(PA.type){case"line":var FA=PA.item.clone();FA._node&&(FA._node.positions[0].pageNumber=Z.page+1),FA.x=(FA.x||0)+(d?s.xOffset||0:Z.x),FA.y=(FA.y||0)+(F?s.yOffset||0:Z.y),EA.items.push({type:"line",item:FA});break;case"vector":var te=bt(PA.item);Dt(te,d?s.xOffset||0:Z.x,F?s.yOffset||0:Z.y),te._isFillColorFromUnbreakable?(delete te._isFillColorFromUnbreakable,EA.items.splice(Z.backgroundLength[Z.page],0,{type:"vector",item:te})):EA.items.push({type:"vector",item:te});break;case"image":case"svg":case"beginClip":case"endClip":case"beginVerticalAlignment":case"endVerticalAlignment":var ge=bt(PA.item);ge.x=(ge.x||0)+(d?s.xOffset||0:Z.x),ge.y=(ge.y||0)+(F?s.yOffset||0:Z.y),EA.items.push({type:PA.type,item:ge})}}),W||Z.moveDown(s.height),0))}pushContext(s,d){if(void 0===s&&(d=this.context().getCurrentPage().height-this.context().pageMargins.top-this.context().pageMargins.bottom,s=this.context().availableWidth),N(s)){let F=s;(s=new Xi).addPage({width:F,height:d},{left:0,right:0,top:0,bottom:0})}this.contextStack.push(this.context()),this._context=s}popContext(){this._context=this.contextStack.pop()}getCurrentPositionOnPage(){return(this.contextStack[0]||this.context()).getCurrentPosition()}},Ms={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]};function Mi($,s){$&&"auto"===$.height&&($.height=1/0);let W=function F(Z){if(I(Z)){let EA=Ms[Z.toUpperCase()];if(!EA)throw new Error(`Page size ${Z} not recognized`);return{width:EA[0],height:EA[1]}}return Z}($||"A4");return function d(Z){return!!I(Z)&&("portrait"===(Z=Z.toLowerCase())&&W.width>W.height||"landscape"===Z&&W.widthW.height?"landscape":"portrait",W}function pi($){if(N($))$={left:$,right:$,top:$,bottom:$};else if(Array.isArray($))if(2===$.length)$={left:$[0],top:$[1],right:$[0],bottom:$[1]};else{if(4!==$.length)throw new Error("Invalid pageMargins definition");$={left:$[0],top:$[1],right:$[2],bottom:$[3]}}return $}const qi=class Zi extends ms{constructor(s){super(s),this.transactionLevel=0,this.repeatables=[]}addLine(s,d,F){return this._fitOnPage(()=>super.addLine(s,d,F))}addImage(s,d){return this._fitOnPage(()=>super.addImage(s,d))}addCanvas(s,d){return this._fitOnPage(()=>super.addCanvas(s,d))}addSVG(s,d){return this._fitOnPage(()=>super.addSVG(s,d))}addQr(s,d){return this._fitOnPage(()=>super.addQr(s,d))}addAttachment(s,d){return this._fitOnPage(()=>super.addAttachment(s,d))}addVector(s,d,F,W,Z){return super.addVector(s,d,F,W,Z)}beginClip(s,d){return super.beginClip(s,d)}endClip(){return super.endClip()}beginVerticalAlignment(s){return super.beginVerticalAlignment(s)}endVerticalAlignment(s){return super.endVerticalAlignment(s)}addFragment(s,d,F,W){return this._fitOnPage(()=>super.addFragment(s,d,F,W))}moveToNextPage(s){let d=this.context().moveToNextPage(s);this.repeatables.forEach(function(F){void 0===F.insertedOnPages[this.context().page]?(F.insertedOnPages[this.context().page]=!0,this.addFragment(F,!0)):this.context().moveDown(F.height)},this),this.emit("pageChanged",{prevPage:d.prevPage,prevY:d.prevY,y:this.context().y})}addPage(s,d,F,W){void 0===W&&(W={});let Z=this.page,EA=this.y;this.context().addPage(Mi(s,d),pi(F),W),this.emit("pageChanged",{prevPage:Z,prevY:EA,y:this.context().y})}beginUnbreakableBlock(s,d){0===this.transactionLevel++&&(this.originalX=this.context().x,this.pushContext(s,d))}commitUnbreakableBlock(s,d){if(0===--this.transactionLevel){let F=this.context();this.popContext();let W=F.pages.length;if(W>0){let Z=F.pages[0];if(Z.xOffset=s,Z.yOffset=d,W>1)if(void 0!==s||void 0!==d)Z.height=F.getCurrentPage().pageSize.height-F.pageMargins.top-F.pageMargins.bottom;else{Z.height=this.context().getCurrentPage().pageSize.height-this.context().pageMargins.top-this.context().pageMargins.bottom;for(let EA=0,PA=this.repeatables.length;EA{d.items.push(F)}),d.xOffset=this.originalX,d.height=s.y,d.insertedOnPages=[],d}pushToRepeatables(s){this.repeatables.push(s)}popFromRepeatables(){this.repeatables.pop()}moveToNextColumn(){let s=this.context().moveToNextColumn();this.repeatables.forEach(function(d){this.addFragment(d,!1)},this),this.emit("columnChanged",{prevY:s.prevY,y:this.context().y})}canMoveToNextColumn(){let s=this.context(),d=s.getSnakingSnapshot();if(d){for(let Qe=s.snapshots.length-1;Qe>=0;Qe--){let me=s.snapshots[Qe];if(me.snakingColumns)break;if(!me.overflowed)return!1}let F=0;for(let Qe=s.snapshots.length-1;Qe>=0&&s.snapshots[Qe].overflowed;Qe--)F++;if(d.columnWidths&&F>=d.columnWidths.length-1)return!1;let W=s.availableWidth||s.lastColumnWidth||0,Z=d.columnWidths?d.columnWidths[F+1]:W,EA=s.x+W+(d.gap||0),PA=s.getCurrentPage();return EA+Z<=PA.pageSize.width-(PA.pageMargins?PA.pageMargins.right:0)-(s.marginXTopParent?s.marginXTopParent[1]:0)+1}return!1}_fitOnPage(s){let d=s();if(!d&&(this.canMoveToNextColumn()&&(this.moveToNextColumn(),d=s()),!d)){let F=this.context();if(F.getSnakingSnapshot()){if(F.isInNestedNonSnakingGroup())this.moveToNextPage();else{this.moveToNextPage();let Z=F.lastColumnWidth;F.resetSnakingColumnsForNewPage(),F.lastColumnWidth=Z}d=s()}else{for(;F.snapshots.length>0&&F.snapshots[F.snapshots.length-1].overflowed;){let Z=F.snapshots.pop(),EA=F.snapshots[F.snapshots.length-1];EA&&(F.x=EA.x,F.y=EA.y,F.availableHeight=EA.availableHeight,F.availableWidth=Z.availableWidth,F.lastColumnWidth=EA.lastColumnWidth)}this.moveToNextPage(),d=s()}}return d}},$i=new Set(["before","beforeOdd","beforeEven","after","afterOdd","afterEven"]),ps=$=>!(!$||"object"!=typeof $)&&$i.has($.pageBreak),Is=class As{constructor(s){this.tableNode=s,this._isCurrentRowUnbreakable=!1}beginTable(s){let Z,EA;Z=this.tableNode,this.offsets=Z._offsets,this.layout=Z._layout,EA=s.context().availableWidth-this.offsets.total,Gt_buildColumnWidths(Z.table.widths,EA,this.offsets.total,Z),this.tableWidth=Z._offsets.total+(()=>{let FA=0;return Z.table.widths.forEach(te=>{FA+=te._calcWidth}),FA})(),this.rowSpanData=(()=>{let ge,FA=[],te=0;FA.push({left:0,rowSpan:0});for(let Me=0,Qe=this.tableNode.table.body[0].length;MeZ.table.body.length)throw new Error(`Too few rows in the table. Property headerRows requires at least ${this.headerRows}, contains only ${Z.table.body.length}`);this.rowsWithoutPageBreak=this.headerRows;const FA=Z.table.keepWithHeaderRows;K(FA)&&(this.rowsWithoutPageBreak+=FA)}this.dontBreakRows=Z.table.dontBreakRows||!1,(this.rowsWithoutPageBreak||this.dontBreakRows)&&(s.beginUnbreakableBlock(),this.drawHorizontalLine(0,s),this.rowsWithoutPageBreak&&this.dontBreakRows&&s.beginUnbreakableBlock()),(FA=>{for(let ge=0;ge0&&te(ge+De,Qe,0,me.border[0]),void 0!==me.border[2]&&te(ge+De,Qe+Ue-1,2,me.border[2]);for(let De=0;De0&&te(ge,Qe+De,1,me.border[1]),void 0!==me.border[3]&&te(ge+Ye-1,Qe+De,3,me.border[3])}}}function te(ge,Me,Qe,me){let Ye=FA[ge][Me];Ye.border=Ye.border||{},Ye.border[Qe]=me}})(this.tableNode.table.body)}onRowBreak(s,d){return()=>{let F=this.rowPaddingTop+(this.headerRows?0:this.topLineWidth);d.context().availableHeight-=this.reservedAtBottom,d.context().moveDown(F)}}beginRow(s,d){this.topLineWidth=this.layout.hLineWidth(s,this.tableNode),this.rowPaddingTop=this.layout.paddingTop(s,this.tableNode),this.bottomLineWidth=this.layout.hLineWidth(s+1,this.tableNode),this.rowPaddingBottom=this.layout.paddingBottom(s,this.tableNode),this.rowCallback=this.onRowBreak(s,d),d.addListener("pageChanged",this.rowCallback),0==s&&!this.dontBreakRows&&!this.rowsWithoutPageBreak&&(this._tableTopBorderY=d.context().y,d.context().moveDown(this.topLineWidth)),this.rowTopPageY=d.context().y+this.rowPaddingTop;const W=(this.tableNode.table.body[s]||[]).some(ps);this._isCurrentRowUnbreakable=this.dontBreakRows&&s>0&&!W,this._isCurrentRowUnbreakable&&d.beginUnbreakableBlock(),this.rowTopY=d.context().y,this.reservedAtBottom=this.bottomLineWidth+this.rowPaddingBottom,d.context().availableHeight-=this.reservedAtBottom,d.context().moveDown(this.rowPaddingTop)}drawHorizontalLine(s,d,F,W,Z){void 0===W&&(W=!0);let EA=this.layout.hLineWidth(s,this.tableNode);if(EA){let Me,ge=this.layout.hLineStyle(s,this.tableNode);ge&&ge.dash&&(Me=ge.dash);let Ue,De,Le,Qe=EA/2,me=null,Ye=this.tableNode.table.body;for(let Se=0,it=this.rowSpanData.length;Se0&&(Ue=Ye[s-1][Se],(FA=Ue.border?Ue.border[3]:this.layout.defaultBorder)&&Ue.borderColor&&(zt=Ue.borderColor[3])),sgn;)me.width+=this.rowSpanData[Se+gn++].width||0;Se+=gn-1}else if(Ue&&Ue.colSpan&&FA){for(;Ue.colSpan>gn;)me.width+=this.rowSpanData[Se+gn++].width||0;Se+=gn-1}else if(De&&De.colSpan&&PA){for(;De.colSpan>gn;)me.width+=this.rowSpanData[Se+gn++].width||0;Se+=gn-1}else me.width+=this.rowSpanData[Se].width||0}let sn=(F||0)+Qe;vt&&me&&me.width&&(d.addVector({type:"line",x1:me.left,x2:me.left+me.width,y1:sn,y2:sn,lineWidth:EA,dash:Me,lineColor:zt},!1,N(F),null,Z),me=null,Ue=null,De=null,Le=null)}W&&d.context().moveDown(EA)}}drawVerticalLine(s,d,F,W,Z,EA,PA){let FA=this.layout.vLineWidth(W,this.tableNode);if(0===FA)return;let ge,te=this.layout.vLineStyle(W,this.tableNode);te&&te.dash&&(ge=te.dash);let Qe,me,Ye,Me=this.tableNode.table.body;if(W>0&&(Qe=Me[EA][PA],Qe&&Qe.borderColor&&(Qe.border?Qe.border[2]:this.layout.defaultBorder)&&(Ye=Qe.borderColor[2])),null==Ye&&W{let Se=[],it=0;for(let Ve=0,vt=this.tableNode.table.body[s].length;Ve0&&it--}return Se.push({x:this.rowSpanData[this.rowSpanData.length-1].left,index:this.rowSpanData.length-1}),Se})(),FA=[],te=F&&F.length>0,ge=this.tableNode.table.body;if(FA.push({y0:this.rowTopY,page:te?F[0].prevPage:Z}),te)for(let Se=0,it=F.length;Se0&&(Se=F[0].prevPage),this.drawHorizontalLine(0,d,this._tableTopBorderY,!1,Se)}for(let Se=Me?1:0,it=FA.length;Se0&&!this.headerRows,zt=vt?0:this.topLineWidth,sn=FA[Se].y0,gn=FA[Se].y1;Ve&&(gn+=this.rowPaddingBottom),d.context().page!=FA[Se].page&&(d.context().page=FA[Se].page,this.reservedAtBottom=0),Ve&&!1!==this.layout.hLineWhenBroken&&this.drawHorizontalLine(s+1,d,gn),vt&&!1!==this.layout.hLineWhenBroken&&this.drawHorizontalLine(s,d,sn);for(let Tn=0,rs=PA.length;Tn0&&!kn){let dn=ge[s][Xt-1];kn=dn.border?dn.border[2]:this.layout.defaultBorder}if(Xt+11)for(let Ve=1;Ve1)for(let Ve=1;Ve0&&this.rowSpanData[Se].rowSpan--}if(this.drawHorizontalLine(s+1,d),this.headerRows&&s===this.headerRows-1&&(this.headerRepeatable=d.currentBlockToRepeatable()),this.dontBreakRows&&(0===s||this._isCurrentRowUnbreakable)){const Se=()=>{s>0&&!this.headerRows&&!1!==this.layout.hLineWhenBroken&&this.drawHorizontalLine(s,d)};d.addListener("pageChanged",Se),d.commitUnbreakableBlock(),d.removeListener("pageChanged",Se)}this._isCurrentRowUnbreakable=!1,this.headerRepeatable&&(s===this.rowsWithoutPageBreak-1||s===this.tableNode.table.body.length-1)&&(d.commitUnbreakableBlock(),d.pushToRepeatables(this.headerRepeatable),this.cleanUpRepeatables=!0,this.headerRepeatable=null)}};class Ui{constructor(s){this.maxWidth=s,this.leadingCut=0,this.trailingCut=0,this.inlineWidths=0,this.inlines=[]}addInline(s){0===this.inlines.length&&(this.leadingCut=s.leadingCut||0),this.trailingCut=s.trailingCut||0,s.x=this.inlineWidths-this.leadingCut,this.inlines.push(s),this.inlineWidths+=s.width,s.lineEnd&&(this.newLineForced=!0)}getHeight(){let s=0;return this.inlines.forEach(d=>{s=Math.max(s,d.height||0)}),s}getAscenderHeight(){let s=0;return this.inlines.forEach(d=>{s=Math.max(s,d.font.ascender/1e3*d.fontSize)}),s}getWidth(){return this.inlineWidths-this.leadingCut-this.trailingCut}getAvailableWidth(){return this.maxWidth-this.getWidth()}hasEnoughSpaceForInline(s,d){if(void 0===d&&(d=[]),0===this.inlines.length)return!0;if(this.newLineForced)return!1;let F=s.width,W=s.trailingCut||0;if(s.noNewLine)for(let Z=0,EA=d.length;Z{$.push(d)})}const Li=class Ds{constructor(s,d,F){this.pageSize=s,this.pageMargins=d,this.svgMeasure=F,this.tableLayouts={},this.nestedLevel=0,this.verticalAlignmentItemStack=[]}registerTableLayouts(s){this.tableLayouts=bt(this.tableLayouts,s)}layoutDocument(s,d,F,W,Z,EA,PA,FA,te){function ge(me,Ye){if("function"!=typeof te)return!1;(me=me.filter(De=>!(!De||0===De.positions.length||""===De.text&&!De.listMarker))).forEach(De=>{let Le={};["id","text","ul","ol","table","image","qr","canvas","svg","columns","headlineLevel","style","pageBreak","pageOrientation","width","height"].forEach(Se=>{void 0!==De[Se]&&(Le[Se]=De[Se])}),Le.startPosition=De.positions[0],Le.pageNumbers=Array.from(new Set(De.positions.map(Se=>Se.pageNumber))),Le.pages=Ye.length,Le.stack=Array.isArray(De.stack),De.nodeInfo=Le});for(let De=0;De{let it=[];for(let Ve=De+1,vt=me.length;Ve-1&&it.push(me[Ve].nodeInfo);return it},getNodesOnNextPage:()=>{let it=[];for(let Ve=De+1,vt=me.length;Ve-1&&it.push(me[Ve].nodeInfo);return it},getPreviousNodesOnPage:()=>{let it=[];for(let Ve=0;Ve-1&&it.push(me[Ve].nodeInfo);return it}}))return Le.pageBreak="before",!0}}return!1}function Me(me){me.linearNodeList.forEach(Ye=>{Ye.resetXY()})}this.docPreprocessor=new dA,this.docMeasure=new di(d,F,W,this.svgMeasure,this.tableLayouts);let Qe=this.tryLayoutDocument(s,d,F,W,Z,EA,PA,FA);for(;ge(Qe.linearNodeList,Qe.pages);)Me(Qe),Qe=this.tryLayoutDocument(s,d,F,W,Z,EA,PA,FA);return Qe.pages}tryLayoutDocument(s,d,F,W,Z,EA,PA,FA){return this.linearNodeList=[],s=this.docPreprocessor.preprocessDocument(s),s=this.docMeasure.measureDocument(s),this.writer=new qi(new Xi),this.writer.context().addListener("pageAdded",ge=>{let Me=Z;(ge.customProperties.background||null===ge.customProperties.background)&&(Me=ge.customProperties.background),this.addBackground(Me)}),!((ge=s).stack&&ge.stack.length>0&&ge.stack[0].section||ge.section)&&this.writer.addPage(this.pageSize,null,this.pageMargins),this.processNode(s),this.addHeadersAndFooters(EA,PA),this.addWatermark(FA,d,W),{pages:this.writer.context().pages,linearNodeList:this.linearNodeList};var ge}addBackground(s){let d="function"==typeof s?s:()=>s,F=this.writer.context(),W=F.getCurrentPage().pageSize,Z=d(F.page+1,W);Z&&(this.writer.beginUnbreakableBlock(W.width,W.height),Z=this.docPreprocessor.preprocessBlock(Z),this.processNode(this.docMeasure.measureBlock(Z)),this.writer.commitUnbreakableBlock(0,0),F.backgroundLength[F.page]+=Z.positions.length)}addDynamicRepeatable(s,d,F){for(let Z=0,EA=this.writer.context().pages.length;Z"u"||null===FA)continue;let te=FA(Z+1,EA,this.writer.context().pages[Z].pageSize);if(te){let ge=d(this.writer.context().getCurrentPage().pageSize,this.writer.context().getCurrentPage().pageMargins);this.writer.beginUnbreakableBlock(ge.width,ge.height),te=this.docPreprocessor.preprocessBlock(te),this.processNode(this.docMeasure.measureBlock(te)),this.writer.commitUnbreakableBlock(ge.x,ge.y)}}}addHeadersAndFooters(s,d){this.addDynamicRepeatable(s,(Z,EA)=>({x:0,y:0,width:Z.width,height:EA.top}),"header"),this.addDynamicRepeatable(d,(Z,EA)=>({x:0,y:Z.height-EA.bottom,width:Z.width,height:EA.bottom}),"footer")}addWatermark(s,d,F){let W=this.writer.context().pages;for(let FA=0,te=W.length;FA1;)Qe.push({fontSize:De}),me=Me.sizeOfRotatedText(te.text,te.angle,Qe),me.width>FA.width?(Ue=De,De=(Ye+Ue)/2):me.widthFA.height?(Ue=De,De=(Ye+Ue)/2):(Ye=De,De=(Ye+Ue)/2)),Qe.pop();return De}(te,FA,ge));let Qe={text:FA.text,font:ge.provideFont(FA.font,FA.bold,FA.italics),fontSize:FA.fontSize,color:FA.color,opacity:FA.opacity,angle:FA.angle};return Qe._size=function EA(FA,te){let ge=new mt(te),Me=new SA(null,{font:FA.font,bold:FA.bold,italics:FA.italics});return Me.push({fontSize:FA.fontSize}),{size:ge.sizeOfText(FA.text,Me),rotatedSize:ge.sizeOfRotatedText(FA.text,FA.angle,Me)}}(FA,ge),Qe}}processNode(s,d){if(void 0===d&&(d=!1),this.linearNodeList.push(s),function Fs($){let s=$.x,d=$.y;$.positions=[],Array.isArray($.canvas)&&$.canvas.forEach(F=>{let W=F.x,Z=F.y,EA=F.x1,PA=F.y1,FA=F.x2,te=F.y2;F.resetXY=()=>{F.x=W,F.y=Z,F.x1=EA,F.y1=PA,F.x2=FA,F.y2=te}}),$.resetXY=()=>{$.x=s,$.y=d,Array.isArray($.canvas)&&$.canvas.forEach(F=>{F.resetXY()})}}(s),null!==this.writer.context().getCurrentPage())var W=this.writer.context().getCurrentPosition().top;(Z=>{let EA=s._margin;"before"===s.pageBreak?this.writer.moveToNextPage(s.pageOrientation):"beforeOdd"===s.pageBreak?(this.writer.moveToNextPage(s.pageOrientation),(this.writer.context().page+1)%2==1&&this.writer.moveToNextPage(s.pageOrientation)):"beforeEven"===s.pageBreak&&(this.writer.moveToNextPage(s.pageOrientation),(this.writer.context().page+1)%2==0&&this.writer.moveToNextPage(s.pageOrientation));const PA=s.relativePosition||s.absolutePosition;if(EA&&!PA){const FA=this.writer.context().availableHeight;FA-EA[1]<0?(this.writer.context().moveDown(FA),this.writer.context().inSnakingColumns()&&!this.writer.context().isInNestedNonSnakingGroup()?this.snakingAwarePageBreak(s.pageOrientation):this.writer.moveToNextPage(s.pageOrientation)):this.writer.context().moveDown(EA[1]),this.writer.context().addMargin(EA[0],EA[2])}if(Z(),EA&&!PA){const FA=this.writer.context().availableHeight;FA-EA[3]<0?(this.writer.context().moveDown(FA),this.writer.context().inSnakingColumns()&&!this.writer.context().isInNestedNonSnakingGroup()?this.snakingAwarePageBreak(s.pageOrientation):this.writer.moveToNextPage(s.pageOrientation)):this.writer.context().moveDown(EA[3]),this.writer.context().addMargin(-EA[0],-EA[2])}"after"===s.pageBreak?this.writer.moveToNextPage(s.pageOrientation):"afterOdd"===s.pageBreak?(this.writer.moveToNextPage(s.pageOrientation),(this.writer.context().page+1)%2==1&&this.writer.moveToNextPage(s.pageOrientation)):"afterEven"===s.pageBreak&&(this.writer.moveToNextPage(s.pageOrientation),(this.writer.context().page+1)%2==0&&this.writer.moveToNextPage(s.pageOrientation))})(()=>{let Z=s.verticalAlignment;if(d&&Z)var EA=this.writer.beginVerticalAlignment(Z);let PA=s.unbreakable;PA&&this.writer.beginUnbreakableBlock();let FA=s.absolutePosition;FA&&(this.writer.context().beginDetachedBlock(),this.writer.context().moveTo(FA.x||0,FA.y||0));let te=s.relativePosition;if(te&&(this.writer.context().beginDetachedBlock(),this.writer.context().moveToRelative(te.x||0,te.y||0)),s.stack)this.processVerticalContainer(s);else if(s.section)this.processSection(s);else if(s.columns)this.processColumns(s);else if(s.ul)this.processList(!1,s);else if(s.ol)this.processList(!0,s);else if(s.table)this.processTable(s);else if(void 0!==s.text)this.processLeaf(s);else if(s.toc)this.processToc(s);else if(s.image)this.processImage(s);else if(s.svg)this.processSVG(s);else if(s.canvas)this.processCanvas(s);else if(s.qr)this.processQr(s);else if(s.attachment)this.processAttachment(s);else if(!s._span)throw new Error(`Unrecognized document structure: ${P(s)}`);(FA||te)&&this.writer.context().endDetachedBlock(),PA&&this.writer.commitUnbreakableBlock(),d&&Z&&this.verticalAlignmentItemStack.push({begin:EA,end:this.writer.endVerticalAlignment(Z)})}),void 0!==W&&(s.__height=this.writer.context().getCurrentPosition().top-W)}snakingAwarePageBreak(s){let d=this.writer.context();if(!d.getSnakingSnapshot())return;if(this.writer.canMoveToNextColumn())return void this.writer.moveToNextColumn();this.writer.moveToNextPage(s);let W=d.lastColumnWidth;d.resetSnakingColumnsForNewPage(),d.lastColumnWidth=W}processVerticalContainer(s){s.stack.forEach(d=>{this.processNode(d),Zn(s.positions,d.positions)},this)}processSection(s){let d=this.writer.context().getCurrentPage();if(!d||d&&d.items.length){"inherit"===s.pageSize&&(s.pageSize=d?{width:d.pageSize.width,height:d.pageSize.height}:void 0),"inherit"===s.pageOrientation&&(s.pageOrientation=d?d.pageSize.orientation:void 0),"inherit"===s.pageMargins&&(s.pageMargins=d?d.pageMargins:void 0),"inherit"===s.header&&(s.header=d?d.customProperties.header:void 0),"inherit"===s.footer&&(s.footer=d?d.customProperties.footer:void 0),"inherit"===s.background&&(s.background=d?d.customProperties.background:void 0),"inherit"===s.watermark&&(s.watermark=d?d.customProperties.watermark:void 0),s.header&&"function"!=typeof s.header&&null!==s.header&&(s.header=Ze(s.header)),s.footer&&"function"!=typeof s.footer&&null!==s.footer&&(s.footer=Ze(s.footer));let F={};typeof s.header<"u"&&(F.header=s.header),typeof s.footer<"u"&&(F.footer=s.footer),typeof s.background<"u"&&(F.background=s.background),typeof s.watermark<"u"&&(F.watermark=s.watermark),this.writer.addPage(s.pageSize||this.pageSize,s.pageOrientation,s.pageMargins||this.pageMargins,F)}this.processNode(s.section)}processColumns(s){this.nestedLevel++;let d=s.columns,F=this.writer.context().availableWidth,W=function EA(PA){if(!PA)return null;let FA=[];FA.push(0);for(let te=d.length-1;te>0;te--)FA.push(PA);return FA}(s._gap);W&&(F-=(W.length-1)*s._gap),Gt_buildColumnWidths(d,F);let Z=this.processRow({marginX:s._margin?[s._margin[0],s._margin[2]]:[0,0],cells:d,widths:d,gaps:W,snakingColumns:s.snakingColumns});Zn(s.positions,Z.positions),this.nestedLevel--,0===this.nestedLevel&&this.writer.context().resetMarginXTopParent()}_findStartingRowSpanCell(s,d){let F=1;for(let W=d-1;W>=0;W--){if(!s[W]._span)return s[W].rowSpan>1&&(s[W].colSpan||1)===F?s[W]:null;F++}return null}_getPageBreak(s,d){return s.find(F=>F.prevPage===d)}_getPageBreakListBySpan(s,d,F){if(!s||!s._breaksBySpan)return null;const W=s._breaksBySpan.filter(PA=>PA.prevPage===d&&F<=PA.rowIndexOfSpanEnd);let Z=Number.MAX_VALUE,EA=Number.MIN_VALUE;return W.forEach(PA=>{EA=Math.max(PA.prevY,EA),Z=Math.min(PA.y,Z)}),{prevPage:d,prevY:EA,y:Z}}_findSameRowPageBreakByRowSpanData(s,d,F){return s?s.find(W=>W.prevPage===d&&F===W.rowIndexOfSpanEnd):null}_updatePageBreaksData(s,d,F){Object.keys(d._bottomByPage).forEach(W=>{const Z=Number(W),EA=this._getPageBreak(s,Z);if(EA&&(EA.prevY=Math.max(EA.prevY,d._bottomByPage[Z])),d._breaksBySpan&&d._breaksBySpan.length>0){const PA=d._breaksBySpan.filter(FA=>FA.prevPage===Z&&F<=FA.rowIndexOfSpanEnd);PA&&PA.length>0&&PA.forEach(FA=>{FA.prevY=Math.max(FA.prevY,d._bottomByPage[Z])})}})}_resolveBreakY(s,d,F){F.prevY=Math.max(s.prevY,d.prevY),F.y=Math.min(s.y,d.y)}_storePageBreakData(s,d,F,W){if(d){let EA=this._findSameRowPageBreakByRowSpanData(W&&W._breaksBySpan||null,s.prevPage,s.rowIndex);EA||(EA={...s,rowIndexOfSpanEnd:s.rowIndex+s.rowSpan-1},W._breaksBySpan||(W._breaksBySpan=[]),W._breaksBySpan.push(EA)),EA.prevY=Math.max(EA.prevY,s.prevY),EA.y=Math.min(EA.y,s.y);let PA=this._getPageBreak(F,s.prevPage);PA&&this._resolveBreakY(PA,EA,PA)}else{let Z=this._getPageBreak(F,s.prevPage),EA=this._getPageBreakListBySpan(W,s.prevPage,s.rowIndex);Z||(Z={...s},F.push(Z)),EA&&this._resolveBreakY(Z,EA,Z),this._resolveBreakY(Z,s,Z)}}_colLeftOffset(s,d){return d&&d.length>s?d[s]:0}_getRowSpanEndingCell(s,d,F,W){if(F.rowSpan&&F.rowSpan>1){let Z=d+F.rowSpan-1;if(Z>=s.length)throw new Error(`Row span for column ${W} (with indexes starting from 0) exceeded row count`);return s[Z][W]}return null}processRow(s){let d=s.marginX,F=void 0===d?[0,0]:d,W=s.dontBreakRows,Z=void 0!==W&&W,EA=s.rowsWithoutPageBreak,FA=s.cells,te=s.widths,ge=s.gaps,Me=s.tableNode,Qe=s.tableBody,me=s.rowIndex,Ye=s.height,Ue=s.snakingColumns,De=void 0!==Ue&&Ue;const Le=Z||me<=(void 0===EA?0:EA)-1;let Se=[],Ve=[],vt=!1,zt={};te=te||FA,!Le&&Ye>this.writer.context().availableHeight&&(vt=!0);const sn=1===this.nestedLevel?F:null,gn=Me?Me._bottomByPage:null,Tn=ge&&ge.length>1?ge[1]:0,rs=te.map(Zt=>Zt._calcWidth);this.writer.context().beginColumnGroup(sn,gn,De,Tn,rs);for(let Zt=0,_n=FA.length;Zt<_n;Zt++){let Yt=FA[Zt],mn=Zt;const ci=Hn=>{const xi=Yt.rowSpan&&Yt.rowSpan>1;xi&&(Hn.rowSpan=Yt.rowSpan),Hn.rowIndex=me,this._storePageBreakData(Hn,xi,Se,Me)};this.writer.addListener("pageChanged",ci);let $n=te[Zt]._calcWidth,zs=this._colLeftOffset(Zt,ge),ks=this._findStartingRowSpanCell(FA,Zt);if(Yt.colSpan&&Yt.colSpan>1)for(let Hn=1;Hn0&&(as._isUnbreakableContext=!0,as._originalXOffset=this.writer.originalX)),this.writer.context().beginColumn($n,zs,as),Yt._span||De&&Zt>0){if(Yt._columnEndingContext){let Hn=0;if(Z){const Ar=this.writer.contextStack[this.writer.contextStack.length-1];"number"==typeof Yt._startingRowSpanPage&&Yt._startingRowSpanPage===Ar.page&&"number"==typeof Yt._startingRowSpanY&&(Hn=Ar.y-Yt._startingRowSpanY),Hn=Math.max(0,Hn)}let xi=0;Yt._isUnbreakableContext&&!this.writer.transactionLevel&&(xi=Yt._originalXOffset),this.writer.context().markEnding(Yt,xi,Hn)}}else this.processNode(Yt,!0),this.writer.context().updateBottomByPage(),Yt.verticalAlignment&&(zt[mn]=this.verticalAlignmentItemStack.length-1),Zn(Ve,Yt.positions);this.writer.removeListener("pageChanged",ci)}let kn=null;const Jn=FA.length>0?FA[FA.length-1]:null;if(Jn)if(Jn._endingCell)kn=Jn._endingCell;else if(!0===Jn._span){const Zt=this._findStartingRowSpanCell(FA,FA.length);Zt&&(kn=Zt._endingCell,this.writer.transactionLevel>0&&(kn._isUnbreakableContext=!0,kn._originalXOffset=this.writer.originalX))}vt&&!Le&&0===Se.length&&(this.writer.context().moveDown(this.writer.context().availableHeight),De?this.snakingAwarePageBreak():this.writer.moveToNextPage());const Xt=this.writer.context().completeColumnGroup(Ye,kn);Me&&(Me._bottomByPage=Xt,this._updatePageBreaksData(Se,Me,me));let dn=this.writer.context().height;for(let Zt=0,_n=FA.length;Zt<_n;Zt++){let Yt=FA[Zt];if(!Yt._span&&Yt.verticalAlignment){let mn=this.verticalAlignmentItemStack[zt[Zt]].begin.item;mn.viewHeight=dn,mn.nodeHeight=Yt.__height,mn.cell=Yt,mn.bottomY=this.writer.context().y,mn.isCellContentMultiPage=!mn.cell.positions.every($n=>$n.pageNumber===mn.cell.positions[0].pageNumber),mn.getViewHeight=function(){return this.cell._willBreak?this.cell._bottomY-this.cell._rowTopPageY:this.cell.rowSpan&&this.cell.rowSpan>1?Z?this.cell._leftEndingCell._rowTopPageY-(this.cell._leftEndingCell._startingRowSpanY+this.cell._leftEndingCell._rowTopPageYPadding)+this.cell._leftEndingCell._bottomY:this.cell.positions[0].pageNumber!==this.cell._leftEndingCell._lastPageNumber?this.bottomY-this.cell._leftEndingCell._bottomY:this.viewHeight+this.cell._leftEndingCell._bottomY-this.bottomY:this.viewHeight},mn.getNodeHeight=function(){return this.nodeHeight},this.verticalAlignmentItemStack[zt[Zt]].end.item.isCellContentMultiPage=mn.isCellContentMultiPage}}return{pageBreaksBySpan:[],pageBreaks:Se,positions:Ve}}processList(s,d){const F=PA=>{if(EA){let FA=EA;if(EA=null,FA.canvas){let te=FA.canvas[0];Dt(te,-FA._minWidth,0),this.writer.addVector(te)}else if(FA._inlines){let te=new es(this.pageSize.width);te.addInline(FA._inlines[0]),te.x=-FA._minWidth,te.y=PA.getAscenderHeight()-te.getAscenderHeight(),this.writer.addLine(te,!0)}}};let EA,W=s?d.ol:d.ul,Z=d._gapSize;this.writer.context().addMargin(Z.width),this.writer.addListener("lineAdded",F),W.forEach(PA=>{EA=PA.listMarker,this.processNode(PA),Zn(d.positions,PA.positions)}),this.writer.removeListener("lineAdded",F),this.writer.context().addMargin(-Z.width)}processTable(s){this.nestedLevel++;let d=new Is(s);d.beginTable(this.writer);let F=s.table.heights,W=0;for(let Z=0,EA=s.table.body.length;Z0&&this.writer.context().inSnakingColumns()){let Qe=W>0?W:d.rowPaddingTop+14+d.rowPaddingBottom+d.bottomLineWidth+d.topLineWidth;this.writer.context().availableHeight{Qe.rowSpan&&Qe.rowSpan>1&&(Qe._startingRowSpanY=this.writer.context().y,Qe._startingRowSpanPage=this.writer.context().page)}),d.beginRow(Z,this.writer),FA="function"==typeof F?F(Z):Array.isArray(F)?F[Z]:F,"auto"===FA&&(FA=void 0);const te=this.writer.context().page;let ge=this.processRow({marginX:s._margin?[s._margin[0],s._margin[2]]:[0,0],dontBreakRows:d.dontBreakRows,rowsWithoutPageBreak:d.rowsWithoutPageBreak,cells:s.table.body[Z],widths:s.table.widths,gaps:s._offsets.offsets,tableBody:s.table.body,tableNode:s,rowIndex:Z,height:FA});if(Zn(s.positions,ge.positions),!ge.pageBreaks||0===ge.pageBreaks.length){const me=this._findSameRowPageBreakByRowSpanData(s&&s._breaksBySpan||null,te,Z);if(me){const Ye=this._getPageBreakListBySpan(s,me.prevPage,Z);ge.pageBreaks.push(Ye)}}d.endRow(Z,this.writer,ge.pageBreaks);let Me=this.writer.context().y;this.writer.context().page===te&&(W=Me-PA)}d.endTable(this.writer),this.nestedLevel--,0===this.nestedLevel&&this.writer.context().resetMarginXTopParent()}processLeaf(s){let d=this.buildNextLine(s);d&&(s.tocItem||s.id)&&(d._node=s);let F=d?d.getHeight():0,W=s.maxHeight||-1;if(d){let Z=rA(s);Z&&(d.id=Z)}if(s.outline)d._outline={id:s.id,parentId:s.outlineParentId,text:s.outlineText||s.text,expanded:s.outlineExpanded||!1};else if(Array.isArray(s.text))for(let Z=0,EA=s.text.length;Zthis.writer.context().availableHeight&&this.writer.context().y>this.writer.context().pageMargins.top){if(this.writer.context().inSnakingColumns()&&!this.writer.context().isInNestedNonSnakingGroup()){this.snakingAwarePageBreak(s.pageOrientation),d.inlines&&d.inlines.length>0&&s._inlines.unshift(...d.inlines),d=this.buildNextLine(s);continue}this.writer.moveToNextPage(s.pageOrientation)}let Z=this.writer.addLine(d);s.positions.push(Z),d=this.buildNextLine(s),d&&(F+=d.getHeight())}}processToc(s){!s.toc._table&&!0===s.toc.hideEmpty||(s.toc.title&&this.processNode(s.toc.title),s.toc._table&&this.processNode(s.toc._table))}buildNextLine(s){function d(PA){let FA=PA.constructor();for(let te in PA)FA[te]=PA[te];return FA}function F(PA,FA,te){let ge=1,Me=PA.length,Qe=1;for(;ge<=Me;){const me=Math.floor((ge+Me)/2);te(PA.substring(0,me))<=FA?(Qe=me,ge=me+1):Me=me-1}return Qe}if(!s._inlines||0===s._inlines.length)return null;let W=new es(this.writer.context().availableWidth);const Z=new mt(null);let EA=!1;for(;s._inlines&&s._inlines.length>0&&(W.hasEnoughSpaceForInline(s._inlines[0],s._inlines.slice(1))||EA);){let PA=!1,FA=s._inlines.shift();if(!FA.noWrap&&FA.text.length>1&&FA.width>W.getAvailableWidth()){let te=F(FA.text,W.getAvailableWidth(),ge=>Z.widthOfText(ge,FA));if(te{let s=parseFloat($);if("number"==typeof s&&!isNaN(s))return s},Ii=$=>{let s;try{s=new Gi.XmlDocument($)}catch(d){throw new Error("Invalid svg document ("+d+")",{cause:d})}if("svg"!==s.name)throw new Error("Invalid svg document (expected )");return s},ys=class qn{constructor(){}measureSVG(s){let d,F,W;if(I(s)){let PA=Ii(s);d=PA.attr.width,F=PA.attr.height,W=PA.attr.viewBox}else{if(!(typeof SVGElement<"u"&&s instanceof SVGElement&&"function"==typeof getComputedStyle))throw new Error("Invalid SVG document");d=s.getAttribute("width"),F=s.getAttribute("height"),W=s.getAttribute("viewBox")}let Z=un(d),EA=un(F);if((void 0===Z||void 0===EA)&&"string"==typeof W){let PA=W.split(/[,\s]+/);if(4!==PA.length)throw new Error("Unexpected svg viewBox format, should have 4 entries but found: '"+W+"'");void 0===Z&&(Z=un(PA[2])),void 0===EA&&(EA=un(PA[3]))}return{width:Z,height:EA}}writeDimensions(s,d){if(I(s)){let F=Ii(s);return"string"!=typeof F.attr.viewBox&&(F.attr.viewBox=`0 0 ${un(F.attr.width)} ${un(F.attr.height)}`),F.attr.width=""+d.width,F.attr.height=""+d.height,F.toString()}return s.hasAttribute("viewBox")||s.setAttribute("viewBox",`0 0 ${un(s.getAttribute("width"))} ${un(s.getAttribute("height"))}`),s.setAttribute("width",""+d.width),s.setAttribute("height",""+d.height),s}},oi=class Di{constructor(s){this.pdfDocument=s}drawBackground(s,d,F){let W=s.getHeight();for(let Z=0,EA=s.inlines.length;Z{let d=[],F=null;for(let W=0,Z=$.inlines.length;W{let Ye=0;for(let Ue=0,De=s.inlines.length;UeYe?Ue:Ye;return s.inlines[Ye]})(),FA=(()=>{let Ye=0;for(let Ue=0,De=s.inlines.length;Ue{let d=$;return s.sup&&(d-=.75*s.fontSize),s.sub&&(d+=.35*s.fontSize),d},ts=class vs{constructor(s,d){this.pdfDocument=s,this.progressCallback=d,this.outlineMap=[]}renderPages(s){this.pdfDocument._pdfMakePages=s;let d=0;this.progressCallback&&s.forEach(W=>{d+=W.items.length});let F=0;for(let W=0;W1){let EA=s.points[0],PA=s.points[s.points.length-1];(s.closePath||EA.x===PA.x&&EA.y===PA.y)&&this.pdfDocument.closePath()}break;case"path":this.pdfDocument.path(s.d)}if(s.linearGradient&&d){let EA=1/(s.linearGradient.length-1);for(let PA=0;PA{let EA=F.split(",").map(te=>te.trim().replace(/('|")/g,"")),PA=(($,s,d)=>{for(let F=0;F-1&&(PA=PA.slice(0,FA)),PA.forEach(ge=>{ge.pageSize.height===1/0&&(ge.pageSize.height=function li($,s){let W=pi(s||40),Z=W.top;return $.items.forEach(EA=>{let PA=function F(EA){return(EA.item.y||0)+function d(EA){return"function"==typeof EA.item.getHeight?EA.item.getHeight():EA.item._height?EA.item._height:"vector"===EA.type?typeof EA.item.y1<"u"?EA.item.y1>EA.item.y2?EA.item.y1:EA.item.y2:EA.item.h:0}(EA)}(EA);PA>Z&&(Z=PA)}),Z+=W.bottom,Z}(ge,ge.pageMargins))}),new ts(F.pdfKitDoc,d.progressCallback).renderPages(PA),F.pdfKitDoc})()}resolveUrls(s){var d=this;return de(function*(){const F=W=>"object"==typeof W?{url:W.url,headers:W.headers}:{url:W,headers:{}};for(let W in d.fontDescriptors)if(d.fontDescriptors.hasOwnProperty(W)){if(d.fontDescriptors[W].normal)if(Array.isArray(d.fontDescriptors[W].normal)){let Z=F(d.fontDescriptors[W].normal[0]);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].normal[0]=Z.url}else{let Z=F(d.fontDescriptors[W].normal);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].normal=Z.url}if(d.fontDescriptors[W].bold)if(Array.isArray(d.fontDescriptors[W].bold)){let Z=F(d.fontDescriptors[W].bold[0]);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].bold[0]=Z.url}else{let Z=F(d.fontDescriptors[W].bold);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].bold=Z.url}if(d.fontDescriptors[W].italics)if(Array.isArray(d.fontDescriptors[W].italics)){let Z=F(d.fontDescriptors[W].italics[0]);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].italics[0]=Z.url}else{let Z=F(d.fontDescriptors[W].italics);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].italics=Z.url}if(d.fontDescriptors[W].bolditalics)if(Array.isArray(d.fontDescriptors[W].bolditalics)){let Z=F(d.fontDescriptors[W].bolditalics[0]);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].bolditalics[0]=Z.url}else{let Z=F(d.fontDescriptors[W].bolditalics);d.urlResolver.resolve(Z.url,Z.headers),d.fontDescriptors[W].bolditalics=Z.url}}if(s.images)for(let W in s.images)if(s.images.hasOwnProperty(W)){let Z=F(s.images[W]);d.urlResolver.resolve(Z.url,Z.headers),s.images[W]=Z.url}if(s.attachments)for(let W in s.attachments)if(s.attachments.hasOwnProperty(W)&&s.attachments[W].src){let Z=F(s.attachments[W].src);d.urlResolver.resolve(Z.url,Z.headers),s.attachments[W].src=Z.url}if(s.files)for(let W in s.files)if(s.files.hasOwnProperty(W)&&s.files[W].src){let Z=F(s.files[W].src);d.urlResolver.resolve(Z.url,Z.headers),s.files[W].src=Z.url}yield d.urlResolver.resolved()})()}};var is=f(6811);function Fi(){return(Fi=de(function*($,s,d){void 0===s&&(s={});for(let F=0;F<=30;F++){if(typeof d<"u"&&!0!==d($))throw new Error(`Access to URL denied by resource access policy: ${$}`);try{let W=yield fetch($,{headers:s,redirect:"manual"});if(W.status>=300&&W.status<400){let Z=W.headers.get("location");if(!Z)throw new Error("Redirect response missing Location header");$=new URL(Z,$).href;continue}if("opaqueredirect"===W.type&&(W=yield fetch($,{headers:s})),!W.ok)throw new Error(`Failed to fetch (status code: ${W.status})`);return W}catch(W){throw new Error(`Network request failed (url: "${$}", error: ${W.message})`,{cause:W})}}throw new Error(`Network request failed (url: "${$}", error: Too many redirects)`)})).apply(this,arguments)}const Us=class ki{constructor(s){this.fs=s,this.resolving={},this.urlAccessPolicy=void 0}setUrlAccessPolicy(s){this.urlAccessPolicy=s}resolve(s,d){var F=this;void 0===d&&(d={});const W=function(){var Z=de(function*(){if(s.toLowerCase().startsWith("https://")||s.toLowerCase().startsWith("http://")){if(F.fs.existsSync(s))return;const EA=yield function Ps($,s,d){return Fi.apply(this,arguments)}(s,d,F.urlAccessPolicy);if(EA.redirected&&typeof F.urlAccessPolicy<"u"&&!0!==F.urlAccessPolicy(EA.url))throw new Error(`Access to URL denied by resource access policy: ${EA.url}`);const PA=yield EA.arrayBuffer();F.fs.writeFileSync(s,PA)}});return function(){return Z.apply(this,arguments)}}();return this.resolving[s]||(this.resolving[s]=W()),this.resolving[s]}resolved(){return Promise.all(Object.values(this.resolving))}};var zn=f(9964);const ss=class Ls{constructor(){this.virtualfs=is.default,this.urlAccessPolicy=void 0,this.localAccessPolicy=void 0}createPdf(s,d){if(void 0===d&&(d={}),!v(s))throw new Error("Parameter 'docDefinition' has an invalid type. Object expected.");if(!v(d))throw new Error("Parameter 'options' has an invalid type. Object expected.");d.progressCallback=this.progressCallback,d.tableLayouts=this.tableLayouts;const F=typeof zn<"u"&&zn?.versions?.node;typeof this.urlAccessPolicy>"u"&&F&&console.warn("No URL access policy defined. Consider using setUrlAccessPolicy() to restrict external resource downloads."),typeof this.localAccessPolicy>"u"&&F&&console.warn("No local access policy defined. Consider using setLocalAccessPolicy() to restrict local file system access.");let W=new Us(this.virtualfs);W.setUrlAccessPolicy(this.urlAccessPolicy);const EA=new Ns(this.fonts,this.virtualfs,W,this.localAccessPolicy).createPdfKitDocument(s,d);return this._transformToDocument(EA)}setUrlAccessPolicy(s){if(void 0!==s&&"function"!=typeof s)throw new Error("Parameter 'callback' has an invalid type. Function or undefined expected.");this.urlAccessPolicy=s}setProgressCallback(s){this.progressCallback=s}addTableLayouts(s){this.tableLayouts=bt(this.tableLayouts,s)}setTableLayouts(s){this.tableLayouts=s}clearTableLayouts(){this.tableLayouts={}}addFonts(s){this.fonts=bt(this.fonts,s)}setFonts(s){this.fonts=s}clearFonts(){this.fonts={}}_transformToDocument(s){return s}};var Gs=f(783).Buffer;const Yn=class yi{constructor(s){this.bufferSize=1073741824,this.pdfDocumentPromise=s,this.bufferPromise=null}getStream(){return this.pdfDocumentPromise}getBuffer(){var s=this;const d=function(){var F=de(function*(){const W=yield s.getStream();return new Promise(Z=>{let EA=[];W.on("readable",()=>{let PA;for(;null!==(PA=W.read(s.bufferSize));)EA.push(PA)}),W.on("end",()=>{Z(Gs.concat(EA))}),W.end()})});return function(){return F.apply(this,arguments)}}();return null===this.bufferPromise&&(this.bufferPromise=d()),this.bufferPromise}getBase64(){var s=this;return de(function*(){return(yield s.getBuffer()).toString("base64")})()}getDataUrl(){var s=this;return de(function*(){return"data:application/pdf;base64,"+(yield s.getBase64())})()}};var h=f(5127);const p=class y extends Yn{getBlob(){var s=this;return de(function*(){const d=yield s.getBuffer();return new Blob([d],{type:"application/pdf"})})()}download(s){var d=this;return de(function*(){void 0===s&&(s="file.pdf");const F=yield d.getBlob();(0,h.saveAs)(F,s)})()}open(s){var d=this;return de(function*(){void 0===s&&(s=null),s||(s=(()=>{let $=window.open("","_blank");if(null===$)throw new Error("Open PDF in new window blocked by browser");return $})());const F=yield d.getBlob();try{let Z=(window.URL||window.webkitURL).createObjectURL(F);s.location.href=Z}catch(W){throw s.close(),W}})()}print(s){var d=this;return de(function*(){void 0===s&&(s=null),(yield d.getStream()).setOpenActionAsPrint(),yield d.open(s)})()}};var q=f(2416),CA=f.n(q),_A=f(890);f.n(_A)()({useNative:["Promise"]});let he={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-MediumItalic.ttf"}};const xe=new class Ie extends ss{constructor(){super(),this.fonts=he}addFontContainer(s){this.addVirtualFileSystem(s.vfs),this.addFonts(s.fonts)}addVirtualFileSystem(s){for(let d in s)if(s.hasOwnProperty(d)){let F,W;"object"==typeof s[d]?(F=s[d].data,W=s[d].encoding||"base64"):(F=s[d],W="base64"),CA().writeFileSync(d,F,W)}}_transformToDocument(s){return new p(s)}}},2736(eA,Q,f){eA.exports=f(7133).default},2416(eA,Q,f){eA.exports=f(6811).default},6811(eA,Q,f){"use strict";f.d(Q,{default:()=>K});var g=f(783).Buffer;const I=v=>(0===v.indexOf("/")&&(v=v.substring(1)),0===v.indexOf("/")&&(v=v.substring(1)),v),K=new class N{constructor(){this.storage={}}existsSync(B){const j=I(B);return typeof this.storage[j]<"u"}readFileSync(B,j){const tA=I(B),w="object"==typeof j?j.encoding:j;if(!this.existsSync(tA))throw new Error(`File '${tA}' not found in virtual file system`);const aA=this.storage[tA];return w?aA.toString(w):aA}writeFileSync(B,j,tA){const w=I(B),aA="object"==typeof tA?tA.encoding:tA;if(!j&&!tA)throw new Error("No content");this.storage[w]=aA||"string"==typeof j?new g(j,aA):j}}},6582(eA,Q,f){"use strict";Q.A=void 0;var g=function I(K){return K&&K.__esModule?K:{default:K}}(f(7696));Q.A=g.default},7696(eA,Q,f){"use strict";(eA=f.nmd(eA))&&typeof eA.exports<"u"&&(eA.exports=function(g,I,N,K,v){const B={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgrey:[211,211,211],lightgreen:[144,238,144],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0]},j={black:[B.black,1],white:[B.white,1],transparent:[B.black,0]},tA={quot:34,amp:38,lt:60,gt:62,apos:39,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,fnof:402,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,bull:8226,hellip:8230,prime:8242,Prime:8243,oline:8254,frasl:8260,weierp:8472,image:8465,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},w={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},aA={A3:!0,A4:!0,a3:!0,a4:!0},AA={color:{inherit:!0,initial:void 0},visibility:{inherit:!0,initial:"visible",values:{hidden:"hidden",collapse:"hidden",visible:"visible"}},fill:{inherit:!0,initial:j.black},stroke:{inherit:!0,initial:"none"},"stop-color":{inherit:!1,initial:j.black},"fill-opacity":{inherit:!0,initial:1},"stroke-opacity":{inherit:!0,initial:1},"stop-opacity":{inherit:!1,initial:1},"fill-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"clip-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"stroke-width":{inherit:!0,initial:1},"stroke-dasharray":{inherit:!0,initial:[]},"stroke-dashoffset":{inherit:!0,initial:0},"stroke-miterlimit":{inherit:!0,initial:4},"stroke-linejoin":{inherit:!0,initial:"miter",values:{miter:"miter",round:"round",bevel:"bevel"}},"stroke-linecap":{inherit:!0,initial:"butt",values:{butt:"butt",round:"round",square:"square"}},"font-size":{inherit:!0,initial:16,values:{"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32}},"font-family":{inherit:!0,initial:"sans-serif"},"font-weight":{inherit:!0,initial:"normal",values:{600:"bold",700:"bold",800:"bold",900:"bold",bold:"bold",bolder:"bold",500:"normal",400:"normal",300:"normal",200:"normal",100:"normal",normal:"normal",lighter:"normal"}},"font-style":{inherit:!0,initial:"normal",values:{italic:"italic",oblique:"italic",normal:"normal"}},"text-anchor":{inherit:!0,initial:"start",values:{start:"start",middle:"middle",end:"end"}},direction:{inherit:!0,initial:"ltr",values:{ltr:"ltr",rtl:"rtl"}},"dominant-baseline":{inherit:!0,initial:"baseline",values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"alignment-baseline":{inherit:!1,initial:void 0,values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"baseline-shift":{inherit:!0,initial:"baseline",values:{baseline:"baseline",sub:"sub",super:"super"}},"word-spacing":{inherit:!0,initial:0,values:{normal:0}},"letter-spacing":{inherit:!0,initial:0,values:{normal:0}},"text-decoration":{inherit:!1,initial:"none",values:{none:"none",underline:"underline",overline:"overline","line-through":"line-through"}},"xml:space":{inherit:!0,initial:"default",css:"white-space",values:{preserve:"preserve",default:"default",pre:"preserve","pre-line":"preserve","pre-wrap":"preserve",nowrap:"default"}},"marker-start":{inherit:!0,initial:"none"},"marker-mid":{inherit:!0,initial:"none"},"marker-end":{inherit:!0,initial:"none"},opacity:{inherit:!1,initial:1},transform:{inherit:!1,initial:[1,0,0,1,0,0]},display:{inherit:!1,initial:"inline",values:{none:"none",inline:"inline",block:"inline"}},"clip-path":{inherit:!1,initial:"none"},mask:{inherit:!1,initial:"none"},overflow:{inherit:!1,initial:"hidden",values:{hidden:"hidden",scroll:"hidden",visible:"visible"}},"vector-effect":{inherit:!0,initial:"none",values:{none:"none","non-scaling-stroke":"non-scaling-stroke"}}};function L(GA){let zA=new function(){};return zA.name="G"+(g._groupCount=(g._groupCount||0)+1),zA.resources=g.ref(),zA.xobj=g.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:GA,Group:{S:"Transparency",CS:"DeviceRGB",I:!0,K:!1},Resources:zA.resources}),zA.xobj.write(""),zA.savedMatrix=g._ctm,zA.savedPage=g.page,Et.push(zA),g._ctm=[1,0,0,1,0,0],g.page={width:g.page.width,height:g.page.height,write:function(vA){zA.xobj.write(vA)},fonts:{},xobjects:{},ext_gstates:{},patterns:{}},zA}function P(GA){if(GA!==Et.pop())throw"Group not matching";Object.keys(g.page.fonts).length&&(GA.resources.data.Font=g.page.fonts),Object.keys(g.page.xobjects).length&&(GA.resources.data.XObject=g.page.xobjects),Object.keys(g.page.ext_gstates).length&&(GA.resources.data.ExtGState=g.page.ext_gstates),Object.keys(g.page.patterns).length&&(GA.resources.data.Pattern=g.page.patterns),GA.resources.end(),GA.xobj.end(),g._ctm=GA.savedMatrix,g.page=GA.savedPage}function rA(GA){g.page.xobjects[GA.name]=GA.xobj,g.addContent("/"+GA.name+" Do")}function QA(GA,zA){let vA="M"+(g._maskCount=(g._maskCount||0)+1),qA=g.ref({Type:"ExtGState",CA:1,ca:1,BM:"Normal",SMask:{S:"Luminosity",G:GA.xobj,BC:zA?[0,0,0]:[1,1,1]}});qA.end(),g.page.ext_gstates[vA]=qA,g.addContent("/"+vA+" gs")}function NA(GA,zA,vA,qA){return{type:"PDFPattern",group:GA,dx:zA,dy:vA,matrix:qA||[1,0,0,1,0,0]}}function oA(GA,zA){let vA="P"+(g._patternCount=(g._patternCount||0)+1),qA=g.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:[0,0,GA.dx,GA.dy],XStep:GA.dx,YStep:GA.dy,Matrix:UA(g._ctm,GA.matrix),Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],XObject:function(){let ZA={};return ZA[GA.group.name]=GA.group.xobj,ZA}()}});qA.write("/"+GA.group.name+" Do"),qA.end(),g.page.patterns[vA]=qA,zA?(g.addContent("/Pattern CS"),g.addContent("/"+vA+" SCN")):(g.addContent("/Pattern cs"),g.addContent("/"+vA+" scn"))}function uA(GA,zA){g.page.fonts[GA.id]||(g.page.fonts[GA.id]=GA.ref()),g.addContent("BT").addContent("/"+GA.id+" "+zA+" Tf")}function dA(GA,zA,vA,qA,ZA,jA){g.addContent(JA(GA)+" "+JA(zA)+" "+JA(-vA)+" "+JA(-qA)+" "+JA(ZA)+" "+JA(jA)+" Tm")}function RA(GA,zA){g.addContent((GA&&zA?2:zA?1:GA?0:3)+" Tr")}function nA(GA,zA){let vA=[],qA="";const ZA=zA.fauxItalic?-.25:0;function jA(WA){qA+=WA.glyph,0!==WA.kern&&(vA.push(`<${qA}> ${JA(WA.kern)}`),qA="")}function ue(){qA.length&&(vA.push(`<${qA}> 0`),qA=""),vA.length&&(g.addContent(`[${vA.join(" ")}] TJ`),vA=[])}for(let WA=0;WA0)for(;zA<0;)zA+=qA;g.dash(GA,{phase:zA})}function VA(GA){let zA=function(WA,ae,ce,ye){this.error=ye,this.nodeName=WA,this.nodeValue=ce,this.nodeType=ae,this.attributes=Object.create(null),this.childNodes=[],this.parentNode=null,this.id="",this.textContent="",this.classList=[]};zA.prototype.getAttribute=function(WA){return null!=this.attributes[WA]?this.attributes[WA]:null},zA.prototype.getElementById=function(WA){let ae=null;return function ce(ye){if(!ae&&1===ye.nodeType){ye.id===WA&&(ae=ye);for(let ke=0;ke/)){for(;ae=ue();)ce.childNodes.push(ae),ae.parentNode=ce,ce.textContent+=3===ae.nodeType||4===ae.nodeType?ae.nodeValue:ae.textContent;return(WA=vA.match(/^<\/([\w:.-]+)\s*>/,!0))?(WA[1]===ce.nodeName||(Mt('parseXml: tag not matching, opening "'+ce.nodeName+'" & closing "'+WA[1]+'"'),jA=!0),ce):(Mt('parseXml: tag not matching, opening "'+ce.nodeName+'" & not closing'),jA=!0,ce)}if(vA.match(/^\/>/))return ce;Mt('parseXml: tag could not be parsed "'+ce.nodeName+'"'),jA=!0}else{if(WA=vA.match(/^/))return new zA(null,8,WA,jA);if(WA=vA.match(/^<\?[\s\S]*?\?>/))return new zA(null,7,WA,jA);if(WA=vA.match(/^/))return new zA(null,10,WA,jA);if(WA=vA.match(/^/,!0))return new zA("#cdata-section",4,WA[1],jA);if(WA=vA.match(/^([^<]+)/,!0))return new zA("#text",3,kA(WA[1]),jA)}};for(;ZA=ue();)1!==ZA.nodeType||qA?(1===ZA.nodeType||3===ZA.nodeType&&""!==ZA.nodeValue.trim())&&Mt("parseXml: data after document end has been discarded"):qA=ZA;return vA.matchAll()&&Mt("parseXml: parsing error"),qA}function kA(GA){return GA.replace(/&(?:#([0-9]+)|#[xX]([0-9A-Fa-f]+)|([0-9A-Za-z]+));/g,function(zA,vA,qA,ZA){return vA?String.fromCharCode(parseInt(vA,10)):qA?String.fromCharCode(parseInt(qA,16)):ZA&&tA[ZA]?String.fromCharCode(tA[ZA]):zA})}function hA(GA){let zA,vA;return GA=(GA||"").trim(),(zA=B[GA])?vA=[zA.slice(),1]:(zA=GA.match(/^cmyk\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i))?(zA[1]=parseInt(zA[1]),zA[2]=parseInt(zA[2]),zA[3]=parseInt(zA[3]),zA[4]=parseFloat(zA[4]),zA[1]<=100&&zA[2]<=100&&zA[3]<=100&&zA[4]<=100&&(vA=[zA.slice(1,5),1])):(zA=GA.match(/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i))?(zA[1]=parseInt(zA[1]),zA[2]=parseInt(zA[2]),zA[3]=parseInt(zA[3]),zA[4]=parseFloat(zA[4]),zA[1]<256&&zA[2]<256&&zA[3]<256&&zA[4]<=1&&(vA=[zA.slice(1,4),zA[4]])):(zA=GA.match(/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/i))?(zA[1]=parseInt(zA[1]),zA[2]=parseInt(zA[2]),zA[3]=parseInt(zA[3]),zA[1]<256&&zA[2]<256&&zA[3]<256&&(vA=[zA.slice(1,4),1])):(zA=GA.match(/^rgb\(\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/i))?(zA[1]=2.55*parseFloat(zA[1]),zA[2]=2.55*parseFloat(zA[2]),zA[3]=2.55*parseFloat(zA[3]),zA[1]<256&&zA[2]<256&&zA[3]<256&&(vA=[zA.slice(1,4),1])):(zA=GA.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i))?vA=[[parseInt(zA[1],16),parseInt(zA[2],16),parseInt(zA[3],16)],1]:(zA=GA.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i))&&(vA=[[17*parseInt(zA[1],16),17*parseInt(zA[2],16),17*parseInt(zA[3],16)],1]),Dt?Dt(vA,GA):vA}function fA(GA,zA,vA){let qA=GA[0].slice(),ZA=GA[1]*zA;if(vA){for(let jA=0;jA=0;zA--)GA=UA(Et[zA].savedMatrix,GA);return GA}function Ee(){return(new oe).M(0,0).L(g.page.width,0).L(g.page.width,g.page.height).L(0,g.page.height).transform(cA(xA())).getBoundingBox()}function cA(GA){let zA=GA[0]*GA[3]-GA[1]*GA[2];return[GA[3]/zA,-GA[1]/zA,-GA[2]/zA,GA[0]/zA,(GA[2]*GA[5]-GA[3]*GA[4])/zA,(GA[1]*GA[4]-GA[0]*GA[5])/zA]}function J(GA){let zA=JA(GA[0]),vA=JA(GA[1]),qA=JA(GA[2]),ZA=JA(GA[3]),jA=JA(GA[4]),ue=JA(GA[5]);if(LA(zA*ZA-vA*qA,0))return[zA,vA,qA,ZA,jA,ue]}function U(GA){let zA=GA[2]||0,vA=GA[1]||0,qA=GA[0]||0;if(lA(zA,0)&&lA(vA,0))return[];if(lA(zA,0))return[-qA/vA];{let ZA=vA*vA-4*zA*qA;return LA(ZA,0)&&ZA>0?[(-vA+Math.sqrt(ZA))/(2*zA),(-vA-Math.sqrt(ZA))/(2*zA)]:lA(ZA,0)?[-vA/(2*zA)]:[]}}function O(GA,zA){return(zA[0]||0)+(zA[1]||0)*GA+(zA[2]||0)*GA*GA+(zA[3]||0)*GA*GA*GA}function lA(GA,zA){return Math.abs(GA-zA)<1e-10}function LA(GA,zA){return Math.abs(GA-zA)>=1e-10}function JA(GA){return GA>-1e21&&GA<1e21?Math.round(1e6*GA)/1e6:0}function IA(GA){let qA,zA=new Te((GA||"").trim()),vA=[1,0,0,1,0,0];for(;qA=zA.match(/^([A-Za-z]+)\s*[(]([^(]+)[)]/,!0);){let WA,ZA=qA[1],jA=[],ue=new Te(qA[2].trim());for(;WA=ue.matchNumber();)jA.push(Number(WA)),ue.matchSeparator();if("matrix"===ZA&&6===jA.length)vA=UA(vA,[jA[0],jA[1],jA[2],jA[3],jA[4],jA[5]]);else if("translate"===ZA&&2===jA.length)vA=UA(vA,[1,0,0,1,jA[0],jA[1]]);else if("translate"===ZA&&1===jA.length)vA=UA(vA,[1,0,0,1,jA[0],0]);else if("scale"===ZA&&2===jA.length)vA=UA(vA,[jA[0],0,0,jA[1],0,0]);else if("scale"===ZA&&1===jA.length)vA=UA(vA,[jA[0],0,0,jA[0],0,0]);else if("rotate"===ZA&&3===jA.length){let ae=jA[0]*Math.PI/180;vA=UA(vA,[1,0,0,1,jA[1],jA[2]],[Math.cos(ae),Math.sin(ae),-Math.sin(ae),Math.cos(ae),0,0],[1,0,0,1,-jA[1],-jA[2]])}else if("rotate"===ZA&&1===jA.length){let ae=jA[0]*Math.PI/180;vA=UA(vA,[Math.cos(ae),Math.sin(ae),-Math.sin(ae),Math.cos(ae),0,0])}else if("skewX"===ZA&&1===jA.length){let ae=jA[0]*Math.PI/180;vA=UA(vA,[1,0,Math.tan(ae),1,0,0])}else{if("skewY"!==ZA||1!==jA.length)return;{let ae=jA[0]*Math.PI/180;vA=UA(vA,[1,Math.tan(ae),0,1,0,0])}}zA.matchSeparator()}if(!zA.matchAll())return vA}function gA(GA,zA,vA,qA,ZA,jA){let ue=(GA||"").trim().match(/^(none)$|^x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?$/)||[],WA=ue[1]||ue[4]||"meet",ye=zA/qA,ke=vA/ZA,Je={Min:0,Mid:.5,Max:1}[ue[2]||"Mid"]-(jA||0),tt={Min:0,Mid:.5,Max:1}[ue[3]||"Mid"]-(jA||0);return"slice"===WA?ke=ye=Math.max(ye,ke):"meet"===WA&&(ke=ye=Math.min(ye,ke)),[ye,0,0,ke,Je*(zA-qA*ye),tt*(vA-ZA*ke)]}function C(GA){let zA=Object.create(null);GA=(GA||"").trim().split(/;/);for(let vA=0;vAst&&(je=st,st=Ce,Ce=je),_e>lt&&(je=lt,lt=_e,_e=je);let wt=U(ke);for(let pt=0;pt=0&&wt[pt]<=1){let ot=O(wt[pt],ce);otst&&(st=ot)}let Bt=U(Je);for(let pt=0;pt=0&&Bt[pt]<=1){let ot=O(Bt[pt],ye);ot<_e&&(_e=ot),ot>lt&&(lt=ot)}return[Ce,_e,st,lt]},this.getPointAtLength=function(je){if(lA(je,0))return this.startPoint;if(lA(je,this.totalLength))return this.endPoint;if(!(je<0||je>this.totalLength))for(let Ce=1;Ce<=ae;Ce++){let _e=tt[Ce-1],st=tt[Ce];if(_e<=je&&je<=st){let lt=(Ce-(st-je)/(st-_e))/ae,wt=O(lt,ce),Bt=O(lt,ye),pt=O(lt,ke),ot=O(lt,Je);return[wt,Bt,Math.atan2(ot,pt)]}}}},Oe=function(GA,zA,vA,qA){this.totalLength=Math.sqrt((vA-GA)*(vA-GA)+(qA-zA)*(qA-zA)),this.startPoint=[GA,zA,Math.atan2(qA-zA,vA-GA)],this.endPoint=[vA,qA,Math.atan2(qA-zA,vA-GA)],this.getBoundingBox=function(){return[Math.min(this.startPoint[0],this.endPoint[0]),Math.min(this.startPoint[1],this.endPoint[1]),Math.max(this.startPoint[0],this.endPoint[0]),Math.max(this.startPoint[1],this.endPoint[1])]},this.getPointAtLength=function(ZA){if(ZA>=0&&ZA<=this.totalLength){let jA=ZA/this.totalLength||0;return[this.startPoint[0]+jA*(this.endPoint[0]-this.startPoint[0]),this.startPoint[1]+jA*(this.endPoint[1]-this.startPoint[1]),this.startPoint[2]]}}},oe=function(){this.pathCommands=[],this.pathSegments=[],this.startPoint=null,this.endPoint=null,this.totalLength=0;let ZA,jA,ue,GA=0,zA=0,vA=0,qA=0;this.move=function(WA,ae){return GA=vA=WA,zA=qA=ae,null},this.line=function(WA,ae){let ce=new Oe(vA,qA,WA,ae);return vA=WA,qA=ae,ce},this.curve=function(WA,ae,ce,ye,ke,Je){let tt=new ze(vA,qA,WA,ae,ce,ye,ke,Je);return vA=ke,qA=Je,tt},this.close=function(){let WA=new Oe(vA,qA,GA,zA);return vA=GA,qA=zA,WA},this.addCommand=function(WA){this.pathCommands.push(WA);let ae=this[WA[0]].apply(this,WA.slice(3));ae&&(ae.hasStart=WA[1],ae.hasEnd=WA[2],this.startPoint=this.startPoint||ae.startPoint,this.endPoint=ae.endPoint,this.pathSegments.push(ae),this.totalLength+=ae.totalLength)},this.M=function(WA,ae){return this.addCommand(["move",!0,!0,WA,ae]),ZA="M",this},this.m=function(WA,ae){return this.M(vA+WA,qA+ae)},this.Z=this.z=function(){return this.addCommand(["close",!0,!0]),ZA="Z",this},this.L=function(WA,ae){return this.addCommand(["line",!0,!0,WA,ae]),ZA="L",this},this.l=function(WA,ae){return this.L(vA+WA,qA+ae)},this.H=function(WA){return this.L(WA,qA)},this.h=function(WA){return this.L(vA+WA,qA)},this.V=function(WA){return this.L(vA,WA)},this.v=function(WA){return this.L(vA,qA+WA)},this.C=function(WA,ae,ce,ye,ke,Je){return this.addCommand(["curve",!0,!0,WA,ae,ce,ye,ke,Je]),ZA="C",jA=ce,ue=ye,this},this.c=function(WA,ae,ce,ye,ke,Je){return this.C(vA+WA,qA+ae,vA+ce,qA+ye,vA+ke,qA+Je)},this.S=function(WA,ae,ce,ye){return this.C(vA+("C"===ZA?vA-jA:0),qA+("C"===ZA?qA-ue:0),WA,ae,ce,ye)},this.s=function(WA,ae,ce,ye){return this.C(vA+("C"===ZA?vA-jA:0),qA+("C"===ZA?qA-ue:0),vA+WA,qA+ae,vA+ce,qA+ye)},this.Q=function(WA,ae,ce,ye){return this.addCommand(["curve",!0,!0,vA+.6666666666666666*(WA-vA),qA+2/3*(ae-qA),ce+2/3*(WA-ce),ye+2/3*(ae-ye),ce,ye]),ZA="Q",jA=WA,ue=ae,this},this.q=function(WA,ae,ce,ye){return this.Q(vA+WA,qA+ae,vA+ce,qA+ye)},this.T=function(WA,ae){return this.Q(vA+("Q"===ZA?vA-jA:0),qA+("Q"===ZA?qA-ue:0),WA,ae)},this.t=function(WA,ae){return this.Q(vA+("Q"===ZA?vA-jA:0),qA+("Q"===ZA?qA-ue:0),vA+WA,qA+ae)},this.A=function(WA,ae,ce,ye,ke,Je,tt){if(lA(WA,0)||lA(ae,0))this.addCommand(["line",!0,!0,Je,tt]);else{ce*=Math.PI/180,WA=Math.abs(WA),ae=Math.abs(ae),ye=1*!!ye,ke=1*!!ke;let je=Math.cos(ce)*(vA-Je)/2+Math.sin(ce)*(qA-tt)/2,Ce=Math.cos(ce)*(qA-tt)/2-Math.sin(ce)*(vA-Je)/2,_e=je*je/(WA*WA)+Ce*Ce/(ae*ae);_e>1&&(WA*=Math.sqrt(_e),ae*=Math.sqrt(_e));let st=Math.sqrt(Math.max(0,WA*WA*ae*ae-WA*WA*Ce*Ce-ae*ae*je*je)/(WA*WA*Ce*Ce+ae*ae*je*je)),lt=(ye===ke?-1:1)*st*WA*Ce/ae,wt=(ye===ke?1:-1)*st*ae*je/WA,Bt=Math.cos(ce)*lt-Math.sin(ce)*wt+(vA+Je)/2,pt=Math.sin(ce)*lt+Math.cos(ce)*wt+(qA+tt)/2,ot=Math.atan2((Ce-wt)/ae,(je-lt)/WA),ut=Math.atan2((-Ce-wt)/ae,(-je-lt)/WA);0===ke&&ut-ot>0?ut-=2*Math.PI:1===ke&&ut-ot<0&&(ut+=2*Math.PI);let an=Math.ceil(Math.abs(ut-ot)/(Math.PI/qe));for(let Wt=0;WtWA[2]&&(WA[2]=ce[2]),ce[1]WA[3]&&(WA[3]=ce[3])}for(let ce=0;ce=0&&WA<=this.totalLength){let ae;for(let ce=0;ceZA.selector.specificity||(zA[jA]=ZA.css[jA],vA[jA]=ZA.selector.specificity)}return zA}(GA),this.allowedChildren=[],this.attr=function(ZA){if("function"==typeof GA.getAttribute)return GA.getAttribute(ZA)},this.resolveUrl=function(ZA){let jA=(ZA||"").match(/^\s*(?:url\("(.*)#(.*)"\)|url\('(.*)#(.*)'\)|url\((.*)#(.*)\)|(.*)#(.*))\s*$/)||[],ue=jA[1]||jA[3]||jA[5]||jA[7],WA=jA[2]||jA[4]||jA[6]||jA[8];if(WA){if(!ue){let ae=I.getElementById(WA);if(ae)return-1===this.stack.indexOf(ae)?ae:void Mt('SVGtoPDF: loop of circular references for id "'+WA+'"')}if(Ze){let ae=ct[ue];if(!ae){ae=Ze(ue),function $A(GA){return"object"==typeof GA&&null!==GA&&"number"==typeof GA.length}(ae)||(ae=[ae]);for(let ce=0;ce=0&&ue[3]>=0?ue:jA},this.getPercent=function(ZA,jA){let ue=this.attr(ZA),WA=new Te((ue||"").trim()),ye=WA.matchNumber();return!ye||(WA.match("%")&&(ye*=.01),WA.matchAll())?jA:Math.max(0,Math.min(1,ye))},this.chooseValue=function(ZA){for(let jA=0;jA=0&&(WA=ce);break;case"stroke-miterlimit":ce=parseFloat(ue),null!=ce&&ce>=1&&(WA=ce);break;case"word-spacing":case"letter-spacing":case"stroke-dashoffset":WA=this.computeLength(ue,this.getViewport())}if(null!=WA)return vA[ZA]=WA}}return vA[ZA]=jA.inherit&&this.inherits?this.inherits.get(ZA):jA.initial},this.getChildren=function(){if(null!=qA)return qA;let ZA=[];for(let jA=0;jA0?jA:this.ref?this.ref.getChildren():[]},this.getPaint=function(jA,ue,WA,ae){let ce="userSpaceOnUse"!==this.attr("patternUnits"),ye="objectBoundingBox"===this.attr("patternContentUnits"),ke=this.getLength("x",ce?1:this.getParentVWidth(),0),Je=this.getLength("y",ce?1:this.getParentVHeight(),0),tt=this.getLength("width",ce?1:this.getParentVWidth(),0),je=this.getLength("height",ce?1:this.getParentVHeight(),0);ye&&!ce?(ke=(ke-jA[0])/(jA[2]-jA[0])||0,Je=(Je-jA[1])/(jA[3]-jA[1])||0,tt=tt/(jA[2]-jA[0])||0,je=je/(jA[3]-jA[1])||0):!ye&&ce&&(ke=jA[0]+ke*(jA[2]-jA[0]),Je=jA[1]+Je*(jA[3]-jA[1]),tt*=jA[2]-jA[0],je*=jA[3]-jA[1]);let Ce=this.getViewbox("viewBox",[0,0,tt,je]),st=UA(gA((this.attr("preserveAspectRatio")||"").trim(),tt,je,Ce[2],Ce[3],0),[1,0,0,1,-Ce[0],-Ce[1]]),lt=IA(this.attr("patternTransform"));if(ye&&(lt=UA([jA[2]-jA[0],0,0,jA[3]-jA[1],jA[0],jA[1]],lt)),lt=UA(lt,[1,0,0,1,ke,Je]),(lt=J(lt))&&(st=J(st))&&(tt=JA(tt))&&(je=JA(je))){let wt=L([0,0,tt,je]);return g.transform.apply(g,st),this.drawChildren(WA,ae),P(wt),[NA(wt,tt,je,lt),ue]}return vA?[vA[0],vA[1]*ue]:void 0},this.getVWidth=function(){let jA="userSpaceOnUse"!==this.attr("patternUnits"),ue=this.getLength("width",jA?1:this.getParentVWidth(),0);return this.getViewbox("viewBox",[0,0,ue,0])[2]},this.getVHeight=function(){let jA="userSpaceOnUse"!==this.attr("patternUnits"),ue=this.getLength("height",jA?1:this.getParentVHeight(),0);return this.getViewbox("viewBox",[0,0,0,ue])[3]}},MA=function(GA,zA,vA){sA.call(this,GA,zA),this.allowedChildren=["stop"],this.ref=function(){let jA=this.getUrl("href")||this.getUrl("xlink:href");if(jA&&jA.nodeName===GA.nodeName)return new MA(jA,zA,vA)}.call(this);let qA=this.attr;this.attr=function(jA){let ue=qA.call(this,jA);return null!=ue||"href"===jA||"xlink:href"===jA?ue:this.ref?this.ref.attr(jA):null};let ZA=this.getChildren;this.getChildren=function(){let jA=ZA.call(this);return jA.length>0?jA:this.ref?this.ref.getChildren():[]},this.getPaint=function(jA,ue,WA,ae){let ce=this.getChildren();if(0===ce.length)return;if(1===ce.length){let ot=ce[0],ut=ot.get("stop-color");return"none"===ut?void 0:fA(ut,ot.get("stop-opacity")*ue,ae)}let tt,je,Ce,_e,st,lt,ye="userSpaceOnUse"!==this.attr("gradientUnits"),ke=IA(this.attr("gradientTransform")),Je=this.attr("spreadMethod"),wt=0,Bt=0,pt=1;if(ye&&(ke=UA([jA[2]-jA[0],0,0,jA[3]-jA[1],jA[0],jA[1]],ke)),ke=J(ke)){if("linearGradient"===this.name)je=this.getLength("x1",ye?1:this.getVWidth(),0),Ce=this.getLength("x2",ye?1:this.getVWidth(),ye?1:this.getVWidth()),_e=this.getLength("y1",ye?1:this.getVHeight(),0),st=this.getLength("y2",ye?1:this.getVHeight(),0);else{Ce=this.getLength("cx",ye?1:this.getVWidth(),ye?.5:.5*this.getVWidth()),st=this.getLength("cy",ye?1:this.getVHeight(),ye?.5:.5*this.getVHeight()),lt=this.getLength("r",ye?1:this.getViewport(),ye?.5:.5*this.getViewport()),je=this.getLength("fx",ye?1:this.getVWidth(),Ce),_e=this.getLength("fy",ye?1:this.getVHeight(),st),lt<0&&Mt("SvgElemGradient: negative r value");let ot=Math.sqrt(Math.pow(Ce-je,2)+Math.pow(st-_e,2)),ut=1;ot>lt&&(ut=lt/ot,je=Ce+(je-Ce)*ut,_e=st+(_e-st)*ut),lt=Math.max(lt,ot*ut*1.000001)}if("reflect"===Je||"repeat"===Je){let ot=cA(ke),ut=yA([jA[0],jA[1]],ot),an=yA([jA[2],jA[1]],ot),Wt=yA([jA[2],jA[3]],ot),_t=yA([jA[0],jA[3]],ot);"linearGradient"===this.name?(wt=Math.max((ut[0]-Ce)*(Ce-je)+(ut[1]-st)*(st-_e),(an[0]-Ce)*(Ce-je)+(an[1]-st)*(st-_e),(Wt[0]-Ce)*(Ce-je)+(Wt[1]-st)*(st-_e),(_t[0]-Ce)*(Ce-je)+(_t[1]-st)*(st-_e))/(Math.pow(Ce-je,2)+Math.pow(st-_e,2)),Bt=Math.max((ut[0]-je)*(je-Ce)+(ut[1]-_e)*(_e-st),(an[0]-je)*(je-Ce)+(an[1]-_e)*(_e-st),(Wt[0]-je)*(je-Ce)+(Wt[1]-_e)*(_e-st),(_t[0]-je)*(je-Ce)+(_t[1]-_e)*(_e-st))/(Math.pow(Ce-je,2)+Math.pow(st-_e,2))):wt=Math.sqrt(Math.max(Math.pow(ut[0]-Ce,2)+Math.pow(ut[1]-st,2),Math.pow(an[0]-Ce,2)+Math.pow(an[1]-st,2),Math.pow(Wt[0]-Ce,2)+Math.pow(Wt[1]-st,2),Math.pow(_t[0]-Ce,2)+Math.pow(_t[1]-st,2)))/lt-1,wt=Math.ceil(wt+.5),Bt=Math.ceil(Bt+.5),pt=Bt+1+wt}tt="linearGradient"===this.name?g.linearGradient(je-Bt*(Ce-je),_e-Bt*(st-_e),Ce+wt*(Ce-je),st+wt*(st-_e)):g.radialGradient(je,_e,0,Ce,st,lt+wt*lt);for(let ot=0;ot0&&tt.stop((ot+0)/pt,Pt[0],Pt[1]),tt.stop((ot+ut)/(wt+Bt+1),Pt[0],Pt[1]),Wt===ce.length-1&&ut<1&&tt.stop((ot+1)/pt,Pt[0],Pt[1])}}return tt.setTransform.apply(tt,ke),[tt,1]}return vA?[vA[0],vA[1]*ue]:void 0}},Pe=function(GA,zA){S.call(this,GA,zA),this.dashScale=1,this.getBoundingShape=function(){return this.shape},this.getTransformation=function(){return this.get("transform")},this.drawInDocument=function(vA,qA){if("hidden"!==this.get("visibility")&&this.shape){if(g.save(),"non-scaling-stroke"===this.get("vector-effect")?this.shape.transform(this.getTransformation()):this.transform(),this.clip(),vA)this.shape.insertInDocument(),pA(j.white),g.fill(this.get("clip-rule"));else{let jA;this.mask()&&(jA=L(Ee()));let ue=this.shape.getSubPaths(),WA=this.getFill(vA,qA),ae=this.getStroke(vA,qA),ce=this.get("stroke-width"),ye=this.get("stroke-linecap");if("non-scaling-stroke"===this.get("vector-effect")&&(ce/=function HA(){const GA=Ee();return g.page.width/GA[2]}()),WA||ae){if(WA&&pA(WA),ae){for(let _e=0;_e0&&ue[_e].startPoint&&ue[_e].startPoint.length>1){let st=ue[_e].startPoint[0],lt=ue[_e].startPoint[1];pA(ae),"square"===ye?g.rect(st-.5*ce,lt-.5*ce,ce,ce):"round"===ye&&g.circle(st,lt,.5*ce),g.fill()}let je=this.get("stroke-dasharray"),Ce=this.get("stroke-dashoffset");if(LA(this.dashScale,1)){for(let _e=0;_e0&&ue[je].insertInDocument();WA&&ae?g.fillAndStroke(this.get("fill-rule")):WA?g.fill(this.get("fill-rule")):ae&&g.stroke()}let ke=this.get("marker-start"),Je=this.get("marker-mid"),tt=this.get("marker-end");if("none"!==ke||"none"!==Je||"none"!==tt){let je=this.shape.getMarkers();if("none"!==ke&&je.length>0&&new et(ke,null).drawMarker(!1,qA,je[0],ce),"none"!==Je)for(let Ce=1;Ce0&&new et(tt,null).drawMarker(!1,qA,je[je.length-1],ce)}jA&&(P(jA),rA(jA))}g.restore()}}},At=function(GA,zA){Pe.call(this,GA,zA);let vA=this.getLength("x",this.getVWidth(),0),qA=this.getLength("y",this.getVHeight(),0),ZA=this.getLength("width",this.getVWidth(),0),jA=this.getLength("height",this.getVHeight(),0),ue=this.getLength("rx",this.getVWidth()),WA=this.getLength("ry",this.getVHeight());void 0===ue&&void 0===WA?ue=WA=0:void 0===ue&&void 0!==WA?ue=WA:void 0!==ue&&void 0===WA&&(WA=ue),ZA>0&&jA>0?ue&&WA?(ue=Math.min(ue,.5*ZA),WA=Math.min(WA,.5*jA),this.shape=(new oe).M(vA+ue,qA).L(vA+ZA-ue,qA).A(ue,WA,0,0,1,vA+ZA,qA+WA).L(vA+ZA,qA+jA-WA).A(ue,WA,0,0,1,vA+ZA-ue,qA+jA).L(vA+ue,qA+jA).A(ue,WA,0,0,1,vA,qA+jA-WA).L(vA,qA+WA).A(ue,WA,0,0,1,vA+ue,qA).Z()):this.shape=(new oe).M(vA,qA).L(vA+ZA,qA).L(vA+ZA,qA+jA).L(vA,qA+jA).Z():this.shape=new oe},_=function(GA,zA){Pe.call(this,GA,zA);let vA=this.getLength("cx",this.getVWidth(),0),qA=this.getLength("cy",this.getVHeight(),0),ZA=this.getLength("r",this.getViewport(),0);this.shape=ZA>0?(new oe).M(vA+ZA,qA).A(ZA,ZA,0,0,1,vA-ZA,qA).A(ZA,ZA,0,0,1,vA+ZA,qA).Z():new oe},be=function(GA,zA){Pe.call(this,GA,zA);let vA=this.getLength("cx",this.getVWidth(),0),qA=this.getLength("cy",this.getVHeight(),0),ZA=this.getLength("rx",this.getVWidth(),0),jA=this.getLength("ry",this.getVHeight(),0);this.shape=ZA>0&&jA>0?(new oe).M(vA+ZA,qA).A(ZA,jA,0,0,1,vA-ZA,qA).A(ZA,jA,0,0,1,vA+ZA,qA).Z():new oe},Re=function(GA,zA){Pe.call(this,GA,zA);let vA=this.getLength("x1",this.getVWidth(),0),qA=this.getLength("y1",this.getVHeight(),0),ZA=this.getLength("x2",this.getVWidth(),0),jA=this.getLength("y2",this.getVHeight(),0);this.shape=(new oe).M(vA,qA).L(ZA,jA)},SA=function(GA,zA){Pe.call(this,GA,zA);let vA=this.getNumberList("points");this.shape=new oe;for(let qA=0;qA0?vA:void 0,this.dashScale=void 0!==this.pathLength?this.shape.totalLength/this.pathLength:1},et=function(GA,zA){Y.call(this,GA,zA);let vA=this.getLength("markerWidth",this.getParentVWidth(),3),qA=this.getLength("markerHeight",this.getParentVHeight(),3),ZA=this.getViewbox("viewBox",[0,0,vA,qA]);this.getVWidth=function(){return ZA[2]},this.getVHeight=function(){return ZA[3]},this.drawMarker=function(jA,ue,WA,ae){g.save();let ce=this.attr("orient"),ye=this.attr("markerUnits"),ke="auto"===ce?WA[2]:(parseFloat(ce)||0)*Math.PI/180,Je="userSpaceOnUse"===ye?1:ae;g.transform(Math.cos(ke)*Je,Math.sin(ke)*Je,-Math.sin(ke)*Je,Math.cos(ke)*Je,WA[0],WA[1]);let _e,tt=this.getLength("refX",this.getVWidth(),0),je=this.getLength("refY",this.getVHeight(),0),Ce=gA(this.attr("preserveAspectRatio"),vA,qA,ZA[2],ZA[3],.5);"hidden"===this.get("overflow")&&g.rect(Ce[0]*(ZA[0]+ZA[2]/2-tt)-vA/2,Ce[3]*(ZA[1]+ZA[3]/2-je)-qA/2,vA,qA).clip(),g.transform.apply(g,Ce),g.translate(-tt,-je),this.get("opacity")<1&&!jA&&(_e=L(Ee())),this.drawChildren(jA,ue),_e&&(P(_e),g.fillOpacity(this.get("opacity")),rA(_e)),g.restore()}},Ke=function(GA,zA){Y.call(this,GA,zA),this.useMask=function(vA){let qA=L(Ee());g.save(),g.transform.apply(g,this.get("transform")),"objectBoundingBox"===this.attr("clipPathUnits")&&g.transform(vA[2]-vA[0],0,0,vA[3]-vA[1],vA[0],vA[1]),this.clip(),this.drawChildren(!0,!1),g.restore(),P(qA),QA(qA,!0)}},$e=function(GA,zA){Y.call(this,GA,zA),this.useMask=function(vA){let ZA,jA,ue,WA,qA=L(Ee());g.save(),"userSpaceOnUse"===this.attr("maskUnits")?(ZA=this.getLength("x",this.getVWidth(),-.1*(vA[2]-vA[0])+vA[0]),jA=this.getLength("y",this.getVHeight(),-.1*(vA[3]-vA[1])+vA[1]),ue=this.getLength("width",this.getVWidth(),1.2*(vA[2]-vA[0])),WA=this.getLength("height",this.getVHeight(),1.2*(vA[3]-vA[1]))):(ZA=this.getLength("x",this.getVWidth(),-.1)*(vA[2]-vA[0])+vA[0],jA=this.getLength("y",this.getVHeight(),-.1)*(vA[3]-vA[1])+vA[1],ue=this.getLength("width",this.getVWidth(),1.2)*(vA[2]-vA[0]),WA=this.getLength("height",this.getVHeight(),1.2)*(vA[3]-vA[1])),"objectBoundingBox"===this.attr("maskContentUnits")&&g.transform(vA[2]-vA[0],0,0,vA[3]-vA[1],vA[0],vA[1]),this.clip(),this.drawChildren(!1,!0),g.restore(),P(qA),QA(qA,!0)}},ht=function(GA,zA){S.call(this,GA,zA),this.allowedChildren=["tspan","#text","#cdata-section","a"],this.isText=!0,this.getBoundingShape=function(){let vA=new oe;for(let qA=0;qA0?jA:this.pathObject.totalLength,this.pathScale=this.pathObject.totalLength/this.pathLength}else if((ZA=this.getUrl("href")||this.getUrl("xlink:href"))&&"path"===ZA.nodeName){let jA=new Fe(ZA,this);this.pathObject=jA.shape.clone().transform(jA.get("transform")),this.pathLength=this.chooseValue(jA.pathLength,this.pathObject.totalLength),this.pathScale=this.pathObject.totalLength/this.pathLength}},mt=function(GA,zA){ht.call(this,GA,zA),this.allowedChildren=["textPath","tspan","#text","#cdata-section","a"],function(vA){let WA,ae,qA="",ZA=GA.textContent,jA=[],ue=[],ce=0,ye=0;function ke(){if(ue.length){let Ce=ue[ue.length-1],lt={startltr:0,middleltr:.5,endltr:1,startrtl:1,middlertl:.5,endrtl:0}[WA+ae]*(Ce.x+Ce.width-ue[0].x)||0;for(let wt=0;wtst||pt<0)Ce._pos[Bt].hidden=!0;else{let ot=_e.getPointAtLength(pt*lt);LA(lt,1)&&(Ce._pos[Bt].scale*=lt,Ce._pos[Bt].width*=lt),Ce._pos[Bt].x=ot[0]-.5*Ce._pos[Bt].width*Math.cos(ot[2])-Ce._pos[Bt].y*Math.sin(ot[2]),Ce._pos[Bt].y=ot[1]-.5*Ce._pos[Bt].width*Math.sin(ot[2])+Ce._pos[Bt].y*Math.cos(ot[2]),Ce._pos[Bt].rotate=ot[2]+Ce._pos[Bt].rotate,Ce._pos[Bt].continuous=!1}}}else for(let wt=0;wt0&&ot<1/0)for(let ut=0;ut=2){let ot=(_e-(pt-Bt))/(Ce.length-1);for(let ut=0;utN)throw new RangeError('The value "'+sA+'" is invalid for option "size"');const S=new Uint8Array(sA);return Object.setPrototypeOf(S,B.prototype),S}function B(sA,S,Y){if("number"==typeof sA){if("string"==typeof S)throw new TypeError('The "string" argument must be of type string. Received type number');return aA(sA)}return j(sA,S,Y)}function j(sA,S,Y){if("string"==typeof sA)return function AA(sA,S){if(("string"!=typeof S||""===S)&&(S="utf8"),!B.isEncoding(S))throw new TypeError("Unknown encoding: "+S);const Y=0|uA(sA,S);let k=v(Y);const m=k.write(sA,S);return m!==Y&&(k=k.slice(0,m)),k}(sA,S);if(ArrayBuffer.isView(sA))return function P(sA){if(Ne(sA,Uint8Array)){const S=new Uint8Array(sA);return rA(S.buffer,S.byteOffset,S.byteLength)}return L(sA)}(sA);if(null==sA)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof sA);if(Ne(sA,ArrayBuffer)||sA&&Ne(sA.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(sA,SharedArrayBuffer)||sA&&Ne(sA.buffer,SharedArrayBuffer)))return rA(sA,S,Y);if("number"==typeof sA)throw new TypeError('The "value" argument must not be of type number. Received type number');const k=sA.valueOf&&sA.valueOf();if(null!=k&&k!==sA)return B.from(k,S,Y);const m=function QA(sA){if(B.isBuffer(sA)){const S=0|NA(sA.length),Y=v(S);return 0===Y.length||sA.copy(Y,0,0,S),Y}return void 0!==sA.length?"number"!=typeof sA.length||Te(sA.length)?v(0):L(sA):"Buffer"===sA.type&&Array.isArray(sA.data)?L(sA.data):void 0}(sA);if(m)return m;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof sA[Symbol.toPrimitive])return B.from(sA[Symbol.toPrimitive]("string"),S,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof sA)}function tA(sA){if("number"!=typeof sA)throw new TypeError('"size" argument must be of type number');if(sA<0)throw new RangeError('The value "'+sA+'" is invalid for option "size"')}function aA(sA){return tA(sA),v(sA<0?0:0|NA(sA))}function L(sA){const S=sA.length<0?0:0|NA(sA.length),Y=v(S);for(let k=0;k=N)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N.toString(16)+" bytes");return 0|sA}function uA(sA,S){if(B.isBuffer(sA))return sA.length;if(ArrayBuffer.isView(sA)||Ne(sA,ArrayBuffer))return sA.byteLength;if("string"!=typeof sA)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof sA);const Y=sA.length,k=arguments.length>2&&!0===arguments[2];if(!k&&0===Y)return 0;let m=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return YA(sA).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Y;case"hex":return Y>>>1;case"base64":return le(sA).length;default:if(m)return k?-1:YA(sA).length;S=(""+S).toLowerCase(),m=!0}}function dA(sA,S,Y){let k=!1;if((void 0===S||S<0)&&(S=0),S>this.length||((void 0===Y||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0)<=(S>>>=0))return"";for(sA||(sA="utf8");;)switch(sA){case"hex":return Ee(this,S,Y);case"utf8":case"utf-8":return hA(this,S,Y);case"ascii":return yA(this,S,Y);case"latin1":case"binary":return xA(this,S,Y);case"base64":return kA(this,S,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return HA(this,S,Y);default:if(k)throw new TypeError("Unknown encoding: "+sA);sA=(sA+"").toLowerCase(),k=!0}}function RA(sA,S,Y){const k=sA[S];sA[S]=sA[Y],sA[Y]=k}function nA(sA,S,Y,k,m){if(0===sA.length)return-1;if("string"==typeof Y?(k=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Te(Y=+Y)&&(Y=m?0:sA.length-1),Y<0&&(Y=sA.length+Y),Y>=sA.length){if(m)return-1;Y=sA.length-1}else if(Y<0){if(!m)return-1;Y=0}if("string"==typeof S&&(S=B.from(S,k)),B.isBuffer(S))return 0===S.length?-1:H(sA,S,Y,k,m);if("number"==typeof S)return S&=255,"function"==typeof Uint8Array.prototype.indexOf?m?Uint8Array.prototype.indexOf.call(sA,S,Y):Uint8Array.prototype.lastIndexOf.call(sA,S,Y):H(sA,[S],Y,k,m);throw new TypeError("val must be string, number or Buffer")}function H(sA,S,Y,k,m){let Ae,E=1,mA=sA.length,ie=S.length;if(void 0!==k&&("ucs2"===(k=String(k).toLowerCase())||"ucs-2"===k||"utf16le"===k||"utf-16le"===k)){if(sA.length<2||S.length<2)return-1;E=2,mA/=2,ie/=2,Y/=2}function DA(pe,MA){return 1===E?pe[MA]:pe.readUInt16BE(MA*E)}if(m){let pe=-1;for(Ae=Y;AemA&&(Y=mA-ie),Ae=Y;Ae>=0;Ae--){let pe=!0;for(let MA=0;MAm&&(k=m):k=m;const E=S.length;let mA;for(k>E/2&&(k=E/2),mA=0;mA>8,m=Y%256,E.push(m),E.push(k);return E}(S,sA.length-Y),sA,Y,k)}function kA(sA,S,Y){return t.fromByteArray(0===S&&Y===sA.length?sA:sA.slice(S,Y))}function hA(sA,S,Y){Y=Math.min(sA.length,Y);const k=[];let m=S;for(;m239?4:E>223?3:E>191?2:1;if(m+ie<=Y){let DA,Ae,pe,MA;switch(ie){case 1:E<128&&(mA=E);break;case 2:DA=sA[m+1],128==(192&DA)&&(MA=(31&E)<<6|63&DA,MA>127&&(mA=MA));break;case 3:DA=sA[m+1],Ae=sA[m+2],128==(192&DA)&&128==(192&Ae)&&(MA=(15&E)<<12|(63&DA)<<6|63&Ae,MA>2047&&(MA<55296||MA>57343)&&(mA=MA));break;case 4:DA=sA[m+1],Ae=sA[m+2],pe=sA[m+3],128==(192&DA)&&128==(192&Ae)&&128==(192&pe)&&(MA=(15&E)<<18|(63&DA)<<12|(63&Ae)<<6|63&pe,MA>65535&&MA<1114112&&(mA=MA))}}null===mA?(mA=65533,ie=1):mA>65535&&(mA-=65536,k.push(mA>>>10&1023|55296),mA=56320|1023&mA),k.push(mA),m+=ie}return function UA(sA){const S=sA.length;if(S<=4096)return String.fromCharCode.apply(String,sA);let Y="",k=0;for(;kk)&&(Y=k);let m="";for(let E=S;EY)throw new RangeError("Trying to access beyond buffer length")}function J(sA,S,Y,k,m,E){if(!B.isBuffer(sA))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>m||SsA.length)throw new RangeError("Index out of range")}function U(sA,S,Y,k,m){b(S,k,m,sA,Y,7);let E=Number(S&BigInt(4294967295));sA[Y++]=E,E>>=8,sA[Y++]=E,E>>=8,sA[Y++]=E,E>>=8,sA[Y++]=E;let mA=Number(S>>BigInt(32)&BigInt(4294967295));return sA[Y++]=mA,mA>>=8,sA[Y++]=mA,mA>>=8,sA[Y++]=mA,mA>>=8,sA[Y++]=mA,Y}function O(sA,S,Y,k,m){b(S,k,m,sA,Y,7);let E=Number(S&BigInt(4294967295));sA[Y+7]=E,E>>=8,sA[Y+6]=E,E>>=8,sA[Y+5]=E,E>>=8,sA[Y+4]=E;let mA=Number(S>>BigInt(32)&BigInt(4294967295));return sA[Y+3]=mA,mA>>=8,sA[Y+2]=mA,mA>>=8,sA[Y+1]=mA,mA>>=8,sA[Y]=mA,Y+8}function lA(sA,S,Y,k,m,E){if(Y+k>sA.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function LA(sA,S,Y,k,m){return S=+S,Y>>>=0,m||lA(sA,0,Y,4),g.write(sA,S,Y,k,23,4),Y+4}function JA(sA,S,Y,k,m){return S=+S,Y>>>=0,m||lA(sA,0,Y,8),g.write(sA,S,Y,k,52,8),Y+8}Q.kMaxLength=N,!(B.TYPED_ARRAY_SUPPORT=function K(){try{const sA=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(sA,S),42===sA.foo()}catch{return!1}}())&&typeof console<"u"&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(B.prototype,"parent",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.buffer}}),Object.defineProperty(B.prototype,"offset",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.byteOffset}}),B.poolSize=8192,B.from=function(sA,S,Y){return j(sA,S,Y)},Object.setPrototypeOf(B.prototype,Uint8Array.prototype),Object.setPrototypeOf(B,Uint8Array),B.alloc=function(sA,S,Y){return function w(sA,S,Y){return tA(sA),sA<=0?v(sA):void 0!==S?"string"==typeof Y?v(sA).fill(S,Y):v(sA).fill(S):v(sA)}(sA,S,Y)},B.allocUnsafe=function(sA){return aA(sA)},B.allocUnsafeSlow=function(sA){return aA(sA)},B.isBuffer=function(S){return null!=S&&!0===S._isBuffer&&S!==B.prototype},B.compare=function(S,Y){if(Ne(S,Uint8Array)&&(S=B.from(S,S.offset,S.byteLength)),Ne(Y,Uint8Array)&&(Y=B.from(Y,Y.offset,Y.byteLength)),!B.isBuffer(S)||!B.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===Y)return 0;let k=S.length,m=Y.length;for(let E=0,mA=Math.min(k,m);Em.length?(B.isBuffer(mA)||(mA=B.from(mA)),mA.copy(m,E)):Uint8Array.prototype.set.call(m,mA,E);else{if(!B.isBuffer(mA))throw new TypeError('"list" argument must be an Array of Buffers');mA.copy(m,E)}E+=mA.length}return m},B.byteLength=uA,B.prototype._isBuffer=!0,B.prototype.swap16=function(){const S=this.length;if(S%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;YY&&(S+=" ... "),""},I&&(B.prototype[I]=B.prototype.inspect),B.prototype.compare=function(S,Y,k,m,E){if(Ne(S,Uint8Array)&&(S=B.from(S,S.offset,S.byteLength)),!B.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(void 0===Y&&(Y=0),void 0===k&&(k=S?S.length:0),void 0===m&&(m=0),void 0===E&&(E=this.length),Y<0||k>S.length||m<0||E>this.length)throw new RangeError("out of range index");if(m>=E&&Y>=k)return 0;if(m>=E)return-1;if(Y>=k)return 1;if(this===S)return 0;let mA=(E>>>=0)-(m>>>=0),ie=(k>>>=0)-(Y>>>=0);const DA=Math.min(mA,ie),Ae=this.slice(m,E),pe=S.slice(Y,k);for(let MA=0;MA>>=0,isFinite(k)?(k>>>=0,void 0===m&&(m="utf8")):(m=k,k=void 0)}const E=this.length-Y;if((void 0===k||k>E)&&(k=E),S.length>0&&(k<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");let mA=!1;for(;;)switch(m){case"hex":return pA(this,S,Y,k);case"utf8":case"utf-8":return z(this,S,Y,k);case"ascii":case"latin1":case"binary":return OA(this,S,Y,k);case"base64":return wA(this,S,Y,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return VA(this,S,Y,k);default:if(mA)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),mA=!0}},B.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},B.prototype.slice=function(S,Y){const k=this.length;(S=~~S)<0?(S+=k)<0&&(S=0):S>k&&(S=k),(Y=void 0===Y?k:~~Y)<0?(Y+=k)<0&&(Y=0):Y>k&&(Y=k),Y>>=0,Y>>>=0,k||cA(S,Y,this.length);let m=this[S],E=1,mA=0;for(;++mA>>=0,Y>>>=0,k||cA(S,Y,this.length);let m=this[S+--Y],E=1;for(;Y>0&&(E*=256);)m+=this[S+--Y]*E;return m},B.prototype.readUint8=B.prototype.readUInt8=function(S,Y){return S>>>=0,Y||cA(S,1,this.length),this[S]},B.prototype.readUint16LE=B.prototype.readUInt16LE=function(S,Y){return S>>>=0,Y||cA(S,2,this.length),this[S]|this[S+1]<<8},B.prototype.readUint16BE=B.prototype.readUInt16BE=function(S,Y){return S>>>=0,Y||cA(S,2,this.length),this[S]<<8|this[S+1]},B.prototype.readUint32LE=B.prototype.readUInt32LE=function(S,Y){return S>>>=0,Y||cA(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+16777216*this[S+3]},B.prototype.readUint32BE=B.prototype.readUInt32BE=function(S,Y){return S>>>=0,Y||cA(S,4,this.length),16777216*this[S]+(this[S+1]<<16|this[S+2]<<8|this[S+3])},B.prototype.readBigUInt64LE=Oe(function(S){R(S>>>=0,"offset");const Y=this[S],k=this[S+7];(void 0===Y||void 0===k)&&M(S,this.length-8);const m=Y+256*this[++S]+65536*this[++S]+this[++S]*2**24,E=this[++S]+256*this[++S]+65536*this[++S]+k*2**24;return BigInt(m)+(BigInt(E)<>>=0,"offset");const Y=this[S],k=this[S+7];(void 0===Y||void 0===k)&&M(S,this.length-8);const m=Y*2**24+65536*this[++S]+256*this[++S]+this[++S],E=this[++S]*2**24+65536*this[++S]+256*this[++S]+k;return(BigInt(m)<>>=0,Y>>>=0,k||cA(S,Y,this.length);let m=this[S],E=1,mA=0;for(;++mA=E&&(m-=Math.pow(2,8*Y)),m},B.prototype.readIntBE=function(S,Y,k){S>>>=0,Y>>>=0,k||cA(S,Y,this.length);let m=Y,E=1,mA=this[S+--m];for(;m>0&&(E*=256);)mA+=this[S+--m]*E;return E*=128,mA>=E&&(mA-=Math.pow(2,8*Y)),mA},B.prototype.readInt8=function(S,Y){return S>>>=0,Y||cA(S,1,this.length),128&this[S]?-1*(255-this[S]+1):this[S]},B.prototype.readInt16LE=function(S,Y){S>>>=0,Y||cA(S,2,this.length);const k=this[S]|this[S+1]<<8;return 32768&k?4294901760|k:k},B.prototype.readInt16BE=function(S,Y){S>>>=0,Y||cA(S,2,this.length);const k=this[S+1]|this[S]<<8;return 32768&k?4294901760|k:k},B.prototype.readInt32LE=function(S,Y){return S>>>=0,Y||cA(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},B.prototype.readInt32BE=function(S,Y){return S>>>=0,Y||cA(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},B.prototype.readBigInt64LE=Oe(function(S){R(S>>>=0,"offset");const Y=this[S],k=this[S+7];return(void 0===Y||void 0===k)&&M(S,this.length-8),(BigInt(this[S+4]+256*this[S+5]+65536*this[S+6]+(k<<24))<>>=0,"offset");const Y=this[S],k=this[S+7];(void 0===Y||void 0===k)&&M(S,this.length-8);const m=(Y<<24)+65536*this[++S]+256*this[++S]+this[++S];return(BigInt(m)<>>=0,Y||cA(S,4,this.length),g.read(this,S,!0,23,4)},B.prototype.readFloatBE=function(S,Y){return S>>>=0,Y||cA(S,4,this.length),g.read(this,S,!1,23,4)},B.prototype.readDoubleLE=function(S,Y){return S>>>=0,Y||cA(S,8,this.length),g.read(this,S,!0,52,8)},B.prototype.readDoubleBE=function(S,Y){return S>>>=0,Y||cA(S,8,this.length),g.read(this,S,!1,52,8)},B.prototype.writeUintLE=B.prototype.writeUIntLE=function(S,Y,k,m){S=+S,Y>>>=0,k>>>=0,m||J(this,S,Y,k,Math.pow(2,8*k)-1,0);let E=1,mA=0;for(this[Y]=255&S;++mA>>=0,k>>>=0,m||J(this,S,Y,k,Math.pow(2,8*k)-1,0);let E=k-1,mA=1;for(this[Y+E]=255&S;--E>=0&&(mA*=256);)this[Y+E]=S/mA&255;return Y+k},B.prototype.writeUint8=B.prototype.writeUInt8=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,1,255,0),this[Y]=255&S,Y+1},B.prototype.writeUint16LE=B.prototype.writeUInt16LE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,2,65535,0),this[Y]=255&S,this[Y+1]=S>>>8,Y+2},B.prototype.writeUint16BE=B.prototype.writeUInt16BE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,2,65535,0),this[Y]=S>>>8,this[Y+1]=255&S,Y+2},B.prototype.writeUint32LE=B.prototype.writeUInt32LE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,4,4294967295,0),this[Y+3]=S>>>24,this[Y+2]=S>>>16,this[Y+1]=S>>>8,this[Y]=255&S,Y+4},B.prototype.writeUint32BE=B.prototype.writeUInt32BE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,4,4294967295,0),this[Y]=S>>>24,this[Y+1]=S>>>16,this[Y+2]=S>>>8,this[Y+3]=255&S,Y+4},B.prototype.writeBigUInt64LE=Oe(function(S,Y){return void 0===Y&&(Y=0),U(this,S,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),B.prototype.writeBigUInt64BE=Oe(function(S,Y){return void 0===Y&&(Y=0),O(this,S,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),B.prototype.writeIntLE=function(S,Y,k,m){if(S=+S,Y>>>=0,!m){const DA=Math.pow(2,8*k-1);J(this,S,Y,k,DA-1,-DA)}let E=0,mA=1,ie=0;for(this[Y]=255&S;++E>>=0,!m){const DA=Math.pow(2,8*k-1);J(this,S,Y,k,DA-1,-DA)}let E=k-1,mA=1,ie=0;for(this[Y+E]=255&S;--E>=0&&(mA*=256);)S<0&&0===ie&&0!==this[Y+E+1]&&(ie=1),this[Y+E]=(S/mA|0)-ie&255;return Y+k},B.prototype.writeInt8=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,1,127,-128),S<0&&(S=255+S+1),this[Y]=255&S,Y+1},B.prototype.writeInt16LE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,2,32767,-32768),this[Y]=255&S,this[Y+1]=S>>>8,Y+2},B.prototype.writeInt16BE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,2,32767,-32768),this[Y]=S>>>8,this[Y+1]=255&S,Y+2},B.prototype.writeInt32LE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,4,2147483647,-2147483648),this[Y]=255&S,this[Y+1]=S>>>8,this[Y+2]=S>>>16,this[Y+3]=S>>>24,Y+4},B.prototype.writeInt32BE=function(S,Y,k){return S=+S,Y>>>=0,k||J(this,S,Y,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[Y]=S>>>24,this[Y+1]=S>>>16,this[Y+2]=S>>>8,this[Y+3]=255&S,Y+4},B.prototype.writeBigInt64LE=Oe(function(S,Y){return void 0===Y&&(Y=0),U(this,S,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),B.prototype.writeBigInt64BE=Oe(function(S,Y){return void 0===Y&&(Y=0),O(this,S,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),B.prototype.writeFloatLE=function(S,Y,k){return LA(this,S,Y,!0,k)},B.prototype.writeFloatBE=function(S,Y,k){return LA(this,S,Y,!1,k)},B.prototype.writeDoubleLE=function(S,Y,k){return JA(this,S,Y,!0,k)},B.prototype.writeDoubleBE=function(S,Y,k){return JA(this,S,Y,!1,k)},B.prototype.copy=function(S,Y,k,m){if(!B.isBuffer(S))throw new TypeError("argument should be a Buffer");if(k||(k=0),!m&&0!==m&&(m=this.length),Y>=S.length&&(Y=S.length),Y||(Y=0),m>0&&m=this.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),S.length-Y>>=0,k=void 0===k?this.length:k>>>0,S||(S=0),"number"==typeof S)for(E=Y;E=k+4;Y-=3)S=`_${sA.slice(Y-3,Y)}${S}`;return`${sA.slice(0,Y)}${S}`}function b(sA,S,Y,k,m,E){if(sA>Y||sA3?0===S||S===BigInt(0)?`>= 0${mA} and < 2${mA} ** ${8*(E+1)}${mA}`:`>= -(2${mA} ** ${8*(E+1)-1}${mA}) and < 2 ** ${8*(E+1)-1}${mA}`:`>= ${S}${mA} and <= ${Y}${mA}`,new $A.ERR_OUT_OF_RANGE("value",ie,sA)}!function C(sA,S,Y){R(S,"offset"),(void 0===sA[S]||void 0===sA[S+Y])&&M(S,sA.length-(Y+1))}(k,m,E)}function R(sA,S){if("number"!=typeof sA)throw new $A.ERR_INVALID_ARG_TYPE(S,"number",sA)}function M(sA,S,Y){throw Math.floor(sA)!==sA?(R(sA,Y),new $A.ERR_OUT_OF_RANGE(Y||"offset","an integer",sA)):S<0?new $A.ERR_BUFFER_OUT_OF_BOUNDS:new $A.ERR_OUT_OF_RANGE(Y||"offset",`>= ${Y?1:0} and <= ${S}`,sA)}IA("ERR_BUFFER_OUT_OF_BOUNDS",function(sA){return sA?`${sA} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),IA("ERR_INVALID_ARG_TYPE",function(sA,S){return`The "${sA}" argument must be of type number. Received type ${typeof S}`},TypeError),IA("ERR_OUT_OF_RANGE",function(sA,S,Y){let k=`The value of "${sA}" is out of range.`,m=Y;return Number.isInteger(Y)&&Math.abs(Y)>4294967296?m=gA(String(Y)):"bigint"==typeof Y&&(m=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(m=gA(m)),m+="n"),k+=` It must be ${S}. Received ${m}`,k},RangeError);const D=/[^+/0-9A-Za-z-_]/g;function YA(sA,S){let Y;S=S||1/0;const k=sA.length;let m=null;const E=[];for(let mA=0;mA55295&&Y<57344){if(!m){if(Y>56319){(S-=3)>-1&&E.push(239,191,189);continue}if(mA+1===k){(S-=3)>-1&&E.push(239,191,189);continue}m=Y;continue}if(Y<56320){(S-=3)>-1&&E.push(239,191,189),m=Y;continue}Y=65536+(m-55296<<10|Y-56320)}else m&&(S-=3)>-1&&E.push(239,191,189);if(m=null,Y<128){if((S-=1)<0)break;E.push(Y)}else if(Y<2048){if((S-=2)<0)break;E.push(Y>>6|192,63&Y|128)}else if(Y<65536){if((S-=3)<0)break;E.push(Y>>12|224,Y>>6&63|128,63&Y|128)}else{if(!(Y<1114112))throw new Error("Invalid code point");if((S-=4)<0)break;E.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,63&Y|128)}}return E}function le(sA){return t.toByteArray(function X(sA){if((sA=(sA=sA.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;sA.length%4!=0;)sA+="=";return sA}(sA))}function ve(sA,S,Y,k){let m;for(m=0;m=S.length||m>=sA.length);++m)S[m+Y]=sA[m];return m}function Ne(sA,S){return sA instanceof S||null!=sA&&null!=sA.constructor&&null!=sA.constructor.name&&sA.constructor.name===S.name}function Te(sA){return sA!=sA}const ze=function(){const sA="0123456789abcdef",S=new Array(256);for(let Y=0;Y<16;++Y){const k=16*Y;for(let m=0;m<16;++m)S[k+m]=sA[Y]+sA[m]}return S}();function Oe(sA){return typeof BigInt>"u"?oe:sA}function oe(){throw new Error("BigInt not supported")}},4406(eA){"use strict";eA.exports=class t{constructor(I){this.stateTable=I.stateTable,this.accepting=I.accepting,this.tags=I.tags}match(I){var N=this;return{*[Symbol.iterator](){for(var K=1,v=null,B=null,j=null,tA=0;tA=v&&(yield[v,B,N.tags[j]]),K=N.stateTable[1][w],v=null),0!==K&&null==v&&(v=tA),N.accepting[K]&&(B=tA),0===K&&(K=1)}null!=v&&null!=B&&B>=v&&(yield[v,B,N.tags[K]])}}}apply(I,N){for(var K of this.match(I)){var v=K[0],B=K[1],j=K[2];for(var tA of j)"function"==typeof N[tA]&&N[tA](v,B,I.slice(v,B+1))}}}},3915(eA,Q,f){"use strict";f(8376),f(6401),f(2017),function(g){var I=typeof Uint8Array<"u"?Uint8Array:Array;function aA(P){var rA=P.charCodeAt(0);return 43===rA||45===rA?62:47===rA||95===rA?63:rA<48?-1:rA<58?rA-48+26+26:rA<91?rA-65:rA<123?rA-97+26:void 0}g.toByteArray=function AA(P){var rA,QA,NA,oA,uA,dA;if(P.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var RA=P.length;uA="="===P.charAt(RA-2)?2:"="===P.charAt(RA-1)?1:0,dA=new I(3*P.length/4-uA),NA=uA>0?P.length-4:P.length;var nA=0;function H(pA){dA[nA++]=pA}for(rA=0,QA=0;rA>16),H((65280&oA)>>8),H(255&oA);return 2===uA?H(255&(oA=aA(P.charAt(rA))<<2|aA(P.charAt(rA+1))>>4)):1===uA&&(H((oA=aA(P.charAt(rA))<<10|aA(P.charAt(rA+1))<<4|aA(P.charAt(rA+2))>>2)>>8&255),H(255&oA)),dA},g.fromByteArray=function L(P){var rA,oA,uA,QA=P.length%3,NA="";function dA(nA){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(nA)}function RA(nA){return dA(nA>>18&63)+dA(nA>>12&63)+dA(nA>>6&63)+dA(63&nA)}for(rA=0,uA=P.length-QA;rA>2),NA+=dA(oA<<4&63),NA+="==";break;case 2:NA+=dA((oA=(P[P.length-2]<<8)+P[P.length-1])>>10),NA+=dA(oA>>4&63),NA+=dA(oA<<2&63),NA+="="}return NA}}(Q)},182(eA,Q,f){"use strict";function t(rA,QA){var NA=Object.keys(rA);if(Object.getOwnPropertySymbols){var oA=Object.getOwnPropertySymbols(rA);QA&&(oA=oA.filter(function(uA){return Object.getOwnPropertyDescriptor(rA,uA).enumerable})),NA.push.apply(NA,oA)}return NA}function g(rA){for(var QA=1;QA0?this.tail.next=oA:this.head=oA,this.tail=oA,++this.length}},{key:"unshift",value:function(NA){var oA={data:NA,next:this.head};0===this.length&&(this.tail=oA),this.head=oA,++this.length}},{key:"shift",value:function(){if(0!==this.length){var NA=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,NA}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(NA){if(0===this.length)return"";for(var oA=this.head,uA=""+oA.data;oA=oA.next;)uA+=NA+oA.data;return uA}},{key:"concat",value:function(NA){if(0===this.length)return w.alloc(0);for(var oA=w.allocUnsafe(NA>>>0),uA=this.head,dA=0;uA;)P(uA.data,oA,dA),dA+=uA.data.length,uA=uA.next;return oA}},{key:"consume",value:function(NA,oA){var uA;return NARA.length?RA.length:NA;if(dA+=nA===RA.length?RA:RA.slice(0,NA),0===(NA-=nA)){nA===RA.length?(++uA,this.head=oA.next?oA.next:this.tail=null):(this.head=oA,oA.data=RA.slice(nA));break}++uA}return this.length-=uA,dA}},{key:"_getBuffer",value:function(NA){var oA=w.allocUnsafe(NA),uA=this.head,dA=1;for(uA.data.copy(oA),NA-=uA.data.length;uA=uA.next;){var RA=uA.data,nA=NA>RA.length?RA.length:NA;if(RA.copy(oA,oA.length-NA,0,nA),0===(NA-=nA)){nA===RA.length?(++dA,this.head=uA.next?uA.next:this.tail=null):(this.head=uA,uA.data=RA.slice(nA));break}++dA}return this.length-=dA,oA}},{key:L,value:function(NA,oA){return AA(this,g(g({},oA),{},{depth:0,customInspect:!1}))}}]),rA}()},5691(eA,Q,f){"use strict";var t=f(783),g=t.Buffer;function I(K,v){for(var B in K)v[B]=K[B]}function N(K,v,B){return g(K,v,B)}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?eA.exports=t:(I(t,Q),Q.Buffer=N),I(g,N),N.from=function(K,v,B){if("number"==typeof K)throw new TypeError("Argument must not be a number");return g(K,v,B)},N.alloc=function(K,v,B){if("number"!=typeof K)throw new TypeError("Argument must be a number");var j=g(K);return void 0!==v?"string"==typeof B?j.fill(v,B):j.fill(v):j.fill(0),j},N.allocUnsafe=function(K){if("number"!=typeof K)throw new TypeError("Argument must be a number");return g(K)},N.allocUnsafeSlow=function(K){if("number"!=typeof K)throw new TypeError("Argument must be a number");return t.SlowBuffer(K)}},7571(eA,Q,f){"use strict";f(8376),f(6401),f(2017);const t=f(3483),I=f(6016).swap32LE;eA.exports=class dA{constructor(nA){const H="function"==typeof nA.readUInt32BE&&"function"==typeof nA.slice;if(H||nA instanceof Uint8Array){let z;if(H)this.highStart=nA.readUInt32LE(0),this.errorValue=nA.readUInt32LE(4),z=nA.readUInt32LE(8),nA=nA.slice(12);else{const OA=new DataView(nA.buffer);this.highStart=OA.getUint32(0,!0),this.errorValue=OA.getUint32(4,!0),z=OA.getUint32(8,!0),nA=nA.subarray(12)}nA=t(nA,new Uint8Array(z)),nA=t(nA,new Uint8Array(z)),I(nA),this.data=new Uint32Array(nA.buffer)}else{var pA=nA;this.data=pA.data,this.highStart=pA.highStart,this.errorValue=pA.errorValue}}get(nA){let H;return nA<0||nA>1114111?this.errorValue:nA<55296||nA>56319&&nA<=65535?(H=(this.data[nA>>5]<<2)+(31&nA),this.data[H]):nA<=65535?(H=(this.data[2048+(nA-55296>>5)]<<2)+(31&nA),this.data[H]):nA>11)],H=this.data[H+(nA>>5&63)],H=(H<<2)+(31&nA),this.data[H]):this.data[this.data.length-4]}}},6016(eA,Q,f){"use strict";f(8376),f(6401),f(2017);const t=18===new Uint8Array(new Uint32Array([305419896]).buffer)[0],g=(K,v,B)=>{let j=K[v];K[v]=K[B],K[B]=j};eA.exports={swap32LE:K=>{t&&(K=>{const v=K.length;for(let B=0;Bthis._compareKeys(p,q)),y=["<<"];if(this.limits&&c.length>1){const q=c[c.length-1];y.push(` /Limits ${pA.convert([this._dataForKey(c[0]),this._dataForKey(q)])}`)}y.push(` /${this._keysName()} [`);for(let p of c)y.push(` ${pA.convert(this._dataForKey(p))} ${pA.convert(this._items[p])}`);return y.push("]"),y.push(">>"),y.join("\n")}_compareKeys(){throw new Error("Must be implemented by subclasses")}_keysName(){throw new Error("Must be implemented by subclasses")}_dataForKey(){throw new Error("Must be implemented by subclasses")}}class NA{constructor(c,y,p,q,CA,_A){this.id="CS"+Object.keys(c.spotColors).length,this.name=y,this.values=[p,q,CA,_A],this.ref=c.ref(["Separation",nA(this.name),"DeviceCMYK",{Range:[0,1,0,1,0,1,0,1],C0:[0,0,0,0],C1:this.values.map(ee=>ee/100),FunctionType:2,Domain:[0,1],N:1}]),this.ref.end()}toString(){return`${this.ref.id} 0 R`}}const oA=(h,c)=>(Array(c+1).join("0")+h).slice(-c),uA=h=>h>127||h>32&&127!==h&&35!==h&&37!==h&&40!==h&&41!==h&&47!==h&&60!==h&&62!==h&&91!==h&&93!==h&&123!==h&&125!==h,dA=/[\n\r\t\b\f()\\]/g,RA={"\n":"\\n","\r":"\\r","\t":"\\t","\b":"\\b","\f":"\\f","\\":"\\\\","(":"\\(",")":"\\)"},nA=function(h){let c="";for(const y of h){const p=y.charCodeAt(0);uA(p)?c+=y:c+=`#${p.toString(16).toUpperCase().padStart(2,"0")}`}return c};class pA{static convert(c,y){if(void 0===y&&(y=null),"string"==typeof c)return`/${c}`;if(c instanceof String){let CA,p=c,q=!1;for(let _A=0,ee=p.length;_A127){q=!0;break}return CA=q?function(h){const c=h.length;if(1&c)throw new Error("Buffer length must be even");for(let y=0,p=c-1;yRA[_A]),`(${p})`}if(I.isBuffer(c))return`<${c.toString("hex")}>`;if(c instanceof rA||c instanceof QA||c instanceof NA)return c.toString();if(c instanceof Date){let p=`D:${oA(c.getUTCFullYear(),4)}`+oA(c.getUTCMonth()+1,2)+oA(c.getUTCDate(),2)+oA(c.getUTCHours(),2)+oA(c.getUTCMinutes(),2)+oA(c.getUTCSeconds(),2)+"Z";return y&&(p=y(I.from(p,"ascii")).toString("binary"),p=p.replace(dA,q=>RA[q])),`(${p})`}if(Array.isArray(c))return`[${c.map(q=>pA.convert(q,y)).join(" ")}]`;if("[object Object]"==={}.toString.call(c)){const p=["<<"];for(let q in c)p.push(`/${q} ${pA.convert(c[q],y)}`);return p.push(">>"),p.join("\n")}return"number"==typeof c?pA.number(c):`${c}`}static number(c){if(c>-1e21&&c<1e21)return Math.round(1e6*c)/1e6;throw new Error(`unsupported number: ${c}`)}}class z extends rA{constructor(c,y,p){void 0===p&&(p={}),super(),this.document=c,this.id=y,this.data=p,this.gen=0,this.compress=this.document.compress&&!this.data.Filter,this.uncompressedLength=0,this.buffer=[]}write(c){c instanceof Uint8Array||(c=I.from(c+"\n","binary")),this.uncompressedLength+=c.length,null==this.data.Length&&(this.data.Length=0),this.buffer.push(c),this.data.Length+=c.length,this.compress&&(this.data.Filter="FlateDecode")}end(c){c&&this.write(c),this.finalize()}finalize(){this.offset=this.document._offset;const c=this.document._security?this.document._security.getEncryptFn(this.id,this.gen):null;this.buffer.length&&(this.buffer=I.concat(this.buffer),this.compress&&(this.buffer=K.default.deflateSync(this.buffer)),c&&(this.buffer=c(this.buffer)),this.data.Length=this.buffer.length),this.document._write(`${this.id} ${this.gen} obj`),this.document._write(pA.convert(this.data,c)),this.buffer.length&&(this.document._write("stream"),this.document._write(this.buffer),this.buffer=[],this.document._write("\nendstream")),this.document._write("endobj"),this.document._refEnd(this)}toString(){return`${this.id} ${this.gen} R`}}const OA=new Float32Array(1),wA=new Uint32Array(OA.buffer);function VA(h){const c=Math.fround(h);return c<=h?c:(OA[0]=h,h<=0?wA[0]+=1:wA[0]-=1,OA[0])}function kA(h,c,y){return void 0===c&&(c=void 0),void 0===y&&(y=p=>p),(null==h||"object"==typeof h&&0===Object.keys(h).length)&&(h=c),null==h||"object"!=typeof h?h={top:h,right:h,bottom:h,left:h}:Array.isArray(h)&&(h=2===h.length?{vertical:h[0],horizontal:h[1]}:{top:h[0],right:h[1],bottom:h[2],left:h[3]}),("vertical"in h||"horizontal"in h)&&(h={top:h.vertical,right:h.horizontal,bottom:h.vertical,left:h.horizontal}),{top:y(h.top),right:y(h.right),bottom:y(h.bottom),left:y(h.left)}}const fA=1/2.54;function Ee(h){return 0===h?1:90===h?0:180===h?-1:270===h?0:Math.cos(h*Math.PI/180)}function HA(h){return 0===h?0:90===h?1:180===h?0:270===h?-1:Math.sin(h*Math.PI/180)}const cA={top:72,left:72,bottom:72,right:72},J={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]};class U{constructor(c,y){void 0===y&&(y={}),this.document=c,this._options=y,this.size=y.size||"letter",this.layout=y.layout||"portrait",this.userUnit=y.userUnit||1;const p=Array.isArray(this.size)?this.size:J[this.size.toUpperCase()];this.width=p["portrait"===this.layout?0:1],this.height=p["portrait"===this.layout?1:0],this.content=this.document.ref(),y.font&&c.font(y.font,y.fontFamily),y.fontSize&&c.fontSize(y.fontSize),this.margins=kA(y.margin??y.margins,cA,q=>c.sizeToPoint(q,0,this)),this.resources=this.document.ref({ProcSet:["PDF","Text","ImageB","ImageC","ImageI"]}),this.dictionary=this.document.ref({Type:"Page",Parent:this.document._root.data.Pages,MediaBox:[0,0,this.width,this.height],Contents:this.content,Resources:this.resources,UserUnit:this.userUnit}),this.markings=[]}get fonts(){const c=this.resources.data;return null!=c.Font?c.Font:c.Font={}}get xobjects(){const c=this.resources.data;return null!=c.XObject?c.XObject:c.XObject={}}get ext_gstates(){const c=this.resources.data;return null!=c.ExtGState?c.ExtGState:c.ExtGState={}}get patterns(){const c=this.resources.data;return null!=c.Pattern?c.Pattern:c.Pattern={}}get colorSpaces(){const c=this.resources.data;return c.ColorSpace||(c.ColorSpace={})}get annotations(){const c=this.dictionary.data;return null!=c.Annots?c.Annots:c.Annots=[]}get structParentTreeKey(){const c=this.dictionary.data;return null!=c.StructParents?c.StructParents:c.StructParents=this.document.createStructParentTreeNextKey()}get contentWidth(){return this.width-this.margins.left-this.margins.right}get contentHeight(){return this.height-this.margins.top-this.margins.bottom}maxY(){return this.height-this.margins.bottom}write(c){return this.content.write(c)}_setTabOrder(){!this.dictionary.Tabs&&this.document.hasMarkInfoDictionary()&&(this.dictionary.data.Tabs="S")}end(){this._setTabOrder(),this.dictionary.end(),this.resources.data.ColorSpace=this.resources.data.ColorSpace||{};for(let c of Object.values(this.document.spotColors))this.resources.data.ColorSpace[c.id]=c;return this.resources.end(),this.content.end()}}class O extends QA{_compareKeys(c,y){return c.localeCompare(y)}_keysName(){return"Names"}_dataForKey(c){return new String(c)}}function lA(h){return new Uint8Array(B.default.arrayBuffer(h))}function JA(h){return(0,j.sha256)(h)}function $A(h,c,y,p){return void 0===p&&(p=!0),(0,tA.cbc)(c,y,{disablePadding:!p}).encrypt(h)}function gA(h,c){const y=new Uint8Array(256);for(let ee=0;ee<256;ee++)y[ee]=ee;let p=0;for(let ee=0;ee<256;ee++){p=p+y[ee]+c[ee%c.length]&255;var q=[y[p],y[ee]];y[ee]=q[0],y[p]=q[1]}const CA=new Uint8Array(h.length);for(let ee=0,he=0,Ie=0;Ie=c[CA]&&h<=c[CA+1])return!0;h>c[CA+1]?y=q+1:p=q-1}return!1}const R=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037],M=h=>b(h,R),D=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279],YA=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288],bA=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],le=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],ve=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109],Ne=h=>b(h,YA)||b(h,ve)||b(h,bA)||b(h,le),Te=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276],ze=h=>b(h,Te),Oe=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109],oe=h=>b(h,Oe),Y=h=>h.codePointAt(0);function E(h){const c=[],y=h.length;for(let p=0;p=55296&&q<=56319&&y>p+1){const CA=h.charCodeAt(p+1);if(CA>=56320&&CA<=57343){c.push(1024*(q-55296)+CA-56320+65536),p+=1;continue}}c.push(q)}return c}class ie{static generateFileID(c){void 0===c&&(c={});let y=`${c.CreationDate.getTime()}\n`;for(let p in c)c.hasOwnProperty(p)&&(y+=`${p}: ${c[p].valueOf()}\n`);return I.from(lA(y))}static generateRandomWordArray(c){return function C(h){const c=new Uint8Array(h);return globalThis.crypto.getRandomValues(c),c}(c)}static create(c,y){return void 0===y&&(y={}),y.ownerPassword||y.userPassword?new ie(c,y):null}constructor(c,y){if(void 0===y&&(y={}),!y.ownerPassword&&!y.userPassword)throw new Error("None of owner password and user password is defined.");this.document=c,this._setupEncryption(y)}_setupEncryption(c){switch(c.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const y={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,y,c);break;case 5:this._setupEncryptionV5(y,c)}this.dictionary=this.document.ref(y)}_setupEncryptionV1V2V4(c,y,p){let q,CA;switch(c){case 1:q=2,this.keyBits=40,CA=function DA(h){void 0===h&&(h={});let c=-64;return h.printing&&(c|=4),h.modifying&&(c|=8),h.copying&&(c|=16),h.annotating&&(c|=32),c}(p.permissions);break;case 2:q=3,this.keyBits=128,CA=Ae(p.permissions);break;case 4:q=4,this.keyBits=128,CA=Ae(p.permissions)}const _A=et(p.userPassword),ee=p.ownerPassword?et(p.ownerPassword):_A,he=function Pe(h,c,y,p){let q=p,CA=h>=3?51:1;for(let Ie=0;Ie=3?20:1;for(let Ie=0;Ie>8&255,CA>>16&255,CA>>24&255]);let ee=(0,v.concatBytes)(p,q,_A,new Uint8Array(y));const he=h>=3?51:1,Ie=c/8;for(let xe=0;xe=2&&(y.Length=this.keyBits),4===c&&(y.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}},y.StmF="StdCF",y.StrF="StdCF"),y.R=q,y.O=I.from(he),y.U=I.from(Ie),y.P=CA}_setupEncryptionV5(c,y){this.keyBits=256;const p=Ae(y.permissions),q=Ke(y.userPassword),CA=y.ownerPassword?Ke(y.ownerPassword):q;this.encryptionKey=function we(h){return h(32)}(ie.generateRandomWordArray);const _A=function _(h,c){const y=c(8),p=c(8),q=JA((0,v.concatBytes)(h,y));return(0,v.concatBytes)(q,y,p)}(q,ie.generateRandomWordArray),he=function be(h,c,y){return $A(y,JA((0,v.concatBytes)(h,c)),new Uint8Array(16),!1)}(q,_A.slice(40,48),this.encryptionKey),Ie=function Re(h,c,y){const p=y(8),q=y(8),CA=JA((0,v.concatBytes)(h,p,c));return(0,v.concatBytes)(CA,p,q)}(CA,_A,ie.generateRandomWordArray),$=function SA(h,c,y,p){return $A(p,JA((0,v.concatBytes)(h,c,y)),new Uint8Array(16),!1)}(CA,Ie.slice(40,48),_A,this.encryptionKey),s=function Fe(h,c,y){const p=new Uint8Array(16);p[0]=255&h,p[1]=h>>8&255,p[2]=h>>16&255,p[3]=h>>24&255,p[4]=255,p[5]=255,p[6]=255,p[7]=255,p[8]=84,p[9]=97,p[10]=100,p[11]=98;const q=y(4);return p.set(q,12),function IA(h,c){return(0,tA.ecb)(c,{disablePadding:!0}).encrypt(h)}(p,c)}(p,this.encryptionKey,ie.generateRandomWordArray);c.V=5,c.Length=this.keyBits,c.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}},c.StmF="StdCF",c.StrF="StdCF",c.R=5,c.O=I.from(Ie),c.OE=I.from($),c.U=I.from(_A),c.UE=I.from(he),c.P=p,c.Perms=I.from(s)}getEncryptFn(c,y){let p,q;if(this.version<5){const _A=new Uint8Array([255&c,c>>8&255,c>>16&255,255&y,y>>8&255]);p=(0,v.concatBytes)(this.encryptionKey,_A)}if(1===this.version||2===this.version){let _A=lA(p);const ee=Math.min(16,this.keyBits/8+5);return _A=_A.slice(0,ee),he=>I.from(gA(new Uint8Array(he),_A))}if(4===this.version){const _A=new Uint8Array([115,65,108,84]);q=lA((0,v.concatBytes)(p,_A))}else q=this.encryptionKey;const CA=ie.generateRandomWordArray(16);return _A=>{const ee=$A(new Uint8Array(_A),q,CA,!0);return I.from((0,v.concatBytes)(CA,ee))}}end(){this.dictionary.end()}}function Ae(h){void 0===h&&(h={});let c=-3904;return"lowResolution"===h.printing&&(c|=4),"highResolution"===h.printing&&(c|=2052),h.modifying&&(c|=8),h.copying&&(c|=16),h.annotating&&(c|=32),h.fillingForms&&(c|=256),h.contentAccessibility&&(c|=512),h.documentAssembly&&(c|=1024),c}function et(h){void 0===h&&(h="");const c=new Uint8Array(32),y=h.length;let p=0;for(;p255)throw new Error("Password contains one or more invalid characters.");c[p]=q,p++}for(;p<32;)c[p]=$e[p-y],p++;return c}function Ke(h){void 0===h&&(h=""),h=unescape(encodeURIComponent(function mA(h,c){if(void 0===c&&(c={}),"string"!=typeof h)throw new TypeError("Expected string.");if(0===h.length)return"";const y=E(h).map(xe=>(h=>b(h,YA))(xe)?32:xe).filter(xe=>!(h=>b(h,D))(xe)),p=String.fromCodePoint.apply(null,y).normalize("NFKC"),q=E(p);if(q.some(Ne))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==c.allowUnassigned&&q.some(M))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5");const _A=q.some(ze),ee=q.some(oe);if(_A&&ee)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const he=ze(Y((h=>h[0])(p))),Ie=ze(Y((h=>h[h.length-1])(p)));if(_A&&(!he||!Ie))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return p}(h)));const c=Math.min(127,h.length),y=new Uint8Array(c);for(let p=0;pxe[2]<1)){let xe=this.opacityGradient();xe._colorSpace="DeviceGray";for(let W of this.stops)xe.stop(W[0],[W[2]]);xe=xe.embed(this.matrix);const $=[0,0,this.doc.page.width,this.doc.page.height],s=this.doc.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:$,Group:{Type:"Group",S:"Transparency",CS:"DeviceGray"},Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:xe}}});s.write("/Pattern cs /Sh1 scn"),s.end(`${$.join(" ")} re f`);const d=this.doc.ref({Type:"ExtGState",SMask:{Type:"Mask",S:"Luminosity",G:s}});d.end();const F=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:$,XStep:$[2],YStep:$[3],Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:Ie},ExtGState:{Gs1:d}}});F.write("/Gs1 gs /Pattern cs /Sh1 scn"),F.end(`${$.join(" ")} re f`),this.doc.page.patterns[this.id]=F}else this.doc.page.patterns[this.id]=Ie;return Ie}apply(c){const y=this.doc._ctm,p=y[0],q=y[1],CA=y[2],_A=y[3],Ie=this.transform,xe=Ie[0],$=Ie[1],s=Ie[2],d=Ie[3],F=Ie[4],W=Ie[5],Z=[p*xe+CA*$,q*xe+_A*$,p*s+CA*d,q*s+_A*d,p*F+CA*W+y[4],q*F+_A*W+y[5]];return(!this.embedded||Z.join(" ")!==this.matrix.join(" "))&&this.embed(Z),this.doc._setColorSpace("Pattern",c),this.doc.addContent(`/${this.id} ${c?"SCN":"scn"}`)}};const Tt=["DeviceCMYK","DeviceRGB"],pn=cn,Gt=class Jc extends cn{constructor(c,y,p,q,CA){super(c),this.x1=y,this.y1=p,this.x2=q,this.y2=CA}shader(c){return this.doc.ref({ShadingType:2,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.x2,this.y2],Function:c,Extend:[!0,!0]})}opacityGradient(){return new Jc(this.doc,this.x1,this.y1,this.x2,this.y2)}},Mt=class _c extends cn{constructor(c,y,p,q,CA,_A,ee){super(c),this.doc=c,this.x1=y,this.y1=p,this.r1=q,this.x2=CA,this.y2=_A,this.r2=ee}shader(c){return this.doc.ref({ShadingType:3,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.r1,this.x2,this.y2,this.r2],Function:c,Extend:[!0,!0]})}opacityGradient(){return new _c(this.doc,this.x1,this.y1,this.r1,this.x2,this.y2,this.r2)}},Ot=class{constructor(c,y,p,q,CA){this.doc=c,this.bBox=y,this.xStep=p,this.yStep=q,this.stream=CA}createPattern(){const c=this.doc.ref();c.end();const y=this.doc._ctm,p=y[0],q=y[1],CA=y[2],_A=y[3],Z=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:2,TilingType:2,BBox:this.bBox,XStep:this.xStep,YStep:this.yStep,Matrix:[1*p+0*CA,1*q+0*_A,0*p+1*CA,0*q+1*_A,0*p+0*CA+y[4],0*q+0*_A+y[5]].map(EA=>+EA.toFixed(5)),Resources:c});return Z.end(this.stream),Z}embedPatternColorSpaces(){Tt.forEach(c=>{const y=this.getPatternColorSpaceId(c);if(this.doc.page.colorSpaces[y])return;const p=this.doc.ref(["Pattern",c]);p.end(),this.doc.page.colorSpaces[y]=p})}getPatternColorSpaceId(c){return`CsP${c}`}embed(){this.id||(this.doc._patternCount=this.doc._patternCount+1,this.id="P"+this.doc._patternCount,this.pattern=this.createPattern()),this.doc.page.patterns[this.id]||(this.doc.page.patterns[this.id]=this.pattern)}apply(c,y){this.embedPatternColorSpaces(),this.embed();const p=this.doc._normalizeColor(y);if(!p)throw Error(`invalid pattern color. (value: ${y})`);const q=this.getPatternColorSpaceId(this.doc._getColorSpace(p));this.doc._setColorSpace(q,c);const CA=c?"SCN":"scn";return this.doc.addContent(`${p.join(" ")} /${this.id} ${CA}`)}};var bt={initColor(){this.spotColors={},this._opacityRegistry={},this._opacityCount=0,this._patternCount=0,this._gradCount=0},_normalizeColor(h){if("string"==typeof h)if("#"===h.charAt(0)){4===h.length&&(h=h.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i,"#$1$1$2$2$3$3"));const c=parseInt(h.slice(1),16);h=[c>>16,c>>8&255,255&c]}else if(Dt[h])h=Dt[h];else if(this.spotColors[h])return this.spotColors[h];return Array.isArray(h)?(3===h.length?h=h.map(c=>c/255):4===h.length&&(h=h.map(c=>c/100)),h):null},_setColor(h,c){return h instanceof pn?(h.apply(c),!0):Array.isArray(h)&&h[0]instanceof Ot?(h[0].apply(c,h[1]),!0):this._setColorCore(h,c)},_setColorCore(h,c){if(!(h=this._normalizeColor(h)))return!1;const y=c?"SCN":"scn",p=this._getColorSpace(h);return this._setColorSpace(p,c),h instanceof NA?(this.page.colorSpaces[h.id]=h.ref,this.addContent(`1 ${y}`)):this.addContent(`${h.join(" ")} ${y}`),!0},_setColorSpace(h,c){return this.addContent(`/${h} ${c?"CS":"cs"}`)},_getColorSpace:h=>h instanceof NA?h.id:4===h.length?"DeviceCMYK":"DeviceRGB",fillColor(h,c){return this._setColor(h,!1)&&this.fillOpacity(c),this._fillColor=[h,c],this},strokeColor(h,c){return this._setColor(h,!0)&&this.strokeOpacity(c),this},opacity(h){return this._doOpacity(h,h),this},fillOpacity(h){return this._doOpacity(h,null),this},strokeOpacity(h){return this._doOpacity(null,h),this},_doOpacity(h,c){let y,p;if(null==h&&null==c)return;null!=h&&(h=Math.max(0,Math.min(1,h))),null!=c&&(c=Math.max(0,Math.min(1,c)));const q=`${h}_${c}`;if(this._opacityRegistry[q]){var CA=this._opacityRegistry[q];y=CA[0],p=CA[1]}else y={Type:"ExtGState"},null!=h&&(y.ca=h),null!=c&&(y.CA=c),y=this.ref(y),y.end(),p="Gs"+ ++this._opacityCount,this._opacityRegistry[q]=[y,p];return this.page.ext_gstates[p]=y,this.addContent(`/${p} gs`)},linearGradient(h,c,y,p){return new Gt(this,h,c,y,p)},radialGradient(h,c,y,p,q,CA){return new Mt(this,h,c,y,p,q,CA)},pattern(h,c,y,p){return new Ot(this,h,c,y,p)},addSpotColor(h,c,y,p,q){const CA=new NA(this,h,c,y,p,q);return this.spotColors[h]=CA,this}},Dt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let Ze,qe,Et,ct,Ht,Jt;Ze=qe=Et=ct=Ht=Jt=0;const GA={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},zA=function(h){return h in GA},vA=function(h){const c=h.codePointAt(0);return 32===c||9===c||13===c||10===c},qA=function(h){const c=h.codePointAt(0);return null!=c&&48<=c&&c<=57},ZA=function(h,c){let y=c,p="",q="none";for(;y(Ze=c[0],qe=c[1],Et=ct=null,Ht=Ze,Jt=qe,h.moveTo(Ze,qe)),m:(h,c)=>(Ze+=c[0],qe+=c[1],Et=ct=null,Ht=Ze,Jt=qe,h.moveTo(Ze,qe)),C:(h,c)=>(Ze=c[4],qe=c[5],Et=c[2],ct=c[3],h.bezierCurveTo(...c)),c:(h,c)=>(h.bezierCurveTo(c[0]+Ze,c[1]+qe,c[2]+Ze,c[3]+qe,c[4]+Ze,c[5]+qe),Et=Ze+c[2],ct=qe+c[3],Ze+=c[4],qe+=c[5]),S:(h,c)=>(null===Et&&(Et=Ze,ct=qe),h.bezierCurveTo(Ze-(Et-Ze),qe-(ct-qe),c[0],c[1],c[2],c[3]),Et=c[0],ct=c[1],Ze=c[2],qe=c[3]),s:(h,c)=>(null===Et&&(Et=Ze,ct=qe),h.bezierCurveTo(Ze-(Et-Ze),qe-(ct-qe),Ze+c[0],qe+c[1],Ze+c[2],qe+c[3]),Et=Ze+c[0],ct=qe+c[1],Ze+=c[2],qe+=c[3]),Q:(h,c)=>(Et=c[0],ct=c[1],Ze=c[2],qe=c[3],h.quadraticCurveTo(c[0],c[1],Ze,qe)),q:(h,c)=>(h.quadraticCurveTo(c[0]+Ze,c[1]+qe,c[2]+Ze,c[3]+qe),Et=Ze+c[0],ct=qe+c[1],Ze+=c[2],qe+=c[3]),T:(h,c)=>(null===Et?(Et=Ze,ct=qe):(Et=Ze-(Et-Ze),ct=qe-(ct-qe)),h.quadraticCurveTo(Et,ct,c[0],c[1]),Et=Ze-(Et-Ze),ct=qe-(ct-qe),Ze=c[0],qe=c[1]),t:(h,c)=>(null===Et?(Et=Ze,ct=qe):(Et=Ze-(Et-Ze),ct=qe-(ct-qe)),h.quadraticCurveTo(Et,ct,Ze+c[0],qe+c[1]),Ze+=c[0],qe+=c[1]),A:(h,c)=>(ae(h,Ze,qe,c),Ze=c[5],qe=c[6]),a:(h,c)=>(c[5]+=Ze,c[6]+=qe,ae(h,Ze,qe,c),Ze=c[5],qe=c[6]),L:(h,c)=>(Ze=c[0],qe=c[1],Et=ct=null,h.lineTo(Ze,qe)),l:(h,c)=>(Ze+=c[0],qe+=c[1],Et=ct=null,h.lineTo(Ze,qe)),H:(h,c)=>(Ze=c[0],Et=ct=null,h.lineTo(Ze,qe)),h:(h,c)=>(Ze+=c[0],Et=ct=null,h.lineTo(Ze,qe)),V:(h,c)=>(qe=c[0],Et=ct=null,h.lineTo(Ze,qe)),v:(h,c)=>(qe+=c[0],Et=ct=null,h.lineTo(Ze,qe)),Z:h=>(h.closePath(),Ze=Ht,qe=Jt),z:h=>(h.closePath(),Ze=Ht,qe=Jt)},ae=function(h,c,y,p){const $=ce(p[5],p[6],p[0],p[1],p[3],p[4],p[2],c,y);for(let s of $){const d=ye(...s);h.bezierCurveTo(...d)}},ce=function(h,c,y,p,q,CA,_A,ee,he){const Ie=_A*(Math.PI/180),xe=Math.sin(Ie),$=Math.cos(Ie);y=Math.abs(y),p=Math.abs(p),Et=$*(ee-h)*.5+xe*(he-c)*.5,ct=$*(he-c)*.5-xe*(ee-h)*.5;let s=Et*Et/(y*y)+ct*ct/(p*p);s>1&&(s=Math.sqrt(s),y*=s,p*=s);const d=$/y,F=xe/y,W=-xe/p,Z=$/p,EA=d*ee+F*he,PA=W*ee+Z*he,FA=d*h+F*c,te=W*h+Z*c;let Me=1/((FA-EA)*(FA-EA)+(te-PA)*(te-PA))-.25;Me<0&&(Me=0);let Qe=Math.sqrt(Me);CA===q&&(Qe=-Qe);const me=.5*(EA+FA)-Qe*(te-PA),Ye=.5*(PA+te)+Qe*(FA-EA),Ue=Math.atan2(PA-Ye,EA-me);let Le=Math.atan2(te-Ye,FA-me)-Ue;Le<0&&1===CA?Le+=2*Math.PI:Le>0&&0===CA&&(Le-=2*Math.PI);const Se=Math.ceil(Math.abs(Le/(.5*Math.PI+.001))),it=[];for(let Ve=0;VeNumber.isFinite(q)&&q>0))throw new Error(`dash(${JSON.stringify(y)}, ${JSON.stringify(c)}) invalid, lengths must be numeric and greater than zero`);return h=h.map(Je).join(" "),this.addContent(`[${h}] ${Je(c.phase||0)} d`)},undash(){return this.addContent("[] 0 d")},moveTo(h,c){return this.addContent(`${Je(h)} ${Je(c)} m`)},lineTo(h,c){return this.addContent(`${Je(h)} ${Je(c)} l`)},bezierCurveTo(h,c,y,p,q,CA){return this.addContent(`${Je(h)} ${Je(c)} ${Je(y)} ${Je(p)} ${Je(q)} ${Je(CA)} c`)},quadraticCurveTo(h,c,y,p){return this.addContent(`${Je(h)} ${Je(c)} ${Je(y)} ${Je(p)} v`)},rect(h,c,y,p){return this.addContent(`${Je(h)} ${Je(c)} ${Je(y)} ${Je(p)} re`)},roundedRect(h,c,y,p,q){let CA;null==q&&(q=0),CA=Array.isArray(q)?q.slice(0,4):[q,q,q,q];const _A=Math.min(.5*y,.5*p),ee=Math.max(0,Math.min(CA[0]||0,_A)),he=Math.max(0,Math.min(CA[1]||0,_A)),Ie=Math.max(0,Math.min(CA[2]||0,_A)),xe=Math.max(0,Math.min(CA[3]||0,_A)),$=he*(1-tt),s=Ie*(1-tt),d=xe*(1-tt),F=ee*(1-tt);return this.moveTo(h+ee,c),this.lineTo(h+y-he,c),he>0&&this.bezierCurveTo(h+y-$,c,h+y,c+$,h+y,c+he),this.lineTo(h+y,c+p-Ie),Ie>0&&this.bezierCurveTo(h+y,c+p-s,h+y-s,c+p,h+y-Ie,c+p),this.lineTo(h+xe,c+p),xe>0&&this.bezierCurveTo(h+d,c+p,h,c+p-d,h,c+p-xe),this.lineTo(h,c+ee),ee>0&&this.bezierCurveTo(h,c+F,h+F,c,h+ee,c),this.closePath()},ellipse(h,c,y,p){null==p&&(p=y);const q=y*tt,CA=p*tt,_A=(h-=y)+2*y,ee=(c-=p)+2*p,he=h+y,Ie=c+p;return this.moveTo(h,Ie),this.bezierCurveTo(h,Ie-CA,he-q,c,he,c),this.bezierCurveTo(he+q,c,_A,Ie-CA,_A,Ie),this.bezierCurveTo(_A,Ie+CA,he+q,ee,he,ee),this.bezierCurveTo(he-q,ee,h,Ie+CA,h,Ie),this.closePath()},circle(h,c,y){return this.ellipse(h,c,y)},arc(h,c,y,p,q,CA){null==CA&&(CA=!1);const _A=2*Math.PI,ee=.5*Math.PI;let he=q-p;Math.abs(he)>_A?he=_A:0!==he&&CA!==he<0&&(he=(CA?-1:1)*_A+he);const Ie=Math.ceil(Math.abs(he)/ee),xe=he/Ie,$=xe/ee*tt*y;let s=p,d=-Math.sin(s)*$,F=Math.cos(s)*$,W=h+Math.cos(s)*y,Z=c+Math.sin(s)*y;this.moveTo(W,Z);for(let EA=0;EA/even-?odd/.test(h)?"*":"",fill(h,c){return/(even-?odd)|(non-?zero)/.test(h)&&(c=h,h=null),h&&this.fillColor(h),this.addContent(`f${this._windingRule(c)}`)},stroke(h){return h&&this.strokeColor(h),this.addContent("S")},fillAndStroke(h,c,y){null==c&&(c=h);const p=/(even-?odd)|(non-?zero)/;return p.test(h)&&(y=h,h=null),p.test(c)&&(y=c,c=h),h&&(this.fillColor(h),this.strokeColor(c)),this.addContent(`B${this._windingRule(y)}`)},clip(h){return this.addContent(`W${this._windingRule(h)} n`)},transform(h,c,y,p,q,CA){if(1===h&&0===c&&0===y&&1===p&&0===q&&0===CA)return this;const _A=this._ctm,ee=_A[0],he=_A[1],Ie=_A[2],xe=_A[3],$=_A[4],s=_A[5];_A[0]=ee*h+Ie*c,_A[1]=he*h+xe*c,_A[2]=ee*y+Ie*p,_A[3]=he*y+xe*p,_A[4]=ee*q+Ie*CA+$,_A[5]=he*q+xe*CA+s;const d=[h,c,y,p,q,CA].map(F=>Je(F)).join(" ");return this.addContent(`${d} cm`)},translate(h,c){return this.transform(1,0,0,1,h,c)},rotate(h,c){let y;void 0===c&&(c={});const p=h*Math.PI/180,q=Math.cos(p),CA=Math.sin(p);let _A=y=0;if(null!=c.origin){var ee=c.origin;_A=ee[0],y=ee[1];const Ie=_A*CA+y*q;_A-=_A*q-y*CA,y-=Ie}return this.transform(q,CA,-CA,q,_A,y)},scale(h,c,y){let p;void 0===y&&(y={}),null==c&&(c=h),"object"==typeof c&&(y=c,c=h);let q=p=0;if(null!=y.origin){var CA=y.origin;q=CA[0],p=CA[1],q-=h*q,p-=c*p}return this.transform(h,0,0,c,q,p)}};const Ce={402:131,8211:150,8212:151,8216:145,8217:146,8218:130,8220:147,8221:148,8222:132,8224:134,8225:135,8226:149,8230:133,8364:128,8240:137,8249:139,8250:155,710:136,8482:153,338:140,339:156,732:152,352:138,353:154,376:159,381:142,382:158},_e=".notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n \nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n \nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n \ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n \nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n \nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n \nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n \nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis".split(/\s+/);class st{constructor(c){this.attributes={},this.glyphWidths={},this.boundingBoxes={},this.kernPairs={},this.parse(c),this.bbox=this.attributes.FontBBox.split(/\s+/).map(y=>+y),this.ascender=+(this.attributes.Ascender||0),this.descender=+(this.attributes.Descender||0),this.xHeight=+(this.attributes.XHeight||0),this.capHeight=+(this.attributes.CapHeight||0),this.lineGap=this.bbox[3]-this.bbox[1]-(this.ascender-this.descender)}parse(c){let y="";for(let he of c.split("\n")){var p,q;if(p=he.match(/^Start(\w+)/))y=p[1];else if(he.match(/^End(\w+)/))y="";else switch(y){case"FontMetrics":var CA=(p=he.match(/(^\w+)\s+(.*)/))[1],_A=p[2];(q=this.attributes[CA])?(Array.isArray(q)||(q=this.attributes[CA]=[q]),q.push(_A)):this.attributes[CA]=_A;break;case"CharMetrics":if(!/^CH?\s/.test(he))continue;var ee=he.match(/\bN\s+(\.?\w+)\s*;/)[1];this.glyphWidths[ee]=+he.match(/\bWX\s+(\d+)\s*;/)[1];break;case"KernPairs":(p=he.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/))&&(this.kernPairs[p[1]+"\0"+p[2]]=parseInt(p[3]))}}}encodeText(c){const y=[];for(let p=0,q=c.length;pP.readFileSync("//data/Courier.afm","utf8"),"Courier-Bold":()=>P.readFileSync("//data/Courier-Bold.afm","utf8"),"Courier-Oblique":()=>P.readFileSync("//data/Courier-Oblique.afm","utf8"),"Courier-BoldOblique":()=>P.readFileSync("//data/Courier-BoldOblique.afm","utf8"),Helvetica:()=>P.readFileSync("//data/Helvetica.afm","utf8"),"Helvetica-Bold":()=>P.readFileSync("//data/Helvetica-Bold.afm","utf8"),"Helvetica-Oblique":()=>P.readFileSync("//data/Helvetica-Oblique.afm","utf8"),"Helvetica-BoldOblique":()=>P.readFileSync("//data/Helvetica-BoldOblique.afm","utf8"),"Times-Roman":()=>P.readFileSync("//data/Times-Roman.afm","utf8"),"Times-Bold":()=>P.readFileSync("//data/Times-Bold.afm","utf8"),"Times-Italic":()=>P.readFileSync("//data/Times-Italic.afm","utf8"),"Times-BoldItalic":()=>P.readFileSync("//data/Times-BoldItalic.afm","utf8"),Symbol:()=>P.readFileSync("//data/Symbol.afm","utf8"),ZapfDingbats:()=>P.readFileSync("//data/ZapfDingbats.afm","utf8")};class Bt extends lt{constructor(c,y,p){super(),this.document=c,this.name=y,this.id=p,this.font=new st(wt[this.name]());var q=this.font;this.ascender=q.ascender,this.descender=q.descender,this.bbox=q.bbox,this.lineGap=q.lineGap,this.xHeight=q.xHeight,this.capHeight=q.capHeight}embed(){return this.dictionary.data={Type:"Font",BaseFont:this.name,Subtype:"Type1",Encoding:"WinAnsiEncoding"},this.dictionary.end()}encode(c){const y=this.font.encodeText(c),p=this.font.glyphsForString(`${c}`),q=this.font.advancesForGlyphs(p),CA=[];for(let _A=0;_A>8;let q=0;this.font.post.isFixedPitch&&(q|=1),1<=p&&p<=7&&(q|=2),q|=4,10===p&&(q|=8),this.font.head.macStyle.italic&&(q|=64);const _A=[1,2,3,4,5,6].map($=>String.fromCharCode((this.id.charCodeAt($)||73)+17)).join("")+"+"+this.font.postscriptName?.replaceAll(" ","_"),ee=this.font.bbox,he=this.document.ref({Type:"FontDescriptor",FontName:_A,Flags:q,FontBBox:[ee.minX*this.scale,ee.minY*this.scale,ee.maxX*this.scale,ee.maxY*this.scale],ItalicAngle:this.font.italicAngle,Ascent:this.ascender,Descent:this.descender,CapHeight:(this.font.capHeight||this.font.ascent)*this.scale,XHeight:(this.font.xHeight||0)*this.scale,StemV:0});if(c?he.data.FontFile3=y:he.data.FontFile2=y,this.document.subset&&1===this.document.subset){const $=this.widths.length-1,s=I.alloc(Math.ceil(($+1)/8),0);for(let F=0;F<=$;F++)null!=this.widths[F]&&(s[Math.floor(F/8)]|=128>>F%8);const d=this.document.ref();d.write(s),d.end(),he.data.CIDSet=d}he.end();const Ie={Type:"Font",Subtype:"CIDFontType0",BaseFont:_A,CIDSystemInfo:{Registry:new String("Adobe"),Ordering:new String("Identity"),Supplement:0},FontDescriptor:he,W:[0,this.widths]};c||(Ie.Subtype="CIDFontType2",Ie.CIDToGIDMap="Identity");const xe=this.document.ref(Ie);return xe.end(),this.dictionary.data={Type:"Font",Subtype:"Type0",BaseFont:_A,Encoding:"Identity-H",DescendantFonts:[xe],ToUnicode:this.toUnicodeCmap()},this.dictionary.end()}toUnicodeCmap(){const c=this.document.ref(),y=[];for(let _A of this.unicode){const ee=[];for(let he of _A)he>65535&&(he-=65536,ee.push(pt(he>>>10&1023|55296)),he=56320|1023&he),ee.push(pt(he));y.push(`<${ee.join(" ")}>`)}const q=Math.ceil(y.length/256),CA=[];for(let _A=0;_A <${pt(he-1)}> [${y.slice(ee,he).join(" ")}]`)}return c.end(`/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000>\nendcodespacerange\n${CA.length} beginbfrange\n${CA.join("\n")}\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend`),c}}class ut{static open(c,y,p,q){let CA;if("string"==typeof y){if(Bt.isStandardFont(y))return new Bt(c,y,q);y=P.readFileSync(y)}if(y instanceof Uint8Array?CA=(0,w.create)(y,p):y instanceof ArrayBuffer&&(CA=(0,w.create)(new Uint8Array(y),p)),null==CA)throw new Error("Not a supported font format or standard PDF font.");return new ot(c,CA,q)}}var Wt={initFonts(h,c,y){void 0===h&&(h="Helvetica"),void 0===c&&(c=null),void 0===y&&(y=12),this._fontFamilies={},this._fontCount=0,this._fontSource=h,this._fontFamily=c,this._fontSize=y,this._font=null,this._remSize=y,this._registeredFonts={},h&&this.font(h,c)},font(h,c,y){let p,q;if("number"==typeof c&&(y=c,c=null),"string"==typeof h&&this._registeredFonts[h]){p=h;var CA=this._registeredFonts[h];h=CA.src,c=CA.family}else p=c||h,"string"!=typeof p&&(p=null);if(this._fontSource=h,this._fontFamily=c,null!=y&&this.fontSize(y),q=this._fontFamilies[p])return this._font=q,this;const _A="F"+ ++this._fontCount;return this._font=ut.open(this,h,c,_A),(q=this._fontFamilies[this._font.name])&&((h,c)=>!(h.font._tables?.head?.checkSumAdjustment!==c.font._tables?.head?.checkSumAdjustment||JSON.stringify(h.font._tables?.name?.records)!==JSON.stringify(c.font._tables?.name?.records)))(this._font,q)?(this._font=q,this):(p&&(this._fontFamilies[p]=this._font),this._font.name&&!this._fontFamilies[this._font.name]&&(this._fontFamilies[this._font.name]=this._font),!p&&(!this._font.name||this._fontFamilies[this._font.name]!==this._font)&&(this._fontFamilies[this._font.id]=this._font),this)},fontSize(h){return this._fontSize=this.sizeToPoint(h),this},currentLineHeight(h){return this._font.lineHeight(this._fontSize,h)},registerFont(h,c,y){return this._registeredFonts[h]={src:c,family:y},this},sizeToPoint(h,c,y,p){if(void 0===c&&(c=0),void 0===y&&(y=this.page),void 0===p&&(p=void 0),p||(p=this._fontSize),"number"!=typeof c&&(c=this.sizeToPoint(c)),void 0===h)return c;if("number"==typeof h)return h;if("boolean"==typeof h)return Number(h);const q=String(h).match(/((\d+)?(\.\d+)?)(em|in|px|cm|mm|pc|ex|ch|rem|vw|vh|vmin|vmax|%|pt)?/);if(!q)throw new Error(`Unsupported size '${h}'`);let CA;switch(q[4]){case"em":CA=this._fontSize;break;case"in":CA=72;break;case"px":CA=.75;break;case"cm":CA=72*fA;break;case"mm":CA=.1*fA*72;break;case"pc":CA=12;break;case"ex":CA=this.currentLineHeight();break;case"ch":CA=this.widthOfString("0");break;case"rem":CA=this._remSize;break;case"vw":CA=y.width/100;break;case"vh":CA=y.height/100;break;case"vmin":CA=Math.min(y.width,y.height)/100;break;case"vmax":CA=Math.max(y.width,y.height)/100;break;case"%":CA=p/100;break;default:CA=1}return CA*Number(q[1])}};class Bn{constructor(c,y){this._listeners=Object.create(null),this.document=c,this.horizontalScaling=y.horizontalScaling||100,this.indent=(y.indent||0)*this.horizontalScaling/100,this.indentAllLines=y.indentAllLines||!1,this.characterSpacing=(y.characterSpacing||0)*this.horizontalScaling/100,this.wordSpacing=(0===y.wordSpacing)*this.horizontalScaling/100,this.columns=y.columns||1,this.columnGap=(null!=y.columnGap?y.columnGap:18)*this.horizontalScaling/100,this.lineWidth=(y.width*this.horizontalScaling/100-this.columnGap*(this.columns-1))/this.columns,this.spaceLeft=this.lineWidth,this.startX=this.document.x,this.startY=this.document.y,this.column=1,this.ellipsis=y.ellipsis,this.continuedX=0,this.features=y.features,null!=y.height?(this.height=y.height,this.maxY=VA(this.startY+y.height)):this.maxY=VA(this.document.page.maxY()),this.on("firstLine",p=>{const q=this.continuedX||this.indent;this.document.x+=q,this.lineWidth-=q,!p.indentAllLines&&this.once("line",()=>{this.document.x-=q,this.lineWidth+=q,p.continued&&!this.continuedX&&(this.continuedX=this.indent),p.continued||(this.continuedX=0)})}),this.on("lastLine",p=>{const q=p.align;"justify"===q&&(p.align="left"),this.lastLine=!0,this.once("line",()=>(this.document.y+=p.paragraphGap||0,p.align=q,this.lastLine=!1))})}on(c,y){(this._listeners[c]||(this._listeners[c]=[])).push(y)}once(c,y){var p=this;const q=function(){const CA=p._listeners[c];CA.splice(CA.indexOf(q),1),y(...arguments)};this.on(c,q)}emit(c){const y=this._listeners[c];if(y){for(var p=arguments.length,q=new Array(p>1?p-1:0),CA=1;CAthis.lineWidth+this.continuedX){let s=CA;const d={};for(;xe.length;){var he,Ie;$>this.spaceLeft?(he=Math.ceil(this.spaceLeft/($/xe.length)),$=this.wordWidth(xe.slice(0,he)),Ie=$<=this.spaceLeft&&hethis.spaceLeft&&he>0;for(;F||Ie;)F?($=this.wordWidth(xe.slice(0,--he)),F=$>this.spaceLeft&&he>0):($=this.wordWidth(xe.slice(0,++he)),F=$>this.spaceLeft&&he>0,Ie=$<=this.spaceLeft&&hethis.maxY||q>this.maxY)&&this.nextSection();let CA="",_A=0,ee=0,he=0,Ie=p.y;const xe=()=>(y.textWidth=_A+this.wordSpacing*(ee-1),y.wordCount=ee,y.lineWidth=this.lineWidth,Ie=p.y,this.emit("line",CA,y,this),he++);this.emit("sectionStart",y,this),this.eachWord(c,($,s,d,F)=>{if((null==F||F.required)&&(this.emit("firstLine",y,this),this.spaceLeft=this.lineWidth),this.canFit($,s)&&(CA+=$,_A+=s,ee++),d.required||!this.canFit($,s)){const W=p.currentLineHeight(!0);if(null!=this.height&&this.ellipsis&&VA(p.y+2*W)>this.maxY&&this.column>=this.columns){for(!0===this.ellipsis&&(this.ellipsis="\u2026"),CA=CA.replace(/\s+$/,""),_A=this.wordWidth(CA+this.ellipsis);CA&&_A>this.lineWidth;)CA=CA.slice(0,-1).replace(/\s+$/,""),_A=this.wordWidth(CA+this.ellipsis);_A<=this.lineWidth&&(CA+=this.ellipsis),_A=this.wordWidth(CA)}if(d.required&&(s>this.spaceLeft&&(xe(),CA=$,_A=s,ee=1),this.emit("lastLine",y,this)),"\xad"==CA[CA.length-1]&&(CA=CA.slice(0,-1)+"-",this.spaceLeft-=this.wordWidth("-")),xe(),VA(p.y+W)>this.maxY){if(this.emit("sectionEnd",y,this),!this.nextSection())return ee=0,CA="",!1;this.emit("sectionStart",y,this)}return d.required?(this.spaceLeft=this.lineWidth,CA="",_A=0,ee=0):(this.spaceLeft=this.lineWidth-s,CA=$,_A=s,ee=1)}return this.spaceLeft-=s}),ee>0&&(this.emit("lastLine",y,this),xe()),this.emit("sectionEnd",y,this),!0===y.continued?(he>1&&(this.continuedX=0),this.continuedX+=y.textWidth||0,p.y=Ie):p.x=this.startX}nextSection(c){if(++this.column>this.columns){if(null!=this.height)return!1;if(this.document.continueOnNewPage(),this.column=1,this.startY=this.document.page.margins.top,this.maxY=this.document.page.maxY(),this.indentAllLines){const y=this.continuedX||this.indent;this.document.x+=y,this.lineWidth-=y}else this.document.x=this.startX;this.document._fillColor&&this.document.fillColor(...this.document._fillColor),this.emit("pageBreak",c,this)}else this.document.x+=this.lineWidth+this.columnGap,this.document.y=this.startY,this.emit("columnBreak",c,this);return!0}}const In=pA.number;var Cn={initText(){this._line=this._line.bind(this),this.x=0,this.y=0,this._lineGap=0},lineGap(h){return this._lineGap=h,this},moveDown(h){return null==h&&(h=1),this.y+=this.currentLineHeight(!0)*h+this._lineGap,this},moveUp(h){return null==h&&(h=1),this.y-=this.currentLineHeight(!0)*h+this._lineGap,this},_text(h,c,y,p,q){h=null==h?"":`${h}`,(p=this._initOptions(c,y,p)).wordSpacing&&(h=h.replace(/\s{2,}/g," "));const CA=()=>{p.structParent&&p.structParent.add(this.struct(p.structType||"P",[this.markStructureContent(p.structType||"P")]))};if(0!==p.rotation&&(this.save(),this.rotate(-p.rotation,{origin:[this.x,this.y]})),p.width){let _A=this._wrapper;_A||(_A=new Bn(this,p),_A.on("line",q),_A.on("firstLine",CA)),this._wrapper=p.continued?_A:null,this._textOptions=p.continued?p:null,_A.wrap(h,p)}else for(let _A of h.split("\n"))CA(),q(_A,p);return 0!==p.rotation&&this.restore(),this},text(h,c,y,p){return this._text(h,c,y,p,this._line)},widthOfString(h,c){void 0===c&&(c={});const y=c.horizontalScaling||100;return(this._font.widthOfString(h,this._fontSize,c.features)+(c.characterSpacing||0)*(h.length-1))*y/100},boundsOfString(h,c,y,p){p=this._initOptions(c,y,p),c=this.x,y=this.y;const q=p.lineGap??this._lineGap??0,CA=this.currentLineHeight(!0)+q;let _A=0;if(h=String(h??""),p.wordSpacing&&(h=h.replace(/\s{2,}/g," ")),p.width){let Me=new Bn(this,p);Me.on("line",(Qe,me)=>{if(this.y+=CA,(Qe=Qe.replace(/\n/g,"")).length){let Ye=me.wordSpacing??0;const Ue=me.characterSpacing??0;if(me.width&&"justify"===me.align){const De=Qe.trim().split(/\s+/),Le=this.widthOfString(Qe.replace(/\s+/g,""),me),Se=this.widthOfString(" ")+Ue;Ye=Math.max(0,(me.lineWidth-Le)/Math.max(1,De.length-1)-Se)}_A=Math.max(_A,me.textWidth+Ye*(me.wordCount-1)+Ue*(Qe.length-1))}}),Me.wrap(h,p)}else for(let Me of h.split("\n")){const Qe=this.widthOfString(Me,p);this.y+=CA,_A=Math.max(_A,Qe)}let ee=this.y-y;if(p.height&&(ee=Math.min(ee,p.height)),this.x=c,this.y=y,0===p.rotation)return{x:c,y,width:_A,height:ee};if(90===p.rotation)return{x:c,y:y-_A,width:ee,height:_A};if(180===p.rotation)return{x:c-_A,y:y-ee,width:_A,height:ee};if(270===p.rotation)return{x:c-ee,y,width:ee,height:_A};const he=Ee(p.rotation),Ie=HA(p.rotation),xe=c,$=y,s=c+_A*he,d=y-_A*Ie,F=c+_A*he+ee*Ie,W=y-_A*Ie+ee*he,Z=c+ee*Ie,EA=y+ee*he,PA=Math.min(xe,s,F,Z),FA=Math.max(xe,s,F,Z),te=Math.min($,d,W,EA);return{x:PA,y:te,width:FA-PA,height:Math.max($,d,W,EA)-te}},heightOfString(h,c){const y=this.x,p=this.y;(c=this._initOptions(c)).height=1/0;const q=c.lineGap||this._lineGap||0;this._text(h,this.x,this.y,c,()=>{this.y+=this.currentLineHeight(!0)+q});const CA=this.y-p;return this.x=y,this.y=p,CA},list(h,c,y,p){const q=(p=this._initOptions(c,y,p)).listType||"bullet",CA=Math.round(this._font.ascender/1e3*this._fontSize),_A=CA/2,ee=p.bulletRadius||CA/3,he=p.textIndent||("bullet"===q?5*ee:2*CA),Ie=p.bulletIndent||("bullet"===q?8*ee:2*CA);let xe=1;const $=[],s=[],d=[];var F=function(Z){let EA=1;for(let PA=0;PA{let FA,te,ge,Me,me;if(p.structParent)if(p.structTypes){var Qe=p.structTypes;te=Qe[0],ge=Qe[1],Me=Qe[2]}else te="LI",ge="Lbl",Me="LBody";if(te?(FA=this.struct(te),p.structParent.add(FA)):p.structParent&&(FA=p.structParent),(me=s[EA++])!==xe){const Ue=Ie*(me-xe);this.x+=Ue,PA.lineWidth-=Ue,xe=me}switch(FA&&(ge||Me)&&FA.add(this.struct(ge||Me,[this.markStructureContent(ge||Me)])),q){case"bullet":this.circle(this.x-he+ee,this.y+_A,ee),this.fill();break;case"numbered":case"lettered":var Ye=function Dn(h,c){if("numbered"===c)return`${h}.`;var y=String.fromCharCode((h-1)%26+65),p=Math.floor((h-1)/26+1);return`${Array(p+1).join(y)}.`}(d[EA-1],q);this._fragment(Ye,this.x-he,this.y,p)}FA&&ge&&Me&&FA.add(this.struct(Me,[this.markStructureContent(Me)])),FA&&FA!==p.structParent&&FA.end()}),PA.on("sectionStart",()=>{const FA=he+Ie*(xe-1);this.x+=FA,PA.lineWidth-=FA}),PA.on("sectionEnd",()=>{const FA=he+Ie*(xe-1);this.x-=FA,PA.lineWidth+=FA}),PA.wrap(Z,p)};for(let Z=0;Z<$.length;Z++)W.call(this,$[Z],Z);return this},_initOptions(h,c,y){void 0===h&&(h={}),void 0===y&&(y={}),h&&"object"==typeof h&&(y=h,h=null);const p=Object.assign({},y);if(this._textOptions)for(let q in this._textOptions)"continued"!==q&&void 0===p[q]&&(p[q]=this._textOptions[q]);return null!=h&&(this.x=h),null!=c&&(this.y=c),!1!==p.lineBreak&&(null==p.width&&(p.width=this.page.width-this.x-this.page.margins.right),p.width=Math.max(p.width,0)),p.columns||(p.columns=0),null==p.columnGap&&(p.columnGap=18),p.rotation=Number(p.rotation??0)%360,p.rotation<0&&(p.rotation+=360),p},_line(h,c,y){if(void 0===c&&(c={}),this._fragment(h,this.x,this.y,c),y){const p=c.lineGap||this._lineGap||0;this.y+=this.currentLineHeight(!0)+p}else this.x+=this.widthOfString(h,c)},_fragment(h,c,y,p){let q,CA,_A,ee,he,Ie;if(0===(h=`${h}`.replace(/\n/g,"")).length)return;let $=p.wordSpacing||0;const s=p.characterSpacing||0,d=p.horizontalScaling||100;if(p.width)switch(p.align||"left"){case"right":he=this.widthOfString(h.replace(/\s+$/,""),p),c+=p.lineWidth-he;break;case"center":c+=p.lineWidth/2-p.textWidth/2;break;case"justify":Ie=h.trim().split(/\s+/),he=this.widthOfString(h.replace(/\s+/g,""),p);var F=this.widthOfString(" ")+s;$=Math.max(0,(p.lineWidth-he)/Math.max(1,Ie.length-1)-F)}if("number"==typeof p.baseline)q=-p.baseline;else{switch(p.baseline){case"svg-middle":q=.5*this._font.xHeight;break;case"middle":case"svg-central":q=.5*(this._font.descender+this._font.ascender);break;case"bottom":case"ideographic":q=this._font.descender;break;case"alphabetic":q=0;break;case"mathematical":q=.5*this._font.ascender;break;case"hanging":q=.8*this._font.ascender;break;default:q=this._font.ascender}q=q/1e3*this._fontSize}const W=p.textWidth+$*(p.wordCount-1)+s*(h.length-1);if(null!=p.link){const me={};this._currentStructureElement&&"Link"===this._currentStructureElement.dictionary.data.S&&(me.structParent=this._currentStructureElement),this.link(c,y,W,this.currentLineHeight(),p.link,me)}if(null!=p.goTo&&this.goTo(c,y,W,this.currentLineHeight(),p.goTo),null!=p.destination&&this.addNamedDestination(p.destination,"XYZ",c,y,null),p.underline){this.save(),p.stroke||this.strokeColor(...this._fillColor||[]);const me=this._fontSize<10?.5:Math.floor(this._fontSize/10);this.lineWidth(me);let Ye=y+this.currentLineHeight()-me;this.moveTo(c,Ye),this.lineTo(c+W,Ye),this.stroke(),this.restore()}if(p.strike){this.save(),p.stroke||this.strokeColor(...this._fillColor||[]);const me=this._fontSize<10?.5:Math.floor(this._fontSize/10);this.lineWidth(me);let Ye=y+this.currentLineHeight()/2;this.moveTo(c,Ye),this.lineTo(c+W,Ye),this.stroke(),this.restore()}if(this.save(),p.oblique){let me;me="number"==typeof p.oblique?-Math.tan(p.oblique*Math.PI/180):-.25,this.transform(1,0,0,1,c,y),this.transform(1,0,me,1,-me*q,0),this.transform(1,0,0,1,-c,-y)}this.transform(1,0,0,-1,0,this.page.height),y=this.page.height-y-q,null==this.page.fonts[this._font.id]&&(this.page.fonts[this._font.id]=this._font.ref()),this.addContent("BT"),this.addContent(`1 0 0 1 ${In(c)} ${In(y)} Tm`),this.addContent(`/${this._font.id} ${In(this._fontSize)} Tf`);const Z=p.fill&&p.stroke?2:p.stroke?1:0;if(Z&&this.addContent(`${Z} Tr`),s&&this.addContent(`${In(s)} Tc`),100!==d&&this.addContent(`${d} Tz`),$){Ie=h.trim().split(/\s+/),$+=this.widthOfString(" ")+s,$*=1e3/this._fontSize,CA=[],ee=[];for(let me of Ie){const Ye=this._font.encode(me,p.features),De=Ye[1];CA=CA.concat(Ye[0]),ee=ee.concat(De);const Le={},Se=ee[ee.length-1];for(let it in Se)Le[it]=Se[it];Le.xAdvance+=$,ee[ee.length-1]=Le}}else{var EA=this._font.encode(h,p.features);CA=EA[0],ee=EA[1]}const PA=this._fontSize/1e3,FA=[];let te=0,ge=!1;const Me=me=>{if(te ${In(-(ee[me-1].xAdvance-ee[me-1].advanceWidth))}`)}te=me},Qe=me=>{Me(me),FA.length>0&&(this.addContent(`[${FA.join(" ")}] TJ`),FA.length=0)};for(_A=0;_A{let y="";for(let p=0;p>>0},vn=function(h,c){return void 0===c&&(c=0),(h[c+1]<<8|h[c])>>>0},Un=function(h,c){return void 0===c&&(c=0),16777216*h[c]+(h[c+1]<<16|h[c+2]<<8|h[c+3])>>>0},Ln=function(h,c){return void 0===c&&(c=0),(h[c]|h[c+1]<<8|h[c+2]<<16)+16777216*h[c+3]>>>0},On=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],Ei={1:"DeviceGray",3:"DeviceRGB",4:"DeviceCMYK"};class wi{constructor(c,y){let p;if(this.data=c,this.label=y,65496!==this.data.readUInt16BE(0))throw"SOI not found in JPEG";this.orientation=(h=>{if(!h||h.length<20)return null;let c=2;for(;c=h.length-4)return null;const y=St(h,c);if(c+=2,65498===y)return null;if(y>=65488&&y<=65497||65281===y)continue;if(c+2>h.length)return null;const p=St(h,c);if(65505===y&&c+8<=h.length&&"Exif\0\0"===Nn(h.subarray(c+2,c+8))){const CA=c+8;if(CA+8>h.length)return null;const _A=Nn(h.subarray(CA,CA+2)),ee="II"===_A;if(!ee&&"MM"!==_A)return null;const he=ee?s=>vn(h,s):s=>St(h,s),Ie=ee?s=>Ln(h,s):s=>Un(h,s);if(42!==he(CA+2))return null;const xe=CA+Ie(CA+4);if(xe+2>h.length)return null;const $=he(xe);for(let s=0;s<$;s++){const d=xe+2+12*s;if(d+12>h.length)return null;if(274===he(d)){const F=he(d+8);return F>=1&&F<=8?F:null}}return null}c+=p}return null})(this.data)||1;let q=2;for(;q=this.data.length||(p=this.data.readUInt16BE(q),q+=2,On.includes(p)))break;q+=this.data.readUInt16BE(q)}if(!On.includes(p))throw"Invalid JPEG.";q+=2,this.bits=this.data[q++],this.height=this.data.readUInt16BE(q),q+=2,this.width=this.data.readUInt16BE(q),q+=2,this.colorSpace=Ei[this.data[q]],this.obj=null}embed(c){if(!this.obj)return this.obj=c.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:this.bits,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:"DCTDecode"}),"DeviceCMYK"===this.colorSpace&&(this.obj.data.Decode=[1,0,1,0,1,0,1,0]),this.obj.end(this.data),this.data=null}}class Ci{constructor(c,y){this.label=y,this.image=new AA.default(c),this.width=this.image.width,this.height=this.image.height,this.imgData=this.image.imgData,this.obj=null}embed(c){if(this.document=c,this.obj)return;const y=this.image,q=this.width,CA=y.hasAlphaChannel,_A=1===y.interlaceMethod,ee=this.obj=c.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:CA?8:y.bits,Width:q,Height:this.height,Filter:"FlateDecode"});if(!CA){const he=c.ref({Predictor:_A?1:15,Colors:y.colors,BitsPerComponent:y.bits,Columns:q});ee.data.DecodeParms=he,he.end()}if(0===y.palette.length)ee.data.ColorSpace=y.colorSpace;else{const he=c.ref();he.end(I.from(y.palette)),ee.data.ColorSpace=["Indexed","DeviceRGB",y.palette.length/3-1,he]}if(null!=y.transparency.grayscale){const he=y.transparency.grayscale;ee.data.Mask=[he,he]}else if(y.transparency.rgb){const he=y.transparency.rgb,Ie=[];for(let xe of he)Ie.push(xe,xe);ee.data.Mask=Ie}else{if(y.transparency.indexed)return this.loadIndexedAlphaChannel();if(CA)return this.splitAlphaChannel()}if(_A)return this.decodeData();this.finalize()}finalize(){if(this.alphaChannel){const c=this.document.ref({Type:"XObject",Subtype:"Image",Height:this.height,Width:this.width,BitsPerComponent:8,Filter:"FlateDecode",ColorSpace:"DeviceGray",Decode:[0,1]});c.end(this.alphaChannel),this.obj.data.SMask=c}return this.obj.end(this.imgData),this.image=null,this.imgData=null}splitAlphaChannel(){return this.image.decodePixels(c=>{let y,p;const q=this.image.colors,CA=this.width*this.height,_A=I.alloc(CA*q),ee=I.alloc(CA);let he=p=y=0;const Ie=c.length,xe=16===this.image.bits?1:0;for(;he{const q=I.alloc(this.width*this.height);let CA=0;for(let _A=0,ee=p.length;_A{this.imgData=K.default.deflateSync(c),this.finalize()})}}class di{static open(c,y){let p;if(I.isBuffer(c))p=c;else if(c instanceof ArrayBuffer)p=I.from(new Uint8Array(c));else{const q=/^data:.+?;base64,(.*)$/.exec(c);if(q)p=I.from(q[1],"base64");else if(p=P.readFileSync(c),!p)return}if(255===p[0]&&216===p[1])return new wi(p,y);if(137===p[0]&&80===p[1]&&78===p[2]&&71===p[3])return new Ci(p,y);throw new Error("Unknown image format.")}}var ri={initImages(){this._imageRegistry={},this._imageCount=0},image(h,c,y,p){let q,CA,_A,ee,he,Ie,xe,$,s;void 0===p&&(p={}),"object"==typeof c&&(p=c,c=null);const d=p.ignoreOrientation||!1!==p.ignoreOrientation&&this.options.ignoreOrientation,F="number"!=typeof y;c=null!=(Ie=c??p.x)?Ie:this.x,y=null!=(xe=y??p.y)?xe:this.y,"string"==typeof h&&(ee=this._imageRegistry[h]),ee||(ee=h.width&&h.height?h:this.openImage(h)),ee.obj||ee.embed(this),null==this.page.xobjects[ee.label]&&(this.page.xobjects[ee.label]=ee.obj);let Z=ee.width,EA=ee.height;if(!d&&ee.orientation>4){var PA=[EA,Z];Z=PA[0],EA=PA[1]}let FA=p.width||Z,te=p.height||EA;if(p.width&&!p.height){const Le=FA/Z;FA=Z*Le,te=EA*Le}else if(p.height&&!p.width){const Le=te/EA;FA=Z*Le,te=EA*Le}else if(p.scale)FA=Z*p.scale,te=EA*p.scale;else if(p.fit){var ge=p.fit;_A=ge[0],q=ge[1],CA=_A/q,he=Z/EA,he>CA?(FA=_A,te=_A/he):(te=q,FA=q*he)}else if(p.cover){var Me=p.cover;_A=Me[0],q=Me[1],CA=_A/q,he=Z/EA,he>CA?(te=q,FA=q*he):(FA=_A,te=_A/he)}(p.fit||p.cover)&&("center"===p.align?c=c+_A/2-FA/2:"right"===p.align&&(c=c+_A-FA),"center"===p.valign?y=y+q/2-te/2:"bottom"===p.valign&&(y=y+q-te));let Qe=0,me=c,Ye=y,Ue=te,De=FA;if(d)Ue=-te,Ye+=te;else switch(ee.orientation){default:case 1:Ue=-te,Ye+=te;break;case 2:De=-FA,Ue=-te,me+=FA,Ye+=te;break;case 3:$=c,s=y,Ue=-te,me-=FA,Qe=180;break;case 4:break;case 5:$=c,s=y,De=te,Ue=FA,Ye-=Ue,Qe=90;break;case 6:$=c,s=y,De=te,Ue=-FA,Qe=90;break;case 7:$=c,s=y,Ue=-FA,De=-te,me+=te,Qe=90;break;case 8:$=c,s=y,De=te,Ue=-FA,me-=te,Ye+=FA,Qe=-90}return null!=p.link&&this.link(c,y,FA,te,p.link),null!=p.goTo&&this.goTo(c,y,FA,te,p.goTo),null!=p.destination&&this.addNamedDestination(p.destination,"XYZ",c,y,null),F&&(this.y+=te),this.save(),null!=p.opacity&&this._doOpacity(p.opacity,null),Qe&&this.rotate(Qe,{origin:[$,s]}),this.transform(De,0,0,Ue,me,Ye),this.addContent(`/${ee.label} Do`),this.restore(),this},openImage(h){let c;return"string"==typeof h&&(c=this._imageRegistry[h]),c||(c=di.open(h,"I"+ ++this._imageCount),"string"==typeof h&&(this._imageRegistry[h]=c)),c}};class xn{constructor(c){this.annotationRef=c}}var ai={annotate(h,c,y,p,q){q.Type="Annot",q.Rect=this._convertRect(h,c,y,p),q.Border=[0,0,0],"Link"===q.Subtype&&typeof q.F>"u"&&(q.F=4),"Link"!==q.Subtype&&null==q.C&&(q.C=this._normalizeColor(q.color||[0,0,0])),delete q.color,"string"==typeof q.Dest&&(q.Dest=new String(q.Dest));const CA=q.structParent;delete q.structParent;for(let ee in q){const he=q[ee];q[ee[0].toUpperCase()+ee.slice(1)]=he}const _A=this.ref(q);if(this.page.annotations.push(_A),CA&&"function"==typeof CA.add){const ee=new xn(_A);CA.add(ee)}return _A.end(),this},note(h,c,y,p,q,CA){return void 0===CA&&(CA={}),CA.Subtype="Text",CA.Contents=new String(q),null==CA.Name&&(CA.Name="Comment"),null==CA.color&&(CA.color=[243,223,92]),this.annotate(h,c,y,p,CA)},goTo(h,c,y,p,q,CA){return void 0===CA&&(CA={}),CA.Subtype="Link",CA.A=this.ref({S:"GoTo",D:new String(q)}),CA.A.end(),this.annotate(h,c,y,p,CA)},link(h,c,y,p,q,CA){if(void 0===CA&&(CA={}),CA.Subtype="Link","number"==typeof q){const _A=this._root.data.Pages.data;if(!(q>=0&&q<_A.Kids.length))throw new Error(`The document has no page ${q}`);CA.A=this.ref({S:"GoTo",D:[_A.Kids[q],"XYZ",null,null,null]}),CA.A.end()}else CA.A=this.ref({S:"URI",URI:new String(q)}),CA.A.end();return CA.structParent&&!CA.Contents&&(CA.Contents=new String("")),this.annotate(h,c,y,p,CA)},_markup(h,c,y,p,q){void 0===q&&(q={});const CA=this._convertRect(h,c,y,p),_A=CA[0],ee=CA[1],he=CA[2],Ie=CA[3];return q.QuadPoints=[_A,Ie,he,Ie,_A,ee,he,ee],q.Contents=new String,this.annotate(h,c,y,p,q)},highlight(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="Highlight",null==q.color&&(q.color=[241,238,148]),this._markup(h,c,y,p,q)},underline(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="Underline",this._markup(h,c,y,p,q)},strike(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="StrikeOut",this._markup(h,c,y,p,q)},lineAnnotation(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="Line",q.Contents=new String,q.L=[h,this.page.height-c,y,this.page.height-p],this.annotate(h,c,y,p,q)},rectAnnotation(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="Square",q.Contents=new String,this.annotate(h,c,y,p,q)},ellipseAnnotation(h,c,y,p,q){return void 0===q&&(q={}),q.Subtype="Circle",q.Contents=new String,this.annotate(h,c,y,p,q)},textAnnotation(h,c,y,p,q,CA){return void 0===CA&&(CA={}),CA.Subtype="FreeText",CA.Contents=new String(q),CA.DA=new String,this.annotate(h,c,y,p,CA)},fileAnnotation(h,c,y,p,q,CA){void 0===q&&(q={}),void 0===CA&&(CA={});const _A=this.file(q.src,Object.assign({hidden:!0},q));return CA.Subtype="FileAttachment",CA.FS=_A,CA.Contents?CA.Contents=new String(CA.Contents):_A.data.Desc&&(CA.Contents=_A.data.Desc),this.annotate(h,c,y,p,CA)},_convertRect(h,c,y,p){let q=c,CA=h+y;const _A=this._ctm,ee=_A[0],he=_A[1],Ie=_A[2],xe=_A[3],$=_A[4],s=_A[5];return CA=ee*CA+Ie*q+$,q=he*CA+xe*q+s,[h=ee*h+Ie*(c+=p)+$,c=he*h+xe*c+s,CA,q]}};const Ki={top:0,left:0,zoom:0,fit:!0,pageNumber:null,expanded:!1};class Qi{constructor(c,y,p,q,CA){void 0===CA&&(CA=Ki),this.document=c,this.options=CA,this.outlineData={},null!==q&&(this.outlineData.Dest=CA.fit?[q,"Fit"]:[q,"XYZ",q.data.MediaBox[2]-(CA.left||0),q.data.MediaBox[3]-(CA.top||0),CA.zoom||0]),null!==y&&(this.outlineData.Parent=y),null!==p&&(this.outlineData.Title=new String(p)),this.dictionary=this.document.ref(this.outlineData),this.children=[]}addItem(c,y){void 0===y&&(y=Ki);const CA=new Qi(this.document,this.dictionary,c,null!=y.pageNumber?this.document._root.data.Pages.data.Kids[y.pageNumber]:this.document.page.dictionary,y);return this.children.push(CA),CA}endOutline(){if(this.children.length>0){this.options.expanded&&(this.outlineData.Count=this.children.length);const y=this.children[this.children.length-1];this.outlineData.First=this.children[0].dictionary,this.outlineData.Last=y.dictionary;for(let p=0,q=this.children.length;p0&&(CA.outlineData.Prev=this.children[p-1].dictionary),p0)return this._root.data.Outlines=this.outline.dictionary,this._root.data.PageMode=this._root.data.PageMode||"UseOutlines"}};class mi{constructor(c,y){this.refs=[{pageRef:c,mcid:y}]}push(c){c.refs.forEach(y=>this.refs.push(y))}}class fn{constructor(c,y,p,q){void 0===p&&(p={}),void 0===q&&(q=null),this.document=c,this._attached=!1,this._ended=!1,this._flushed=!1,this.dictionary=c.ref({S:y});const CA=this.dictionary.data;(Array.isArray(p)||this._isValidChild(p))&&(q=p,p={}),p.title&&(CA.T=new String(p.title)),p.lang&&(CA.Lang=new String(p.lang)),p.alt&&(CA.Alt=new String(p.alt)),p.expanded&&(CA.E=new String(p.expanded)),p.actual&&(CA.ActualText=new String(p.actual));const _A=Array.isArray(p.bbox)&&4===p.bbox.length,ee="string"==typeof p.placement;if(_A||ee){const he={O:"Layout"};if(he.Placement=ee?p.placement:"Block",_A){const Ie=c.page.height;he.BBox=[p.bbox[0],Ie-p.bbox[3],p.bbox[2],Ie-p.bbox[1]]}CA.A=he}p.scope&&(CA.A={...CA.A||{},O:"Table",Scope:p.scope}),this._children=[],q&&(Array.isArray(q)||(q=[q]),q.forEach(he=>this.add(he)),this.end())}add(c){if(this._ended)throw new Error("Cannot add child to already-ended structure element");if(!this._isValidChild(c))throw new Error("Invalid structure element child");return c instanceof fn&&(c.setParent(this.dictionary),this._attached&&c.setAttached()),c instanceof mi&&this._addContentToParentTree(c),c instanceof xn&&this._addAnnotationToParentTree(c.annotationRef),"function"==typeof c&&this._attached&&(c=this._contentForClosure(c)),this._children.push(c),this}_addContentToParentTree(c){c.refs.forEach(y=>{let p=y.pageRef,q=y.mcid;this.document.getStructParentTree().get(p.data.StructParents)[q]=this.dictionary})}_addAnnotationToParentTree(c){const y=this.document.createStructParentTreeNextKey();c.data.StructParent=y,this.document.getStructParentTree().add(y,this.dictionary)}setParent(c){if(this.dictionary.data.P)throw new Error("Structure element added to more than one parent");this.dictionary.data.P=c,this._flush()}setAttached(){this._attached||(this._children.forEach((c,y)=>{c instanceof fn&&c.setAttached(),"function"==typeof c&&(this._children[y]=this._contentForClosure(c))}),this._attached=!0,this._flush())}end(){this._ended||(this._children.filter(c=>c instanceof fn).forEach(c=>c.end()),this._ended=!0,this._flush())}_isValidChild(c){return c instanceof fn||c instanceof mi||c instanceof xn||"function"==typeof c}_contentForClosure(c){const y=this.document.markStructureContent(this.dictionary.data.S),p=this.document._currentStructureElement;this.document._currentStructureElement=this;const q=this._ended;return this._ended=!1,c(),this._ended=q,this.document._currentStructureElement=p,this.document.endMarkedContent(),this._addContentToParentTree(y),y}_isFlushable(){return!(!this.dictionary.data.P||!this._ended)&&this._children.every(c=>"function"!=typeof c&&(!(c instanceof fn)||c._isFlushable()))}_flush(){this._flushed||!this._isFlushable()||(this.dictionary.data.K=[],this._children.forEach(c=>this._flushChild(c)),this.dictionary.end(),this._children=[],this.dictionary.data.K=null,this._flushed=!0)}_flushChild(c){c instanceof fn&&this.dictionary.data.K.push(c.dictionary),c instanceof mi&&c.refs.forEach(y=>{let p=y.pageRef,q=y.mcid;this.dictionary.data.Pg||(this.dictionary.data.Pg=p),this.dictionary.data.K.push(this.dictionary.data.Pg===p?q:{Type:"MCR",Pg:p,MCID:q})}),c instanceof xn&&this.dictionary.data.K.push({Type:"OBJR",Obj:c.annotationRef,Pg:this.document.page.dictionary})}}class ms extends QA{_compareKeys(c,y){return parseInt(c)-parseInt(y)}_keysName(){return"Nums"}_dataForKey(c){return parseInt(c)}}var Ms={initMarkings(h){this.structChildren=[],h.tagged&&(this.getMarkInfoDictionary().data.Marked=!0,this.getStructTreeRoot())},markContent(h,c){if(void 0===c&&(c=null),"Artifact"===h||c&&c.mcid){let p=0;for(this.page.markings.forEach(q=>{(p||q.structContent||"Artifact"===q.tag)&&p++});p--;)this.endMarkedContent()}if(!c)return this.page.markings.push({tag:h}),this.addContent(`/${h} BMC`),this;this.page.markings.push({tag:h,options:c});const y={};return typeof c.mcid<"u"&&(y.MCID=c.mcid),"Artifact"===h&&("string"==typeof c.type&&(y.Type=c.type),Array.isArray(c.bbox)&&(y.BBox=[c.bbox[0],this.page.height-c.bbox[3],c.bbox[2],this.page.height-c.bbox[1]]),Array.isArray(c.attached)&&c.attached.every(p=>"string"==typeof p)&&(y.Attached=c.attached)),"Span"===h&&(c.lang&&(y.Lang=new String(c.lang)),c.alt&&(y.Alt=new String(c.alt)),c.expanded&&(y.E=new String(c.expanded)),c.actual&&(y.ActualText=new String(c.actual))),this.addContent(`/${h} ${pA.convert(y)} BDC`),this},markStructureContent(h,c){void 0===c&&(c={});const y=this.getStructParentTree().get(this.page.structParentTreeKey),p=y.length;y.push(null),this.markContent(h,{...c,mcid:p});const q=new mi(this.page.dictionary,p);return this.page.markings.slice(-1)[0].structContent=q,q},endMarkedContent(){return this.page.markings.pop(),this.addContent("EMC"),this._textOptions&&(delete this._textOptions.link,delete this._textOptions.goTo,delete this._textOptions.destination,delete this._textOptions.underline,delete this._textOptions.strike),this},struct(h,c,y){return void 0===c&&(c={}),void 0===y&&(y=null),new fn(this,h,c,y)},addStructure(h){const c=this.getStructTreeRoot();return h.setParent(c),h.setAttached(),this.structChildren.push(h),c.data.K||(c.data.K=[]),c.data.K.push(h.dictionary),this},initPageMarkings(h){h.forEach(c=>{if(c.structContent){const y=c.structContent,p=this.markStructureContent(c.tag,c.options);y.push(p),this.page.markings.slice(-1)[0].structContent=y}else this.markContent(c.tag,c.options)})},endPageMarkings(h){const c=h.markings;return c.forEach(()=>h.write("EMC")),h.markings=[],c},getMarkInfoDictionary(){return this._root.data.MarkInfo||(this._root.data.MarkInfo=this.ref({})),this._root.data.MarkInfo},hasMarkInfoDictionary(){return!!this._root.data.MarkInfo},getStructTreeRoot(){return this._root.data.StructTreeRoot||(this._root.data.StructTreeRoot=this.ref({Type:"StructTreeRoot",ParentTree:new ms,ParentTreeNextKey:0})),this._root.data.StructTreeRoot},getStructParentTree(){return this.getStructTreeRoot().data.ParentTree},createStructParentTreeNextKey(){this.getMarkInfoDictionary();const h=this.getStructTreeRoot(),c=h.data.ParentTreeNextKey++;return h.data.ParentTree.add(c,[]),c},endMarkings(){const h=this._root.data.StructTreeRoot;h&&(h.end(),this.structChildren.forEach(c=>c.end())),this._root.data.MarkInfo&&this._root.data.MarkInfo.end()}};const Mi={readOnly:1,required:2,noExport:4,multiline:4096,password:8192,toggleToOffButton:16384,radioButton:32768,pushButton:65536,combo:131072,edit:262144,sort:524288,multiSelect:2097152,noSpell:4194304},pi={left:0,center:1,right:2},Zi={value:"V",defaultValue:"DV"},qi={zip:"0",zipPlus4:"1",zip4:"1",phone:"2",ssn:"3"},$i_number={nDec:0,sepComma:!1,negStyle:"MinusBlack",currency:"",currencyPrepend:!0},$i_percent={nDec:0,sepComma:!1};var ps={initForm(){if(!this._font)throw new Error("Must set a font before calling initForm method");this._acroform={fonts:{},defaultFont:this._font.name},this._acroform.fonts[this._font.id]=this._font.ref();let h={Fields:[],NeedAppearances:!0,DA:new String(`/${this._font.id} 0 Tf 0 g`),DR:{Font:{}}};h.DR.Font[this._font.id]=this._font.ref();const c=this.ref(h);return this._root.data.AcroForm=c,this},endAcroForm(){if(this._root.data.AcroForm){if(!Object.keys(this._acroform.fonts).length&&!this._acroform.defaultFont)throw new Error("No fonts specified for PDF form");let h=this._root.data.AcroForm.data.DR.Font;Object.keys(this._acroform.fonts).forEach(c=>{h[c]=this._acroform.fonts[c]}),this._root.data.AcroForm.data.Fields.forEach(c=>{this._endChild(c)}),this._root.data.AcroForm.end()}return this},_endChild(h){return Array.isArray(h.data.Kids)&&(h.data.Kids.forEach(c=>{this._endChild(c)}),h.end()),this},formField(h,c){void 0===c&&(c={});let y=this._fieldDict(h,null,c),p=this.ref(y);return this._addToParent(p),p},formAnnotation(h,c,y,p,q,CA,_A){void 0===_A&&(_A={});let ee=this._fieldDict(h,c,_A);return ee.Subtype="Widget",void 0===ee.F&&(ee.F=4),this.annotate(y,p,q,CA,ee),this._addToParent(this.page.annotations[this.page.annotations.length-1])},formText(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"text",c,y,p,q,CA)},formPushButton(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"pushButton",c,y,p,q,CA)},formCombo(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"combo",c,y,p,q,CA)},formList(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"list",c,y,p,q,CA)},formRadioButton(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"radioButton",c,y,p,q,CA)},formCheckbox(h,c,y,p,q,CA){return void 0===CA&&(CA={}),this.formAnnotation(h,"checkbox",c,y,p,q,CA)},_addToParent(h){let c=h.data.Parent;return c?(c.data.Kids||(c.data.Kids=[]),c.data.Kids.push(h)):this._root.data.AcroForm.data.Fields.push(h),this},_fieldDict(h,c,y){if(void 0===y&&(y={}),!this._acroform)throw new Error("Call document.initForm() method before adding form elements to document");let p=Object.assign({},y);return null!==c&&(p=this._resolveType(c,y)),p=this._resolveFlags(p),p=this._resolveJustify(p),p=this._resolveFont(p),p=this._resolveStrings(p),p=this._resolveColors(p),p=this._resolveFormat(p),p.T=new String(h),p.parent&&(p.Parent=p.parent,delete p.parent),p},_resolveType(h,c){if("text"===h)c.FT="Tx";else if("pushButton"===h)c.FT="Btn",c.pushButton=!0;else if("radioButton"===h)c.FT="Btn",c.radioButton=!0;else if("checkbox"===h)c.FT="Btn";else if("combo"===h)c.FT="Ch",c.combo=!0;else{if("list"!==h)throw new Error(`Invalid form annotation type '${h}'`);c.FT="Ch"}return c},_resolveFormat(h){const c=h.format;if(c&&c.type){let y,p,q="";if(void 0!==qi[c.type])y="AFSpecial_Keystroke",p="AFSpecial_Format",q=qi[c.type];else{let CA=c.type.charAt(0).toUpperCase()+c.type.slice(1);if(y=`AF${CA}_Keystroke`,p=`AF${CA}_Format`,"date"===c.type)y+="Ex",q=String(c.param);else if("time"===c.type)q=String(c.param);else if("number"===c.type){let _A=Object.assign({},$i_number,c);q=String([String(_A.nDec),_A.sepComma?"0":"1",'"'+_A.negStyle+'"',"null",'"'+_A.currency+'"',String(_A.currencyPrepend)].join(","))}else if("percent"===c.type){let _A=Object.assign({},$i_percent,c);q=String([String(_A.nDec),_A.sepComma?"0":"1"].join(","))}}h.AA=h.AA?h.AA:{},h.AA.K={S:"JavaScript",JS:new String(`${y}(${q});`)},h.AA.F={S:"JavaScript",JS:new String(`${p}(${q});`)}}return delete h.format,h},_resolveColors(h){let c=this._normalizeColor(h.backgroundColor);return c&&(h.MK||(h.MK={}),h.MK.BG=c),c=this._normalizeColor(h.borderColor),c&&(h.MK||(h.MK={}),h.MK.BC=c),delete h.backgroundColor,delete h.borderColor,h},_resolveFlags(h){let c=0;return Object.keys(h).forEach(y=>{Mi[y]&&(h[y]&&(c|=Mi[y]),delete h[y])}),0!==c&&(h.Ff=h.Ff?h.Ff:0,h.Ff|=c),h},_resolveJustify(h){let c=0;return void 0!==h.align&&("number"==typeof pi[h.align]&&(c=pi[h.align]),delete h.align),0!==c&&(h.Q=c),h},_resolveFont(h){if(null==this._acroform.fonts[this._font.id]&&(this._acroform.fonts[this._font.id]=this._font.ref()),this._acroform.defaultFont!==this._font.name){h.DR={Font:{}};const c=h.fontSize||0;h.DR.Font[this._font.id]=this._font.ref(),h.DA=new String(`/${this._font.id} ${c} Tf 0 g`)}return h},_resolveStrings(h){let c=[];function y(p){if(Array.isArray(p))for(let q=0;q{void 0!==h[p]&&(h[Zi[p]]=h[p],delete h[p])}),["V","DV"].forEach(p=>{"string"==typeof h[p]&&(h[p]=new String(h[p]))}),h.MK&&h.MK.CA&&(h.MK.CA=new String(h.MK.CA)),h.label&&(h.MK=h.MK?h.MK:{},h.MK.CA=new String(h.label),delete h.label),h}},As={file(h,c){void 0===c&&(c={}),c.name=c.name||h,c.relationship=c.relationship||"Unspecified";const y={Type:"EmbeddedFile",Params:{}};let p;if(!h)throw new Error("No src specified");if(I.isBuffer(h))p=h;else if(h instanceof ArrayBuffer)p=I.from(new Uint8Array(h));else{const Ie=/^data:(.*?);base64,(.*)$/.exec(h);if(Ie)Ie[1]&&(y.Subtype=nA(Ie[1])),p=I.from(Ie[2],"base64");else{if(p=P.readFileSync(h),!p)throw new Error(`Could not read contents of file at filepath ${h}`);const xe=P.statSync(h),s=xe.ctime;y.Params.CreationDate=xe.birthtime,y.Params.ModDate=s}}c.creationDate instanceof Date&&(y.Params.CreationDate=c.creationDate),c.modifiedDate instanceof Date&&(y.Params.ModDate=c.modifiedDate),c.type&&(y.Subtype=nA(c.type));const q=function LA(h){return(0,B.default)(h)}(new Uint8Array(p));let CA;y.Params.CheckSum=new String(q),y.Params.Size=p.byteLength,this._fileRegistry||(this._fileRegistry={});let _A=this._fileRegistry[c.name];_A&&function Is(h,c){return h.Subtype===c.Subtype&&h.Params.CheckSum.toString()===c.Params.CheckSum.toString()&&h.Params.Size===c.Params.Size&&h.Params.CreationDate.getTime()===c.Params.CreationDate.getTime()&&(void 0===h.Params.ModDate&&void 0===c.Params.ModDate||h.Params.ModDate.getTime()===c.Params.ModDate.getTime())}(y,_A)?CA=_A.ref:(CA=this.ref(y),CA.end(p),this._fileRegistry[c.name]={...y,ref:CA});const ee={Type:"Filespec",AFRelationship:c.relationship,F:new String(c.name),EF:{F:CA},UF:new String(c.name)};c.description&&(ee.Desc=new String(c.description));const he=this.ref(ee);return he.end(),c.hidden||this.addNamedEmbeddedFile(c.name,he),this._root.data.AF?this._root.data.AF.push(he):this._root.data.AF=[he],he}},Ui={initPDFA(h){"-"===h.charAt(h.length-3)?(this.subset_conformance=h.charAt(h.length-1).toUpperCase(),this.subset=parseInt(h.charAt(h.length-2))):(this.subset_conformance="B",this.subset=parseInt(h.charAt(h.length-1)))},endSubset(){this._addPdfaMetadata(),this._addColorOutputIntent()},_addColorOutputIntent(){const h=I("AAAL0AAAAAACAAAAbW50clJHQiBYWVogB98AAgAPAAAAAAAAYWNzcAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAPbWAAEAAAAA0y0AAAAAPQ6y3q6Tl76bZybOjApDzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQZGVzYwAAAUQAAABjYlhZWgAAAagAAAAUYlRSQwAAAbwAAAgMZ1RSQwAAAbwAAAgMclRSQwAAAbwAAAgMZG1kZAAACcgAAACIZ1hZWgAAClAAAAAUbHVtaQAACmQAAAAUbWVhcwAACngAAAAkYmtwdAAACpwAAAAUclhZWgAACrAAAAAUdGVjaAAACsQAAAAMdnVlZAAACtAAAACHd3RwdAAAC1gAAAAUY3BydAAAC2wAAAA3Y2hhZAAAC6QAAAAsZGVzYwAAAAAAAAAJc1JHQjIwMTQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAQAAAAABQAKAA8AFAAZAB4AIwAoAC0AMgA3ADsAQABFAEoATwBUAFkAXgBjAGgAbQByAHcAfACBAIYAiwCQAJUAmgCfAKQAqQCuALIAtwC8AMEAxgDLANAA1QDbAOAA5QDrAPAA9gD7AQEBBwENARMBGQEfASUBKwEyATgBPgFFAUwBUgFZAWABZwFuAXUBfAGDAYsBkgGaAaEBqQGxAbkBwQHJAdEB2QHhAekB8gH6AgMCDAIUAh0CJgIvAjgCQQJLAlQCXQJnAnECegKEAo4CmAKiAqwCtgLBAssC1QLgAusC9QMAAwsDFgMhAy0DOANDA08DWgNmA3IDfgOKA5YDogOuA7oDxwPTA+AD7AP5BAYEEwQgBC0EOwRIBFUEYwRxBH4EjASaBKgEtgTEBNME4QTwBP4FDQUcBSsFOgVJBVgFZwV3BYYFlgWmBbUFxQXVBeUF9gYGBhYGJwY3BkgGWQZqBnsGjAadBq8GwAbRBuMG9QcHBxkHKwc9B08HYQd0B4YHmQesB78H0gflB/gICwgfCDIIRghaCG4IggiWCKoIvgjSCOcI+wkQCSUJOglPCWQJeQmPCaQJugnPCeUJ+woRCicKPQpUCmoKgQqYCq4KxQrcCvMLCwsiCzkLUQtpC4ALmAuwC8gL4Qv5DBIMKgxDDFwMdQyODKcMwAzZDPMNDQ0mDUANWg10DY4NqQ3DDd4N+A4TDi4OSQ5kDn8Omw62DtIO7g8JDyUPQQ9eD3oPlg+zD88P7BAJECYQQxBhEH4QmxC5ENcQ9RETETERTxFtEYwRqhHJEegSBxImEkUSZBKEEqMSwxLjEwMTIxNDE2MTgxOkE8UT5RQGFCcUSRRqFIsUrRTOFPAVEhU0FVYVeBWbFb0V4BYDFiYWSRZsFo8WshbWFvoXHRdBF2UXiReuF9IX9xgbGEAYZRiKGK8Y1Rj6GSAZRRlrGZEZtxndGgQaKhpRGncanhrFGuwbFBs7G2MbihuyG9ocAhwqHFIcexyjHMwc9R0eHUcdcB2ZHcMd7B4WHkAeah6UHr4e6R8THz4faR+UH78f6iAVIEEgbCCYIMQg8CEcIUghdSGhIc4h+yInIlUigiKvIt0jCiM4I2YjlCPCI/AkHyRNJHwkqyTaJQklOCVoJZclxyX3JicmVyaHJrcm6CcYJ0kneierJ9woDSg/KHEooijUKQYpOClrKZ0p0CoCKjUqaCqbKs8rAis2K2krnSvRLAUsOSxuLKIs1y0MLUEtdi2rLeEuFi5MLoIuty7uLyQvWi+RL8cv/jA1MGwwpDDbMRIxSjGCMbox8jIqMmMymzLUMw0zRjN/M7gz8TQrNGU0njTYNRM1TTWHNcI1/TY3NnI2rjbpNyQ3YDecN9c4FDhQOIw4yDkFOUI5fzm8Ofk6Njp0OrI67zstO2s7qjvoPCc8ZTykPOM9Ij1hPaE94D4gPmA+oD7gPyE/YT+iP+JAI0BkQKZA50EpQWpBrEHuQjBCckK1QvdDOkN9Q8BEA0RHRIpEzkUSRVVFmkXeRiJGZ0arRvBHNUd7R8BIBUhLSJFI10kdSWNJqUnwSjdKfUrESwxLU0uaS+JMKkxyTLpNAk1KTZNN3E4lTm5Ot08AT0lPk0/dUCdQcVC7UQZRUFGbUeZSMVJ8UsdTE1NfU6pT9lRCVI9U21UoVXVVwlYPVlxWqVb3V0RXklfgWC9YfVjLWRpZaVm4WgdaVlqmWvVbRVuVW+VcNVyGXNZdJ114XcleGl5sXr1fD19hX7NgBWBXYKpg/GFPYaJh9WJJYpxi8GNDY5dj62RAZJRk6WU9ZZJl52Y9ZpJm6Gc9Z5Nn6Wg/aJZo7GlDaZpp8WpIap9q92tPa6dr/2xXbK9tCG1gbbluEm5rbsRvHm94b9FwK3CGcOBxOnGVcfByS3KmcwFzXXO4dBR0cHTMdSh1hXXhdj52m3b4d1Z3s3gReG54zHkqeYl553pGeqV7BHtje8J8IXyBfOF9QX2hfgF+Yn7CfyN/hH/lgEeAqIEKgWuBzYIwgpKC9INXg7qEHYSAhOOFR4Wrhg6GcobXhzuHn4gEiGmIzokziZmJ/opkisqLMIuWi/yMY4zKjTGNmI3/jmaOzo82j56QBpBukNaRP5GokhGSepLjk02TtpQglIqU9JVflcmWNJaflwqXdZfgmEyYuJkkmZCZ/JpomtWbQpuvnByciZz3nWSd0p5Anq6fHZ+Ln/qgaaDYoUehtqImopajBqN2o+akVqTHpTilqaYapoum/adup+CoUqjEqTepqaocqo+rAqt1q+msXKzQrUStuK4trqGvFq+LsACwdbDqsWCx1rJLssKzOLOutCW0nLUTtYq2AbZ5tvC3aLfguFm40blKucK6O7q1uy67p7whvJu9Fb2Pvgq+hL7/v3q/9cBwwOzBZ8Hjwl/C28NYw9TEUcTOxUvFyMZGxsPHQce/yD3IvMk6ybnKOMq3yzbLtsw1zLXNNc21zjbOts83z7jQOdC60TzRvtI/0sHTRNPG1EnUy9VO1dHWVdbY11zX4Nhk2OjZbNnx2nba+9uA3AXcit0Q3ZbeHN6i3ynfr+A24L3hROHM4lPi2+Nj4+vkc+T85YTmDeaW5x/nqegy6LzpRunQ6lvq5etw6/vshu0R7ZzuKO6070DvzPBY8OXxcvH/8ozzGfOn9DT0wvVQ9d72bfb794r4Gfio+Tj5x/pX+uf7d/wH/Jj9Kf26/kv+3P9t//9kZXNjAAAAAAAAAC5JRUMgNjE5NjYtMi0xIERlZmF1bHQgUkdCIENvbG91ciBTcGFjZSAtIHNSR0IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAAAAAUAAAAAAAAG1lYXMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlhZWiAAAAAAAAAAngAAAKQAAACHWFlaIAAAAAAAAG+iAAA49QAAA5BzaWcgAAAAAENSVCBkZXNjAAAAAAAAAC1SZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDIDYxOTY2LTItMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y10ZXh0AAAAAENvcHlyaWdodCBJbnRlcm5hdGlvbmFsIENvbG9yIENvbnNvcnRpdW0sIDIwMTUAAHNmMzIAAAAAAAEMRAAABd////MmAAAHlAAA/Y////uh///9ogAAA9sAAMB1","base64"),c=this.ref({Length:h.length,N:3});c.write(h),c.end();const y=this.ref({Type:"OutputIntent",S:"GTS_PDFA1",Info:new String("sRGB IEC61966-2.1"),OutputConditionIdentifier:new String("sRGB IEC61966-2.1"),DestOutputProfile:c});y.end(),this._root.data.OutputIntents=[y]},_getPdfaid(){return`\n \n ${this.subset}\n ${this.subset_conformance}\n \n `},_addPdfaMetadata(){this.appendXML(this._getPdfaid())}},es={initPDFUA(){this.subset=1},endSubset(){this._addPdfuaMetadata()},_addPdfuaMetadata(){this.appendXML(this._getPdfuaid())},_getPdfuaid(){return`\n \n ${this.subset}\n \n `}},Zn={_importSubset(h){Object.assign(this,h)},initSubset(h){switch(h.subset){case"PDF/A-1":case"PDF/A-1a":case"PDF/A-1b":case"PDF/A-2":case"PDF/A-2a":case"PDF/A-2b":case"PDF/A-3":case"PDF/A-3a":case"PDF/A-3b":this._importSubset(Ui),this.initPDFA(h.subset);break;case"PDF/UA":this._importSubset(es),this.initPDFUA()}}};const Ds=["height","minHeight","maxHeight"],Fs=["width","minWidth","maxWidth"];function Li(h,c){const y=new Map;return function(){const p=arguments.length<=0?void 0:arguments[0];return y.has(p)||(y.set(p,h(...arguments)),y.size>c&&y.delete(y.keys().next())),y.get(p)}}function Gi(h){return h&&"object"==typeof h&&!Array.isArray(h)}function un(h){if(!Gi(h))return h;h=Ii(h);for(var c=arguments.length,y=new Array(c>1?c-1:0),p=1;pDs.includes(q[0]))),p=Object.fromEntries(Object.entries(c).filter(q=>Fs.includes(q[0])));return c.padding=kA(c.padding),c.border=kA(c.border),c.borderColor=kA(c.borderColor),c.align=Di(c.align),{defaultStyle:c,defaultRowStyle:y,defaultColStyle:p}}(c.defaultStyle),CA=p.defaultColStyle,_A=p.defaultRowStyle;let ee,he;this._defaultStyle=p.defaultStyle,c.columnStyles&&(Array.isArray(c.columnStyles)?ee=Ie=>c.columnStyles[Ie]:"function"==typeof c.columnStyles?ee=Li(Ie=>c.columnStyles(Ie),1/0):"object"==typeof c.columnStyles&&(ee=()=>c.columnStyles)),ee||(ee=()=>({})),this._colStyle=xs.bind(this,CA,ee),c.rowStyles&&(Array.isArray(c.rowStyles)?he=Ie=>c.rowStyles[Ie]:"function"==typeof c.rowStyles?he=Li(Ie=>c.rowStyles(Ie),10):"object"==typeof c.rowStyles&&(he=()=>c.rowStyles)),he||(he=()=>({})),this._rowStyle=ys.bind(this,_A,he)}function bs(h,c,y){const p=this._colStyle(y);let q=this._rowStyle(c);const CA=un({},p.font,q.font,h.font),_A=Object.values(CA).filter(s=>null!=s).length>0,ee=this.document,he=ee._fontSource,Ie=ee._fontSize,xe=ee._fontFamily;_A&&(CA.src&&ee.font(CA.src,CA.family),CA.size&&ee.fontSize(CA.size),q=this._rowStyle(c)),h.padding=kA(h.padding),h.border=kA(h.border),h.borderColor=kA(h.borderColor);const $=un(this._defaultStyle,p,q,h);return $.rowIndex=c,$.colIndex=y,$.font=CA??{},$.customFont=_A,$.text=function Ys(h){return null!=h&&(h=`${h}`),h}($.text),$.rowSpan=$.rowSpan??1,$.colSpan=$.colSpan??1,$.padding=kA($.padding,"0.25em",s=>ee.sizeToPoint(s,"0.25em")),$.border=kA($.border,1,s=>ee.sizeToPoint(s,1)),$.borderColor=kA($.borderColor,"black",s=>s??"black"),$.align=Di($.align),$.align.x=$.align.x??"left",$.align.y=$.align.y??"top",$.textStroke=ee.sizeToPoint($.textStroke,0),$.textStrokeColor=$.textStrokeColor??"black",$.textColor=$.textColor??"black",$.textOptions=$.textOptions??{},$.id=new String($.id??`${this._id}-${c}-${y}`),$.type="TH"===$.type?.toUpperCase()?"TH":"TD",$.scope&&($.scope=$.scope.toLowerCase(),"row"===$.scope?$.scope="Row":"both"===$.scope?$.scope="Both":"column"===$.scope&&($.scope="Column")),"boolean"==typeof this.opts.debug&&($.debug=this.opts.debug),_A&&ee.font(he,xe,Ie),$}function zi(h,c){this._cellClaim||(this._cellClaim=new Set);let y=0;return h.map(p=>{for((null==p||"object"!=typeof p)&&(p={text:p});this._cellClaim.has(`${c},${y}`);)y++;p=bs.call(this,p,c,y);for(let q=0;qc+y.colSpan,0)),this._rowHeights=[],this._rowYPos=[this._position.y],this._rowBuffer=new Set}function ts(h){let c=[],y=0,p=this._maxWidth;for(let _A=0;_A_A+1,0);y>=p?c.forEach((_A,ee)=>{this._columnWidths[ee]=_A.minWidth}):q>0&&c.forEach((_A,ee)=>{this._columnWidths[ee]=Math.max(p/q,_A.minWidth),_A.maxWidth>0&&(this._columnWidths[ee]=Math.min(this._columnWidths[ee],_A.maxWidth)),p-=this._columnWidths[ee],q--});let CA=this._position.x;this._columnXPos=Array.from(this._columnWidths,_A=>{const ee=CA;return CA+=_A,ee})}function Rs(h,c){h.forEach(_A=>this._rowBuffer.add(_A)),c>0&&(this._rowYPos[c]=this._rowYPos[c-1]+this._rowHeights[c-1]);const y=this._rowStyle(c);let p=[];this._rowBuffer.forEach(_A=>{_A.rowIndex+_A.rowSpan-1===c&&(p.push(ns.call(this,_A,y.height)),this._rowBuffer.delete(_A))});let q=y.height;"auto"===q&&(q=p.reduce((_A,ee)=>{let he=ee.textBounds.height+ee.padding.top+ee.padding.bottom;for(let Ie=0;Ie0&&(q=Math.min(q,y.maxHeight)),this._rowHeights[c]=q;let CA=!1;return q>this.document.page.contentHeight?(console.warn(new Error(`Row ${c} requested more than the safe page height, row has been clamped`).stack.slice(7)),this._rowHeights[c]=this.document.page.maxY()-this._rowYPos[c]):this._rowYPos[c]+q>=this.document.page.maxY()&&(this._rowYPos[c]=this.document.page.margins.top,CA=!0),{newPage:CA,toRender:p.map(_A=>ns.call(this,_A,q))}}function ns(h,c){let y=0;for(let s=0;s180&&h<270?(p=c/(2*CA),q=c/(2*_A)):(q=c/(2*CA),p=c/(2*_A));if(_A*p+CA*q>y){const Ie=CA*CA-_A*_A;0===h||180===h?(p=c,q=y):90===h||270===h?(p=y,q=c):h<90||h>180&&h<270?(p=(c*CA-y*_A)/Ie,q=(y*CA-c*_A)/Ie):(q=(c*CA-y*_A)/Ie,p=(y*CA-c*_A)/Ie)}return{width:Math.abs(p),height:Math.abs(q)}}(_A,q,CA),xe={align:h.align.x,ellipsis:!0,stroke:h.textStroke>0,fill:!0,width:ee.width,height:ee.height,rotation:_A,...h.textOptions};let $={x:0,y:0,width:0,height:0};if(h.text){const s=this.document._fontSource,d=this.document._fontSize,F=this.document._fontFamily;h.font?.src&&this.document.font(h.font.src,h.font?.family),h.font?.size&&this.document.fontSize(h.font.size);const W=this.document.boundsOfString(h.text,0,0,{...xe,rotation:0});xe.width=W.width,xe.height=W.height,$=this.document.boundsOfString(h.text,0,0,xe),this.document.font(s,F,d)}return{...h,textOptions:xe,x:this._columnXPos[h.colIndex],y:this._rowYPos[h.rowIndex],textX:this._columnXPos[h.colIndex]+h.padding.left,textY:this._rowYPos[h.rowIndex]+h.padding.top,width:y,height:p,textAllocatedHeight:CA,textAllocatedWidth:q,textBounds:$}}function li(){const h=this.opts.structParent;h&&(this._tableStruct=this.document.struct("Table"),this._tableStruct.dictionary.data.ID=this._id,h instanceof fn?h.add(this._tableStruct):h instanceof yi&&h.addStructure(this._tableStruct),this._headerRowLookup={},this._headerColumnLookup={})}function Ns(){this._tableStruct&&this._tableStruct.end()}function is(h,c,y){const p=this.document.struct("TR");p.dictionary.data.ID=new String(`${this._id}-${c}`),this._tableStruct.add(p),h.forEach(q=>y(q,p)),p.end()}function Ts(h,c,y){const p=this.document,q=p.struct(h.type,{title:h.title});q.dictionary.data.ID=h.id,c.add(q);const CA=h.padding,_A=h.border,ee={O:"Table",Width:h.width,Height:h.height,Padding:[CA.top,CA.bottom,CA.left,CA.right],RowSpan:h.rowSpan>1?h.rowSpan:void 0,ColSpan:h.colSpan>1?h.colSpan:void 0,BorderThickness:[_A.top,_A.bottom,_A.left,_A.right]};if("TH"===h.type){if("Row"===h.scope||"Both"===h.scope){for(let $=0;$this._headerColumnLookup[h.colIndex+s]).flat(),...Array.from({length:h.rowSpan},($,s)=>this._headerRowLookup[h.rowIndex+s]).flat()].filter(Boolean));he.size&&(ee.Headers=Array.from(he));const Ie=p._normalizeColor;null!=h.backgroundColor&&(ee.BackgroundColor=Ie(h.backgroundColor));const xe=[_A.top,_A.bottom,_A.left,_A.right];if(xe.some($=>$)){const $=h.borderColor;ee.BorderColor=[xe[0]?Ie($.top):null,xe[1]?Ie($.bottom):null,xe[2]?Ie($.left):null,xe[3]?Ie($.right):null]}Object.keys(ee).forEach($=>void 0===ee[$]&&delete ee[$]),q.dictionary.data.A=p.ref(ee),q.add(y),q.end(),q.dictionary.data.A.end()}function Ps(h,c){return this._tableStruct?is.call(this,h,c,Fi.bind(this)):h.forEach(y=>Fi.call(this,y)),this._rowYPos[c]+this._rowHeights[c]}function Fi(h,c){const y=()=>{null!=h.backgroundColor&&this.document.save().fillColor(h.backgroundColor).rect(h.x,h.y,h.width,h.height).fill().restore(),Us.call(this,h.border,h.borderColor,h.x,h.y,h.width,h.height),h.debug&&(this.document.save(),this.document.dash(1,{space:1}).lineWidth(1).strokeOpacity(.3),this.document.rect(h.x,h.y,h.width,h.height).stroke("green"),this.document.restore()),h.text&&ki.call(this,h)};c?Ts.call(this,h,c,y):y()}function ki(h){const c=this.document,y=c._fontSource,p=c._fontSize,q=c._fontFamily;h.customFont&&(h.font.src&&c.font(h.font.src,h.font.family),h.font.size&&c.fontSize(h.font.size));const CA=h.textX,_A=h.textY,ee=h.textAllocatedHeight,he=h.textAllocatedWidth,Ie=h.textBounds.width,xe=h.textBounds.height,F=(he-Ie)*("right"===h.align.x?1:"center"===h.align.x?.5:0),Z=(ee-xe)*("bottom"===h.align.y?1:"center"===h.align.y?.5:0),EA=F+-h.textBounds.x,PA=Z+-h.textBounds.y;h.debug&&(c.save(),c.dash(1,{space:1}).lineWidth(1).strokeOpacity(.3),h.text&&c.moveTo(CA+F,_A).lineTo(CA+F,_A+ee).moveTo(CA+F+Ie,_A).lineTo(CA+F+Ie,_A+ee).stroke("blue").moveTo(CA,_A+Z).lineTo(CA+he,_A+Z).moveTo(CA,_A+Z+xe).lineTo(CA+he,_A+Z+xe).stroke("green"),c.rect(CA,_A,he,ee).stroke("orange"),c.restore()),c.save().rect(CA,_A,he,ee).clip(),c.fillColor(h.textColor).strokeColor(h.textStrokeColor),h.textStroke>0&&c.lineWidth(h.textStroke),c.text(h.text,CA+EA,_A+PA,h.textOptions),c.restore(),h.font&&c.font(y,q,p)}function Us(h,c,y,p,q,CA,_A){h=Object.fromEntries(Object.entries(h).map(he=>{let Ie=he[0];return[Ie,_A&&!_A[Ie]?0:he[1]]}));const ee=this.document;[h.right,h.bottom,h.left].every(he=>he===h.top)?h.top>0&&ee.save().lineWidth(h.top).strokeColor(c.top).rect(y,p,q,CA).stroke().restore():(h.top>0&&ee.save().lineWidth(h.top).moveTo(y,p).strokeColor(c.top).lineTo(y+q,p).stroke().restore(),h.right>0&&ee.save().lineWidth(h.right).moveTo(y+q,p).strokeColor(c.right).lineTo(y+q,p+CA).stroke().restore(),h.bottom>0&&ee.save().lineWidth(h.bottom).moveTo(y+q,p+CA).strokeColor(c.bottom).lineTo(y,p+CA).stroke().restore(),h.left>0&&ee.save().lineWidth(h.left).moveTo(y,p+CA).strokeColor(c.left).lineTo(y,p).stroke().restore())}class zn{constructor(c,y){if(void 0===y&&(y={}),this.document=c,this.opts=Object.freeze(y),oi.call(this),li.call(this),this._currRowIndex=0,this._ended=!1,y.data){for(const p of y.data)this.row(p);return this.end()}}row(c,y){if(void 0===y&&(y=!1),this._ended)throw new Error(`Table was marked as ended on row ${this._currRowIndex}`);c=Array.from(c),c=zi.call(this,c,this._currRowIndex),0===this._currRowIndex&&vs.call(this,c);const p=Rs.call(this,c,this._currRowIndex),CA=p.toRender;p.newPage&&this.document.continueOnNewPage();const _A=Ps.call(this,CA,this._currRowIndex);return this.document.x=this._position.x,this.document.y=_A,y?this.end():(this._currRowIndex++,this)}end(){for(;this._rowBuffer?.size;)this.row([]);return this._ended=!0,Ns.call(this),this.document}}var Ls={initTables(){this._tableIndex=0},table(h){return new zn(this,h)}};class ss{constructor(){this._metadata='\n \n \n \n '}_closeTags(){this._metadata=this._metadata.concat('\n \n \n \n ')}append(c,y){void 0===y&&(y=!0),this._metadata=this._metadata.concat(c),y&&(this._metadata=this._metadata.concat("\n"))}getXML(){return this._metadata}getLength(){return this._metadata.length}end(){this._closeTags(),this._metadata=this._metadata.trim()}}var Gs={initMetadata(){this.metadata=new ss},appendXML(h,c){void 0===c&&(c=!0),this.metadata.append(h,c)},_addInfo(){this.appendXML(`\n \n ${this.info.CreationDate.toISOString().split(".")[0]+"Z"}\n ${this.info.Creator}\n \n `),(this.info.Title||this.info.Author||this.info.Subject)&&(this.appendXML('\n \n '),this.info.Title&&this.appendXML(`\n \n \n ${this.info.Title}\n \n \n `),this.info.Author&&this.appendXML(`\n \n \n ${this.info.Author}\n \n \n `),this.info.Subject&&this.appendXML(`\n \n \n ${this.info.Subject}\n \n \n `),this.appendXML("\n \n ")),this.appendXML(`\n \n ${this.info.Producer}`,!1),this.info.Keywords&&this.appendXML(`\n ${this.info.Keywords}`,!1),this.appendXML("\n \n ")},endMetadata(){this._addInfo(),this.metadata.end(),1.3!=this.version&&(this.metadataRef=this.ref({length:this.metadata.getLength(),Type:"Metadata",Subtype:"XML"}),this.metadataRef.compress=!1,this.metadataRef.write(I.from(this.metadata.getXML(),"utf-8")),this.metadataRef.end(),this._root.data.Metadata=this.metadataRef)}};class yi extends N.default.Readable{constructor(c){switch(void 0===c&&(c={}),super(c),this.options=c,c.pdfVersion){case"1.4":this.version=1.4;break;case"1.5":this.version=1.5;break;case"1.6":this.version=1.6;break;case"1.7":case"1.7ext3":this.version=1.7;break;default:this.version=1.3}this.compress=null==this.options.compress||this.options.compress,this._pageBuffer=[],this._pageBufferStart=0,this._offsets=[],this._waiting=0,this._ended=!1,this._offset=0;const y=this.ref({Type:"Pages",Count:0,Kids:[]}),p=this.ref({Dests:new O});if(this._root=this.ref({Type:"Catalog",Pages:y,Names:p}),this.options.lang&&(this._root.data.Lang=new String(this.options.lang)),this.options.pageLayout){const q=this.options.pageLayout;this._root.data.PageLayout=q.charAt(0).toUpperCase()+q.slice(1)}if(this.page=null,this.initMetadata(),this.initColor(),this.initVector(),this.initFonts(c.font),this.initText(),this.initImages(),this.initOutline(),this.initMarkings(c),this.initTables(),this.initSubset(c),this.info={Producer:"PDFKit",Creator:"PDFKit",CreationDate:new Date},this.options.info)for(let q in this.options.info)this.info[q]=this.options.info[q];this.options.displayTitle&&(this._root.data.ViewerPreferences=this.ref({DisplayDocTitle:!0})),this._id=ie.generateFileID(this.info),this._security=ie.create(this,c),this._write(`%PDF-${this.version}`),this._write("%\xff\xff\xff\xff"),!1!==this.options.autoFirstPage&&this.addPage()}addPage(c){null==c&&(c=this.options),this.options.bufferPages||this.flushPages(),this.page=new U(this,c),this._pageBuffer.push(this.page);const y=this._root.data.Pages.data;return y.Kids.push(this.page.dictionary),y.Count++,this.x=this.page.margins.left,this.y=this.page.margins.top,this._ctm=[1,0,0,1,0,0],this.transform(1,0,0,-1,0,this.page.height),this.emit("pageAdded"),this}continueOnNewPage(c){const y=this.endPageMarkings(this.page);return this.addPage(c??this.page._options),this.initPageMarkings(y),this}bufferedPageRange(){return{start:this._pageBufferStart,count:this._pageBuffer.length}}switchToPage(c){let y;if(!(y=this._pageBuffer[c-this._pageBufferStart]))throw new Error(`switchToPage(${c}) out of bounds, current buffer covers pages ${this._pageBufferStart} to ${this._pageBufferStart+this._pageBuffer.length-1}`);return this.page=y}flushPages(){const c=this._pageBuffer;this._pageBuffer=[],this._pageBufferStart+=c.length;for(let y of c)this.endPageMarkings(y),y.end()}addNamedDestination(c){for(var y=arguments.length,p=new Array(y>1?y-1:0),q=1;q{Object.assign(yi.prototype,h)};Yn(Gs),Yn(bt),Yn(je),Yn(Wt),Yn(Cn),Yn(ri),Yn(ai),Yn(Xi),Yn(Ms),Yn(ps),Yn(As),Yn(Zn),Yn(Ls),yi.LineWrapper=Bn},6092(eA,Q,f){var t=f(2736),g=f(2022);typeof g.pdfMake>"u"&&(g.pdfMake=t),eA.exports=t},656(eA,Q,f){"use strict";Q.polyval=Q.ghash=void 0;const g=f(5181),I=16,N=new Uint8Array(16),K=(0,g.u32)(N),B=(P,rA,QA,NA)=>({s3:QA<<31|NA>>>1,s2:rA<<31|QA>>>1,s1:P<<31|rA>>>1,s0:P>>>1^225<<24&-(1&NA)}),j=P=>(P>>>0&255)<<24|(P>>>8&255)<<16|(P>>>16&255)<<8|P>>>24&255;class aA{constructor(rA,QA){this.blockLen=I,this.outputLen=I,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,rA=(0,g.toBytes)(rA),(0,g.abytes)(rA,16);const NA=(0,g.createView)(rA);let oA=NA.getUint32(0,!1),uA=NA.getUint32(4,!1),dA=NA.getUint32(8,!1),RA=NA.getUint32(12,!1);const nA=[];for(let VA=0;VA<128;VA++)nA.push({s0:j(oA),s1:j(uA),s2:j(dA),s3:j(RA)}),({s0:oA,s1:uA,s2:dA,s3:RA}=B(oA,uA,dA,RA));const H=(P=QA||1024)>65536?8:P>1024?4:2;var P;if(![1,2,4,8].includes(H))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=H;const z=128/H,OA=this.windowSize=2**H,wA=[];for(let VA=0;VA>>H-xA-1&1))continue;const{s0:HA,s1:cA,s2:J,s3:U}=nA[H*VA+xA];hA^=HA,fA^=cA,UA^=J,yA^=U}wA.push({s0:hA,s1:fA,s2:UA,s3:yA})}this.t=wA}_updateBlock(rA,QA,NA,oA){rA^=this.s0,QA^=this.s1,NA^=this.s2,oA^=this.s3;const{W:uA,t:dA,windowSize:RA}=this;let nA=0,H=0,pA=0,z=0;const OA=(1<>>8*kA&255;for(let fA=8/uA-1;fA>=0;fA--){const UA=hA>>>uA*fA&OA,{s0:yA,s1:xA,s2:Ee,s3:HA}=dA[wA*RA+UA];nA^=yA,H^=xA,pA^=Ee,z^=HA,wA+=1}}this.s0=nA,this.s1=H,this.s2=pA,this.s3=z}update(rA){(0,g.aexists)(this),rA=(0,g.toBytes)(rA),(0,g.abytes)(rA);const QA=(0,g.u32)(rA),NA=Math.floor(rA.length/I),oA=rA.length%I;for(let uA=0;uA>>1|QA,QA=(1&oA)<<7}return P[0]^=225&-rA,P}((0,g.copyBytes)(rA));super(NA,QA),(0,g.clean)(NA)}update(rA){rA=(0,g.toBytes)(rA),(0,g.aexists)(this);const QA=(0,g.u32)(rA),NA=rA.length%I,oA=Math.floor(rA.length/I);for(let uA=0;uAP(oA,NA.length).update((0,g.toBytes)(NA)).digest(),QA=P(new Uint8Array(16),0);return rA.outputLen=QA.outputLen,rA.blockLen=QA.blockLen,rA.create=(NA,oA)=>P(NA,oA),rA}Q.ghash=L((P,rA)=>new aA(P,rA)),Q.polyval=L((P,rA)=>new AA(P,rA))},2651(eA,Q,f){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.unsafe=Q.aeskwp=Q.aeskw=Q.siv=Q.gcmsiv=Q.gcm=Q.cfb=Q.cbc=Q.ecb=Q.ctr=void 0;const t=f(656),g=f(5181),I=16,K=new Uint8Array(I);function B(J){return J<<1^283&-(J>>7)}function j(J,U){let O=0;for(;U>0;U>>=1)O^=J&-(1&U),J=B(J);return O}const tA=(()=>{const J=new Uint8Array(256);for(let O=0,lA=1;O<256;O++,lA^=B(lA))J[O]=lA;const U=new Uint8Array(256);U[0]=99;for(let O=0;O<255;O++){let lA=J[255-O];lA|=lA<<8,U[J[O]]=255&(lA^lA>>4^lA>>5^lA>>6^lA>>7^99)}return(0,g.clean)(J),U})(),w=tA.map((J,U)=>tA.indexOf(U)),aA=J=>J<<24|J>>>8,AA=J=>J<<8|J>>>24,L=J=>J<<24&4278190080|J<<8&16711680|J>>>8&65280|J>>>24&255;function P(J,U){if(256!==J.length)throw new Error("Wrong sbox length");const O=new Uint32Array(256).map((C,b)=>U(J[b])),lA=O.map(AA),LA=lA.map(AA),JA=LA.map(AA),$A=new Uint32Array(65536),IA=new Uint32Array(65536),gA=new Uint16Array(65536);for(let C=0;C<256;C++)for(let b=0;b<256;b++){const R=256*C+b;$A[R]=O[C]^lA[b],IA[R]=LA[C]^JA[b],gA[R]=J[C]<<8|J[b]}return{sbox:J,sbox2:gA,T0:O,T1:lA,T2:LA,T3:JA,T01:$A,T23:IA}}const rA=P(tA,J=>j(J,3)<<24|J<<16|J<<8|j(J,2)),QA=P(w,J=>j(J,11)<<24|j(J,13)<<16|j(J,9)<<8|j(J,14)),NA=(()=>{const J=new Uint8Array(16);for(let U=0,O=1;U<16;U++,O=B(O))J[U]=O;return J})();function oA(J){(0,g.abytes)(J);const U=J.length;if(![16,24,32].includes(U))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+U);const{sbox2:O}=rA,lA=[];(0,g.isAligned32)(J)||lA.push(J=(0,g.copyBytes)(J));const LA=(0,g.u32)(J),JA=LA.length,$A=gA=>RA(O,gA,gA,gA,gA),IA=new Uint32Array(U+28);IA.set(LA);for(let gA=JA;gA6&&gA%JA===4&&(C=$A(C)),IA[gA]=IA[gA-JA]^C}return(0,g.clean)(...lA),IA}function uA(J){const U=oA(J),O=U.slice(),lA=U.length,{sbox2:LA}=rA,{T0:JA,T1:$A,T2:IA,T3:gA}=QA;for(let C=0;C>>8&255]^IA[R>>>16&255]^gA[R>>>24]}return O}function dA(J,U,O,lA,LA,JA){return J[O<<8&65280|lA>>>8&255]^U[LA>>>8&65280|JA>>>24&255]}function RA(J,U,O,lA,LA){return J[255&U|65280&O]|J[lA>>>16&255|LA>>>16&65280]<<16}function nA(J,U,O,lA,LA){const{sbox2:JA,T01:$A,T23:IA}=rA;let gA=0;U^=J[gA++],O^=J[gA++],lA^=J[gA++],LA^=J[gA++];const C=J.length/4-2;for(let X=0;X=0;KA--)YA=YA+(255&JA[KA])|0,JA[KA]=255&YA,YA>>>=8;({s0:IA,s1:gA,s2:C,s3:b}=nA(J,$A[0],$A[1],$A[2],$A[3]))}const D=I*Math.floor(R.length/4);if(D>>0,IA.setUint32(b,M,U),({s0:D,s1:X,s2:YA,s3:KA}=nA(J,$A[0],$A[1],$A[2],$A[3]));const bA=I*Math.floor(gA.length/4);if(bA16)throw new Error("aes/pcks5: wrong padding");const LA=J.subarray(0,-lA);for(let JA=0;JAlA(LA,JA),decrypt:(LA,JA)=>lA(LA,JA)}}),Q.ecb=(0,g.wrapCipher)({blockSize:16},function(U,O={}){const lA=!O.disablePadding;return{encrypt(LA,JA){const{b:$A,o:IA,out:gA}=wA(LA,lA,JA),C=oA(U);let b=0;for(;b+4<=$A.length;){const{s0:R,s1:M,s2:D,s3:X}=nA(C,$A[b+0],$A[b+1],$A[b+2],$A[b+3]);IA[b++]=R,IA[b++]=M,IA[b++]=D,IA[b++]=X}if(lA){const R=kA(LA.subarray(4*b)),{s0:M,s1:D,s2:X,s3:YA}=nA(C,R[0],R[1],R[2],R[3]);IA[b++]=M,IA[b++]=D,IA[b++]=X,IA[b++]=YA}return(0,g.clean)(C),gA},decrypt(LA,JA){OA(LA);const $A=uA(U);JA=(0,g.getOutput)(LA.length,JA);const IA=[$A];(0,g.isAligned32)(LA)||IA.push(LA=(0,g.copyBytes)(LA)),(0,g.complexOverlapBytes)(LA,JA);const gA=(0,g.u32)(LA),C=(0,g.u32)(JA);for(let b=0;b+4<=gA.length;){const{s0:R,s1:M,s2:D,s3:X}=H($A,gA[b+0],gA[b+1],gA[b+2],gA[b+3]);C[b++]=R,C[b++]=M,C[b++]=D,C[b++]=X}return(0,g.clean)(...IA),VA(JA,lA)}}}),Q.cbc=(0,g.wrapCipher)({blockSize:16,nonceLength:16},function(U,O,lA={}){const LA=!lA.disablePadding;return{encrypt(JA,$A){const IA=oA(U),{b:gA,o:C,out:b}=wA(JA,LA,$A);let R=O;const M=[IA];(0,g.isAligned32)(R)||M.push(R=(0,g.copyBytes)(R));const D=(0,g.u32)(R);let X=D[0],YA=D[1],KA=D[2],bA=D[3],le=0;for(;le+4<=gA.length;)X^=gA[le+0],YA^=gA[le+1],KA^=gA[le+2],bA^=gA[le+3],({s0:X,s1:YA,s2:KA,s3:bA}=nA(IA,X,YA,KA,bA)),C[le++]=X,C[le++]=YA,C[le++]=KA,C[le++]=bA;if(LA){const ve=kA(JA.subarray(4*le));X^=ve[0],YA^=ve[1],KA^=ve[2],bA^=ve[3],({s0:X,s1:YA,s2:KA,s3:bA}=nA(IA,X,YA,KA,bA)),C[le++]=X,C[le++]=YA,C[le++]=KA,C[le++]=bA}return(0,g.clean)(...M),b},decrypt(JA,$A){OA(JA);const IA=uA(U);let gA=O;const C=[IA];(0,g.isAligned32)(gA)||C.push(gA=(0,g.copyBytes)(gA));const b=(0,g.u32)(gA);$A=(0,g.getOutput)(JA.length,$A),(0,g.isAligned32)(JA)||C.push(JA=(0,g.copyBytes)(JA)),(0,g.complexOverlapBytes)(JA,$A);const R=(0,g.u32)(JA),M=(0,g.u32)($A);let D=b[0],X=b[1],YA=b[2],KA=b[3];for(let bA=0;bA+4<=R.length;){const le=D,ve=X,Ne=YA,Te=KA;D=R[bA+0],X=R[bA+1],YA=R[bA+2],KA=R[bA+3];const{s0:ze,s1:Oe,s2:oe,s3:sA}=H(IA,D,X,YA,KA);M[bA++]=ze^le,M[bA++]=Oe^ve,M[bA++]=oe^Ne,M[bA++]=sA^Te}return(0,g.clean)(...C),VA($A,LA)}}}),Q.cfb=(0,g.wrapCipher)({blockSize:16,nonceLength:16},function(U,O){function lA(LA,JA,$A){(0,g.abytes)(LA);const IA=LA.length;if($A=(0,g.getOutput)(IA,$A),(0,g.overlapBytes)(LA,$A))throw new Error("overlapping src and dst not supported.");const gA=oA(U);let C=O;const b=[gA];(0,g.isAligned32)(C)||b.push(C=(0,g.copyBytes)(C)),(0,g.isAligned32)(LA)||b.push(LA=(0,g.copyBytes)(LA));const R=(0,g.u32)(LA),M=(0,g.u32)($A),D=JA?M:R,X=(0,g.u32)(C);let YA=X[0],KA=X[1],bA=X[2],le=X[3];for(let Ne=0;Ne+4<=R.length;){const{s0:Te,s1:ze,s2:Oe,s3:oe}=nA(gA,YA,KA,bA,le);M[Ne+0]=R[Ne+0]^Te,M[Ne+1]=R[Ne+1]^ze,M[Ne+2]=R[Ne+2]^Oe,M[Ne+3]=R[Ne+3]^oe,YA=D[Ne++],KA=D[Ne++],bA=D[Ne++],le=D[Ne++]}const ve=I*Math.floor(R.length/4);if(velA(LA,!0,JA),decrypt:(LA,JA)=>lA(LA,!1,JA)}}),Q.gcm=(0,g.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(U,O,lA){if(O.length<8)throw new Error("aes/gcm: invalid nonce length");function JA(IA,gA,C){const b=hA(t.ghash,!1,IA,C,lA);for(let R=0;RlA=>{if(!Number.isSafeInteger(lA)||U>lA||lA>O)throw new Error(J+": expected value in range ["+U+".."+O+"], got "+lA)};function UA(J){return J instanceof Uint32Array||ArrayBuffer.isView(J)&&"Uint32Array"===J.constructor.name}function yA(J,U){if((0,g.abytes)(U,16),!UA(J))throw new Error("_encryptBlock accepts result of expandKeyLE");const O=(0,g.u32)(U);let{s0:lA,s1:LA,s2:JA,s3:$A}=nA(J,O[0],O[1],O[2],O[3]);return O[0]=lA,O[1]=LA,O[2]=JA,O[3]=$A,U}function xA(J,U){if((0,g.abytes)(U,16),!UA(J))throw new Error("_decryptBlock accepts result of expandKeyLE");const O=(0,g.u32)(U);let{s0:lA,s1:LA,s2:JA,s3:$A}=H(J,O[0],O[1],O[2],O[3]);return O[0]=lA,O[1]=LA,O[2]=JA,O[3]=$A,U}Q.gcmsiv=(0,g.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(U,O,lA){const JA=fA("AAD",0,68719476736),$A=fA("plaintext",0,2**36),IA=fA("nonce",12,12),gA=fA("ciphertext",16,2**36+16);function C(){const M=oA(U),D=new Uint8Array(U.length),X=new Uint8Array(16),YA=[M,D];let KA=O;(0,g.isAligned32)(KA)||YA.push(KA=(0,g.copyBytes)(KA));const bA=(0,g.u32)(KA);let le=0,ve=bA[0],Ne=bA[1],Te=bA[2],ze=0;for(const oe of[X,D].map(g.u32)){const sA=(0,g.u32)(oe);for(let S=0;S=2**32)throw new Error("plaintext should be less than 4gb");const O=oA(J);if(16===U.length)yA(O,U);else{const lA=(0,g.u32)(U);let LA=lA[0],JA=lA[1];for(let $A=0,IA=1;$A<6;$A++)for(let gA=2;gA=2**32)throw new Error("ciphertext should be less than 4gb");const O=uA(J),lA=U.length/8-1;if(1===lA)xA(O,U);else{const LA=(0,g.u32)(U);let JA=LA[0],$A=LA[1];for(let IA=0,gA=6*lA;IA<6;IA++)for(let C=2*lA;C>=1;C-=2,gA--){$A^=L(gA);const{s0:b,s1:R,s2:M,s3:D}=H(O,JA,$A,LA[C],LA[C+1]);JA=b,$A=R,LA[C]=M,LA[C+1]=D}LA[0]=JA,LA[1]=$A}O.fill(0)}},HA=new Uint8Array(8).fill(166);Q.aeskw=(0,g.wrapCipher)({blockSize:8},J=>({encrypt(U){if(!U.length||U.length%8!=0)throw new Error("invalid plaintext length");if(8===U.length)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const O=(0,g.concatBytes)(HA,U);return Ee.encrypt(J,O),O},decrypt(U){if(U.length%8!=0||U.length<24)throw new Error("invalid ciphertext length");const O=(0,g.copyBytes)(U);if(Ee.decrypt(J,O),!(0,g.equalBytes)(O.subarray(0,8),HA))throw new Error("integrity check failed");return O.subarray(0,8).fill(0),O.subarray(8)}}));const cA=2790873510;Q.aeskwp=(0,g.wrapCipher)({blockSize:8},J=>({encrypt(U){if(!U.length)throw new Error("invalid plaintext length");const O=8*Math.ceil(U.length/8),lA=new Uint8Array(8+O);lA.set(U,8);const LA=(0,g.u32)(lA);return LA[0]=cA,LA[1]=L(U.length),Ee.encrypt(J,lA),lA},decrypt(U){if(U.length<16)throw new Error("invalid ciphertext length");const O=(0,g.copyBytes)(U),lA=(0,g.u32)(O);Ee.decrypt(J,O);const LA=L(lA[1])>>>0,JA=8*Math.ceil(LA/8);if(lA[0]!==cA||O.length-8!==JA)throw new Error("integrity check failed");for(let $A=LA;$A0&&!J.includes(cA.length))throw new Error("Uint8Array expected of length "+J+", got length="+cA.length)}function aA(cA){return new DataView(cA.buffer,cA.byteOffset,cA.byteLength)}function z(cA,J){return cA.buffer===J.buffer&&cA.byteOffset>lA&LA),$A=Number(U&LA),gA=O?0:4;cA.setUint32(J+(O?4:0),JA,O),cA.setUint32(J+gA,$A,O)}function Ee(cA){return cA.byteOffset%4==0}function HA(cA){return Uint8Array.from(cA)}Q.wrapCipher=Q.qv=void 0,Q.abytes=N,Q.aexists=function v(cA,J=!0){if(cA.destroyed)throw new Error("Hash instance has been destroyed");if(J&&cA.finished)throw new Error("Hash#digest() has already been called")},Q.aoutput=function B(cA,J){N(cA);const U=J.outputLen;if(cA.length{function U(O,...lA){if(N(O),!Q.qv)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==cA.nonceLength){const C=lA[0];if(!C)throw new Error("nonce / iv required");cA.varSizeNonce?N(C):N(C,cA.nonceLength)}const LA=cA.tagLength;LA&&void 0!==lA[1]&&N(lA[1]);const JA=J(O,...lA),$A=(C,b)=>{if(void 0!==b){if(2!==C)throw new Error("cipher output not supported");N(b)}};let IA=!1;return{encrypt(C,b){if(IA)throw new Error("cannot encrypt() twice with same key + nonce");return IA=!0,N(C),$A(JA.encrypt.length,b),JA.encrypt(C,b)},decrypt(C,b){if(N(C),LA&&C.lengthaA-L&&(this.process(w,0),L=0);for(let oA=L;oA>aA&AA),P=Number(tA&AA),QA=w?0:4;B.setUint32(j+(w?4:0),L,w),B.setUint32(j+QA,P,w)})(w,aA-8,BigInt(8*this.length),AA),this.process(w,0);const P=(0,g.createView)(j),rA=this.outputLen;if(rA%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const QA=rA/4,NA=this.get();if(QA>NA.length)throw new Error("_sha2: outputLen bigger than state");for(let oA=0;oA>>0)+(kA>>>0);return{h:OA+VA+(hA/4294967296|0)|0,l:0|hA}},Q.split=function N(OA,wA=!1){const VA=OA.length;let kA=new Uint32Array(VA),hA=new Uint32Array(VA);for(let fA=0;fA>g&t)}:{h:0|Number(OA>>g&t),l:0|Number(OA&t)}}Q.shrSH=(OA,wA,VA)=>OA>>>VA;Q.shrSL=(OA,wA,VA)=>OA<<32-VA|wA>>>VA;Q.rotrSH=(OA,wA,VA)=>OA>>>VA|wA<<32-VA;Q.rotrSL=(OA,wA,VA)=>OA<<32-VA|wA>>>VA;Q.rotrBH=(OA,wA,VA)=>OA<<64-VA|wA>>>VA-32;Q.rotrBL=(OA,wA,VA)=>OA>>>VA-32|wA<<64-VA;Q.add3L=(OA,wA,VA)=>(OA>>>0)+(wA>>>0)+(VA>>>0);Q.add3H=(OA,wA,VA,kA)=>wA+VA+kA+(OA/2**32|0)|0;Q.add4L=(OA,wA,VA,kA)=>(OA>>>0)+(wA>>>0)+(VA>>>0)+(kA>>>0);Q.add4H=(OA,wA,VA,kA,hA)=>wA+VA+kA+hA+(OA/2**32|0)|0;Q.add5L=(OA,wA,VA,kA,hA)=>(OA>>>0)+(wA>>>0)+(VA>>>0)+(kA>>>0)+(hA>>>0);Q.add5H=(OA,wA,VA,kA,hA,fA)=>wA+VA+kA+hA+fA+(OA/2**32|0)|0},2491(eA,Q){"use strict";Q.crypto=void 0,Q.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},2650(eA,Q,f){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.sha512_224=Q.sha512_256=Q.sha384=Q.sha512=Q.sha224=Q.sha256=Q.SHA512_256=Q.SHA512_224=Q.SHA384=Q.SHA512=Q.SHA224=Q.SHA256=void 0;const t=f(6784),g=f(4996),I=f(3973),N=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),K=new Uint32Array(64);class v extends t.HashMD{constructor(dA=32){super(64,dA,8,!1),this.A=0|t.SHA256_IV[0],this.B=0|t.SHA256_IV[1],this.C=0|t.SHA256_IV[2],this.D=0|t.SHA256_IV[3],this.E=0|t.SHA256_IV[4],this.F=0|t.SHA256_IV[5],this.G=0|t.SHA256_IV[6],this.H=0|t.SHA256_IV[7]}get(){const{A:dA,B:RA,C:nA,D:H,E:pA,F:z,G:OA,H:wA}=this;return[dA,RA,nA,H,pA,z,OA,wA]}set(dA,RA,nA,H,pA,z,OA,wA){this.A=0|dA,this.B=0|RA,this.C=0|nA,this.D=0|H,this.E=0|pA,this.F=0|z,this.G=0|OA,this.H=0|wA}process(dA,RA){for(let hA=0;hA<16;hA++,RA+=4)K[hA]=dA.getUint32(RA,!1);for(let hA=16;hA<64;hA++){const fA=K[hA-15],UA=K[hA-2],yA=(0,I.rotr)(fA,7)^(0,I.rotr)(fA,18)^fA>>>3,xA=(0,I.rotr)(UA,17)^(0,I.rotr)(UA,19)^UA>>>10;K[hA]=xA+K[hA-7]+yA+K[hA-16]|0}let{A:nA,B:H,C:pA,D:z,E:OA,F:wA,G:VA,H:kA}=this;for(let hA=0;hA<64;hA++){const UA=kA+((0,I.rotr)(OA,6)^(0,I.rotr)(OA,11)^(0,I.rotr)(OA,25))+(0,t.Chi)(OA,wA,VA)+N[hA]+K[hA]|0,xA=((0,I.rotr)(nA,2)^(0,I.rotr)(nA,13)^(0,I.rotr)(nA,22))+(0,t.Maj)(nA,H,pA)|0;kA=VA,VA=wA,wA=OA,OA=z+UA|0,z=pA,pA=H,H=nA,nA=UA+xA|0}nA=nA+this.A|0,H=H+this.B|0,pA=pA+this.C|0,z=z+this.D|0,OA=OA+this.E|0,wA=wA+this.F|0,VA=VA+this.G|0,kA=kA+this.H|0,this.set(nA,H,pA,z,OA,wA,VA,kA)}roundClean(){(0,I.clean)(K)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,I.clean)(this.buffer)}}Q.SHA256=v;class B extends v{constructor(){super(28),this.A=0|t.SHA224_IV[0],this.B=0|t.SHA224_IV[1],this.C=0|t.SHA224_IV[2],this.D=0|t.SHA224_IV[3],this.E=0|t.SHA224_IV[4],this.F=0|t.SHA224_IV[5],this.G=0|t.SHA224_IV[6],this.H=0|t.SHA224_IV[7]}}Q.SHA224=B;const j=g.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(uA=>BigInt(uA))),tA=j[0],w=j[1],aA=new Uint32Array(80),AA=new Uint32Array(80);class L extends t.HashMD{constructor(dA=64){super(128,dA,16,!1),this.Ah=0|t.SHA512_IV[0],this.Al=0|t.SHA512_IV[1],this.Bh=0|t.SHA512_IV[2],this.Bl=0|t.SHA512_IV[3],this.Ch=0|t.SHA512_IV[4],this.Cl=0|t.SHA512_IV[5],this.Dh=0|t.SHA512_IV[6],this.Dl=0|t.SHA512_IV[7],this.Eh=0|t.SHA512_IV[8],this.El=0|t.SHA512_IV[9],this.Fh=0|t.SHA512_IV[10],this.Fl=0|t.SHA512_IV[11],this.Gh=0|t.SHA512_IV[12],this.Gl=0|t.SHA512_IV[13],this.Hh=0|t.SHA512_IV[14],this.Hl=0|t.SHA512_IV[15]}get(){const{Ah:dA,Al:RA,Bh:nA,Bl:H,Ch:pA,Cl:z,Dh:OA,Dl:wA,Eh:VA,El:kA,Fh:hA,Fl:fA,Gh:UA,Gl:yA,Hh:xA,Hl:Ee}=this;return[dA,RA,nA,H,pA,z,OA,wA,VA,kA,hA,fA,UA,yA,xA,Ee]}set(dA,RA,nA,H,pA,z,OA,wA,VA,kA,hA,fA,UA,yA,xA,Ee){this.Ah=0|dA,this.Al=0|RA,this.Bh=0|nA,this.Bl=0|H,this.Ch=0|pA,this.Cl=0|z,this.Dh=0|OA,this.Dl=0|wA,this.Eh=0|VA,this.El=0|kA,this.Fh=0|hA,this.Fl=0|fA,this.Gh=0|UA,this.Gl=0|yA,this.Hh=0|xA,this.Hl=0|Ee}process(dA,RA){for(let J=0;J<16;J++,RA+=4)aA[J]=dA.getUint32(RA),AA[J]=dA.getUint32(RA+=4);for(let J=16;J<80;J++){const U=0|aA[J-15],O=0|AA[J-15],lA=g.rotrSH(U,O,1)^g.rotrSH(U,O,8)^g.shrSH(U,O,7),LA=g.rotrSL(U,O,1)^g.rotrSL(U,O,8)^g.shrSL(U,O,7),JA=0|aA[J-2],$A=0|AA[J-2],IA=g.rotrSH(JA,$A,19)^g.rotrBH(JA,$A,61)^g.shrSH(JA,$A,6),gA=g.rotrSL(JA,$A,19)^g.rotrBL(JA,$A,61)^g.shrSL(JA,$A,6),C=g.add4L(LA,gA,AA[J-7],AA[J-16]),b=g.add4H(C,lA,IA,aA[J-7],aA[J-16]);aA[J]=0|b,AA[J]=0|C}let{Ah:nA,Al:H,Bh:pA,Bl:z,Ch:OA,Cl:wA,Dh:VA,Dl:kA,Eh:hA,El:fA,Fh:UA,Fl:yA,Gh:xA,Gl:Ee,Hh:HA,Hl:cA}=this;for(let J=0;J<80;J++){const U=g.rotrSH(hA,fA,14)^g.rotrSH(hA,fA,18)^g.rotrBH(hA,fA,41),O=g.rotrSL(hA,fA,14)^g.rotrSL(hA,fA,18)^g.rotrBL(hA,fA,41),lA=hA&UA^~hA&xA,JA=g.add5L(cA,O,fA&yA^~fA&Ee,w[J],AA[J]),$A=g.add5H(JA,HA,U,lA,tA[J],aA[J]),IA=0|JA,gA=g.rotrSH(nA,H,28)^g.rotrBH(nA,H,34)^g.rotrBH(nA,H,39),C=g.rotrSL(nA,H,28)^g.rotrBL(nA,H,34)^g.rotrBL(nA,H,39),b=nA&pA^nA&OA^pA&OA,R=H&z^H&wA^z&wA;HA=0|xA,cA=0|Ee,xA=0|UA,Ee=0|yA,UA=0|hA,yA=0|fA,({h:hA,l:fA}=g.add(0|VA,0|kA,0|$A,0|IA)),VA=0|OA,kA=0|wA,OA=0|pA,wA=0|z,pA=0|nA,z=0|H;const M=g.add3L(IA,C,R);nA=g.add3H(M,$A,gA,b),H=0|M}({h:nA,l:H}=g.add(0|this.Ah,0|this.Al,0|nA,0|H)),({h:pA,l:z}=g.add(0|this.Bh,0|this.Bl,0|pA,0|z)),({h:OA,l:wA}=g.add(0|this.Ch,0|this.Cl,0|OA,0|wA)),({h:VA,l:kA}=g.add(0|this.Dh,0|this.Dl,0|VA,0|kA)),({h:hA,l:fA}=g.add(0|this.Eh,0|this.El,0|hA,0|fA)),({h:UA,l:yA}=g.add(0|this.Fh,0|this.Fl,0|UA,0|yA)),({h:xA,l:Ee}=g.add(0|this.Gh,0|this.Gl,0|xA,0|Ee)),({h:HA,l:cA}=g.add(0|this.Hh,0|this.Hl,0|HA,0|cA)),this.set(nA,H,pA,z,OA,wA,VA,kA,hA,fA,UA,yA,xA,Ee,HA,cA)}roundClean(){(0,I.clean)(aA,AA)}destroy(){(0,I.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Q.SHA512=L;class P extends L{constructor(){super(48),this.Ah=0|t.SHA384_IV[0],this.Al=0|t.SHA384_IV[1],this.Bh=0|t.SHA384_IV[2],this.Bl=0|t.SHA384_IV[3],this.Ch=0|t.SHA384_IV[4],this.Cl=0|t.SHA384_IV[5],this.Dh=0|t.SHA384_IV[6],this.Dl=0|t.SHA384_IV[7],this.Eh=0|t.SHA384_IV[8],this.El=0|t.SHA384_IV[9],this.Fh=0|t.SHA384_IV[10],this.Fl=0|t.SHA384_IV[11],this.Gh=0|t.SHA384_IV[12],this.Gl=0|t.SHA384_IV[13],this.Hh=0|t.SHA384_IV[14],this.Hl=0|t.SHA384_IV[15]}}Q.SHA384=P;const rA=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),QA=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class NA extends L{constructor(){super(28),this.Ah=0|rA[0],this.Al=0|rA[1],this.Bh=0|rA[2],this.Bl=0|rA[3],this.Ch=0|rA[4],this.Cl=0|rA[5],this.Dh=0|rA[6],this.Dl=0|rA[7],this.Eh=0|rA[8],this.El=0|rA[9],this.Fh=0|rA[10],this.Fl=0|rA[11],this.Gh=0|rA[12],this.Gl=0|rA[13],this.Hh=0|rA[14],this.Hl=0|rA[15]}}Q.SHA512_224=NA;class oA extends L{constructor(){super(32),this.Ah=0|QA[0],this.Al=0|QA[1],this.Bh=0|QA[2],this.Bl=0|QA[3],this.Ch=0|QA[4],this.Cl=0|QA[5],this.Dh=0|QA[6],this.Dl=0|QA[7],this.Eh=0|QA[8],this.El=0|QA[9],this.Fh=0|QA[10],this.Fl=0|QA[11],this.Gh=0|QA[12],this.Gl=0|QA[13],this.Hh=0|QA[14],this.Hl=0|QA[15]}}Q.SHA512_256=oA,Q.sha256=(0,I.createHasher)(()=>new v),Q.sha224=(0,I.createHasher)(()=>new B),Q.sha512=(0,I.createHasher)(()=>new L),Q.sha384=(0,I.createHasher)(()=>new P),Q.sha512_256=(0,I.createHasher)(()=>new oA),Q.sha512_224=(0,I.createHasher)(()=>new NA)},3973(eA,Q,f){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.wrapXOFConstructorWithOpts=Q.wrapConstructorWithOpts=Q.wrapConstructor=Q.Hash=Q.nextTick=Q.swap32IfBE=Q.byteSwapIfBE=Q.swap8IfBE=Q.isLE=void 0,Q.isBytes=g,Q.anumber=I,Q.abytes=N,Q.ahash=function K(HA){if("function"!=typeof HA||"function"!=typeof HA.create)throw new Error("Hash should be wrapped by utils.createHasher");I(HA.outputLen),I(HA.blockLen)},Q.aexists=function v(HA,cA=!0){if(HA.destroyed)throw new Error("Hash instance has been destroyed");if(cA&&HA.finished)throw new Error("Hash#digest() has already been called")},Q.aoutput=function B(HA,cA){N(HA);const J=cA.outputLen;if(HA.length>>cA},Q.rotl=function L(HA,cA){return HA<>>32-cA>>>0},Q.byteSwap=P,Q.byteSwap32=rA,Q.bytesToHex=function oA(HA){if(N(HA),QA)return HA.toHex();let cA="";for(let J=0;J0&&!cA.includes(HA.length))throw new Error("Uint8Array expected of length "+cA+", got length="+HA.length)}function P(HA){return HA<<24&4278190080|HA<<8&16711680|HA>>>8&65280|HA>>>24&255}function rA(HA){for(let cA=0;cAHA:HA=>P(HA),Q.byteSwapIfBE=Q.swap8IfBE,Q.swap32IfBE=Q.isLE?HA=>HA:rA;const QA="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,NA=Array.from({length:256},(HA,cA)=>cA.toString(16).padStart(2,"0"));function dA(HA){return HA>=48&&HA<=57?HA-48:HA>=65&&HA<=70?HA-55:HA>=97&&HA<=102?HA-87:void 0}const nA=function(){var HA=de(function*(){});return function(){return HA.apply(this,arguments)}}();function pA(){return(pA=de(function*(HA,cA,J){let U=Date.now();for(let O=0;O=0&&lAHA().update(wA(U)).digest(),J=HA();return cA.outputLen=J.outputLen,cA.blockLen=J.blockLen,cA.create=()=>HA(),cA}function yA(HA){const cA=(U,O)=>HA(O).update(wA(U)).digest(),J=HA({});return cA.outputLen=J.outputLen,cA.blockLen=J.blockLen,cA.create=U=>HA(U),cA}function xA(HA){const cA=(U,O)=>HA(O).update(wA(U)).digest(),J=HA({});return cA.outputLen=J.outputLen,cA.blockLen=J.blockLen,cA.create=U=>HA(U),cA}Q.nextTick=nA,Q.Hash=class fA{},Q.wrapConstructor=UA,Q.wrapConstructorWithOpts=yA,Q.wrapXOFConstructorWithOpts=xA},7801(eA,Q,f){"use strict";var t=f(9964);function g(X){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(YA){return typeof YA}:function(YA){return YA&&"function"==typeof Symbol&&YA.constructor===Symbol&&YA!==Symbol.prototype?"symbol":typeof YA})(X)}function I(X,YA){for(var KA=0;KA1?KA-1:0),le=1;le1?KA-1:0),le=1;le1?KA-1:0),le=1;le1?KA-1:0),le=1;le"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function oA(cA,J){return(oA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,lA){return O.__proto__=lA,O})(cA,J)}function uA(cA){return(uA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)})(cA)}function dA(cA){return(dA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(J){return typeof J}:function(J){return J&&"function"==typeof Symbol&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J})(cA)}var nA=f(7187).inspect,pA=f(5403).codes.ERR_INVALID_ARG_TYPE;function z(cA,J,U){return(void 0===U||U>cA.length)&&(U=cA.length),cA.substring(U-J.length,U)===J}var wA="",VA="",kA="",hA="",fA={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function yA(cA){var J=Object.keys(cA),U=Object.create(Object.getPrototypeOf(cA));return J.forEach(function(O){U[O]=cA[O]}),Object.defineProperty(U,"message",{value:cA.message}),U}function xA(cA){return nA(cA,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var HA=function(cA,J){!function w(cA,J){if("function"!=typeof J&&null!==J)throw new TypeError("Super expression must either be null or a function");cA.prototype=Object.create(J&&J.prototype,{constructor:{value:cA,writable:!0,configurable:!0}}),Object.defineProperty(cA,"prototype",{writable:!1}),J&&oA(cA,J)}(O,cA);var U=function aA(cA){var J=QA();return function(){var lA,O=uA(cA);if(J){var LA=uA(this).constructor;lA=Reflect.construct(O,arguments,LA)}else lA=O.apply(this,arguments);return AA(this,lA)}}(O);function O(lA){var LA;if(function K(cA,J){if(!(cA instanceof J))throw new TypeError("Cannot call a class as a function")}(this,O),"object"!==dA(lA)||null===lA)throw new pA("options","Object",lA);var JA=lA.message,$A=lA.operator,IA=lA.stackStartFn,gA=lA.actual,C=lA.expected,b=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=JA)LA=U.call(this,String(JA));else if(t.stderr&&t.stderr.isTTY&&(t.stderr&&t.stderr.getColorDepth&&1!==t.stderr.getColorDepth()?(wA="\x1b[34m",VA="\x1b[32m",hA="\x1b[39m",kA="\x1b[31m"):(wA="",VA="",hA="",kA="")),"object"===dA(gA)&&null!==gA&&"object"===dA(C)&&null!==C&&"stack"in gA&&gA instanceof Error&&"stack"in C&&C instanceof Error&&(gA=yA(gA),C=yA(C)),"deepStrictEqual"===$A||"strictEqual"===$A)LA=U.call(this,function Ee(cA,J,U){var O="",lA="",LA=0,JA="",$A=!1,IA=xA(cA),gA=IA.split("\n"),C=xA(J).split("\n"),b=0,R="";if("strictEqual"===U&&"object"===dA(cA)&&"object"===dA(J)&&null!==cA&&null!==J&&(U="strictEqualObject"),1===gA.length&&1===C.length&&gA[0]!==C[0]){var M=gA[0].length+C[0].length;if(M<=10){if(!("object"===dA(cA)&&null!==cA||"object"===dA(J)&&null!==J||0===cA&&0===J))return"".concat(fA[U],"\n\n")+"".concat(gA[0]," !== ").concat(C[0],"\n")}else if("strictEqualObject"!==U&&M<(t.stderr&&t.stderr.isTTY?t.stderr.columns:80)){for(;gA[0][b]===C[0][b];)b++;b>2&&(R="\n ".concat(function OA(cA,J){if(J=Math.floor(J),0==cA.length||0==J)return"";var U=cA.length*J;for(J=Math.floor(Math.log(J)/Math.log(2));J;)cA+=cA,J--;return cA+cA.substring(0,U-cA.length)}(" ",b),"^"),b=0)}}for(var X=gA[gA.length-1],YA=C[C.length-1];X===YA&&(b++<2?JA="\n ".concat(X).concat(JA):O=X,gA.pop(),C.pop(),0!==gA.length&&0!==C.length);)X=gA[gA.length-1],YA=C[C.length-1];var KA=Math.max(gA.length,C.length);if(0===KA){var bA=IA.split("\n");if(bA.length>30)for(bA[26]="".concat(wA,"...").concat(hA);bA.length>27;)bA.pop();return"".concat(fA.notIdentical,"\n\n").concat(bA.join("\n"),"\n")}b>3&&(JA="\n".concat(wA,"...").concat(hA).concat(JA),$A=!0),""!==O&&(JA="\n ".concat(O).concat(JA),O="");var le=0,ve=fA[U]+"\n".concat(VA,"+ actual").concat(hA," ").concat(kA,"- expected").concat(hA),Ne=" ".concat(wA,"...").concat(hA," Lines skipped");for(b=0;b1&&b>2&&(Te>4?(lA+="\n".concat(wA,"...").concat(hA),$A=!0):Te>3&&(lA+="\n ".concat(C[b-2]),le++),lA+="\n ".concat(C[b-1]),le++),LA=b,O+="\n".concat(kA,"-").concat(hA," ").concat(C[b]),le++;else if(C.length1&&b>2&&(Te>4?(lA+="\n".concat(wA,"...").concat(hA),$A=!0):Te>3&&(lA+="\n ".concat(gA[b-2]),le++),lA+="\n ".concat(gA[b-1]),le++),LA=b,lA+="\n".concat(VA,"+").concat(hA," ").concat(gA[b]),le++;else{var ze=C[b],Oe=gA[b],oe=Oe!==ze&&(!z(Oe,",")||Oe.slice(0,-1)!==ze);oe&&z(ze,",")&&ze.slice(0,-1)===Oe&&(oe=!1,Oe+=","),oe?(Te>1&&b>2&&(Te>4?(lA+="\n".concat(wA,"...").concat(hA),$A=!0):Te>3&&(lA+="\n ".concat(gA[b-2]),le++),lA+="\n ".concat(gA[b-1]),le++),LA=b,lA+="\n".concat(VA,"+").concat(hA," ").concat(Oe),O+="\n".concat(kA,"-").concat(hA," ").concat(ze),le+=2):(lA+=O,O="",(1===Te||0===b)&&(lA+="\n ".concat(Oe),le++))}if(le>20&&b30)for(M[26]="".concat(wA,"...").concat(hA);M.length>27;)M.pop();LA=U.call(this,1===M.length?"".concat(R," ").concat(M[0]):"".concat(R,"\n\n").concat(M.join("\n"),"\n"))}else{var D=xA(gA),X="",YA=fA[$A];"notDeepEqual"===$A||"notEqual"===$A?(D="".concat(fA[$A],"\n\n").concat(D)).length>1024&&(D="".concat(D.slice(0,1021),"...")):(X="".concat(xA(C)),D.length>512&&(D="".concat(D.slice(0,509),"...")),X.length>512&&(X="".concat(X.slice(0,509),"...")),"deepEqual"===$A||"equal"===$A?D="".concat(YA,"\n\n").concat(D,"\n\nshould equal\n\n"):X=" ".concat($A," ").concat(X)),LA=U.call(this,"".concat(D).concat(X))}return Error.stackTraceLimit=b,LA.generatedMessage=!JA,Object.defineProperty(L(LA),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),LA.code="ERR_ASSERTION",LA.actual=gA,LA.expected=C,LA.operator=$A,Error.captureStackTrace&&Error.captureStackTrace(L(LA),IA),LA.name="AssertionError",AA(LA)}return function B(cA,J,U){J&&v(cA.prototype,J),U&&v(cA,U),Object.defineProperty(cA,"prototype",{writable:!1})}(O,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:J,value:function(LA,JA){return nA(this,I(I({},JA),{},{customInspect:!1,depth:0}))}}]),O}(P(Error),nA.custom);eA.exports=HA},5403(eA,Q,f){"use strict";function t(nA){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(H){return typeof H}:function(H){return H&&"function"==typeof Symbol&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H})(nA)}function g(nA,H){for(var pA=0;pA"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var OA,z=L(nA);if(H){var wA=L(this).constructor;OA=Reflect.construct(z,arguments,wA)}else OA=z.apply(this,arguments);return function w(nA,H){if(H&&("object"===t(H)||"function"==typeof H))return H;if(void 0!==H)throw new TypeError("Derived constructors may only return object or undefined");return function aA(nA){if(void 0===nA)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nA}(nA)}(this,OA)}}(kA);function kA(hA,fA,UA){var yA;return function v(nA,H){if(!(nA instanceof H))throw new TypeError("Cannot call a class as a function")}(this,kA),yA=VA.call(this,function z(wA,VA,kA){return"string"==typeof H?H:H(wA,VA,kA)}(hA,fA,UA)),yA.code=nA,yA}return function I(nA,H,pA){return H&&g(nA.prototype,H),pA&&g(nA,pA),Object.defineProperty(nA,"prototype",{writable:!1}),nA}(kA)}(pA);P[nA]=OA}function oA(nA,H){if(Array.isArray(nA)){var pA=nA.length;return nA=nA.map(function(z){return String(z)}),pA>2?"one of ".concat(H," ").concat(nA.slice(0,pA-1).join(", "),", or ")+nA[pA-1]:2===pA?"one of ".concat(H," ").concat(nA[0]," or ").concat(nA[1]):"of ".concat(H," ").concat(nA[0])}return"of ".concat(H," ").concat(String(nA))}NA("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),NA("ERR_INVALID_ARG_TYPE",function(nA,H,pA){var z,OA;if(void 0===rA&&(rA=f(7801)),rA("string"==typeof nA,"'name' must be a string"),"string"==typeof H&&function uA(nA,H,pA){return nA.substr(!pA||pA<0?0:+pA,H.length)===H}(H,"not ")?(z="must not be",H=H.replace(/^not /,"")):z="must be",function dA(nA,H,pA){return(void 0===pA||pA>nA.length)&&(pA=nA.length),nA.substring(pA-H.length,pA)===H}(nA," argument"))OA="The ".concat(nA," ").concat(z," ").concat(oA(H,"type"));else{var wA=function RA(nA,H,pA){return"number"!=typeof pA&&(pA=0),!(pA+H.length>nA.length)&&-1!==nA.indexOf(H,pA)}(nA,".")?"property":"argument";OA='The "'.concat(nA,'" ').concat(wA," ").concat(z," ").concat(oA(H,"type"))}return OA+". Received type ".concat(t(pA))},TypeError),NA("ERR_INVALID_ARG_VALUE",function(nA,H){var pA=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===QA&&(QA=f(7187));var z=QA.inspect(H);return z.length>128&&(z="".concat(z.slice(0,128),"...")),"The argument '".concat(nA,"' ").concat(pA,". Received ").concat(z)},TypeError,RangeError),NA("ERR_INVALID_RETURN_VALUE",function(nA,H,pA){var z;return z=pA&&pA.constructor&&pA.constructor.name?"instance of ".concat(pA.constructor.name):"type ".concat(t(pA)),"Expected ".concat(nA,' to be returned from the "').concat(H,'"')+" function but got ".concat(z,".")},TypeError),NA("ERR_MISSING_ARGS",function(){for(var nA=arguments.length,H=new Array(nA),pA=0;pA0,"At least one arg needs to be specified");var z="The ",OA=H.length;switch(H=H.map(function(wA){return'"'.concat(wA,'"')}),OA){case 1:z+="".concat(H[0]," argument");break;case 2:z+="".concat(H[0]," and ").concat(H[1]," arguments");break;default:z+=H.slice(0,OA-1).join(", "),z+=", and ".concat(H[OA-1]," arguments")}return"".concat(z," must be specified")},TypeError),eA.exports.codes=P},6781(eA,Q,f){"use strict";function t(oe,sA){return function v(oe){if(Array.isArray(oe))return oe}(oe)||function K(oe,sA){var S=null==oe?null:typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(null!=S){var Y,k,m,E,mA=[],ie=!0,DA=!1;try{if(m=(S=S.call(oe)).next,0===sA){if(Object(S)!==S)return;ie=!1}else for(;!(ie=(Y=m.call(S)).done)&&(mA.push(Y.value),mA.length!==sA);ie=!0);}catch(Ae){DA=!0,k=Ae}finally{try{if(!ie&&null!=S.return&&(E=S.return(),Object(E)!==E))return}finally{if(DA)throw k}}return mA}}(oe,sA)||function I(oe,sA){if(oe){if("string"==typeof oe)return N(oe,sA);var S=Object.prototype.toString.call(oe).slice(8,-1);if("Object"===S&&oe.constructor&&(S=oe.constructor.name),"Map"===S||"Set"===S)return Array.from(oe);if("Arguments"===S||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S))return N(oe,sA)}}(oe,sA)||function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(oe,sA){(null==sA||sA>oe.length)&&(sA=oe.length);for(var S=0,Y=new Array(sA);S10)return!0;for(var sA=0;sA57)return!0}return 10===oe.length&&oe>=Math.pow(2,32)}function Ee(oe){return Object.keys(oe).filter(xA).concat(AA(oe).filter(Object.prototype.propertyIsEnumerable.bind(oe)))}function HA(oe,sA){if(oe===sA)return 0;for(var S=oe.length,Y=sA.length,k=0,m=Math.min(S,Y);k0?QA-4:QA;for(RA=0;RA>16&255,oA[uA++]=P>>8&255,oA[uA++]=255&P;return 2===NA&&(P=t[L.charCodeAt(RA)]<<2|t[L.charCodeAt(RA+1)]>>4,oA[uA++]=255&P),1===NA&&(P=t[L.charCodeAt(RA)]<<10|t[L.charCodeAt(RA+1)]<<4|t[L.charCodeAt(RA+2)]>>2,oA[uA++]=P>>8&255,oA[uA++]=255&P),oA},Q.fromByteArray=function AA(L){for(var P,rA=L.length,QA=rA%3,NA=[],uA=0,dA=rA-QA;uAdA?dA:uA+16383));return 1===QA?NA.push(f[(P=L[rA-1])>>2]+f[P<<4&63]+"=="):2===QA&&NA.push(f[(P=(L[rA-2]<<8)+L[rA-1])>>10]+f[P>>4&63]+f[P<<2&63]+"="),NA.join("")};for(var f=[],t=[],g=typeof Uint8Array<"u"?Uint8Array:Array,I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=0;N<64;++N)f[N]=I[N],t[I.charCodeAt(N)]=N;function v(L){var P=L.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var rA=L.indexOf("=");return-1===rA&&(rA=P),[rA,rA===P?0:4-rA%4]}function w(L){return f[L>>18&63]+f[L>>12&63]+f[L>>6&63]+f[63&L]}function aA(L,P,rA){for(var NA=[],oA=P;oA0},I.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var N=this.buf_ptr_,K=this.input_.read(this.buf_,N,Q);if(K<0)throw new Error("Unexpected end of input");if(K=8;)this.val_>>>=8,this.val_|=this.buf_[8191&this.pos_]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},I.prototype.readBits=function(N){32-this.bit_pos_>>this.bit_pos_&g[N];return this.bit_pos_+=N,K},eA.exports=I},7043(eA,Q){Q.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Q.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},980(eA,Q,f){var g=f(8197).z,I=f(8197).y,N=f(4097),K=f(614),v=f(1561).z,B=f(1561).u,j=f(7043),tA=f(2210),w=f(7984),dA=1080,nA=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),pA=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),z=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),OA=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function wA(gA){var C;return 0===gA.readBits(1)?16:(C=gA.readBits(3))>0?17+C:(C=gA.readBits(3))>0?8+C:17}function VA(gA){if(gA.readBits(1)){var C=gA.readBits(3);return 0===C?1:gA.readBits(C)+(1<1&&0===D)throw new Error("Invalid size byte");C.meta_block_length|=D<<8*M}}else for(M=0;M4&&0===X)throw new Error("Invalid size nibble");C.meta_block_length|=X<<4*M}return++C.meta_block_length,!C.input_end&&!C.is_metadata&&(C.is_uncompressed=gA.readBits(1)),C}function fA(gA,C,b){var M;return b.fillBitWindow(),(M=gA[C+=b.val_>>>b.bit_pos_&255].bits-8)>0&&(b.bit_pos_+=8,C+=gA[C].value,C+=b.val_>>>b.bit_pos_&(1<>=1,++bA;for(YA=0;YA0;++YA){var S,oe=nA[YA],sA=0;R.fillBitWindow(),R.bit_pos_+=Oe[sA+=R.val_>>>R.bit_pos_&15].bits,Ne[oe]=S=Oe[sA].value,0!==S&&(Te-=32>>S,++ze)}if(1!==ze&&0!==Te)throw new Error("[ReadHuffmanCode] invalid num_codes or space");!function UA(gA,C,b,R){for(var M=0,D=8,X=0,YA=0,KA=32768,bA=[],le=0;le<32;le++)bA.push(new v(0,0));for(B(bA,0,5,gA,18);M0;){var Ne,ve=0;if(R.readMoreInput(),R.fillBitWindow(),R.bit_pos_+=bA[ve+=R.val_>>>R.bit_pos_&31].bits,(Ne=255&bA[ve].value)<16)X=0,b[M++]=Ne,0!==Ne&&(D=Ne,KA-=32768>>Ne);else{var ze,Oe,Te=Ne-14,oe=0;if(16===Ne&&(oe=D),YA!==oe&&(X=0,YA=oe),ze=X,X>0&&(X-=2,X<<=Te),M+(Oe=(X+=R.readBits(Te)+3)-ze)>C)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var sA=0;sA>>5]),this.htrees=new Uint32Array(C)}function U(gA,C){var D,X,b={num_htrees:null,context_map:null},M=0;C.readMoreInput();var YA=b.num_htrees=VA(C)+1,KA=b.context_map=new Uint8Array(gA);if(YA<=1)return b;for(C.readBits(1)&&(M=C.readBits(4)+1),D=[],X=0;X=gA)throw new Error("[DecodeContextMap] i >= context_map_size");KA[X]=0,++X}else KA[X]=bA-M,++X}return C.readBits(1)&&function cA(gA,C){var R,b=new Uint8Array(256);for(R=0;R<256;++R)b[R]=R;for(R=0;R=gA&&(le-=gA),R[b]=le,M[YA+(1&D[KA])]=le,++D[KA]}function lA(gA,C,b,R,M,D){var bA,X=M+1,YA=b&M,KA=D.pos_&N.IBUF_MASK;if(C<8||D.bit_pos_+(C<<3)0;)D.readMoreInput(),R[YA++]=D.readBits(8),YA===X&&(gA.write(R,X),YA=0);else{if(D.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;D.bit_pos_<32;)R[YA]=D.val_>>>D.bit_pos_,D.bit_pos_+=8,++YA,--C;if(KA+(bA=D.bit_end_pos_-D.bit_pos_>>3)>N.IBUF_MASK){for(var le=N.IBUF_MASK+1-KA,ve=0;ve=X)for(gA.write(R,X),YA-=X,ve=0;ve=X;){if(D.input_.read(R,YA,bA=X-YA)C.buffer.length){var Gt=new Uint8Array(R+E);Gt.set(C.buffer),C.buffer=Gt}if(M=pn.input_end,mA=pn.is_uncompressed,pn.is_metadata)for(LA(Y);E>0;--E)Y.readMoreInput(),Y.readBits(8);else if(0!==E){if(mA){Y.bit_pos_=Y.bit_pos_+7&-8,lA(C,E,R,le,bA,Y),R+=E;continue}for(b=0;b<3;++b)Ae[b]=VA(Y)+1,Ae[b]>=2&&(yA(Ae[b]+2,sA,b*dA,Y),yA(26,S,b*dA,Y),ie[b]=xA(S,b*dA,Y),MA[b]=1);for(Y.readMoreInput(),_=(1<<(Pe=Y.readBits(2)))-1,be=(At=16+(Y.readBits(4)<0;){var bt,Dt,Ze,qe,Et,ct,Ht,Jt,zA,vA,qA,ZA;for(Y.readMoreInput(),0===ie[1]&&(O(Ae[1],sA,1,DA,pe,MA,Y),ie[1]=xA(S,dA,Y),Qn=oe[1].htrees[DA[1]]),--ie[1],(Dt=(bt=fA(oe[1].codes,Qn,Y))>>6)>=2?(Dt-=2,Ht=-1):Ht=0,qe=tA.kCopyRangeLut[Dt]+(7&bt),Et=tA.kInsertLengthPrefixCode[Ze=tA.kInsertRangeLut[Dt]+(bt>>3&7)].offset+Y.readBits(tA.kInsertLengthPrefixCode[Ze].nbits),ct=tA.kCopyLengthPrefixCode[qe].offset+Y.readBits(tA.kCopyLengthPrefixCode[qe].nbits),ze=le[R-1&bA],Oe=le[R-2&bA],zA=0;zA4?3:ct-2))]],Y))>=At&&(ZA=(Ht-=At)&_,Ht=At+((jA=(2+(1&(Ht>>=Pe))<<(qA=1+(Ht>>1)))-4)+Y.readBits(qA)<(YA=R=K.minDictionaryWordLength&&ct<=K.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+R+" distance: "+Jt+" len: "+ct+" bytes left: "+E);var jA=K.offsetsByLength[ct],ue=Jt-YA-1,WA=K.sizeBitsByLength[ct],ye=ue>>WA;if(jA+=(ue&(1<=ve){C.write(le,KA);for(var Je=0;Je0&&(Ne[3&Te]=Jt,++Te),ct>E)throw new Error("Invalid backward reference. pos: "+R+" distance: "+Jt+" len: "+ct+" bytes left: "+E);for(zA=0;zA>=1;return(K&B-1)+B}function I(K,v,B,j,tA){do{K[v+(j-=B)]=new f(tA.bits,tA.value)}while(j>0)}function N(K,v,B){for(var j=1<0;--nA[AA])I(K,v+P,rA,uA,new f(255&AA,65535&RA[L++])),P=g(P,AA);for(NA=dA-1,QA=-1,AA=B+1,rA=2;AA<=15;++AA,rA<<=1)for(;nA[AA]>0;--nA[AA])(P&NA)!==QA&&(v+=uA,dA+=uA=1<<(oA=N(nA,AA,B)),K[w+(QA=P&NA)]=new f(oA+B&255,v-w-QA&65535)),I(K,v+(P>>B),rA,uA,new f(AA-B&255,65535&RA[L++])),P=g(P,AA);return dA}},2210(eA,Q){function f(t,g){this.offset=t,this.nbits=g}Q.kBlockLengthPrefixCode=[new f(1,2),new f(5,2),new f(9,2),new f(13,2),new f(17,3),new f(25,3),new f(33,3),new f(41,3),new f(49,4),new f(65,4),new f(81,4),new f(97,4),new f(113,5),new f(145,5),new f(177,5),new f(209,5),new f(241,6),new f(305,6),new f(369,7),new f(497,8),new f(753,9),new f(1265,10),new f(2289,11),new f(4337,12),new f(8433,13),new f(16625,24)],Q.kInsertLengthPrefixCode=[new f(0,0),new f(1,0),new f(2,0),new f(3,0),new f(4,0),new f(5,0),new f(6,1),new f(8,1),new f(10,2),new f(14,2),new f(18,3),new f(26,3),new f(34,4),new f(50,4),new f(66,5),new f(98,5),new f(130,6),new f(194,7),new f(322,8),new f(578,9),new f(1090,10),new f(2114,12),new f(6210,14),new f(22594,24)],Q.kCopyLengthPrefixCode=[new f(2,0),new f(3,0),new f(4,0),new f(5,0),new f(6,0),new f(7,0),new f(8,0),new f(9,0),new f(10,1),new f(12,1),new f(14,2),new f(18,2),new f(22,3),new f(30,3),new f(38,4),new f(54,4),new f(70,5),new f(102,5),new f(134,6),new f(198,7),new f(326,8),new f(582,9),new f(1094,10),new f(2118,24)],Q.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],Q.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},8197(eA,Q){function f(g){this.buffer=g,this.pos=0}function t(g){this.buffer=g,this.pos=0}f.prototype.read=function(g,I,N){this.pos+N>this.buffer.length&&(N=this.buffer.length-this.pos);for(var K=0;Kthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(g.subarray(0,I),this.pos),this.pos+=I,I},Q.y=t},7984(eA,Q,f){var t=f(614),L=11;function H(OA,wA,VA){this.prefix=new Uint8Array(OA.length),this.transform=wA,this.suffix=new Uint8Array(VA.length);for(var kA=0;kA'),new H("",0,"\n"),new H("",3,""),new H("",0,"]"),new H("",0," for "),new H("",14,""),new H("",2,""),new H("",0," a "),new H("",0," that "),new H(" ",10,""),new H("",0,". "),new H(".",0,""),new H(" ",0,", "),new H("",15,""),new H("",0," with "),new H("",0,"'"),new H("",0," from "),new H("",0," by "),new H("",16,""),new H("",17,""),new H(" the ",0,""),new H("",4,""),new H("",0,". The "),new H("",L,""),new H("",0," on "),new H("",0," as "),new H("",0," is "),new H("",7,""),new H("",1,"ing "),new H("",0,"\n\t"),new H("",0,":"),new H(" ",0,". "),new H("",0,"ed "),new H("",20,""),new H("",18,""),new H("",6,""),new H("",0,"("),new H("",10,", "),new H("",8,""),new H("",0," at "),new H("",0,"ly "),new H(" the ",0," of "),new H("",5,""),new H("",9,""),new H(" ",10,", "),new H("",10,'"'),new H(".",0,"("),new H("",L," "),new H("",10,'">'),new H("",0,'="'),new H(" ",0,"."),new H(".com/",0,""),new H(" the ",0," of the "),new H("",10,"'"),new H("",0,". This "),new H("",0,","),new H(".",0," "),new H("",10,"("),new H("",10,"."),new H("",0," not "),new H(" ",0,'="'),new H("",0,"er "),new H(" ",L," "),new H("",0,"al "),new H(" ",L,""),new H("",0,"='"),new H("",L,'"'),new H("",10,". "),new H(" ",0,"("),new H("",0,"ful "),new H(" ",10,". "),new H("",0,"ive "),new H("",0,"less "),new H("",L,"'"),new H("",0,"est "),new H(" ",10,"."),new H("",L,'">'),new H(" ",0,"='"),new H("",10,","),new H("",0,"ize "),new H("",L,"."),new H("\xc2\xa0",0,""),new H(" ",0,","),new H("",10,'="'),new H("",L,'="'),new H("",0,"ous "),new H("",L,", "),new H("",10,"='"),new H(" ",10,","),new H(" ",L,'="'),new H(" ",L,", "),new H("",L,","),new H("",L,"("),new H("",L,". "),new H(" ",L,"."),new H("",L,"='"),new H(" ",L,". "),new H(" ",10,'="'),new H(" ",L,"='"),new H(" ",10,"='")];function z(OA,wA){return OA[wA]<192?(OA[wA]>=97&&OA[wA]<=122&&(OA[wA]^=32),1):OA[wA]<224?(OA[wA+1]^=32,2):(OA[wA+2]^=5,3)}Q.kTransforms=pA,Q.kNumTransforms=pA.length,Q.transformDictionaryWord=function(OA,wA,VA,kA,hA){var cA,fA=pA[hA].prefix,UA=pA[hA].suffix,yA=pA[hA].transform,xA=yA<12?0:yA-11,Ee=0,HA=wA;xA>kA&&(xA=kA);for(var J=0;J0;){var U=z(OA,cA);cA+=U,kA-=U}for(var O=0;OQ.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=AA,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}Q.NONE=0,Q.DEFLATE=1,Q.INFLATE=2,Q.GZIP=3,Q.GUNZIP=4,Q.DEFLATERAW=5,Q.INFLATERAW=6,Q.UNZIP=7,aA.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,I(this.init_done,"close before init"),I(this.mode<=Q.UNZIP),this.mode===Q.DEFLATE||this.mode===Q.GZIP||this.mode===Q.DEFLATERAW?K.deflateEnd(this.strm):(this.mode===Q.INFLATE||this.mode===Q.GUNZIP||this.mode===Q.INFLATERAW||this.mode===Q.UNZIP)&&v.inflateEnd(this.strm),this.mode=Q.NONE,this.dictionary=null)},aA.prototype.write=function(AA,L,P,rA,QA,NA,oA){return this._write(!0,AA,L,P,rA,QA,NA,oA)},aA.prototype.writeSync=function(AA,L,P,rA,QA,NA,oA){return this._write(!1,AA,L,P,rA,QA,NA,oA)},aA.prototype._write=function(AA,L,P,rA,QA,NA,oA,uA){if(I.equal(arguments.length,8),I(this.init_done,"write before init"),I(this.mode!==Q.NONE,"already finalized"),I.equal(!1,this.write_in_progress,"write already in progress"),I.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,I.equal(!1,void 0===L,"must provide flush value"),this.write_in_progress=!0,L!==Q.Z_NO_FLUSH&&L!==Q.Z_PARTIAL_FLUSH&&L!==Q.Z_SYNC_FLUSH&&L!==Q.Z_FULL_FLUSH&&L!==Q.Z_FINISH&&L!==Q.Z_BLOCK)throw new Error("Invalid flush value");if(null==P&&(P=t.alloc(0),QA=0,rA=0),this.strm.avail_in=QA,this.strm.input=P,this.strm.next_in=rA,this.strm.avail_out=uA,this.strm.output=NA,this.strm.next_out=oA,this.flush=L,!AA)return this._process(),this._checkError()?this._afterSync():void 0;var dA=this;return g.nextTick(function(){dA._process(),dA._after()}),this},aA.prototype._afterSync=function(){var AA=this.strm.avail_out,L=this.strm.avail_in;return this.write_in_progress=!1,[L,AA]},aA.prototype._process=function(){var AA=null;switch(this.mode){case Q.DEFLATE:case Q.GZIP:case Q.DEFLATERAW:this.err=K.deflate(this.strm,this.flush);break;case Q.UNZIP:switch(this.strm.avail_in>0&&(AA=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===AA)break;if(31!==this.strm.input[AA]){this.mode=Q.INFLATE;break}if(this.gzip_id_bytes_read=1,AA++,1===this.strm.avail_in)break;case 1:if(null===AA)break;139===this.strm.input[AA]?(this.gzip_id_bytes_read=2,this.mode=Q.GUNZIP):this.mode=Q.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Q.INFLATE:case Q.GUNZIP:case Q.INFLATERAW:for(this.err=v.inflate(this.strm,this.flush),this.err===Q.Z_NEED_DICT&&this.dictionary&&(this.err=v.inflateSetDictionary(this.strm,this.dictionary),this.err===Q.Z_OK?this.err=v.inflate(this.strm,this.flush):this.err===Q.Z_DATA_ERROR&&(this.err=Q.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Q.GUNZIP&&this.err===Q.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=v.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},aA.prototype._checkError=function(){switch(this.err){case Q.Z_OK:case Q.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===Q.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Q.Z_STREAM_END:break;case Q.Z_NEED_DICT:return this._error(null==this.dictionary?"Missing dictionary":"Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},aA.prototype._after=function(){if(this._checkError()){var AA=this.strm.avail_out,L=this.strm.avail_in;this.write_in_progress=!1,this.callback(L,AA),this.pending_close&&this.close()}},aA.prototype._error=function(AA){this.strm.msg&&(AA=this.strm.msg),this.onerror(AA,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},aA.prototype.init=function(AA,L,P,rA,QA){I(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),I(AA>=8&&AA<=15,"invalid windowBits"),I(L>=-1&&L<=9,"invalid compression level"),I(P>=1&&P<=9,"invalid memlevel"),I(rA===Q.Z_FILTERED||rA===Q.Z_HUFFMAN_ONLY||rA===Q.Z_RLE||rA===Q.Z_FIXED||rA===Q.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(L,AA,P,rA,QA),this._setDictionary()},aA.prototype.params=function(){throw new Error("deflateParams Not supported")},aA.prototype.reset=function(){this._reset(),this._setDictionary()},aA.prototype._init=function(AA,L,P,rA,QA){switch(this.level=AA,this.windowBits=L,this.memLevel=P,this.strategy=rA,this.flush=Q.Z_NO_FLUSH,this.err=Q.Z_OK,(this.mode===Q.GZIP||this.mode===Q.GUNZIP)&&(this.windowBits+=16),this.mode===Q.UNZIP&&(this.windowBits+=32),(this.mode===Q.DEFLATERAW||this.mode===Q.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new N,this.mode){case Q.DEFLATE:case Q.GZIP:case Q.DEFLATERAW:this.err=K.deflateInit2(this.strm,this.level,Q.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Q.INFLATE:case Q.GUNZIP:case Q.INFLATERAW:case Q.UNZIP:this.err=v.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Q.Z_OK&&this._error("Init error"),this.dictionary=QA,this.write_in_progress=!1,this.init_done=!0},aA.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=Q.Z_OK,this.mode){case Q.DEFLATE:case Q.DEFLATERAW:this.err=K.deflateSetDictionary(this.strm,this.dictionary)}this.err!==Q.Z_OK&&this._error("Failed to set dictionary")}},aA.prototype._reset=function(){switch(this.err=Q.Z_OK,this.mode){case Q.DEFLATE:case Q.DEFLATERAW:case Q.GZIP:this.err=K.deflateReset(this.strm);break;case Q.INFLATE:case Q.INFLATERAW:case Q.GUNZIP:this.err=v.inflateReset(this.strm)}this.err!==Q.Z_OK&&this._error("Failed to reset stream")},Q.Zlib=aA},6729(eA,Q,f){"use strict";var t=f(9964),g=f(783).Buffer,I=f(9760).Transform,N=f(2908),K=f(7187),v=f(7801).ok,B=f(783).kMaxLength,j="Cannot create final Buffer. It would be larger than 0x"+B.toString(16)+" bytes";N.Z_MIN_WINDOWBITS=8,N.Z_MAX_WINDOWBITS=15,N.Z_DEFAULT_WINDOWBITS=15,N.Z_MIN_CHUNK=64,N.Z_MAX_CHUNK=1/0,N.Z_DEFAULT_CHUNK=16384,N.Z_MIN_MEMLEVEL=1,N.Z_MAX_MEMLEVEL=9,N.Z_DEFAULT_MEMLEVEL=8,N.Z_MIN_LEVEL=-1,N.Z_MAX_LEVEL=9,N.Z_DEFAULT_LEVEL=N.Z_DEFAULT_COMPRESSION;for(var tA=Object.keys(N),w=0;w=B?J=new RangeError(j):cA=g.concat(UA,yA),UA=[],kA.close(),fA(J,cA)}kA.on("error",function Ee(cA){kA.removeListener("end",HA),kA.removeListener("readable",xA),fA(cA)}),kA.on("end",HA),kA.end(hA),xA()}function NA(kA,hA){if("string"==typeof hA&&(hA=g.from(hA)),!g.isBuffer(hA))throw new TypeError("Not a string or buffer");return kA._processChunk(hA,kA._finishFlushFlag)}function oA(kA){if(!(this instanceof oA))return new oA(kA);OA.call(this,kA,N.DEFLATE)}function uA(kA){if(!(this instanceof uA))return new uA(kA);OA.call(this,kA,N.INFLATE)}function dA(kA){if(!(this instanceof dA))return new dA(kA);OA.call(this,kA,N.GZIP)}function RA(kA){if(!(this instanceof RA))return new RA(kA);OA.call(this,kA,N.GUNZIP)}function nA(kA){if(!(this instanceof nA))return new nA(kA);OA.call(this,kA,N.DEFLATERAW)}function H(kA){if(!(this instanceof H))return new H(kA);OA.call(this,kA,N.INFLATERAW)}function pA(kA){if(!(this instanceof pA))return new pA(kA);OA.call(this,kA,N.UNZIP)}function z(kA){return kA===N.Z_NO_FLUSH||kA===N.Z_PARTIAL_FLUSH||kA===N.Z_SYNC_FLUSH||kA===N.Z_FULL_FLUSH||kA===N.Z_FINISH||kA===N.Z_BLOCK}function OA(kA,hA){var fA=this;if(this._opts=kA=kA||{},this._chunkSize=kA.chunkSize||Q.Z_DEFAULT_CHUNK,I.call(this,kA),kA.flush&&!z(kA.flush))throw new Error("Invalid flush flag: "+kA.flush);if(kA.finishFlush&&!z(kA.finishFlush))throw new Error("Invalid flush flag: "+kA.finishFlush);if(this._flushFlag=kA.flush||N.Z_NO_FLUSH,this._finishFlushFlag=typeof kA.finishFlush<"u"?kA.finishFlush:N.Z_FINISH,kA.chunkSize&&(kA.chunkSizeQ.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+kA.chunkSize);if(kA.windowBits&&(kA.windowBitsQ.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+kA.windowBits);if(kA.level&&(kA.levelQ.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+kA.level);if(kA.memLevel&&(kA.memLevelQ.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+kA.memLevel);if(kA.strategy&&kA.strategy!=Q.Z_FILTERED&&kA.strategy!=Q.Z_HUFFMAN_ONLY&&kA.strategy!=Q.Z_RLE&&kA.strategy!=Q.Z_FIXED&&kA.strategy!=Q.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+kA.strategy);if(kA.dictionary&&!g.isBuffer(kA.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new N.Zlib(hA);var UA=this;this._hadError=!1,this._handle.onerror=function(Ee,HA){wA(UA),UA._hadError=!0;var cA=new Error(Ee);cA.errno=HA,cA.code=Q.codes[HA],UA.emit("error",cA)};var yA=Q.Z_DEFAULT_COMPRESSION;"number"==typeof kA.level&&(yA=kA.level);var xA=Q.Z_DEFAULT_STRATEGY;"number"==typeof kA.strategy&&(xA=kA.strategy),this._handle.init(kA.windowBits||Q.Z_DEFAULT_WINDOWBITS,yA,kA.memLevel||Q.Z_DEFAULT_MEMLEVEL,xA,kA.dictionary),this._buffer=g.allocUnsafe(this._chunkSize),this._offset=0,this._level=yA,this._strategy=xA,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!fA._handle},configurable:!0,enumerable:!0})}function wA(kA,hA){hA&&t.nextTick(hA),kA._handle&&(kA._handle.close(),kA._handle=null)}function VA(kA){kA.emit("close")}Object.defineProperty(Q,"codes",{enumerable:!0,value:Object.freeze(AA),writable:!1}),Q.Deflate=oA,Q.Inflate=uA,Q.Gzip=dA,Q.Gunzip=RA,Q.DeflateRaw=nA,Q.InflateRaw=H,Q.Unzip=pA,Q.createDeflate=function(kA){return new oA(kA)},Q.createInflate=function(kA){return new uA(kA)},Q.createDeflateRaw=function(kA){return new nA(kA)},Q.createInflateRaw=function(kA){return new H(kA)},Q.createGzip=function(kA){return new dA(kA)},Q.createGunzip=function(kA){return new RA(kA)},Q.createUnzip=function(kA){return new pA(kA)},Q.deflate=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new oA(hA),kA,fA)},Q.deflateSync=function(kA,hA){return NA(new oA(hA),kA)},Q.gzip=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new dA(hA),kA,fA)},Q.gzipSync=function(kA,hA){return NA(new dA(hA),kA)},Q.deflateRaw=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new nA(hA),kA,fA)},Q.deflateRawSync=function(kA,hA){return NA(new nA(hA),kA)},Q.unzip=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new pA(hA),kA,fA)},Q.unzipSync=function(kA,hA){return NA(new pA(hA),kA)},Q.inflate=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new uA(hA),kA,fA)},Q.inflateSync=function(kA,hA){return NA(new uA(hA),kA)},Q.gunzip=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new RA(hA),kA,fA)},Q.gunzipSync=function(kA,hA){return NA(new RA(hA),kA)},Q.inflateRaw=function(kA,hA,fA){return"function"==typeof hA&&(fA=hA,hA={}),QA(new H(hA),kA,fA)},Q.inflateRawSync=function(kA,hA){return NA(new H(hA),kA)},K.inherits(OA,I),OA.prototype.params=function(kA,hA,fA){if(kAQ.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+kA);if(hA!=Q.Z_FILTERED&&hA!=Q.Z_HUFFMAN_ONLY&&hA!=Q.Z_RLE&&hA!=Q.Z_FIXED&&hA!=Q.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+hA);if(this._level!==kA||this._strategy!==hA){var UA=this;this.flush(N.Z_SYNC_FLUSH,function(){v(UA._handle,"zlib binding closed"),UA._handle.params(kA,hA),UA._hadError||(UA._level=kA,UA._strategy=hA,fA&&fA())})}else t.nextTick(fA)},OA.prototype.reset=function(){return v(this._handle,"zlib binding closed"),this._handle.reset()},OA.prototype._flush=function(kA){this._transform(g.alloc(0),"",kA)},OA.prototype.flush=function(kA,hA){var fA=this,UA=this._writableState;("function"==typeof kA||void 0===kA&&!hA)&&(hA=kA,kA=N.Z_FULL_FLUSH),UA.ended?hA&&t.nextTick(hA):UA.ending?hA&&this.once("end",hA):UA.needDrain?hA&&this.once("drain",function(){return fA.flush(kA,hA)}):(this._flushFlag=kA,this.write(g.alloc(0),"",hA))},OA.prototype.close=function(kA){wA(this,kA),t.nextTick(VA,this)},OA.prototype._transform=function(kA,hA,fA){var UA,yA=this._writableState,Ee=(yA.ending||yA.ended)&&(!kA||yA.length===kA.length);return null===kA||g.isBuffer(kA)?this._handle?(Ee?UA=this._finishFlushFlag:(UA=this._flushFlag,kA.length>=yA.length&&(this._flushFlag=this._opts.flush||N.Z_NO_FLUSH)),void this._processChunk(kA,UA,fA)):fA(new Error("zlib binding closed")):fA(new Error("invalid input"))},OA.prototype._processChunk=function(kA,hA,fA){var UA=kA&&kA.length,yA=this._chunkSize-this._offset,xA=0,Ee=this,HA="function"==typeof fA;if(!HA){var U,cA=[],J=0;this.on("error",function($A){U=$A}),v(this._handle,"zlib binding closed");do{var O=this._handle.writeSync(hA,kA,xA,UA,this._buffer,this._offset,yA)}while(!this._hadError&&JA(O[0],O[1]));if(this._hadError)throw U;if(J>=B)throw wA(this),new RangeError(j);var lA=g.concat(cA,J);return wA(this),lA}v(this._handle,"zlib binding closed");var LA=this._handle.write(hA,kA,xA,UA,this._buffer,this._offset,yA);function JA($A,IA){if(this&&(this.buffer=null,this.callback=null),!Ee._hadError){var gA=yA-IA;if(v(gA>=0,"have should not go down"),gA>0){var C=Ee._buffer.slice(Ee._offset,Ee._offset+gA);Ee._offset+=gA,HA?Ee.push(C):(cA.push(C),J+=C.length)}if((0===IA||Ee._offset>=Ee._chunkSize)&&(yA=Ee._chunkSize,Ee._offset=0,Ee._buffer=g.allocUnsafe(Ee._chunkSize)),0===IA){if(xA+=UA-$A,UA=$A,!HA)return!0;var b=Ee._handle.write(hA,kA,xA,UA,Ee._buffer,Ee._offset,Ee._chunkSize);return b.callback=JA,void(b.buffer=kA)}if(!HA)return!1;fA()}}LA.buffer=kA,LA.callback=JA},K.inherits(oA,OA),K.inherits(uA,OA),K.inherits(dA,OA),K.inherits(RA,OA),K.inherits(nA,OA),K.inherits(H,OA),K.inherits(pA,OA)},7802(eA,Q,f){"use strict";var t=f(5049),g=f(3036),I=f(78),N=f(1909);eA.exports=N||t.call(I,g)},8619(eA,Q,f){"use strict";var t=f(5049),g=f(3036),I=f(7802);eA.exports=function(){return I(t,g,arguments)}},3036(eA){"use strict";eA.exports=Function.prototype.apply},78(eA){"use strict";eA.exports=Function.prototype.call},6688(eA,Q,f){"use strict";var t=f(5049),g=f(6785),I=f(78),N=f(7802);eA.exports=function(v){if(v.length<1||"function"!=typeof v[0])throw new g("a function is required");return N(t,I,v)}},1909(eA){"use strict";eA.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply},7913(eA,Q,f){"use strict";var t=f(8651),g=f(6601),I=g(t("String.prototype.indexOf"));eA.exports=function(K,v){var B=t(K,!!v);return"function"==typeof B&&I(K,".prototype.")>-1?g(B):B}},6601(eA,Q,f){"use strict";var t=f(6255),g=f(6649),I=f(6688),N=f(8619);eA.exports=function(v){var B=I(arguments),j=1+v.length-(arguments.length-1);return t(B,j>0?j:0,!0)},g?g(eA.exports,"apply",{value:N}):eA.exports.apply=N},2774(eA,Q,f){"use strict";var t=f(8651),g=f(6688),I=g([t("%String.prototype.indexOf%")]);eA.exports=function(K,v){var B=t(K,!!v);return"function"==typeof B&&I(K,".prototype.")>-1?g([B]):B}},1613(eA,Q,f){var t=f(783).Buffer,g=function(){"use strict";function I(L,P){return null!=P&&L instanceof P}var N,K,v;try{N=Map}catch{N=function(){}}try{K=Set}catch{K=function(){}}try{v=Promise}catch{v=function(){}}function B(L,P,rA,QA,NA){"object"==typeof P&&(rA=P.depth,QA=P.prototype,NA=P.includeNonEnumerable,P=P.circular);var oA=[],uA=[],dA=typeof t<"u";return typeof P>"u"&&(P=!0),typeof rA>"u"&&(rA=1/0),function RA(nA,H){if(null===nA)return null;if(0===H)return nA;var pA,z;if("object"!=typeof nA)return nA;if(I(nA,N))pA=new N;else if(I(nA,K))pA=new K;else if(I(nA,v))pA=new v(function(xA,Ee){nA.then(function(HA){xA(RA(HA,H-1))},function(HA){Ee(RA(HA,H-1))})});else if(B.__isArray(nA))pA=[];else if(B.__isRegExp(nA))pA=new RegExp(nA.source,AA(nA)),nA.lastIndex&&(pA.lastIndex=nA.lastIndex);else if(B.__isDate(nA))pA=new Date(nA.getTime());else{if(dA&&t.isBuffer(nA))return pA=t.allocUnsafe?t.allocUnsafe(nA.length):new t(nA.length),nA.copy(pA),pA;I(nA,Error)?pA=Object.create(nA):typeof QA>"u"?(z=Object.getPrototypeOf(nA),pA=Object.create(z)):(pA=Object.create(QA),z=QA)}if(P){var OA=oA.indexOf(nA);if(-1!=OA)return uA[OA];oA.push(nA),uA.push(pA)}for(var wA in I(nA,N)&&nA.forEach(function(xA,Ee){var HA=RA(Ee,H-1),cA=RA(xA,H-1);pA.set(HA,cA)}),I(nA,K)&&nA.forEach(function(xA){var Ee=RA(xA,H-1);pA.add(Ee)}),nA){var VA;z&&(VA=Object.getOwnPropertyDescriptor(z,wA)),(!VA||null!=VA.set)&&(pA[wA]=RA(nA[wA],H-1))}if(Object.getOwnPropertySymbols){var kA=Object.getOwnPropertySymbols(nA);for(wA=0;wA3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new I("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new I("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new I("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new I("`loose`, if provided, must be a boolean");var tA=arguments.length>3?arguments[3]:null,w=arguments.length>4?arguments[4]:null,aA=arguments.length>5?arguments[5]:null,AA=arguments.length>6&&arguments[6],L=!!N&&N(v,B);if(t)t(v,B,{configurable:null===aA&&L?L.configurable:!aA,enumerable:null===tA&&L?L.enumerable:!tA,value:j,writable:null===w&&L?L.writable:!w});else{if(!AA&&(tA||w||aA))throw new g("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");v[B]=j}}},5421(eA,Q,f){"use strict";var t=f(5643),g="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),I=Object.prototype.toString,N=Array.prototype.concat,K=f(9295),B=f(8890)(),j=function(w,aA,AA,L){if(aA in w)if(!0===L){if(w[aA]===AA)return}else if(!function(w){return"function"==typeof w&&"[object Function]"===I.call(w)}(L)||!L())return;B?K(w,aA,AA,!0):K(w,aA,AA)},tA=function(w,aA){var AA=arguments.length>2?arguments[2]:{},L=t(aA);g&&(L=N.call(L,Object.getOwnPropertySymbols(aA)));for(var P=0;P0&&z.length>H&&!z.warned){z.warned=!0;var OA=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(dA)+" listeners added. Use emitter.setMaxListeners() to increase limit");OA.name="MaxListenersExceededWarning",OA.emitter=uA,OA.type=dA,OA.count=z.length,function g(uA){console&&console.warn&&console.warn(uA)}(OA)}return uA}function tA(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(uA,dA,RA){var nA={fired:!1,wrapFn:void 0,target:uA,type:dA,listener:RA},H=tA.bind(nA);return H.listener=RA,nA.wrapFn=H,H}function aA(uA,dA,RA){var nA=uA._events;if(void 0===nA)return[];var H=nA[dA];return void 0===H?[]:"function"==typeof H?RA?[H.listener||H]:[H]:RA?function rA(uA){for(var dA=new Array(uA.length),RA=0;RA0&&(z=RA[0]),z instanceof Error)throw z;var OA=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw OA.context=z,OA}var wA=pA[dA];if(void 0===wA)return!1;if("function"==typeof wA)f(wA,this,RA);else{var VA=wA.length,kA=L(wA,VA);for(nA=0;nA=0;z--)if(nA[z]===RA||nA[z].listener===RA){OA=nA[z].listener,pA=z;break}if(pA<0)return this;0===pA?nA.shift():function P(uA,dA){for(;dA+1=0;H--)this.removeListener(dA,RA[H]);return this},N.prototype.listeners=function(dA){return aA(this,dA,!0)},N.prototype.rawListeners=function(dA){return aA(this,dA,!1)},N.listenerCount=function(uA,dA){return"function"==typeof uA.listenerCount?uA.listenerCount(dA):AA.call(uA,dA)},N.prototype.listenerCount=AA,N.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2022(eA,Q,f){"use strict";eA.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch{if("object"==typeof window)return window;if("object"==typeof self)return self;if(typeof f.g<"u")return f.g}return t}()},453(eA){"use strict";eA.exports=function Q(f,t){if(f===t)return!0;if(f&&t&&"object"==typeof f&&"object"==typeof t){if(f.constructor!==t.constructor)return!1;var g,I,N;if(Array.isArray(f)){if((g=f.length)!=t.length)return!1;for(I=g;0!==I--;)if(!Q(f[I],t[I]))return!1;return!0}if(f.constructor===RegExp)return f.source===t.source&&f.flags===t.flags;if(f.valueOf!==Object.prototype.valueOf)return f.valueOf()===t.valueOf();if(f.toString!==Object.prototype.toString)return f.toString()===t.toString();if((g=(N=Object.keys(f)).length)!==Object.keys(t).length)return!1;for(I=g;0!==I--;)if(!Object.prototype.hasOwnProperty.call(t,N[I]))return!1;for(I=g;0!==I--;){var K=N[I];if(!Q(f[K],t[K]))return!1}return!0}return f!=f&&t!=t}},8404(eA,Q,f){"use strict";var t=f(3746),g=Object.prototype.toString,I=Object.prototype.hasOwnProperty;eA.exports=function(tA,w,aA){if(!t(w))throw new TypeError("iterator must be a function");var AA;arguments.length>=3&&(AA=aA),function B(j){return"[object Array]"===g.call(j)}(tA)?function(tA,w,aA){for(var AA=0,L=tA.length;AAQ},8651(eA,Q,f){"use strict";var t,g=f(5846),I=f(5293),N=f(9055),K=f(8888),v=f(7900),B=f(7770),j=f(6785),tA=f(4055),w=f(716),aA=f(7450),AA=f(3774),L=f(7552),P=f(5874),rA=f(9292),QA=f(6071),NA=Function,oA=function(gA){try{return NA('"use strict"; return ('+gA+").constructor;")()}catch{}},uA=f(8109),dA=f(6649),RA=function(){throw new j},nA=uA?function(){try{return RA}catch{try{return uA(arguments,"callee").get}catch{return RA}}}():RA,H=f(3257)(),pA=f(7106),z=f(3766),OA=f(6822),wA=f(3036),VA=f(78),kA={},hA=typeof Uint8Array>"u"||!pA?t:pA(Uint8Array),fA={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":H&&pA?pA([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":kA,"%AsyncGenerator%":kA,"%AsyncGeneratorFunction%":kA,"%AsyncIteratorPrototype%":kA,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":I,"%eval%":eval,"%EvalError%":N,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":NA,"%GeneratorFunction%":kA,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&pA?pA(pA([][Symbol.iterator]())):t,"%JSON%":"object"==typeof JSON?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!pA?t:pA((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":g,"%Object.getOwnPropertyDescriptor%":uA,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":K,"%ReferenceError%":v,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!pA?t:pA((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&pA?pA(""[Symbol.iterator]()):t,"%Symbol%":H?Symbol:t,"%SyntaxError%":B,"%ThrowTypeError%":nA,"%TypedArray%":hA,"%TypeError%":j,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":tA,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":VA,"%Function.prototype.apply%":wA,"%Object.defineProperty%":dA,"%Object.getPrototypeOf%":z,"%Math.abs%":w,"%Math.floor%":aA,"%Math.max%":AA,"%Math.min%":L,"%Math.pow%":P,"%Math.round%":rA,"%Math.sign%":QA,"%Reflect.getPrototypeOf%":OA};if(pA)try{null.error}catch(gA){var UA=pA(pA(gA));fA["%Error.prototype%"]=UA}var yA=function gA(C){var b;if("%AsyncFunction%"===C)b=oA("async function () {}");else if("%GeneratorFunction%"===C)b=oA("function* () {}");else if("%AsyncGeneratorFunction%"===C)b=oA("async function* () {}");else if("%AsyncGenerator%"===C){var R=gA("%AsyncGeneratorFunction%");R&&(b=R.prototype)}else if("%AsyncIteratorPrototype%"===C){var M=gA("%AsyncGenerator%");M&&pA&&(b=pA(M.prototype))}return fA[C]=b,b},xA={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ee=f(5049),HA=f(5215),cA=Ee.call(VA,Array.prototype.concat),J=Ee.call(wA,Array.prototype.splice),U=Ee.call(VA,String.prototype.replace),O=Ee.call(VA,String.prototype.slice),lA=Ee.call(VA,RegExp.prototype.exec),LA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,JA=/\\(\\)?/g,IA=function(C,b){var M,R=C;if(HA(xA,R)&&(R="%"+(M=xA[R])[0]+"%"),HA(fA,R)){var D=fA[R];if(D===kA&&(D=yA(R)),typeof D>"u"&&!b)throw new j("intrinsic "+C+" exists, but is not available. Please file an issue!");return{alias:M,name:R,value:D}}throw new B("intrinsic "+C+" does not exist!")};eA.exports=function(C,b){if("string"!=typeof C||0===C.length)throw new j("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof b)throw new j('"allowMissing" argument must be a boolean');if(null===lA(/^%?[^%]*%?$/,C))throw new B("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var R=function(C){var b=O(C,0,1),R=O(C,-1);if("%"===b&&"%"!==R)throw new B("invalid intrinsic syntax, expected closing `%`");if("%"===R&&"%"!==b)throw new B("invalid intrinsic syntax, expected opening `%`");var M=[];return U(C,LA,function(D,X,YA,KA){M[M.length]=YA?U(KA,JA,"$1"):X||D}),M}(C),M=R.length>0?R[0]:"",D=IA("%"+M+"%",b),X=D.name,YA=D.value,KA=!1,bA=D.alias;bA&&(M=bA[0],J(R,cA([0,1],bA)));for(var le=1,ve=!0;le=R.length){var Oe=uA(YA,Ne);YA=(ve=!!Oe)&&"get"in Oe&&!("originalValue"in Oe.get)?Oe.get:YA[Ne]}else ve=HA(YA,Ne),YA=YA[Ne];ve&&!KA&&(fA[X]=YA)}}return YA}},3766(eA,Q,f){"use strict";var t=f(5846);eA.exports=t.getPrototypeOf||null},6822(eA){"use strict";eA.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null},7106(eA,Q,f){"use strict";var t=f(6822),g=f(3766),I=f(9302);eA.exports=t?function(K){return t(K)}:g?function(K){if(!K||"object"!=typeof K&&"function"!=typeof K)throw new TypeError("getProto: not an object");return g(K)}:I?function(K){return I(K)}:null},5567(eA){"use strict";eA.exports=Object.getOwnPropertyDescriptor},8109(eA,Q,f){"use strict";var t=f(5567);if(t)try{t([],"length")}catch{t=null}eA.exports=t},8890(eA,Q,f){"use strict";var t=f(6649),g=function(){return!!t};g.hasArrayLengthDefineBug=function(){if(!t)return null;try{return 1!==t([],"length",{value:1}).length}catch{return!0}},eA.exports=g},3257(eA,Q,f){"use strict";var t=typeof Symbol<"u"&&Symbol,g=f(2843);eA.exports=function(){return"function"==typeof t&&"function"==typeof Symbol&&"symbol"==typeof t("foo")&&"symbol"==typeof Symbol("bar")&&g()}},2843(eA){"use strict";eA.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var f={},t=Symbol("test"),g=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(g))return!1;for(var N in f[t]=42,f)return!1;if("function"==typeof Object.keys&&0!==Object.keys(f).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(f).length)return!1;var K=Object.getOwnPropertySymbols(f);if(1!==K.length||K[0]!==t||!Object.prototype.propertyIsEnumerable.call(f,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var v=Object.getOwnPropertyDescriptor(f,t);if(42!==v.value||!0!==v.enumerable)return!1}return!0}},6626(eA,Q,f){"use strict";var t=f(2843);eA.exports=function(){return t()&&!!Symbol.toStringTag}},5215(eA,Q,f){"use strict";var t=Function.prototype.call,g=Object.prototype.hasOwnProperty,I=f(5049);eA.exports=I.call(t,g)},9029(eA,Q){Q.read=function(f,t,g,I,N){var K,v,B=8*N-I-1,j=(1<>1,w=-7,aA=g?N-1:0,AA=g?-1:1,L=f[t+aA];for(aA+=AA,K=L&(1<<-w)-1,L>>=-w,w+=B;w>0;K=256*K+f[t+aA],aA+=AA,w-=8);for(v=K&(1<<-w)-1,K>>=-w,w+=I;w>0;v=256*v+f[t+aA],aA+=AA,w-=8);if(0===K)K=1-tA;else{if(K===j)return v?NaN:1/0*(L?-1:1);v+=Math.pow(2,I),K-=tA}return(L?-1:1)*v*Math.pow(2,K-I)},Q.write=function(f,t,g,I,N,K){var v,B,j,tA=8*K-N-1,w=(1<>1,AA=23===N?Math.pow(2,-24)-Math.pow(2,-77):0,L=I?0:K-1,P=I?1:-1,rA=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(B=isNaN(t)?1:0,v=w):(v=Math.floor(Math.log(t)/Math.LN2),t*(j=Math.pow(2,-v))<1&&(v--,j*=2),(t+=v+aA>=1?AA/j:AA*Math.pow(2,1-aA))*j>=2&&(v++,j/=2),v+aA>=w?(B=0,v=w):v+aA>=1?(B=(t*j-1)*Math.pow(2,N),v+=aA):(B=t*Math.pow(2,aA-1)*Math.pow(2,N),v=0));N>=8;f[g+L]=255&B,L+=P,B/=256,N-=8);for(v=v<0;f[g+L]=255&v,L+=P,v/=256,tA-=8);f[g+L-P]|=128*rA}},9784(eA){eA.exports="function"==typeof Object.create?function(f,t){t&&(f.super_=t,f.prototype=Object.create(t.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:function(f,t){if(t){f.super_=t;var g=function(){};g.prototype=t.prototype,f.prototype=new g,f.prototype.constructor=f}}},7906(eA,Q,f){"use strict";var t=f(6626)(),I=f(2774)("Object.prototype.toString"),N=function(j){return!(t&&j&&"object"==typeof j&&Symbol.toStringTag in j)&&"[object Arguments]"===I(j)},K=function(j){return!!N(j)||null!==j&&"object"==typeof j&&"length"in j&&"number"==typeof j.length&&j.length>=0&&"[object Array]"!==I(j)&&"callee"in j&&"[object Function]"===I(j.callee)},v=function(){return N(arguments)}();N.isLegacyArguments=K,eA.exports=v?N:K},3746(eA){"use strict";var t,g,Q=Function.prototype.toString,f="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof f&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw g}}),g={},f(function(){throw 42},null,t)}catch(NA){NA!==g&&(f=null)}else f=null;var I=/^\s*class\b/,N=function(oA){try{var uA=Q.call(oA);return I.test(uA)}catch{return!1}},K=function(oA){try{return!N(oA)&&(Q.call(oA),!0)}catch{return!1}},v=Object.prototype.toString,L="function"==typeof Symbol&&!!Symbol.toStringTag,P=!(0 in[,]),rA=function(){return!1};if("object"==typeof document){var QA=document.all;v.call(QA)===v.call(document.all)&&(rA=function(oA){if((P||!oA)&&(typeof oA>"u"||"object"==typeof oA))try{var uA=v.call(oA);return("[object HTMLAllCollection]"===uA||"[object HTML document.all class]"===uA||"[object HTMLCollection]"===uA||"[object Object]"===uA)&&null==oA("")}catch{}return!1})}eA.exports=f?function(oA){if(rA(oA))return!0;if(!oA||"function"!=typeof oA&&"object"!=typeof oA)return!1;try{f(oA,null,t)}catch(uA){if(uA!==g)return!1}return!N(oA)&&K(oA)}:function(oA){if(rA(oA))return!0;if(!oA||"function"!=typeof oA&&"object"!=typeof oA)return!1;if(L)return K(oA);if(N(oA))return!1;var uA=v.call(oA);return!("[object Function]"!==uA&&"[object GeneratorFunction]"!==uA&&!/^\[object HTML/.test(uA))&&K(oA)}},4610(eA,Q,f){"use strict";var t=f(2774),I=f(8843)(/^\s*(?:function)?\*/),N=f(6626)(),K=f(7106),v=t("Object.prototype.toString"),B=t("Function.prototype.toString"),j=f(9294).c;eA.exports=function(w){if("function"!=typeof w)return!1;if(I(B(w)))return!0;if(!N)return"[object GeneratorFunction]"===v(w);if(!K)return!1;var AA=j();return AA&&K(w)===AA.prototype}},2621(eA){"use strict";eA.exports=function(f){return f!=f}},7051(eA,Q,f){"use strict";var t=f(6601),g=f(5421),I=f(2621),N=f(1320),K=f(5074),v=t(N(),Number);g(v,{getPolyfill:N,implementation:I,shim:K}),eA.exports=v},1320(eA,Q,f){"use strict";var t=f(2621);eA.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:t}},5074(eA,Q,f){"use strict";var t=f(5421),g=f(1320);eA.exports=function(){var N=g();return t(Number,{isNaN:N},{isNaN:function(){return Number.isNaN!==N}}),N}},1689(eA,Q,f){"use strict";var K,t=f(2774),g=f(6626)(),I=f(5215),N=f(8109);if(g){var v=t("RegExp.prototype.exec"),B={},j=function(){throw B},tA={toString:j,valueOf:j};"symbol"==typeof Symbol.toPrimitive&&(tA[Symbol.toPrimitive]=j),K=function(L){if(!L||"object"!=typeof L)return!1;var P=N(L,"lastIndex");if(!P||!I(P,"value"))return!1;try{v(L,tA)}catch(QA){return QA===B}}}else{var w=t("Object.prototype.toString");K=function(L){return!(!L||"object"!=typeof L&&"function"!=typeof L)&&"[object RegExp]"===w(L)}}eA.exports=K},6094(eA,Q,f){"use strict";var t=f(3381);eA.exports=function(I){return!!t(I)}},1632(eA,Q,f){var g,t=f(9964);!function(){"use strict";var I="input is invalid type",K="object"==typeof window,v=K?window:{};v.JS_MD5_NO_WINDOW&&(K=!1);var B=!K&&"object"==typeof self,j=!v.JS_MD5_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node;j?v=f.g:B&&(v=self);var oA,tA=!v.JS_MD5_NO_COMMON_JS&&eA.exports,w=f.amdO,aA=!v.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",AA="0123456789abcdef".split(""),L=[128,32768,8388608,-2147483648],P=[0,8,16,24],rA=["hex","array","digest","buffer","arrayBuffer","base64"],QA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),NA=[];if(aA){var uA=new ArrayBuffer(68);oA=new Uint8Array(uA),NA=new Uint32Array(uA)}var dA=Array.isArray;(v.JS_MD5_NO_NODE_JS||!dA)&&(dA=function(fA){return"[object Array]"===Object.prototype.toString.call(fA)});var RA=ArrayBuffer.isView;aA&&(v.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!RA)&&(RA=function(fA){return"object"==typeof fA&&fA.buffer&&fA.buffer.constructor===ArrayBuffer});var nA=function(fA){var UA=typeof fA;if("string"===UA)return[fA,!0];if("object"!==UA||null===fA)throw new Error(I);if(aA&&fA.constructor===ArrayBuffer)return[new Uint8Array(fA),!1];if(!dA(fA)&&!RA(fA))throw new Error(I);return[fA,!1]},H=function(fA){return function(UA){return new VA(!0).update(UA)[fA]()}},OA=function(fA){return function(UA,yA){return new kA(UA,!0).update(yA)[fA]()}};function VA(fA){if(fA)NA[0]=NA[16]=NA[1]=NA[2]=NA[3]=NA[4]=NA[5]=NA[6]=NA[7]=NA[8]=NA[9]=NA[10]=NA[11]=NA[12]=NA[13]=NA[14]=NA[15]=0,this.blocks=NA,this.buffer8=oA;else if(aA){var UA=new ArrayBuffer(68);this.buffer8=new Uint8Array(UA),this.blocks=new Uint32Array(UA)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function kA(fA,UA){var yA,xA=nA(fA);if(fA=xA[0],xA[1]){var J,Ee=[],HA=fA.length,cA=0;for(yA=0;yA>>6,Ee[cA++]=128|63&J):J<55296||J>=57344?(Ee[cA++]=224|J>>>12,Ee[cA++]=128|J>>>6&63,Ee[cA++]=128|63&J):(J=65536+((1023&J)<<10|1023&fA.charCodeAt(++yA)),Ee[cA++]=240|J>>>18,Ee[cA++]=128|J>>>12&63,Ee[cA++]=128|J>>>6&63,Ee[cA++]=128|63&J);fA=Ee}fA.length>64&&(fA=new VA(!0).update(fA).array());var U=[],O=[];for(yA=0;yA<64;++yA){var lA=fA[yA]||0;U[yA]=92^lA,O[yA]=54^lA}VA.call(this,UA),this.update(O),this.oKeyPad=U,this.inner=!0,this.sharedMemory=UA}VA.prototype.update=function(fA){if(this.finalized)throw new Error("finalize already called");for(var xA,HA,UA=nA(fA),yA=UA[1],Ee=0,cA=(fA=UA[0]).length,J=this.blocks,U=this.buffer8;Ee>>6,U[HA++]=128|63&xA):xA<55296||xA>=57344?(U[HA++]=224|xA>>>12,U[HA++]=128|xA>>>6&63,U[HA++]=128|63&xA):(xA=65536+((1023&xA)<<10|1023&fA.charCodeAt(++Ee)),U[HA++]=240|xA>>>18,U[HA++]=128|xA>>>12&63,U[HA++]=128|xA>>>6&63,U[HA++]=128|63&xA);else for(HA=this.start;Ee>>2]|=xA<>>2]|=(192|xA>>>6)<>>2]|=(128|63&xA)<=57344?(J[HA>>>2]|=(224|xA>>>12)<>>2]|=(128|xA>>>6&63)<>>2]|=(128|63&xA)<>>2]|=(240|xA>>>18)<>>2]|=(128|xA>>>12&63)<>>2]|=(128|xA>>>6&63)<>>2]|=(128|63&xA)<>>2]|=fA[Ee]<=64?(this.start=HA-64,this.hash(),this.hashed=!0):this.start=HA}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},VA.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var fA=this.blocks,UA=this.lastByteIndex;fA[UA>>>2]|=L[3&UA],UA>=56&&(this.hashed||this.hash(),fA[0]=fA[16],fA[16]=fA[1]=fA[2]=fA[3]=fA[4]=fA[5]=fA[6]=fA[7]=fA[8]=fA[9]=fA[10]=fA[11]=fA[12]=fA[13]=fA[14]=fA[15]=0),fA[14]=this.bytes<<3,fA[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},VA.prototype.hash=function(){var fA,UA,yA,xA,Ee,HA,cA=this.blocks;this.first?UA=((UA=((fA=((fA=cA[0]-680876937)<<7|fA>>>25)-271733879|0)^(yA=((yA=(-271733879^(xA=((xA=(-1732584194^2004318071&fA)+cA[1]-117830708)<<12|xA>>>20)+fA|0)&(-271733879^fA))+cA[2]-1126478375)<<17|yA>>>15)+xA|0)&(xA^fA))+cA[3]-1316259209)<<22|UA>>>10)+yA|0:(fA=this.h0,UA=this.h1,UA=((UA+=((fA=((fA+=((xA=this.h3)^UA&((yA=this.h2)^xA))+cA[0]-680876936)<<7|fA>>>25)+UA|0)^(yA=((yA+=(UA^(xA=((xA+=(yA^fA&(UA^yA))+cA[1]-389564586)<<12|xA>>>20)+fA|0)&(fA^UA))+cA[2]+606105819)<<17|yA>>>15)+xA|0)&(xA^fA))+cA[3]-1044525330)<<22|UA>>>10)+yA|0),UA=((UA+=((fA=((fA+=(xA^UA&(yA^xA))+cA[4]-176418897)<<7|fA>>>25)+UA|0)^(yA=((yA+=(UA^(xA=((xA+=(yA^fA&(UA^yA))+cA[5]+1200080426)<<12|xA>>>20)+fA|0)&(fA^UA))+cA[6]-1473231341)<<17|yA>>>15)+xA|0)&(xA^fA))+cA[7]-45705983)<<22|UA>>>10)+yA|0,UA=((UA+=((fA=((fA+=(xA^UA&(yA^xA))+cA[8]+1770035416)<<7|fA>>>25)+UA|0)^(yA=((yA+=(UA^(xA=((xA+=(yA^fA&(UA^yA))+cA[9]-1958414417)<<12|xA>>>20)+fA|0)&(fA^UA))+cA[10]-42063)<<17|yA>>>15)+xA|0)&(xA^fA))+cA[11]-1990404162)<<22|UA>>>10)+yA|0,UA=((UA+=((fA=((fA+=(xA^UA&(yA^xA))+cA[12]+1804603682)<<7|fA>>>25)+UA|0)^(yA=((yA+=(UA^(xA=((xA+=(yA^fA&(UA^yA))+cA[13]-40341101)<<12|xA>>>20)+fA|0)&(fA^UA))+cA[14]-1502002290)<<17|yA>>>15)+xA|0)&(xA^fA))+cA[15]+1236535329)<<22|UA>>>10)+yA|0,UA=((UA+=((xA=((xA+=(UA^yA&((fA=((fA+=(yA^xA&(UA^yA))+cA[1]-165796510)<<5|fA>>>27)+UA|0)^UA))+cA[6]-1069501632)<<9|xA>>>23)+fA|0)^fA&((yA=((yA+=(fA^UA&(xA^fA))+cA[11]+643717713)<<14|yA>>>18)+xA|0)^xA))+cA[0]-373897302)<<20|UA>>>12)+yA|0,UA=((UA+=((xA=((xA+=(UA^yA&((fA=((fA+=(yA^xA&(UA^yA))+cA[5]-701558691)<<5|fA>>>27)+UA|0)^UA))+cA[10]+38016083)<<9|xA>>>23)+fA|0)^fA&((yA=((yA+=(fA^UA&(xA^fA))+cA[15]-660478335)<<14|yA>>>18)+xA|0)^xA))+cA[4]-405537848)<<20|UA>>>12)+yA|0,UA=((UA+=((xA=((xA+=(UA^yA&((fA=((fA+=(yA^xA&(UA^yA))+cA[9]+568446438)<<5|fA>>>27)+UA|0)^UA))+cA[14]-1019803690)<<9|xA>>>23)+fA|0)^fA&((yA=((yA+=(fA^UA&(xA^fA))+cA[3]-187363961)<<14|yA>>>18)+xA|0)^xA))+cA[8]+1163531501)<<20|UA>>>12)+yA|0,UA=((UA+=((xA=((xA+=(UA^yA&((fA=((fA+=(yA^xA&(UA^yA))+cA[13]-1444681467)<<5|fA>>>27)+UA|0)^UA))+cA[2]-51403784)<<9|xA>>>23)+fA|0)^fA&((yA=((yA+=(fA^UA&(xA^fA))+cA[7]+1735328473)<<14|yA>>>18)+xA|0)^xA))+cA[12]-1926607734)<<20|UA>>>12)+yA|0,UA=((UA+=((HA=(xA=((xA+=((Ee=UA^yA)^(fA=((fA+=(Ee^xA)+cA[5]-378558)<<4|fA>>>28)+UA|0))+cA[8]-2022574463)<<11|xA>>>21)+fA|0)^fA)^(yA=((yA+=(HA^UA)+cA[11]+1839030562)<<16|yA>>>16)+xA|0))+cA[14]-35309556)<<23|UA>>>9)+yA|0,UA=((UA+=((HA=(xA=((xA+=((Ee=UA^yA)^(fA=((fA+=(Ee^xA)+cA[1]-1530992060)<<4|fA>>>28)+UA|0))+cA[4]+1272893353)<<11|xA>>>21)+fA|0)^fA)^(yA=((yA+=(HA^UA)+cA[7]-155497632)<<16|yA>>>16)+xA|0))+cA[10]-1094730640)<<23|UA>>>9)+yA|0,UA=((UA+=((HA=(xA=((xA+=((Ee=UA^yA)^(fA=((fA+=(Ee^xA)+cA[13]+681279174)<<4|fA>>>28)+UA|0))+cA[0]-358537222)<<11|xA>>>21)+fA|0)^fA)^(yA=((yA+=(HA^UA)+cA[3]-722521979)<<16|yA>>>16)+xA|0))+cA[6]+76029189)<<23|UA>>>9)+yA|0,UA=((UA+=((HA=(xA=((xA+=((Ee=UA^yA)^(fA=((fA+=(Ee^xA)+cA[9]-640364487)<<4|fA>>>28)+UA|0))+cA[12]-421815835)<<11|xA>>>21)+fA|0)^fA)^(yA=((yA+=(HA^UA)+cA[15]+530742520)<<16|yA>>>16)+xA|0))+cA[2]-995338651)<<23|UA>>>9)+yA|0,UA=((UA+=((xA=((xA+=(UA^((fA=((fA+=(yA^(UA|~xA))+cA[0]-198630844)<<6|fA>>>26)+UA|0)|~yA))+cA[7]+1126891415)<<10|xA>>>22)+fA|0)^((yA=((yA+=(fA^(xA|~UA))+cA[14]-1416354905)<<15|yA>>>17)+xA|0)|~fA))+cA[5]-57434055)<<21|UA>>>11)+yA|0,UA=((UA+=((xA=((xA+=(UA^((fA=((fA+=(yA^(UA|~xA))+cA[12]+1700485571)<<6|fA>>>26)+UA|0)|~yA))+cA[3]-1894986606)<<10|xA>>>22)+fA|0)^((yA=((yA+=(fA^(xA|~UA))+cA[10]-1051523)<<15|yA>>>17)+xA|0)|~fA))+cA[1]-2054922799)<<21|UA>>>11)+yA|0,UA=((UA+=((xA=((xA+=(UA^((fA=((fA+=(yA^(UA|~xA))+cA[8]+1873313359)<<6|fA>>>26)+UA|0)|~yA))+cA[15]-30611744)<<10|xA>>>22)+fA|0)^((yA=((yA+=(fA^(xA|~UA))+cA[6]-1560198380)<<15|yA>>>17)+xA|0)|~fA))+cA[13]+1309151649)<<21|UA>>>11)+yA|0,UA=((UA+=((xA=((xA+=(UA^((fA=((fA+=(yA^(UA|~xA))+cA[4]-145523070)<<6|fA>>>26)+UA|0)|~yA))+cA[11]-1120210379)<<10|xA>>>22)+fA|0)^((yA=((yA+=(fA^(xA|~UA))+cA[2]+718787259)<<15|yA>>>17)+xA|0)|~fA))+cA[9]-343485551)<<21|UA>>>11)+yA|0,this.first?(this.h0=fA+1732584193|0,this.h1=UA-271733879|0,this.h2=yA-1732584194|0,this.h3=xA+271733878|0,this.first=!1):(this.h0=this.h0+fA|0,this.h1=this.h1+UA|0,this.h2=this.h2+yA|0,this.h3=this.h3+xA|0)},VA.prototype.toString=VA.prototype.hex=function(){this.finalize();var fA=this.h0,UA=this.h1,yA=this.h2,xA=this.h3;return AA[fA>>>4&15]+AA[15&fA]+AA[fA>>>12&15]+AA[fA>>>8&15]+AA[fA>>>20&15]+AA[fA>>>16&15]+AA[fA>>>28&15]+AA[fA>>>24&15]+AA[UA>>>4&15]+AA[15&UA]+AA[UA>>>12&15]+AA[UA>>>8&15]+AA[UA>>>20&15]+AA[UA>>>16&15]+AA[UA>>>28&15]+AA[UA>>>24&15]+AA[yA>>>4&15]+AA[15&yA]+AA[yA>>>12&15]+AA[yA>>>8&15]+AA[yA>>>20&15]+AA[yA>>>16&15]+AA[yA>>>28&15]+AA[yA>>>24&15]+AA[xA>>>4&15]+AA[15&xA]+AA[xA>>>12&15]+AA[xA>>>8&15]+AA[xA>>>20&15]+AA[xA>>>16&15]+AA[xA>>>28&15]+AA[xA>>>24&15]},VA.prototype.array=VA.prototype.digest=function(){this.finalize();var fA=this.h0,UA=this.h1,yA=this.h2,xA=this.h3;return[255&fA,fA>>>8&255,fA>>>16&255,fA>>>24&255,255&UA,UA>>>8&255,UA>>>16&255,UA>>>24&255,255&yA,yA>>>8&255,yA>>>16&255,yA>>>24&255,255&xA,xA>>>8&255,xA>>>16&255,xA>>>24&255]},VA.prototype.buffer=VA.prototype.arrayBuffer=function(){this.finalize();var fA=new ArrayBuffer(16),UA=new Uint32Array(fA);return UA[0]=this.h0,UA[1]=this.h1,UA[2]=this.h2,UA[3]=this.h3,fA},VA.prototype.base64=function(){for(var fA,UA,yA,xA="",Ee=this.array(),HA=0;HA<15;)fA=Ee[HA++],UA=Ee[HA++],yA=Ee[HA++],xA+=QA[fA>>>2]+QA[63&(fA<<4|UA>>>4)]+QA[63&(UA<<2|yA>>>6)]+QA[63&yA];return xA+(QA[(fA=Ee[HA])>>>2]+QA[fA<<4&63]+"==")},(kA.prototype=new VA).finalize=function(){if(VA.prototype.finalize.call(this),this.inner){this.inner=!1;var fA=this.array();VA.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(fA),VA.prototype.finalize.call(this)}};var hA=function(){var fA=H("hex");j&&(fA=function(fA){var xA,UA=f(8535),yA=f(6274).Buffer;return xA=yA.from&&!v.JS_MD5_NO_BUFFER_FROM?yA.from:function(HA){return new yA(HA)},function(HA){if("string"==typeof HA)return UA.createHash("md5").update(HA,"utf8").digest("hex");if(null==HA)throw new Error(I);return HA.constructor===ArrayBuffer&&(HA=new Uint8Array(HA)),dA(HA)||RA(HA)||HA.constructor===yA?UA.createHash("md5").update(xA(HA)).digest("hex"):fA(HA)}}(fA)),fA.create=function(){return new VA},fA.update=function(xA){return fA.create().update(xA)};for(var UA=0;UA"u")return!1;for(var L in window)try{if(!w["$"+L]&&g.call(window,L)&&null!==window[L]&&"object"==typeof window[L])try{tA(window[L])}catch{return!0}}catch{return!0}return!1}();t=function(P){var rA=null!==P&&"object"==typeof P,QA="[object Function]"===I.call(P),NA=N(P),oA=rA&&"[object String]"===I.call(P),uA=[];if(!rA&&!QA&&!NA)throw new TypeError("Object.keys called on a non-object");var dA=B&&QA;if(oA&&P.length>0&&!g.call(P,0))for(var RA=0;RA0)for(var nA=0;nA"u"||!aA)return tA(L);try{return tA(L)}catch{return!1}}(P),z=0;z=0&&"[object Function]"===Q.call(t.callee)),I}},6521(eA,Q,f){"use strict";var t=f(5643),g=f(2843)(),I=f(2774),N=f(5846),K=I("Array.prototype.push"),v=I("Object.prototype.propertyIsEnumerable"),B=g?N.getOwnPropertySymbols:null;eA.exports=function(tA,w){if(null==tA)throw new TypeError("target must be an object");var aA=N(tA);if(1===arguments.length)return aA;for(var AA=1;AA>>16&65535,v=0;0!==g;){g-=v=g>2e3?2e3:g;do{K=K+(N=N+t[I++]|0)|0}while(--v);N%=65521,K%=65521}return N|K<<16}},1607(eA){"use strict";eA.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},9049(eA){"use strict";var f=function Q(){for(var g,I=[],N=0;N<256;N++){g=N;for(var K=0;K<8;K++)g=1&g?3988292384^g>>>1:g>>>1;I[N]=g}return I}();eA.exports=function t(g,I,N,K){var v=f,B=K+N;g^=-1;for(var j=K;j>>8^v[255&(g^I[j])];return-1^g}},2925(eA,Q,f){"use strict";var k,t=f(2519),g=f(2367),I=f(6911),N=f(9049),K=f(6228),L=-2,HA=262;function M(_,be){return _.msg=K[be],be}function D(_){return(_<<1)-(_>4?9:0)}function X(_){for(var be=_.length;--be>=0;)_[be]=0}function YA(_){var be=_.state,Re=be.pending;Re>_.avail_out&&(Re=_.avail_out),0!==Re&&(t.arraySet(_.output,be.pending_buf,be.pending_out,Re,_.next_out),_.next_out+=Re,be.pending_out+=Re,_.total_out+=Re,_.avail_out-=Re,be.pending-=Re,0===be.pending&&(be.pending_out=0))}function KA(_,be){g._tr_flush_block(_,_.block_start>=0?_.block_start:-1,_.strstart-_.block_start,be),_.block_start=_.strstart,YA(_.strm)}function bA(_,be){_.pending_buf[_.pending++]=be}function le(_,be){_.pending_buf[_.pending++]=be>>>8&255,_.pending_buf[_.pending++]=255&be}function ve(_,be,Re,SA){var we=_.avail_in;return we>SA&&(we=SA),0===we?0:(_.avail_in-=we,t.arraySet(be,_.input,_.next_in,we,Re),1===_.state.wrap?_.adler=I(_.adler,be,we,Re):2===_.state.wrap&&(_.adler=N(_.adler,be,we,Re)),_.next_in+=we,_.total_in+=we,we)}function Ne(_,be){var we,Fe,Re=_.max_chain_length,SA=_.strstart,et=_.prev_length,Ke=_.nice_match,$e=_.strstart>_.w_size-HA?_.strstart-(_.w_size-HA):0,ht=_.window,cn=_.w_mask,at=_.prev,It=_.strstart+258,mt=ht[SA+et-1],Tt=ht[SA+et];_.prev_length>=_.good_match&&(Re>>=2),Ke>_.lookahead&&(Ke=_.lookahead);do{if(ht[(we=be)+et]===Tt&&ht[we+et-1]===mt&&ht[we]===ht[SA]&&ht[++we]===ht[SA+1]){SA+=2,we++;do{}while(ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&ht[++SA]===ht[++we]&&SAet){if(_.match_start=be,et=Fe,Fe>=Ke)break;mt=ht[SA+et-1],Tt=ht[SA+et]}}}while((be=at[be&cn])>$e&&0!==--Re);return et<=_.lookahead?et:_.lookahead}function Te(_){var Re,SA,we,Fe,et,be=_.w_size;do{if(Fe=_.window_size-_.lookahead-_.strstart,_.strstart>=be+(be-HA)){t.arraySet(_.window,_.window,be,be,0),_.match_start-=be,_.strstart-=be,_.block_start-=be,Re=SA=_.hash_size;do{we=_.head[--Re],_.head[Re]=we>=be?we-be:0}while(--SA);Re=SA=be;do{we=_.prev[--Re],_.prev[Re]=we>=be?we-be:0}while(--SA);Fe+=be}if(0===_.strm.avail_in)break;if(SA=ve(_.strm,_.window,_.strstart+_.lookahead,Fe),_.lookahead+=SA,_.lookahead+_.insert>=3)for(_.ins_h=_.window[et=_.strstart-_.insert],_.ins_h=(_.ins_h<<_.hash_shift^_.window[et+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[et+3-1])&_.hash_mask,_.prev[et&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=et,et++,_.insert--,!(_.lookahead+_.insert<3)););}while(_.lookahead=3&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,Re=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),0!==Re&&_.strstart-Re<=_.w_size-HA&&(_.match_length=Ne(_,Re)),_.match_length>=3)if(SA=g._tr_tally(_,_.strstart-_.match_start,_.match_length-3),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=3){_.match_length--;do{_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,Re=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart}while(0!==--_.match_length);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else SA=g._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(SA&&(KA(_,!1),0===_.strm.avail_out))return 1}return _.insert=_.strstart<2?_.strstart:2,4===be?(KA(_,!0),0===_.strm.avail_out?3:4):_.last_lit&&(KA(_,!1),0===_.strm.avail_out)?1:2}function oe(_,be){for(var Re,SA,we;;){if(_.lookahead=3&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,Re=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=2,0!==Re&&_.prev_length<_.max_lazy_match&&_.strstart-Re<=_.w_size-HA&&(_.match_length=Ne(_,Re),_.match_length<=5&&(1===_.strategy||3===_.match_length&&_.strstart-_.match_start>4096)&&(_.match_length=2)),_.prev_length>=3&&_.match_length<=_.prev_length){we=_.strstart+_.lookahead-3,SA=g._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-3),_.lookahead-=_.prev_length-1,_.prev_length-=2;do{++_.strstart<=we&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,Re=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart)}while(0!==--_.prev_length);if(_.match_available=0,_.match_length=2,_.strstart++,SA&&(KA(_,!1),0===_.strm.avail_out))return 1}else if(_.match_available){if((SA=g._tr_tally(_,0,_.window[_.strstart-1]))&&KA(_,!1),_.strstart++,_.lookahead--,0===_.strm.avail_out)return 1}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(SA=g._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<2?_.strstart:2,4===be?(KA(_,!0),0===_.strm.avail_out?3:4):_.last_lit&&(KA(_,!1),0===_.strm.avail_out)?1:2}function Y(_,be,Re,SA,we){this.good_length=_,this.max_lazy=be,this.nice_length=Re,this.max_chain=SA,this.func=we}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(1146),this.dyn_dtree=new t.Buf16(122),this.bl_tree=new t.Buf16(78),X(this.dyn_ltree),X(this.dyn_dtree),X(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(16),this.heap=new t.Buf16(573),X(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(573),X(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function mA(_){var be;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=2,(be=_.state).pending=0,be.pending_out=0,be.wrap<0&&(be.wrap=-be.wrap),be.status=be.wrap?42:113,_.adler=2===be.wrap?0:1,be.last_flush=0,g._tr_init(be),0):M(_,L)}function ie(_){var be=mA(_);return 0===be&&function m(_){_.window_size=2*_.w_size,X(_.head),_.max_lazy_match=k[_.level].max_lazy,_.good_match=k[_.level].good_length,_.nice_match=k[_.level].nice_length,_.max_chain_length=k[_.level].max_chain,_.strstart=0,_.block_start=0,_.lookahead=0,_.insert=0,_.match_length=_.prev_length=2,_.match_available=0,_.ins_h=0}(_.state),be}function Ae(_,be,Re,SA,we,Fe){if(!_)return L;var et=1;if(-1===be&&(be=6),SA<0?(et=0,SA=-SA):SA>15&&(et=2,SA-=16),we<1||we>9||8!==Re||SA<8||SA>15||be<0||be>9||Fe<0||Fe>4)return M(_,L);8===SA&&(SA=9);var Ke=new E;return _.state=Ke,Ke.strm=_,Ke.wrap=et,Ke.gzhead=null,Ke.w_bits=SA,Ke.w_size=1<_.pending_buf_size-5&&(Re=_.pending_buf_size-5);;){if(_.lookahead<=1){if(Te(_),0===_.lookahead&&0===be)return 1;if(0===_.lookahead)break}_.strstart+=_.lookahead,_.lookahead=0;var SA=_.block_start+Re;if((0===_.strstart||_.strstart>=SA)&&(_.lookahead=_.strstart-SA,_.strstart=SA,KA(_,!1),0===_.strm.avail_out)||_.strstart-_.block_start>=_.w_size-HA&&(KA(_,!1),0===_.strm.avail_out))return 1}return _.insert=0,4===be?(KA(_,!0),0===_.strm.avail_out?3:4):(_.strstart>_.block_start&&KA(_,!1),1)}),new Y(4,4,8,4,Oe),new Y(4,5,16,8,Oe),new Y(4,6,32,32,Oe),new Y(4,4,16,16,oe),new Y(8,16,32,32,oe),new Y(8,16,128,128,oe),new Y(8,32,128,256,oe),new Y(32,128,258,1024,oe),new Y(32,258,258,4096,oe)],Q.deflateInit=function pe(_,be){return Ae(_,be,8,15,8,0)},Q.deflateInit2=Ae,Q.deflateReset=ie,Q.deflateResetKeep=mA,Q.deflateSetHeader=function DA(_,be){return _&&_.state&&2===_.state.wrap?(_.state.gzhead=be,0):L},Q.deflate=function MA(_,be){var Re,SA,we,Fe;if(!_||!_.state||be>5||be<0)return _?M(_,L):L;if(SA=_.state,!_.output||!_.input&&0!==_.avail_in||666===SA.status&&4!==be)return M(_,0===_.avail_out?-5:L);if(SA.strm=_,Re=SA.last_flush,SA.last_flush=be,42===SA.status)if(2===SA.wrap)_.adler=0,bA(SA,31),bA(SA,139),bA(SA,8),SA.gzhead?(bA(SA,(SA.gzhead.text?1:0)+(SA.gzhead.hcrc?2:0)+(SA.gzhead.extra?4:0)+(SA.gzhead.name?8:0)+(SA.gzhead.comment?16:0)),bA(SA,255&SA.gzhead.time),bA(SA,SA.gzhead.time>>8&255),bA(SA,SA.gzhead.time>>16&255),bA(SA,SA.gzhead.time>>24&255),bA(SA,9===SA.level?2:SA.strategy>=2||SA.level<2?4:0),bA(SA,255&SA.gzhead.os),SA.gzhead.extra&&SA.gzhead.extra.length&&(bA(SA,255&SA.gzhead.extra.length),bA(SA,SA.gzhead.extra.length>>8&255)),SA.gzhead.hcrc&&(_.adler=N(_.adler,SA.pending_buf,SA.pending,0)),SA.gzindex=0,SA.status=69):(bA(SA,0),bA(SA,0),bA(SA,0),bA(SA,0),bA(SA,0),bA(SA,9===SA.level?2:SA.strategy>=2||SA.level<2?4:0),bA(SA,3),SA.status=113);else{var et=8+(SA.w_bits-8<<4)<<8;et|=(SA.strategy>=2||SA.level<2?0:SA.level<6?1:6===SA.level?2:3)<<6,0!==SA.strstart&&(et|=32),et+=31-et%31,SA.status=113,le(SA,et),0!==SA.strstart&&(le(SA,_.adler>>>16),le(SA,65535&_.adler)),_.adler=1}if(69===SA.status)if(SA.gzhead.extra){for(we=SA.pending;SA.gzindex<(65535&SA.gzhead.extra.length)&&(SA.pending!==SA.pending_buf_size||(SA.gzhead.hcrc&&SA.pending>we&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),YA(_),we=SA.pending,SA.pending!==SA.pending_buf_size));)bA(SA,255&SA.gzhead.extra[SA.gzindex]),SA.gzindex++;SA.gzhead.hcrc&&SA.pending>we&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),SA.gzindex===SA.gzhead.extra.length&&(SA.gzindex=0,SA.status=73)}else SA.status=73;if(73===SA.status)if(SA.gzhead.name){we=SA.pending;do{if(SA.pending===SA.pending_buf_size&&(SA.gzhead.hcrc&&SA.pending>we&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),YA(_),we=SA.pending,SA.pending===SA.pending_buf_size)){Fe=1;break}Fe=SA.gzindexwe&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),0===Fe&&(SA.gzindex=0,SA.status=91)}else SA.status=91;if(91===SA.status)if(SA.gzhead.comment){we=SA.pending;do{if(SA.pending===SA.pending_buf_size&&(SA.gzhead.hcrc&&SA.pending>we&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),YA(_),we=SA.pending,SA.pending===SA.pending_buf_size)){Fe=1;break}Fe=SA.gzindexwe&&(_.adler=N(_.adler,SA.pending_buf,SA.pending-we,we)),0===Fe&&(SA.status=103)}else SA.status=103;if(103===SA.status&&(SA.gzhead.hcrc?(SA.pending+2>SA.pending_buf_size&&YA(_),SA.pending+2<=SA.pending_buf_size&&(bA(SA,255&_.adler),bA(SA,_.adler>>8&255),_.adler=0,SA.status=113)):SA.status=113),0!==SA.pending){if(YA(_),0===_.avail_out)return SA.last_flush=-1,0}else if(0===_.avail_in&&D(be)<=D(Re)&&4!==be)return M(_,-5);if(666===SA.status&&0!==_.avail_in)return M(_,-5);if(0!==_.avail_in||0!==SA.lookahead||0!==be&&666!==SA.status){var $e=2===SA.strategy?function S(_,be){for(var Re;;){if(0===_.lookahead&&(Te(_),0===_.lookahead)){if(0===be)return 1;break}if(_.match_length=0,Re=g._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++,Re&&(KA(_,!1),0===_.strm.avail_out))return 1}return _.insert=0,4===be?(KA(_,!0),0===_.strm.avail_out?3:4):_.last_lit&&(KA(_,!1),0===_.strm.avail_out)?1:2}(SA,be):3===SA.strategy?function sA(_,be){for(var Re,SA,we,Fe,et=_.window;;){if(_.lookahead<=258){if(Te(_),_.lookahead<=258&&0===be)return 1;if(0===_.lookahead)break}if(_.match_length=0,_.lookahead>=3&&_.strstart>0&&(SA=et[we=_.strstart-1])===et[++we]&&SA===et[++we]&&SA===et[++we]){Fe=_.strstart+258;do{}while(SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&SA===et[++we]&&we_.lookahead&&(_.match_length=_.lookahead)}if(_.match_length>=3?(Re=g._tr_tally(_,1,_.match_length-3),_.lookahead-=_.match_length,_.strstart+=_.match_length,_.match_length=0):(Re=g._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++),Re&&(KA(_,!1),0===_.strm.avail_out))return 1}return _.insert=0,4===be?(KA(_,!0),0===_.strm.avail_out?3:4):_.last_lit&&(KA(_,!1),0===_.strm.avail_out)?1:2}(SA,be):k[SA.level].func(SA,be);if((3===$e||4===$e)&&(SA.status=666),1===$e||3===$e)return 0===_.avail_out&&(SA.last_flush=-1),0;if(2===$e&&(1===be?g._tr_align(SA):5!==be&&(g._tr_stored_block(SA,0,0,!1),3===be&&(X(SA.head),0===SA.lookahead&&(SA.strstart=0,SA.block_start=0,SA.insert=0))),YA(_),0===_.avail_out))return SA.last_flush=-1,0}return 4!==be?0:SA.wrap<=0?1:(2===SA.wrap?(bA(SA,255&_.adler),bA(SA,_.adler>>8&255),bA(SA,_.adler>>16&255),bA(SA,_.adler>>24&255),bA(SA,255&_.total_in),bA(SA,_.total_in>>8&255),bA(SA,_.total_in>>16&255),bA(SA,_.total_in>>24&255)):(le(SA,_.adler>>>16),le(SA,65535&_.adler)),YA(_),SA.wrap>0&&(SA.wrap=-SA.wrap),0!==SA.pending?0:1)},Q.deflateEnd=function Pe(_){var be;return _&&_.state?42!==(be=_.state.status)&&69!==be&&73!==be&&91!==be&&103!==be&&113!==be&&666!==be?M(_,L):(_.state=null,113===be?M(_,-3):0):L},Q.deflateSetDictionary=function At(_,be){var SA,we,Fe,et,Ke,$e,ht,cn,Re=be.length;if(!_||!_.state||2===(et=(SA=_.state).wrap)||1===et&&42!==SA.status||SA.lookahead)return L;for(1===et&&(_.adler=I(_.adler,be,Re,0)),SA.wrap=0,Re>=SA.w_size&&(0===et&&(X(SA.head),SA.strstart=0,SA.block_start=0,SA.insert=0),cn=new t.Buf8(SA.w_size),t.arraySet(cn,be,Re-SA.w_size,SA.w_size,0),be=cn,Re=SA.w_size),Ke=_.avail_in,$e=_.next_in,ht=_.input,_.avail_in=Re,_.next_in=0,_.input=be,Te(SA);SA.lookahead>=3;){we=SA.strstart,Fe=SA.lookahead-2;do{SA.ins_h=(SA.ins_h<>>=nA=RA>>>24,QA-=nA,0==(nA=RA>>>16&255))VA[B++]=65535&RA;else{if(!(16&nA)){if(64&nA){if(32&nA){N.mode=12;break A}g.msg="invalid literal/length code",N.mode=30;break A}RA=NA[(65535&RA)+(rA&(1<>>=nA,QA-=nA),QA<15&&(rA+=wA[K++]<>>=nA=RA>>>24,QA-=nA,16&(nA=RA>>>16&255)){if(pA=65535&RA,QA<(nA&=15)&&(rA+=wA[K++]<w){g.msg="invalid distance too far back",N.mode=30;break A}if(rA>>>=nA,QA-=nA,pA>(nA=B-j)){if((nA=pA-nA)>AA&&N.sane){g.msg="invalid distance too far back",N.mode=30;break A}if(z=0,OA=P,0===L){if(z+=aA-nA,nA2;)VA[B++]=OA[z++],VA[B++]=OA[z++],VA[B++]=OA[z++],H-=3;H&&(VA[B++]=OA[z++],H>1&&(VA[B++]=OA[z++]))}else{z=B-pA;do{VA[B++]=VA[z++],VA[B++]=VA[z++],VA[B++]=VA[z++],H-=3}while(H>2);H&&(VA[B++]=VA[z++],H>1&&(VA[B++]=VA[z++]))}break}if(64&nA){g.msg="invalid distance code",N.mode=30;break A}RA=oA[(65535&RA)+(rA&(1<>3)<<3))-1,g.next_in=K-=H,g.next_out=B,g.avail_in=K>>24&255)+(Ae>>>8&65280)+((65280&Ae)<<8)+((255&Ae)<<24)}function ve(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ne(Ae){var pe;return Ae&&Ae.state?(Ae.total_in=Ae.total_out=(pe=Ae.state).total=0,Ae.msg="",pe.wrap&&(Ae.adler=1&pe.wrap),pe.mode=1,pe.last=0,pe.havedict=0,pe.dmax=32768,pe.head=null,pe.hold=0,pe.bits=0,pe.lencode=pe.lendyn=new t.Buf32(852),pe.distcode=pe.distdyn=new t.Buf32(592),pe.sane=1,pe.back=-1,0):-2}function Te(Ae){var pe;return Ae&&Ae.state?((pe=Ae.state).wsize=0,pe.whave=0,pe.wnext=0,Ne(Ae)):-2}function ze(Ae,pe){var MA,Pe;return!Ae||!Ae.state||(Pe=Ae.state,pe<0?(MA=0,pe=-pe):(MA=1+(pe>>4),pe<48&&(pe&=15)),pe&&(pe<8||pe>15))?-2:(null!==Pe.window&&Pe.wbits!==pe&&(Pe.window=null),Pe.wrap=MA,Pe.wbits=pe,Te(Ae))}function Oe(Ae,pe){var MA,Pe;return Ae?(Pe=new ve,Ae.state=Pe,Pe.window=null,0!==(MA=ze(Ae,pe))&&(Ae.state=null),MA):-2}var S,Y,sA=!0;function k(Ae){if(sA){var pe;for(S=new t.Buf32(512),Y=new t.Buf32(32),pe=0;pe<144;)Ae.lens[pe++]=8;for(;pe<256;)Ae.lens[pe++]=9;for(;pe<280;)Ae.lens[pe++]=7;for(;pe<288;)Ae.lens[pe++]=8;for(K(1,Ae.lens,0,288,S,0,Ae.work,{bits:9}),pe=0;pe<32;)Ae.lens[pe++]=5;K(2,Ae.lens,0,32,Y,0,Ae.work,{bits:5}),sA=!1}Ae.lencode=S,Ae.lenbits=9,Ae.distcode=Y,Ae.distbits=5}function m(Ae,pe,MA,Pe){var At,_=Ae.state;return null===_.window&&(_.wsize=1<<_.wbits,_.wnext=0,_.whave=0,_.window=new t.Buf8(_.wsize)),Pe>=_.wsize?(t.arraySet(_.window,pe,MA-_.wsize,_.wsize,0),_.wnext=0,_.whave=_.wsize):((At=_.wsize-_.wnext)>Pe&&(At=Pe),t.arraySet(_.window,pe,MA-Pe,At,_.wnext),(Pe-=At)?(t.arraySet(_.window,pe,MA-Pe,Pe,0),_.wnext=Pe,_.whave=_.wsize):(_.wnext+=At,_.wnext===_.wsize&&(_.wnext=0),_.whave<_.wsize&&(_.whave+=At))),0}Q.inflateReset=Te,Q.inflateReset2=ze,Q.inflateResetKeep=Ne,Q.inflateInit=function oe(Ae){return Oe(Ae,15)},Q.inflateInit2=Oe,Q.inflate=function E(Ae,pe){var MA,Pe,At,_,be,Re,SA,we,Fe,et,Ke,$e,ht,cn,It,mt,Tt,Lt,Qn,pn,Gt,Mt,bt,Dt,at=0,Ot=new t.Buf8(4),Ze=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ae||!Ae.state||!Ae.output||!Ae.input&&0!==Ae.avail_in)return-2;12===(MA=Ae.state).mode&&(MA.mode=13),be=Ae.next_out,At=Ae.output,_=Ae.next_in,Pe=Ae.input,we=MA.hold,Fe=MA.bits,et=Re=Ae.avail_in,Ke=SA=Ae.avail_out,Mt=0;A:for(;;)switch(MA.mode){case 1:if(0===MA.wrap){MA.mode=13;break}for(;Fe<16;){if(0===Re)break A;Re--,we+=Pe[_++]<>>8&255,MA.check=I(MA.check,Ot,2,0),we=0,Fe=0,MA.mode=2;break}if(MA.flags=0,MA.head&&(MA.head.done=!1),!(1&MA.wrap)||(((255&we)<<8)+(we>>8))%31){Ae.msg="incorrect header check",MA.mode=R;break}if(8!=(15&we)){Ae.msg="unknown compression method",MA.mode=R;break}if(Fe-=4,Gt=8+(15&(we>>>=4)),0===MA.wbits)MA.wbits=Gt;else if(Gt>MA.wbits){Ae.msg="invalid window size",MA.mode=R;break}MA.dmax=1<>8&1),512&MA.flags&&(Ot[0]=255&we,Ot[1]=we>>>8&255,MA.check=I(MA.check,Ot,2,0)),we=0,Fe=0,MA.mode=3;case 3:for(;Fe<32;){if(0===Re)break A;Re--,we+=Pe[_++]<>>8&255,Ot[2]=we>>>16&255,Ot[3]=we>>>24&255,MA.check=I(MA.check,Ot,4,0)),we=0,Fe=0,MA.mode=4;case 4:for(;Fe<16;){if(0===Re)break A;Re--,we+=Pe[_++]<>8),512&MA.flags&&(Ot[0]=255&we,Ot[1]=we>>>8&255,MA.check=I(MA.check,Ot,2,0)),we=0,Fe=0,MA.mode=5;case 5:if(1024&MA.flags){for(;Fe<16;){if(0===Re)break A;Re--,we+=Pe[_++]<>>8&255,MA.check=I(MA.check,Ot,2,0)),we=0,Fe=0}else MA.head&&(MA.head.extra=null);MA.mode=6;case 6:if(1024&MA.flags&&(($e=MA.length)>Re&&($e=Re),$e&&(MA.head&&(Gt=MA.head.extra_len-MA.length,MA.head.extra||(MA.head.extra=new Array(MA.head.extra_len)),t.arraySet(MA.head.extra,Pe,_,$e,Gt)),512&MA.flags&&(MA.check=I(MA.check,Pe,$e,_)),Re-=$e,_+=$e,MA.length-=$e),MA.length))break A;MA.length=0,MA.mode=7;case 7:if(2048&MA.flags){if(0===Re)break A;$e=0;do{Gt=Pe[_+$e++],MA.head&&Gt&&MA.length<65536&&(MA.head.name+=String.fromCharCode(Gt))}while(Gt&&$e>9&1,MA.head.done=!0),Ae.adler=MA.check=0,MA.mode=12;break;case 10:for(;Fe<32;){if(0===Re)break A;Re--,we+=Pe[_++]<>>=7&Fe,Fe-=7&Fe,MA.mode=27;break}for(;Fe<3;){if(0===Re)break A;Re--,we+=Pe[_++]<>>=1)){case 0:MA.mode=14;break;case 1:if(k(MA),MA.mode=20,6===pe){we>>>=2,Fe-=2;break A}break;case 2:MA.mode=17;break;case 3:Ae.msg="invalid block type",MA.mode=R}we>>>=2,Fe-=2;break;case 14:for(we>>>=7&Fe,Fe-=7&Fe;Fe<32;){if(0===Re)break A;Re--,we+=Pe[_++]<>>16^65535)){Ae.msg="invalid stored block lengths",MA.mode=R;break}if(MA.length=65535&we,we=0,Fe=0,MA.mode=15,6===pe)break A;case 15:MA.mode=16;case 16:if($e=MA.length){if($e>Re&&($e=Re),$e>SA&&($e=SA),0===$e)break A;t.arraySet(At,Pe,_,$e,be),Re-=$e,_+=$e,SA-=$e,be+=$e,MA.length-=$e;break}MA.mode=12;break;case 17:for(;Fe<14;){if(0===Re)break A;Re--,we+=Pe[_++]<>>=5)),Fe-=5,MA.ncode=4+(15&(we>>>=5)),we>>>=4,Fe-=4,MA.nlen>286||MA.ndist>30){Ae.msg="too many length or distance symbols",MA.mode=R;break}MA.have=0,MA.mode=18;case 18:for(;MA.have>>=3,Fe-=3}for(;MA.have<19;)MA.lens[Ze[MA.have++]]=0;if(MA.lencode=MA.lendyn,MA.lenbits=7,Mt=K(0,MA.lens,0,19,MA.lencode,0,MA.work,bt={bits:MA.lenbits}),MA.lenbits=bt.bits,Mt){Ae.msg="invalid code lengths set",MA.mode=R;break}MA.have=0,MA.mode=19;case 19:for(;MA.have>>16&255,Tt=65535&at,!((It=at>>>24)<=Fe);){if(0===Re)break A;Re--,we+=Pe[_++]<>>=It,Fe-=It,MA.lens[MA.have++]=Tt;else{if(16===Tt){for(Dt=It+2;Fe>>=It,Fe-=It,0===MA.have){Ae.msg="invalid bit length repeat",MA.mode=R;break}Gt=MA.lens[MA.have-1],$e=3+(3&we),we>>>=2,Fe-=2}else if(17===Tt){for(Dt=It+3;Fe>>=It)),we>>>=3,Fe-=3}else{for(Dt=It+7;Fe>>=It)),we>>>=7,Fe-=7}if(MA.have+$e>MA.nlen+MA.ndist){Ae.msg="invalid bit length repeat",MA.mode=R;break}for(;$e--;)MA.lens[MA.have++]=Gt}}if(MA.mode===R)break;if(0===MA.lens[256]){Ae.msg="invalid code -- missing end-of-block",MA.mode=R;break}if(MA.lenbits=9,Mt=K(1,MA.lens,0,MA.nlen,MA.lencode,0,MA.work,bt={bits:MA.lenbits}),MA.lenbits=bt.bits,Mt){Ae.msg="invalid literal/lengths set",MA.mode=R;break}if(MA.distbits=6,MA.distcode=MA.distdyn,Mt=K(2,MA.lens,MA.nlen,MA.ndist,MA.distcode,0,MA.work,bt={bits:MA.distbits}),MA.distbits=bt.bits,Mt){Ae.msg="invalid distances set",MA.mode=R;break}if(MA.mode=20,6===pe)break A;case 20:MA.mode=21;case 21:if(Re>=6&&SA>=258){Ae.next_out=be,Ae.avail_out=SA,Ae.next_in=_,Ae.avail_in=Re,MA.hold=we,MA.bits=Fe,N(Ae,Ke),be=Ae.next_out,At=Ae.output,SA=Ae.avail_out,_=Ae.next_in,Pe=Ae.input,Re=Ae.avail_in,we=MA.hold,Fe=MA.bits,12===MA.mode&&(MA.back=-1);break}for(MA.back=0;mt=(at=MA.lencode[we&(1<>>16&255,Tt=65535&at,!((It=at>>>24)<=Fe);){if(0===Re)break A;Re--,we+=Pe[_++]<>Lt)])>>>16&255,Tt=65535&at,!(Lt+(It=at>>>24)<=Fe);){if(0===Re)break A;Re--,we+=Pe[_++]<>>=Lt,Fe-=Lt,MA.back+=Lt}if(we>>>=It,Fe-=It,MA.back+=It,MA.length=Tt,0===mt){MA.mode=26;break}if(32&mt){MA.back=-1,MA.mode=12;break}if(64&mt){Ae.msg="invalid literal/length code",MA.mode=R;break}MA.extra=15&mt,MA.mode=22;case 22:if(MA.extra){for(Dt=MA.extra;Fe>>=MA.extra,Fe-=MA.extra,MA.back+=MA.extra}MA.was=MA.length,MA.mode=23;case 23:for(;mt=(at=MA.distcode[we&(1<>>16&255,Tt=65535&at,!((It=at>>>24)<=Fe);){if(0===Re)break A;Re--,we+=Pe[_++]<>Lt)])>>>16&255,Tt=65535&at,!(Lt+(It=at>>>24)<=Fe);){if(0===Re)break A;Re--,we+=Pe[_++]<>>=Lt,Fe-=Lt,MA.back+=Lt}if(we>>>=It,Fe-=It,MA.back+=It,64&mt){Ae.msg="invalid distance code",MA.mode=R;break}MA.offset=Tt,MA.extra=15&mt,MA.mode=24;case 24:if(MA.extra){for(Dt=MA.extra;Fe>>=MA.extra,Fe-=MA.extra,MA.back+=MA.extra}if(MA.offset>MA.dmax){Ae.msg="invalid distance too far back",MA.mode=R;break}MA.mode=25;case 25:if(0===SA)break A;if(MA.offset>($e=Ke-SA)){if(($e=MA.offset-$e)>MA.whave&&MA.sane){Ae.msg="invalid distance too far back",MA.mode=R;break}ht=$e>MA.wnext?MA.wsize-($e-=MA.wnext):MA.wnext-$e,$e>MA.length&&($e=MA.length),cn=MA.window}else cn=At,ht=be-MA.offset,$e=MA.length;$e>SA&&($e=SA),SA-=$e,MA.length-=$e;do{At[be++]=cn[ht++]}while(--$e);0===MA.length&&(MA.mode=21);break;case 26:if(0===SA)break A;At[be++]=MA.length,SA--,MA.mode=21;break;case 27:if(MA.wrap){for(;Fe<32;){if(0===Re)break A;Re--,we|=Pe[_++]<=1&&0===O[z];z--);if(OA>z&&(OA=z),0===z)return NA[oA++]=20971520,NA[oA++]=20971520,dA.bits=1,0;for(pA=1;pA0&&(0===L||1!==z))return-1;for(lA[1]=0,nA=1;nA<15;nA++)lA[nA+1]=lA[nA]+O[nA];for(H=0;H852||2===L&&hA>592)return 1;for(;;){$A=nA-VA,uA[H]U?(IA=LA[JA+uA[H]],gA=cA[J+uA[H]]):(IA=96,gA=0),UA=1<>VA)+(yA-=UA)]=$A<<24|IA<<16|gA}while(0!==yA);for(UA=1<>=1;if(0!==UA?(fA&=UA-1,fA+=UA):fA=0,H++,0===--O[nA]){if(nA===z)break;nA=P[rA+uA[H]]}if(nA>OA&&(fA&Ee)!==xA){for(0===VA&&(VA=OA),HA+=pA,kA=1<<(wA=nA-VA);wA+VA852||2===L&&hA>592)return 1;NA[xA=fA&Ee]=OA<<24|wA<<16|HA-oA}}return 0!==fA&&(NA[HA+fA]=4194304|nA-VA<<24),dA.bits=OA,0}},6228(eA){"use strict";eA.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},2367(eA,Q,f){"use strict";var t=f(2519);function v(E){for(var mA=E.length;--mA>=0;)E[mA]=0}var z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],OA=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],VA=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hA=new Array(576);v(hA);var fA=new Array(60);v(fA);var UA=new Array(512);v(UA);var yA=new Array(256);v(yA);var xA=new Array(29);v(xA);var cA,J,U,Ee=new Array(30);function HA(E,mA,ie,DA,Ae){this.static_tree=E,this.extra_bits=mA,this.extra_base=ie,this.elems=DA,this.max_length=Ae,this.has_stree=E&&E.length}function O(E,mA){this.dyn_tree=E,this.max_code=0,this.stat_desc=mA}function lA(E){return E<256?UA[E]:UA[256+(E>>>7)]}function LA(E,mA){E.pending_buf[E.pending++]=255&mA,E.pending_buf[E.pending++]=mA>>>8&255}function JA(E,mA,ie){E.bi_valid>16-ie?(E.bi_buf|=mA<>16-E.bi_valid,E.bi_valid+=ie-16):(E.bi_buf|=mA<>>=1,ie<<=1}while(--mA>0);return ie>>>1}function b(E,mA,ie){var pe,MA,DA=new Array(16),Ae=0;for(pe=1;pe<=15;pe++)DA[pe]=Ae=Ae+ie[pe-1]<<1;for(MA=0;MA<=mA;MA++){var Pe=E[2*MA+1];0!==Pe&&(E[2*MA]=IA(DA[Pe]++,Pe))}}function M(E){var mA;for(mA=0;mA<286;mA++)E.dyn_ltree[2*mA]=0;for(mA=0;mA<30;mA++)E.dyn_dtree[2*mA]=0;for(mA=0;mA<19;mA++)E.bl_tree[2*mA]=0;E.dyn_ltree[512]=1,E.opt_len=E.static_len=0,E.last_lit=E.matches=0}function D(E){E.bi_valid>8?LA(E,E.bi_buf):E.bi_valid>0&&(E.pending_buf[E.pending++]=E.bi_buf),E.bi_buf=0,E.bi_valid=0}function YA(E,mA,ie,DA){var Ae=2*mA,pe=2*ie;return E[Ae]>1;MA>=1;MA--)KA(E,ie,MA);_=pe;do{MA=E.heap[1],E.heap[1]=E.heap[E.heap_len--],KA(E,ie,1),Pe=E.heap[1],E.heap[--E.heap_max]=MA,E.heap[--E.heap_max]=Pe,ie[2*_]=ie[2*MA]+ie[2*Pe],E.depth[_]=(E.depth[MA]>=E.depth[Pe]?E.depth[MA]:E.depth[Pe])+1,ie[2*MA+1]=ie[2*Pe+1]=_,E.heap[1]=_++,KA(E,ie,1)}while(E.heap_len>=2);E.heap[--E.heap_max]=E.heap[1],function C(E,mA){var _,be,Re,SA,we,Fe,ie=mA.dyn_tree,DA=mA.max_code,Ae=mA.stat_desc.static_tree,pe=mA.stat_desc.has_stree,MA=mA.stat_desc.extra_bits,Pe=mA.stat_desc.extra_base,At=mA.stat_desc.max_length,et=0;for(SA=0;SA<=15;SA++)E.bl_count[SA]=0;for(ie[2*E.heap[E.heap_max]+1]=0,_=E.heap_max+1;_<573;_++)(SA=ie[2*ie[2*(be=E.heap[_])+1]+1]+1)>At&&(SA=At,et++),ie[2*be+1]=SA,!(be>DA)&&(E.bl_count[SA]++,we=0,be>=Pe&&(we=MA[be-Pe]),E.opt_len+=(Fe=ie[2*be])*(SA+we),pe&&(E.static_len+=Fe*(Ae[2*be+1]+we)));if(0!==et){do{for(SA=At-1;0===E.bl_count[SA];)SA--;E.bl_count[SA]--,E.bl_count[SA+1]+=2,E.bl_count[At]--,et-=2}while(et>0);for(SA=At;0!==SA;SA--)for(be=E.bl_count[SA];0!==be;)!((Re=E.heap[--_])>DA)&&(ie[2*Re+1]!==SA&&(E.opt_len+=(SA-ie[2*Re+1])*ie[2*Re],ie[2*Re+1]=SA),be--)}}(E,mA),b(ie,At,E.bl_count)}function ve(E,mA,ie){var DA,pe,Ae=-1,MA=mA[1],Pe=0,At=7,_=4;for(0===MA&&(At=138,_=3),mA[2*(ie+1)+1]=65535,DA=0;DA<=ie;DA++)pe=MA,MA=mA[2*(DA+1)+1],!(++Pe>=7;DA<30;DA++)for(Ee[DA]=Ae<<7,E=0;E<1<0?(2===E.strm.data_type&&(E.strm.data_type=function Oe(E){var ie,mA=4093624447;for(ie=0;ie<=31;ie++,mA>>>=1)if(1&mA&&0!==E.dyn_ltree[2*ie])return 0;if(0!==E.dyn_ltree[18]||0!==E.dyn_ltree[20]||0!==E.dyn_ltree[26])return 1;for(ie=32;ie<256;ie++)if(0!==E.dyn_ltree[2*ie])return 1;return 0}(E)),le(E,E.l_desc),le(E,E.d_desc),MA=function Te(E){var mA;for(ve(E,E.dyn_ltree,E.l_desc.max_code),ve(E,E.dyn_dtree,E.d_desc.max_code),le(E,E.bl_desc),mA=18;mA>=3&&0===E.bl_tree[2*VA[mA]+1];mA--);return E.opt_len+=3*(mA+1)+5+5+4,mA}(E),(pe=E.static_len+3+7>>>3)<=(Ae=E.opt_len+3+7>>>3)&&(Ae=pe)):Ae=pe=ie+5,ie+4<=Ae&&-1!==mA?S(E,mA,ie,DA):4===E.strategy||pe===Ae?(JA(E,2+(DA?1:0),3),bA(E,hA,fA)):(JA(E,4+(DA?1:0),3),function ze(E,mA,ie,DA){var Ae;for(JA(E,mA-257,5),JA(E,ie-1,5),JA(E,DA-4,4),Ae=0;Ae>>8&255,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&mA,E.pending_buf[E.l_buf+E.last_lit]=255&ie,E.last_lit++,0===mA?E.dyn_ltree[2*ie]++:(E.matches++,mA--,E.dyn_ltree[2*(yA[ie]+256+1)]++,E.dyn_dtree[2*lA(mA)]++),E.last_lit===E.lit_bufsize-1},Q._tr_align=function Y(E){JA(E,2,3),$A(E,256,hA),function gA(E){16===E.bi_valid?(LA(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):E.bi_valid>=8&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)}(E)}},7468(eA){"use strict";eA.exports=function Q(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},884(eA){"use strict";eA.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},9964(eA){var f,t,Q=eA.exports={};function g(){throw new Error("setTimeout has not been defined")}function I(){throw new Error("clearTimeout has not been defined")}function N(P){if(f===setTimeout)return setTimeout(P,0);if((f===g||!f)&&setTimeout)return f=setTimeout,setTimeout(P,0);try{return f(P,0)}catch{try{return f.call(null,P,0)}catch{return f.call(this,P,0)}}}!function(){try{f="function"==typeof setTimeout?setTimeout:g}catch{f=g}try{t="function"==typeof clearTimeout?clearTimeout:I}catch{t=I}}();var j,v=[],B=!1,tA=-1;function w(){!B||!j||(B=!1,j.length?v=j.concat(v):tA=-1,v.length&&aA())}function aA(){if(!B){var P=N(w);B=!0;for(var rA=v.length;rA;){for(j=v,v=[];++tA1)for(var QA=1;QA"===X?(xA(M,"onsgmldeclaration",M.sgmlDecl),M.sgmlDecl="",M.state=wA.TEXT):(H(X)&&(M.state=wA.SGML_DECL_QUOTED),M.sgmlDecl+=X);continue;case wA.SGML_DECL_QUOTED:X===M.q&&(M.state=wA.SGML_DECL,M.q=""),M.sgmlDecl+=X;continue;case wA.DOCTYPE:">"===X?(M.state=wA.TEXT,xA(M,"ondoctype",M.doctype),M.doctype=!0):(M.doctype+=X,"["===X?M.state=wA.DOCTYPE_DTD:H(X)&&(M.state=wA.DOCTYPE_QUOTED,M.q=X));continue;case wA.DOCTYPE_QUOTED:M.doctype+=X,X===M.q&&(M.q="",M.state=wA.DOCTYPE);continue;case wA.DOCTYPE_DTD:"]"===X?(M.doctype+=X,M.state=wA.DOCTYPE):"<"===X?(M.state=wA.OPEN_WAKA,M.startTagPosition=M.position):H(X)?(M.doctype+=X,M.state=wA.DOCTYPE_DTD_QUOTED,M.q=X):M.doctype+=X;continue;case wA.DOCTYPE_DTD_QUOTED:M.doctype+=X,X===M.q&&(M.state=wA.DOCTYPE_DTD,M.q="");continue;case wA.COMMENT:"-"===X?M.state=wA.COMMENT_ENDING:M.comment+=X;continue;case wA.COMMENT_ENDING:"-"===X?(M.state=wA.COMMENT_ENDED,M.comment=HA(M.opt,M.comment),M.comment&&xA(M,"oncomment",M.comment),M.comment=""):(M.comment+="-"+X,M.state=wA.COMMENT);continue;case wA.COMMENT_ENDED:">"!==X?(U(M,"Malformed comment"),M.comment+="--"+X,M.state=wA.COMMENT):M.state=M.doctype&&!0!==M.doctype?wA.DOCTYPE_DTD:wA.TEXT;continue;case wA.CDATA:for(KA=D-1;X&&"]"!==X;)(X=C(R,D++))&&M.trackPosition&&(M.position++,"\n"===X?(M.line++,M.column=0):M.column++);M.cdata+=R.substring(KA,D-1),"]"===X&&(M.state=wA.CDATA_ENDING);continue;case wA.CDATA_ENDING:"]"===X?M.state=wA.CDATA_ENDING_2:(M.cdata+="]"+X,M.state=wA.CDATA);continue;case wA.CDATA_ENDING_2:">"===X?(M.cdata&&xA(M,"oncdata",M.cdata),xA(M,"onclosecdata"),M.cdata="",M.state=wA.TEXT):"]"===X?M.cdata+="]":(M.cdata+="]]"+X,M.state=wA.CDATA);continue;case wA.PROC_INST:"?"===X?M.state=wA.PROC_INST_ENDING:nA(X)?M.state=wA.PROC_INST_BODY:M.procInstName+=X;continue;case wA.PROC_INST_BODY:if(!M.procInstBody&&nA(X))continue;"?"===X?M.state=wA.PROC_INST_ENDING:M.procInstBody+=X;continue;case wA.PROC_INST_ENDING:if(">"===X){const Ne={name:M.procInstName,body:M.procInstBody};yA(M,Ne),xA(M,"onprocessinginstruction",Ne),M.procInstName=M.procInstBody="",M.state=wA.TEXT}else M.procInstBody+="?"+X,M.state=wA.PROC_INST_BODY;continue;case wA.OPEN_TAG:z(uA,X)?M.tagName+=X:(O(M),">"===X?JA(M):"/"===X?M.state=wA.OPEN_TAG_SLASH:(nA(X)||U(M,"Invalid character in tag name"),M.state=wA.ATTRIB));continue;case wA.OPEN_TAG_SLASH:">"===X?(JA(M,!0),$A(M)):(U(M,"Forward-slash in opening tag not followed by >"),M.state=wA.ATTRIB);continue;case wA.ATTRIB:if(nA(X))continue;">"===X?JA(M):"/"===X?M.state=wA.OPEN_TAG_SLASH:z(oA,X)?(M.attribName=X,M.attribValue="",M.state=wA.ATTRIB_NAME):U(M,"Invalid attribute name");continue;case wA.ATTRIB_NAME:"="===X?M.state=wA.ATTRIB_VALUE:">"===X?(U(M,"Attribute without value"),M.attribValue=M.attribName,LA(M),JA(M)):nA(X)?M.state=wA.ATTRIB_NAME_SAW_WHITE:z(uA,X)?M.attribName+=X:U(M,"Invalid attribute name");continue;case wA.ATTRIB_NAME_SAW_WHITE:if("="===X)M.state=wA.ATTRIB_VALUE;else{if(nA(X))continue;U(M,"Attribute without value"),M.tag.attributes[M.attribName]="",M.attribValue="",xA(M,"onattribute",{name:M.attribName,value:""}),M.attribName="",">"===X?JA(M):z(oA,X)?(M.attribName=X,M.state=wA.ATTRIB_NAME):(U(M,"Invalid attribute name"),M.state=wA.ATTRIB)}continue;case wA.ATTRIB_VALUE:if(nA(X))continue;H(X)?(M.q=X,M.state=wA.ATTRIB_VALUE_QUOTED):(M.opt.unquotedAttributeValues||cA(M,"Unquoted attribute value"),M.state=wA.ATTRIB_VALUE_UNQUOTED,M.attribValue=X);continue;case wA.ATTRIB_VALUE_QUOTED:if(X!==M.q){"&"===X?M.state=wA.ATTRIB_VALUE_ENTITY_Q:M.attribValue+=X;continue}LA(M),M.q="",M.state=wA.ATTRIB_VALUE_CLOSED;continue;case wA.ATTRIB_VALUE_CLOSED:nA(X)?M.state=wA.ATTRIB:">"===X?JA(M):"/"===X?M.state=wA.OPEN_TAG_SLASH:z(oA,X)?(U(M,"No whitespace between attributes"),M.attribName=X,M.attribValue="",M.state=wA.ATTRIB_NAME):U(M,"Invalid attribute name");continue;case wA.ATTRIB_VALUE_UNQUOTED:if(!pA(X)){"&"===X?M.state=wA.ATTRIB_VALUE_ENTITY_U:M.attribValue+=X;continue}LA(M),">"===X?JA(M):M.state=wA.ATTRIB;continue;case wA.CLOSE_TAG:if(M.tagName)">"===X?$A(M):z(uA,X)?M.tagName+=X:M.script?(M.script+=""===X?$A(M):U(M,"Invalid characters in closing tag");continue;case wA.TEXT_ENTITY:case wA.ATTRIB_VALUE_ENTITY_Q:case wA.ATTRIB_VALUE_ENTITY_U:var bA,le;switch(M.state){case wA.TEXT_ENTITY:bA=wA.TEXT,le="textNode";break;case wA.ATTRIB_VALUE_ENTITY_Q:bA=wA.ATTRIB_VALUE_QUOTED,le="attribValue";break;case wA.ATTRIB_VALUE_ENTITY_U:bA=wA.ATTRIB_VALUE_UNQUOTED,le="attribValue"}if(";"===X){var ve=IA(M);M.opt.unparsedEntities&&!Object.values(g.XML_ENTITIES).includes(ve)?((M.entityCount+=1)>M.opt.maxEntityCount&&cA(M,"Parsed entity count exceeds max entity count"),(M.entityDepth+=1)>M.opt.maxEntityDepth&&cA(M,"Parsed entity depth exceeds max entity depth"),M.entity="",M.state=bA,M.write(ve),M.entityDepth-=1):(M[le]+=ve,M.entity="",M.state=bA)}else z(M.entity.length?RA:dA,X)?M.entity+=X:(U(M,"Invalid character in entity name"),M[le]+="&"+M.entity+X,M.entity="",M.state=bA);continue;default:throw new Error(M,"Unknown state: "+M.state)}return M.position>=M.bufferCheckPosition&&function K(R){for(var M=Math.max(g.MAX_BUFFER_LENGTH,10),D=0,X=0,YA=I.length;XM)switch(I[X]){case"textNode":Ee(R);break;case"cdata":xA(R,"oncdata",R.cdata),R.cdata="";break;case"script":xA(R,"onscript",R.script),R.script="";break;default:cA(R,"Max buffer length exceeded: "+I[X])}D=Math.max(D,KA)}R.bufferCheckPosition=g.MAX_BUFFER_LENGTH-D+R.position}(M),M},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function B(R){Ee(R),""!==R.cdata&&(xA(R,"oncdata",R.cdata),R.cdata=""),""!==R.script&&(xA(R,"onscript",R.script),R.script="")}(this)}};try{j=f(9760).Stream}catch{j=function(){}}j||(j=function(){});var tA=g.EVENTS.filter(function(R){return"error"!==R&&"end"!==R});function AA(R,M){if(!(this instanceof AA))return new AA(R,M);j.apply(this),this._parser=new N(R,M),this.writable=!0,this.readable=!0;var D=this;this._parser.onend=function(){D.emit("end")},this._parser.onerror=function(X){D.emit("error",X),D._parser.error=null},this._decoder=null,this._decoderBuffer=null,tA.forEach(function(X){Object.defineProperty(D,"on"+X,{get:function(){return D._parser["on"+X]},set:function(YA){if(!YA)return D.removeAllListeners(X),D._parser["on"+X]=YA,YA;D.on(X,YA)},enumerable:!0,configurable:!1})})}(AA.prototype=Object.create(j.prototype,{constructor:{value:AA}}))._decodeBuffer=function(R,M){if(this._decoderBuffer&&(R=t.concat([this._decoderBuffer,R]),this._decoderBuffer=null),!this._decoder){var D=function aA(R,M){if(R.length>=2){if(255===R[0]&&254===R[1])return"utf-16le";if(254===R[0]&&255===R[1])return"utf-16be"}return R.length>=3&&239===R[0]&&187===R[1]&&191===R[2]?"utf8":R.length>=4?60===R[0]&&0===R[1]&&63===R[2]&&0===R[3]?"utf-16le":0===R[0]&&60===R[1]&&0===R[2]&&63===R[3]?"utf-16be":"utf8":M?"utf8":null}(R,M);if(!D)return this._decoderBuffer=R,"";this._parser.encoding=D,this._decoder=new TextDecoder(D)}return this._decoder.decode(R,{stream:!M})},AA.prototype.write=function(R){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(R))R=this._decodeBuffer(R,!1);else if(this._decoderBuffer){var M=this._decodeBuffer(t.alloc(0),!0);M&&(this._parser.write(M),this.emit("data",M))}return this._parser.write(R.toString()),this.emit("data",R),!0},AA.prototype.end=function(R){if(R&&R.length&&this.write(R),this._decoderBuffer){var M=this._decodeBuffer(t.alloc(0),!0);M&&(this._parser.write(M),this.emit("data",M))}else if(this._decoder){var D=this._decoder.decode();D&&(this._parser.write(D),this.emit("data",D))}return this._parser.end(),!0},AA.prototype.on=function(R,M){var D=this;return!D._parser["on"+R]&&-1!==tA.indexOf(R)&&(D._parser["on"+R]=function(){var X=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);X.splice(0,0,R),D.emit.apply(D,X)}),j.prototype.on.call(D,R,M)};var L="[CDATA[",P="DOCTYPE",rA="http://www.w3.org/XML/1998/namespace",QA="http://www.w3.org/2000/xmlns/",NA={xml:rA,xmlns:QA},oA=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,uA=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,dA=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,RA=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function nA(R){return" "===R||"\n"===R||"\r"===R||"\t"===R}function H(R){return'"'===R||"'"===R}function pA(R){return">"===R||nA(R)}function z(R,M){return R.test(M)}function OA(R,M){return!z(R,M)}var R,M,D,wA=0;for(var VA in g.STATE={BEGIN:wA++,BEGIN_WHITESPACE:wA++,TEXT:wA++,TEXT_ENTITY:wA++,OPEN_WAKA:wA++,SGML_DECL:wA++,SGML_DECL_QUOTED:wA++,DOCTYPE:wA++,DOCTYPE_QUOTED:wA++,DOCTYPE_DTD:wA++,DOCTYPE_DTD_QUOTED:wA++,COMMENT_STARTING:wA++,COMMENT:wA++,COMMENT_ENDING:wA++,COMMENT_ENDED:wA++,CDATA:wA++,CDATA_ENDING:wA++,CDATA_ENDING_2:wA++,PROC_INST:wA++,PROC_INST_BODY:wA++,PROC_INST_ENDING:wA++,OPEN_TAG:wA++,OPEN_TAG_SLASH:wA++,ATTRIB:wA++,ATTRIB_NAME:wA++,ATTRIB_NAME_SAW_WHITE:wA++,ATTRIB_VALUE:wA++,ATTRIB_VALUE_QUOTED:wA++,ATTRIB_VALUE_CLOSED:wA++,ATTRIB_VALUE_UNQUOTED:wA++,ATTRIB_VALUE_ENTITY_Q:wA++,ATTRIB_VALUE_ENTITY_U:wA++,CLOSE_TAG:wA++,CLOSE_TAG_SAW_WHITE:wA++,SCRIPT:wA++,SCRIPT_ENDING:wA++},g.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},g.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(g.ENTITIES).forEach(function(R){var M=g.ENTITIES[R],D="number"==typeof M?String.fromCharCode(M):M;g.ENTITIES[R]=D}),g.STATE)g.STATE[g.STATE[VA]]=VA;function kA(R,M,D){R[M]&&R[M](D)}function fA(R){return R?R.toLowerCase().replace(/[^a-z0-9]/g,""):null}function yA(R,M){if(R.strict&&R.encoding&&M&&"xml"===M.name){var D=function hA(R){var M=R&&R.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return M?M[2]:null}(M.body);D&&!function UA(R,M){const D=fA(R),X=fA(M);return!D||!X||("utf16"===X?"utf16le"===D||"utf16be"===D:D===X)}(R.encoding,D)&&U(R,"XML declaration encoding "+D+" does not match detected stream encoding "+R.encoding.toUpperCase())}}function xA(R,M,D){R.textNode&&Ee(R),kA(R,M,D)}function Ee(R){R.textNode=HA(R.opt,R.textNode),R.textNode&&kA(R,"ontext",R.textNode),R.textNode=""}function HA(R,M){return R.trim&&(M=M.trim()),R.normalize&&(M=M.replace(/\s+/g," ")),M}function cA(R,M){return Ee(R),R.trackPosition&&(M+="\nLine: "+R.line+"\nColumn: "+R.column+"\nChar: "+R.c),M=new Error(M),R.error=M,kA(R,"onerror",M),R}function J(R){return R.sawRoot&&!R.closedRoot&&U(R,"Unclosed root tag"),R.state!==wA.BEGIN&&R.state!==wA.BEGIN_WHITESPACE&&R.state!==wA.TEXT&&cA(R,"Unexpected end"),Ee(R),R.c="",R.closed=!0,kA(R,"onend"),N.call(R,R.strict,R.opt),R}function U(R,M){if("object"!=typeof R||!(R instanceof N))throw new Error("bad call to strictFail");R.strict&&cA(R,M)}function O(R){R.strict||(R.tagName=R.tagName[R.looseCase]());var M=R.tags[R.tags.length-1]||R,D=R.tag={name:R.tagName,attributes:{}};R.opt.xmlns&&(D.ns=M.ns),R.attribList.length=0,xA(R,"onopentagstart",D)}function lA(R,M){var X=R.indexOf(":")<0?["",R]:R.split(":"),YA=X[0],KA=X[1];return M&&"xmlns"===R&&(YA="xmlns",KA=""),{prefix:YA,local:KA}}function LA(R){if(R.strict||(R.attribName=R.attribName[R.looseCase]()),-1!==R.attribList.indexOf(R.attribName)||R.tag.attributes.hasOwnProperty(R.attribName))R.attribName=R.attribValue="";else{if(R.opt.xmlns){var M=lA(R.attribName,!0),X=M.local;if("xmlns"===M.prefix)if("xml"===X&&R.attribValue!==rA)U(R,"xml: prefix must be bound to "+rA+"\nActual: "+R.attribValue);else if("xmlns"===X&&R.attribValue!==QA)U(R,"xmlns: prefix must be bound to "+QA+"\nActual: "+R.attribValue);else{var YA=R.tag,KA=R.tags[R.tags.length-1]||R;YA.ns===KA.ns&&(YA.ns=Object.create(KA.ns)),YA.ns[X]=R.attribValue}R.attribList.push([R.attribName,R.attribValue])}else R.tag.attributes[R.attribName]=R.attribValue,xA(R,"onattribute",{name:R.attribName,value:R.attribValue});R.attribName=R.attribValue=""}}function JA(R,M){if(R.opt.xmlns){var D=R.tag,X=lA(R.tagName);D.prefix=X.prefix,D.local=X.local,D.uri=D.ns[X.prefix]||"",D.prefix&&!D.uri&&(U(R,"Unbound namespace prefix: "+JSON.stringify(R.tagName)),D.uri=X.prefix),D.ns&&(R.tags[R.tags.length-1]||R).ns!==D.ns&&Object.keys(D.ns).forEach(function(S){xA(R,"onopennamespace",{prefix:S,uri:D.ns[S]})});for(var KA=0,bA=R.attribList.length;KA",R.tagName="",void(R.state=wA.SCRIPT);xA(R,"onscript",R.script),R.script=""}var M=R.tags.length,D=R.tagName;R.strict||(D=D[R.looseCase]());for(var X=D;M--&&R.tags[M].name!==X;)U(R,"Unexpected close tag");if(M<0)return U(R,"Unmatched closing tag: "+R.tagName),R.textNode+="",void(R.state=wA.TEXT);R.tagName=D;for(var KA=R.tags.length;KA-- >M;){var bA=R.tag=R.tags.pop();R.tagName=R.tag.name,xA(R,"onclosetag",R.tagName);var le={};for(var ve in bA.ns)le[ve]=bA.ns[ve];R.opt.xmlns&&bA.ns!==(R.tags[R.tags.length-1]||R).ns&&Object.keys(bA.ns).forEach(function(Te){xA(R,"onclosenamespace",{prefix:Te,uri:bA.ns[Te]})})}0===M&&(R.closedRoot=!0),R.tagName=R.attribValue=R.attribName="",R.attribList.length=0,R.state=wA.TEXT}function IA(R){var X,M=R.entity,D=M.toLowerCase(),YA="";return R.ENTITIES[M]?R.ENTITIES[M]:R.ENTITIES[D]?R.ENTITIES[D]:("#"===(M=D).charAt(0)&&("x"===M.charAt(1)?(M=M.slice(2),YA=(X=parseInt(M,16)).toString(16)):(M=M.slice(1),YA=(X=parseInt(M,10)).toString(10))),M=M.replace(/^0+/,""),isNaN(X)||YA.toLowerCase()!==M||X<0||X>1114111?(U(R,"Invalid character entity"),"&"+R.entity+";"):String.fromCodePoint(X))}function gA(R,M){"<"===M?(R.state=wA.OPEN_WAKA,R.startTagPosition=R.position):nA(M)||(U(R,"Non-whitespace before first tag."),R.textNode=M,R.state=wA.TEXT)}function C(R,M){var D="";return M1114111||M(Te)!==Te)throw RangeError("Invalid code point: "+Te);Te<=65535?YA.push(Te):YA.push(55296+((Te-=65536)>>10),Te%1024+56320),(le+1===ve||YA.length>16384)&&(Ne+=R.apply(null,YA),YA.length=0)}return Ne},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:D,configurable:!0,writable:!0}):String.fromCodePoint=D)}(Q)},6255(eA,Q,f){"use strict";var t=f(8651),g=f(9295),I=f(8890)(),N=f(8109),K=f(6785),v=t("%Math.floor%");eA.exports=function(j,tA){if("function"!=typeof j)throw new K("`fn` is not a function");if("number"!=typeof tA||tA<0||tA>4294967295||v(tA)!==tA)throw new K("`length` must be a positive 32-bit integer");var w=arguments.length>2&&!!arguments[2],aA=!0,AA=!0;if("length"in j&&N){var L=N(j,"length");L&&!L.configurable&&(aA=!1),L&&!L.writable&&(AA=!1)}return(aA||AA||!w)&&(I?g(j,"length",tA,!0,!0):g(j,"length",tA)),j}},9760(eA,Q,f){eA.exports=I;var t=f(4785).EventEmitter;function I(){t.call(this)}f(9784)(I,t),I.Readable=f(8261),I.Writable=f(9781),I.Duplex=f(4903),I.Transform=f(8569),I.PassThrough=f(7723),I.finished=f(2167),I.pipeline=f(3765),I.Stream=I,I.prototype.pipe=function(N,K){var v=this;function B(P){N.writable&&!1===N.write(P)&&v.pause&&v.pause()}function j(){v.readable&&v.resume&&v.resume()}v.on("data",B),N.on("drain",j),!N._isStdio&&(!K||!1!==K.end)&&(v.on("end",w),v.on("close",aA));var tA=!1;function w(){tA||(tA=!0,N.end())}function aA(){tA||(tA=!0,"function"==typeof N.destroy&&N.destroy())}function AA(P){if(L(),0===t.listenerCount(this,"error"))throw P}function L(){v.removeListener("data",B),N.removeListener("drain",j),v.removeListener("end",w),v.removeListener("close",aA),v.removeListener("error",AA),N.removeListener("error",AA),v.removeListener("end",L),v.removeListener("close",L),N.removeListener("close",L)}return v.on("error",AA),N.on("error",AA),v.on("end",L),v.on("close",L),N.on("close",L),N.emit("pipe",v),N}},3797(eA){"use strict";var f={};function t(v,B,j){j||(j=Error);var w=function(aA){function AA(L,P,rA){return aA.call(this,function tA(aA,AA,L){return"string"==typeof B?B:B(aA,AA,L)}(L,P,rA))||this}return function Q(v,B){v.prototype=Object.create(B.prototype),v.prototype.constructor=v,v.__proto__=B}(AA,aA),AA}(j);w.prototype.name=j.name,w.prototype.code=v,f[v]=w}function g(v,B){if(Array.isArray(v)){var j=v.length;return v=v.map(function(tA){return String(tA)}),j>2?"one of ".concat(B," ").concat(v.slice(0,j-1).join(", "),", or ")+v[j-1]:2===j?"one of ".concat(B," ").concat(v[0]," or ").concat(v[1]):"of ".concat(B," ").concat(v[0])}return"of ".concat(B," ").concat(String(v))}t("ERR_INVALID_OPT_VALUE",function(v,B){return'The value "'+B+'" is invalid for option "'+v+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(v,B,j){var tA,w;if("string"==typeof B&&function I(v,B,j){return v.substr(!j||j<0?0:+j,B.length)===B}(B,"not ")?(tA="must not be",B=B.replace(/^not /,"")):tA="must be",function N(v,B,j){return(void 0===j||j>v.length)&&(j=v.length),v.substring(j-B.length,j)===B}(v," argument"))w="The ".concat(v," ").concat(tA," ").concat(g(B,"type"));else{var aA=function K(v,B,j){return"number"!=typeof j&&(j=0),!(j+B.length>v.length)&&-1!==v.indexOf(B,j)}(v,".")?"property":"argument";w='The "'.concat(v,'" ').concat(aA," ").concat(tA," ").concat(g(B,"type"))}return w+". Received type ".concat(typeof j)},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(v){return"The "+v+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(v){return"Cannot call "+v+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(v){return"Unknown encoding: "+v},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),eA.exports.F=f},4903(eA,Q,f){"use strict";var t=f(9964),g=Object.keys||function(aA){var AA=[];for(var L in aA)AA.push(L);return AA};eA.exports=j;var I=f(8261),N=f(9781);f(9784)(j,I);for(var K=g(N.prototype),v=0;v0)if("string"!=typeof D&&!bA.objectMode&&Object.getPrototypeOf(D)!==v.prototype&&(D=function j(M){return v.from(M)}(D)),YA)bA.endEmitted?pA(M,new dA):hA(M,bA,D,!0);else if(bA.ended)pA(M,new oA);else{if(bA.destroyed)return!1;bA.reading=!1,bA.decoder&&!X?(D=bA.decoder.write(D),bA.objectMode||0!==D.length?hA(M,bA,D,!1):J(M,bA)):hA(M,bA,D,!1)}else YA||(bA.reading=!1,J(M,bA));return!bA.ended&&(bA.lengthD.highWaterMark&&(D.highWaterMark=function yA(M){return M>=UA?M=UA:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}(M)),M<=D.length?M:D.ended?D.length:(D.needReadable=!0,0))}function HA(M){var D=M._readableState;aA("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(aA("emitReadable",D.flowing),D.emittedReadable=!0,t.nextTick(cA,M))}function cA(M){var D=M._readableState;aA("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&(D.length||D.ended)&&(M.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,IA(M)}function J(M,D){D.readingMore||(D.readingMore=!0,t.nextTick(U,M,D))}function U(M,D){for(;!D.reading&&!D.ended&&(D.length0,D.resumeScheduled&&!D.paused?D.flowing=!0:M.listenerCount("data")>0&&M.resume()}function LA(M){aA("readable nexttick read 0"),M.read(0)}function $A(M,D){aA("resume",D.reading),D.reading||M.read(0),D.resumeScheduled=!1,M.emit("resume"),IA(M),D.flowing&&!D.reading&&M.read(0)}function IA(M){var D=M._readableState;for(aA("flow",D.flowing);D.flowing&&null!==M.read(););}function gA(M,D){return 0===D.length?null:(D.objectMode?X=D.buffer.shift():!M||M>=D.length?(X=D.decoder?D.buffer.join(""):1===D.buffer.length?D.buffer.first():D.buffer.concat(D.length),D.buffer.clear()):X=D.buffer.consume(M,D.decoder),X);var X}function C(M){var D=M._readableState;aA("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,t.nextTick(b,D,M))}function b(M,D){if(aA("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&0===M.length&&(M.endEmitted=!0,D.readable=!1,D.emit("end"),M.autoDestroy)){var X=D._writableState;(!X||X.autoDestroy&&X.finished)&&D.destroy()}}function R(M,D){for(var X=0,YA=M.length;X=D.highWaterMark:D.length>0)||D.ended))return aA("read: emitReadable",D.length,D.ended),0===D.length&&D.ended?C(this):HA(this),null;if(0===(M=xA(M,D))&&D.ended)return 0===D.length&&C(this),null;var KA,YA=D.needReadable;return aA("need readable",YA),(0===D.length||D.length-M0?gA(M,D):null)?(D.needReadable=D.length<=D.highWaterMark,M=0):(D.length-=M,D.awaitDrain=0),0===D.length&&(D.ended||(D.needReadable=!0),X!==M&&D.ended&&C(this)),null!==KA&&this.emit("data",KA),KA},VA.prototype._read=function(M){pA(this,new uA("_read()"))},VA.prototype.pipe=function(M,D){var X=this,YA=this._readableState;switch(YA.pipesCount){case 0:YA.pipes=M;break;case 1:YA.pipes=[YA.pipes,M];break;default:YA.pipes.push(M)}YA.pipesCount+=1,aA("pipe count=%d opts=%j",YA.pipesCount,D);var bA=D&&!1===D.end||M===t.stdout||M===t.stderr?Y:ve;function ve(){aA("onend"),M.end()}YA.endEmitted?t.nextTick(bA):X.once("end",bA),M.on("unpipe",function le(k,m){aA("onunpipe"),k===X&&m&&!1===m.hasUnpiped&&(m.hasUnpiped=!0,function ze(){aA("cleanup"),M.removeListener("close",sA),M.removeListener("finish",S),M.removeListener("drain",Ne),M.removeListener("error",oe),M.removeListener("unpipe",le),X.removeListener("end",ve),X.removeListener("end",Y),X.removeListener("data",Oe),Te=!0,YA.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&Ne()}())});var Ne=function O(M){return function(){var X=M._readableState;aA("pipeOnDrain",X.awaitDrain),X.awaitDrain&&X.awaitDrain--,0===X.awaitDrain&&N(M,"data")&&(X.flowing=!0,IA(M))}}(X);M.on("drain",Ne);var Te=!1;function Oe(k){aA("ondata");var m=M.write(k);aA("dest.write",m),!1===m&&((1===YA.pipesCount&&YA.pipes===M||YA.pipesCount>1&&-1!==R(YA.pipes,M))&&!Te&&(aA("false write response, pause",YA.awaitDrain),YA.awaitDrain++),X.pause())}function oe(k){aA("onerror",k),Y(),M.removeListener("error",oe),0===N(M,"error")&&pA(M,k)}function sA(){M.removeListener("finish",S),Y()}function S(){aA("onfinish"),M.removeListener("close",sA),Y()}function Y(){aA("unpipe"),X.unpipe(M)}return X.on("data",Oe),function OA(M,D,X){if("function"==typeof M.prependListener)return M.prependListener(D,X);M._events&&M._events[D]?Array.isArray(M._events[D])?M._events[D].unshift(X):M._events[D]=[X,M._events[D]]:M.on(D,X)}(M,"error",oe),M.once("close",sA),M.once("finish",S),M.emit("pipe",X),YA.flowing||(aA("pipe resume"),X.resume()),M},VA.prototype.unpipe=function(M){var D=this._readableState,X={hasUnpiped:!1};if(0===D.pipesCount)return this;if(1===D.pipesCount)return M&&M!==D.pipes||(M||(M=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,M&&M.emit("unpipe",this,X)),this;if(!M){var YA=D.pipes,KA=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var bA=0;bA0,!1!==YA.flowing&&this.resume()):"readable"===M&&!YA.endEmitted&&!YA.readableListening&&(YA.readableListening=YA.needReadable=!0,YA.flowing=!1,YA.emittedReadable=!1,aA("on readable",YA.length,YA.reading),YA.length?HA(this):YA.reading||t.nextTick(LA,this)),X},VA.prototype.removeListener=function(M,D){var X=K.prototype.removeListener.call(this,M,D);return"readable"===M&&t.nextTick(lA,this),X},VA.prototype.removeAllListeners=function(M){var D=K.prototype.removeAllListeners.apply(this,arguments);return("readable"===M||void 0===M)&&t.nextTick(lA,this),D},VA.prototype.resume=function(){var M=this._readableState;return M.flowing||(aA("resume"),M.flowing=!M.readableListening,function JA(M,D){D.resumeScheduled||(D.resumeScheduled=!0,t.nextTick($A,M,D))}(this,M)),M.paused=!1,this},VA.prototype.pause=function(){return aA("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(aA("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},VA.prototype.wrap=function(M){var D=this,X=this._readableState,YA=!1;for(var KA in M.on("end",function(){if(aA("wrapped end"),X.decoder&&!X.ended){var le=X.decoder.end();le&&le.length&&D.push(le)}D.push(null)}),M.on("data",function(le){aA("wrapped data"),X.decoder&&(le=X.decoder.write(le)),X.objectMode&&null==le||!(X.objectMode||le&&le.length)||D.push(le)||(YA=!0,M.pause())}),M)void 0===this[KA]&&"function"==typeof M[KA]&&(this[KA]=function(ve){return function(){return M[ve].apply(M,arguments)}}(KA));for(var bA=0;bA-1))throw new nA(gA);return this._writableState.defaultEncoding=gA,this},Object.defineProperty(wA.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(wA.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),wA.prototype._write=function(IA,gA,C){C(new QA("_write()"))},wA.prototype._writev=null,wA.prototype.end=function(IA,gA,C){var b=this._writableState;return"function"==typeof IA?(C=IA,IA=null,gA=null):"function"==typeof gA&&(C=gA,gA=null),null!=IA&&this.write(IA,gA),b.corked&&(b.corked=1,this.uncork()),b.ending||function JA(IA,gA,C){gA.ending=!0,LA(IA,gA),C&&(gA.finished?t.nextTick(C):IA.once("finish",C)),gA.ended=!0,IA.writable=!1}(this,b,C),this},Object.defineProperty(wA.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(wA.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(gA){this._writableState&&(this._writableState.destroyed=gA)}}),wA.prototype.destroy=aA.destroy,wA.prototype._undestroy=aA.undestroy,wA.prototype._destroy=function(IA,gA){gA(IA)}},9676(eA,Q,f){"use strict";var g,t=f(9964);function I(RA,nA,H){return nA=function N(RA){var nA=function K(RA,nA){if("object"!=typeof RA||null===RA)return RA;var H=RA[Symbol.toPrimitive];if(void 0!==H){var pA=H.call(RA,nA||"default");if("object"!=typeof pA)return pA;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===nA?String:Number)(RA)}(RA,"string");return"symbol"==typeof nA?nA:String(nA)}(nA),nA in RA?Object.defineProperty(RA,nA,{value:H,enumerable:!0,configurable:!0,writable:!0}):RA[nA]=H,RA}var v=f(2167),B=Symbol("lastResolve"),j=Symbol("lastReject"),tA=Symbol("error"),w=Symbol("ended"),aA=Symbol("lastPromise"),AA=Symbol("handlePromise"),L=Symbol("stream");function P(RA,nA){return{value:RA,done:nA}}function rA(RA){var nA=RA[B];if(null!==nA){var H=RA[L].read();null!==H&&(RA[aA]=null,RA[B]=null,RA[j]=null,nA(P(H,!1)))}}function QA(RA){t.nextTick(rA,RA)}var oA=Object.getPrototypeOf(function(){}),uA=Object.setPrototypeOf((I(g={get stream(){return this[L]},next:function(){var nA=this,H=this[tA];if(null!==H)return Promise.reject(H);if(this[w])return Promise.resolve(P(void 0,!0));if(this[L].destroyed)return new Promise(function(wA,VA){t.nextTick(function(){nA[tA]?VA(nA[tA]):wA(P(void 0,!0))})});var z,pA=this[aA];if(pA)z=new Promise(function NA(RA,nA){return function(H,pA){RA.then(function(){nA[w]?H(P(void 0,!0)):nA[AA](H,pA)},pA)}}(pA,this));else{var OA=this[L].read();if(null!==OA)return Promise.resolve(P(OA,!1));z=new Promise(this[AA])}return this[aA]=z,z}},Symbol.asyncIterator,function(){return this}),I(g,"return",function(){var nA=this;return new Promise(function(H,pA){nA[L].destroy(null,function(z){z?pA(z):H(P(void 0,!0))})})}),g),oA);eA.exports=function(nA){var H,pA=Object.create(uA,(I(H={},L,{value:nA,writable:!0}),I(H,B,{value:null,writable:!0}),I(H,j,{value:null,writable:!0}),I(H,tA,{value:null,writable:!0}),I(H,w,{value:nA._readableState.endEmitted,writable:!0}),I(H,AA,{value:function(OA,wA){var VA=pA[L].read();VA?(pA[aA]=null,pA[B]=null,pA[j]=null,OA(P(VA,!1))):(pA[B]=OA,pA[j]=wA)},writable:!0}),H));return pA[aA]=null,v(nA,function(z){if(z&&"ERR_STREAM_PREMATURE_CLOSE"!==z.code){var OA=pA[j];return null!==OA&&(pA[aA]=null,pA[B]=null,pA[j]=null,OA(z)),void(pA[tA]=z)}var wA=pA[B];null!==wA&&(pA[aA]=null,pA[B]=null,pA[j]=null,wA(P(void 0,!0))),pA[w]=!0}),nA.on("readable",QA.bind(null,pA)),pA}},7385(eA,Q,f){"use strict";var t=f(9964);function I(j,tA){v(j,tA),N(j)}function N(j){j._writableState&&!j._writableState.emitClose||j._readableState&&!j._readableState.emitClose||j.emit("close")}function v(j,tA){j.emit("error",tA)}eA.exports={destroy:function g(j,tA){var w=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(tA?tA(j):j&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(v,this,j)):t.nextTick(v,this,j)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(j||null,function(L){!tA&&L?w._writableState?w._writableState.errorEmitted?t.nextTick(N,w):(w._writableState.errorEmitted=!0,t.nextTick(I,w,L)):t.nextTick(I,w,L):tA?(t.nextTick(N,w),tA(L)):t.nextTick(N,w)}),this)},undestroy:function K(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function B(j,tA){var w=j._readableState,aA=j._writableState;w&&w.autoDestroy||aA&&aA.autoDestroy?j.destroy(tA):j.emit("error",tA)}}},2167(eA,Q,f){"use strict";var t=f(3797).F.ERR_STREAM_PREMATURE_CLOSE;function I(){}eA.exports=function K(v,B,j){if("function"==typeof B)return K(v,null,B);B||(B={}),j=function g(v){var B=!1;return function(){if(!B){B=!0;for(var j=arguments.length,tA=new Array(j),w=0;w0,function(H){NA||(NA=H),H&&oA.forEach(tA),!RA&&(oA.forEach(tA),QA(NA))})});return P.reduce(w)}},8130(eA,Q,f){"use strict";var t=f(3797).F.ERR_INVALID_OPT_VALUE;eA.exports={getHighWaterMark:function I(N,K,v,B){var j=function g(N,K,v){return null!=N.highWaterMark?N.highWaterMark:K?N[v]:null}(K,B,v);if(null!=j){if(!isFinite(j)||Math.floor(j)!==j||j<0)throw new t(B?v:"highWaterMark",j);return Math.floor(j)}return N.objectMode?16:16384}}},9018(eA,Q,f){eA.exports=f(4785).EventEmitter},3143(eA,Q,f){"use strict";var t=f(5691).Buffer,g=t.isEncoding||function(oA){switch((oA=""+oA)&&oA.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K(oA){var uA;switch(this.encoding=function N(oA){var uA=function I(oA){if(!oA)return"utf8";for(var uA;;)switch(oA){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return oA;default:if(uA)return;oA=(""+oA).toLowerCase(),uA=!0}}(oA);if("string"!=typeof uA&&(t.isEncoding===g||!g(oA)))throw new Error("Unknown encoding: "+oA);return uA||oA}(oA),this.encoding){case"utf16le":this.text=AA,this.end=L,uA=4;break;case"utf8":this.fillLast=tA,uA=4;break;case"base64":this.text=P,this.end=rA,uA=3;break;default:return this.write=QA,void(this.end=NA)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(uA)}function v(oA){return oA<=127?0:oA>>5==6?2:oA>>4==14?3:oA>>3==30?4:oA>>6==2?-1:-2}function tA(oA){var uA=this.lastTotal-this.lastNeed,dA=function j(oA,uA){if(128!=(192&uA[0]))return oA.lastNeed=0,"\ufffd";if(oA.lastNeed>1&&uA.length>1){if(128!=(192&uA[1]))return oA.lastNeed=1,"\ufffd";if(oA.lastNeed>2&&uA.length>2&&128!=(192&uA[2]))return oA.lastNeed=2,"\ufffd"}}(this,oA);return void 0!==dA?dA:this.lastNeed<=oA.length?(oA.copy(this.lastChar,uA,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(oA.copy(this.lastChar,uA,0,oA.length),void(this.lastNeed-=oA.length))}function AA(oA,uA){if((oA.length-uA)%2==0){var dA=oA.toString("utf16le",uA);if(dA){var RA=dA.charCodeAt(dA.length-1);if(RA>=55296&&RA<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=oA[oA.length-2],this.lastChar[1]=oA[oA.length-1],dA.slice(0,-1)}return dA}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=oA[oA.length-1],oA.toString("utf16le",uA,oA.length-1)}function L(oA){var uA=oA&&oA.length?this.write(oA):"";return this.lastNeed?uA+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):uA}function P(oA,uA){var dA=(oA.length-uA)%3;return 0===dA?oA.toString("base64",uA):(this.lastNeed=3-dA,this.lastTotal=3,1===dA?this.lastChar[0]=oA[oA.length-1]:(this.lastChar[0]=oA[oA.length-2],this.lastChar[1]=oA[oA.length-1]),oA.toString("base64",uA,oA.length-dA))}function rA(oA){var uA=oA&&oA.length?this.write(oA):"";return this.lastNeed?uA+this.lastChar.toString("base64",0,3-this.lastNeed):uA}function QA(oA){return oA.toString(this.encoding)}function NA(oA){return oA&&oA.length?this.write(oA):""}Q.I=K,K.prototype.write=function(oA){if(0===oA.length)return"";var uA,dA;if(this.lastNeed){if(void 0===(uA=this.fillLast(oA)))return"";dA=this.lastNeed,this.lastNeed=0}else dA=0;return dA=0?(nA>0&&(oA.lastNeed=nA-1),nA):--RA=0?(nA>0&&(oA.lastNeed=nA-2),nA):--RA=0?(nA>0&&(2===nA?nA=0:oA.lastNeed=nA-3),nA):0}(this,oA,uA);if(!this.lastNeed)return oA.toString("utf8",uA);this.lastTotal=dA;var RA=oA.length-(dA-this.lastNeed);return oA.copy(this.lastChar,0,RA),oA.toString("utf8",uA,RA)},K.prototype.fillLast=function(oA){if(this.lastNeed<=oA.length)return oA.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);oA.copy(this.lastChar,this.lastTotal-this.lastNeed,0,oA.length),this.lastNeed-=oA.length}},3483(eA){function t(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function g(H,pA){this.source=H,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=pA,this.destLen=0,this.ltree=new t,this.dtree=new t}var I=new t,N=new t,K=new Uint8Array(30),v=new Uint16Array(30),B=new Uint8Array(30),j=new Uint16Array(30),tA=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=new t,aA=new Uint8Array(320);function AA(H,pA,z,OA){var wA,VA;for(wA=0;wA>>=1,pA}function NA(H,pA,z){if(!pA)return z;for(;H.bitcount<24;)H.tag|=H.source[H.sourceIndex++]<>>16-pA;return H.tag>>>=pA,H.bitcount-=pA,OA+z}function oA(H,pA){for(;H.bitcount<24;)H.tag|=H.source[H.sourceIndex++]<>>=1,++wA,z+=pA.table[wA],OA-=pA.table[wA]}while(OA>=0);return H.tag=VA,H.bitcount-=wA,pA.trans[z+OA]}function uA(H,pA,z){var OA,wA,VA,kA,hA,fA;for(OA=NA(H,5,257),wA=NA(H,5,1),VA=NA(H,4,4),kA=0;kA<19;++kA)aA[kA]=0;for(kA=0;kA8;)H.sourceIndex--,H.bitcount-=8;if((pA=256*(pA=H.source[H.sourceIndex+1])+H.source[H.sourceIndex])!==(65535&~(256*H.source[H.sourceIndex+3]+H.source[H.sourceIndex+2])))return-3;for(H.sourceIndex+=4,OA=pA;OA;--OA)H.dest[H.destLen++]=H.source[H.sourceIndex++];return H.bitcount=0,0}(function L(H,pA){var z;for(z=0;z<7;++z)H.table[z]=0;for(H.table[7]=24,H.table[8]=152,H.table[9]=112,z=0;z<24;++z)H.trans[z]=256+z;for(z=0;z<144;++z)H.trans[24+z]=z;for(z=0;z<8;++z)H.trans[168+z]=280+z;for(z=0;z<112;++z)H.trans[176+z]=144+z;for(z=0;z<5;++z)pA.table[z]=0;for(pA.table[5]=32,z=0;z<32;++z)pA.trans[z]=z})(I,N),AA(K,v,4,3),AA(B,j,2,1),K[28]=0,v[28]=258,eA.exports=function nA(H,pA){var OA,VA,z=new g(H,pA);do{switch(OA=QA(z),NA(z,2,0)){case 0:VA=RA(z);break;case 1:VA=dA(z,I,N);break;case 2:uA(z,z.ltree,z.dtree),VA=dA(z,z.ltree,z.dtree);break;default:VA=-3}if(0!==VA)throw new Error("Data error")}while(!OA);return z.destLen"u")&&(HA.working?HA(bA):bA instanceof ArrayBuffer)}function J(bA){return"[object DataView]"===j(bA)}function U(bA){return!(typeof DataView>"u")&&(J.working?J(bA):bA instanceof DataView)}Q.isArgumentsObject=t,Q.isGeneratorFunction=g,Q.isTypedArray=N,Q.isPromise=function rA(bA){return typeof Promise<"u"&&bA instanceof Promise||null!==bA&&"object"==typeof bA&&"function"==typeof bA.then&&"function"==typeof bA.catch},Q.isArrayBufferView=function QA(bA){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(bA):N(bA)||U(bA)},Q.isUint8Array=function NA(bA){return"Uint8Array"===I(bA)},Q.isUint8ClampedArray=function oA(bA){return"Uint8ClampedArray"===I(bA)},Q.isUint16Array=function uA(bA){return"Uint16Array"===I(bA)},Q.isUint32Array=function dA(bA){return"Uint32Array"===I(bA)},Q.isInt8Array=function RA(bA){return"Int8Array"===I(bA)},Q.isInt16Array=function nA(bA){return"Int16Array"===I(bA)},Q.isInt32Array=function H(bA){return"Int32Array"===I(bA)},Q.isFloat32Array=function pA(bA){return"Float32Array"===I(bA)},Q.isFloat64Array=function z(bA){return"Float64Array"===I(bA)},Q.isBigInt64Array=function OA(bA){return"BigInt64Array"===I(bA)},Q.isBigUint64Array=function wA(bA){return"BigUint64Array"===I(bA)},VA.working=typeof Map<"u"&&VA(new Map),Q.isMap=function kA(bA){return!(typeof Map>"u")&&(VA.working?VA(bA):bA instanceof Map)},hA.working=typeof Set<"u"&&hA(new Set),Q.isSet=function fA(bA){return!(typeof Set>"u")&&(hA.working?hA(bA):bA instanceof Set)},UA.working=typeof WeakMap<"u"&&UA(new WeakMap),Q.isWeakMap=function yA(bA){return!(typeof WeakMap>"u")&&(UA.working?UA(bA):bA instanceof WeakMap)},xA.working=typeof WeakSet<"u"&&xA(new WeakSet),Q.isWeakSet=function Ee(bA){return xA(bA)},HA.working=typeof ArrayBuffer<"u"&&HA(new ArrayBuffer),Q.isArrayBuffer=cA,J.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&J(new DataView(new ArrayBuffer(1),0,1)),Q.isDataView=U;var O=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function lA(bA){return"[object SharedArrayBuffer]"===j(bA)}function LA(bA){return!(typeof O>"u")&&(typeof lA.working>"u"&&(lA.working=lA(new O)),lA.working?lA(bA):bA instanceof O)}function b(bA){return P(bA,tA)}function R(bA){return P(bA,w)}function M(bA){return P(bA,aA)}function D(bA){return v&&P(bA,AA)}function X(bA){return B&&P(bA,L)}Q.isSharedArrayBuffer=LA,Q.isAsyncFunction=function JA(bA){return"[object AsyncFunction]"===j(bA)},Q.isMapIterator=function $A(bA){return"[object Map Iterator]"===j(bA)},Q.isSetIterator=function IA(bA){return"[object Set Iterator]"===j(bA)},Q.isGeneratorObject=function gA(bA){return"[object Generator]"===j(bA)},Q.isWebAssemblyCompiledModule=function C(bA){return"[object WebAssembly.Module]"===j(bA)},Q.isNumberObject=b,Q.isStringObject=R,Q.isBooleanObject=M,Q.isBigIntObject=D,Q.isSymbolObject=X,Q.isBoxedPrimitive=function YA(bA){return b(bA)||R(bA)||M(bA)||D(bA)||X(bA)},Q.isAnyArrayBuffer=function KA(bA){return typeof Uint8Array<"u"&&(cA(bA)||LA(bA))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(bA){Object.defineProperty(Q,bA,{enumerable:!1,value:function(){throw new Error(bA+" is not supported in userland")}})})},7187(eA,Q,f){var t=f(9964),g=Object.getOwnPropertyDescriptors||function(O){for(var lA=Object.keys(O),LA={},JA=0;JA=JA)return gA;switch(gA){case"%s":return String(LA[lA++]);case"%d":return Number(LA[lA++]);case"%j":try{return JSON.stringify(LA[lA++])}catch{return"[Circular]"}default:return gA}}),IA=LA[lA];lA"u")return function(){return Q.deprecate(U,O).apply(this,arguments)};var lA=!1;return function LA(){if(!lA){if(t.throwDeprecation)throw new Error(O);t.traceDeprecation?console.trace(O):console.error(O),lA=!0}return U.apply(this,arguments)}};var N={},K=/^$/;if(t.env.NODE_DEBUG){var v=t.env.NODE_DEBUG;v=v.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),K=new RegExp("^"+v+"$","i")}function B(U,O){var lA={seen:[],stylize:tA};return arguments.length>=3&&(lA.depth=arguments[2]),arguments.length>=4&&(lA.colors=arguments[3]),oA(O)?lA.showHidden=O:O&&Q._extend(lA,O),pA(lA.showHidden)&&(lA.showHidden=!1),pA(lA.depth)&&(lA.depth=2),pA(lA.colors)&&(lA.colors=!1),pA(lA.customInspect)&&(lA.customInspect=!0),lA.colors&&(lA.stylize=j),aA(lA,U,lA.depth)}function j(U,O){var lA=B.styles[O];return lA?"\x1b["+B.colors[lA][0]+"m"+U+"\x1b["+B.colors[lA][1]+"m":U}function tA(U,O){return U}function aA(U,O,lA){if(U.customInspect&&O&&kA(O.inspect)&&O.inspect!==Q.inspect&&(!O.constructor||O.constructor.prototype!==O)){var LA=O.inspect(lA,U);return nA(LA)||(LA=aA(U,LA,lA)),LA}var JA=function AA(U,O){if(pA(O))return U.stylize("undefined","undefined");if(nA(O)){var lA="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(lA,"string")}return RA(O)?U.stylize(""+O,"number"):oA(O)?U.stylize(""+O,"boolean"):uA(O)?U.stylize("null","null"):void 0}(U,O);if(JA)return JA;var $A=Object.keys(O),IA=function w(U){var O={};return U.forEach(function(lA,LA){O[lA]=!0}),O}($A);if(U.showHidden&&($A=Object.getOwnPropertyNames(O)),VA(O)&&($A.indexOf("message")>=0||$A.indexOf("description")>=0))return L(O);if(0===$A.length){if(kA(O))return U.stylize("[Function"+(O.name?": "+O.name:"")+"]","special");if(z(O))return U.stylize(RegExp.prototype.toString.call(O),"regexp");if(wA(O))return U.stylize(Date.prototype.toString.call(O),"date");if(VA(O))return L(O)}var D,C="",b=!1,R=["{","}"];return NA(O)&&(b=!0,R=["[","]"]),kA(O)&&(C=" [Function"+(O.name?": "+O.name:"")+"]"),z(O)&&(C=" "+RegExp.prototype.toString.call(O)),wA(O)&&(C=" "+Date.prototype.toUTCString.call(O)),VA(O)&&(C=" "+L(O)),0!==$A.length||b&&0!=O.length?lA<0?z(O)?U.stylize(RegExp.prototype.toString.call(O),"regexp"):U.stylize("[Object]","special"):(U.seen.push(O),D=b?function P(U,O,lA,LA,JA){for(var $A=[],IA=0,gA=O.length;IA60?lA[0]+(""===O?"":O+"\n ")+" "+U.join(",\n ")+" "+lA[1]:lA[0]+O+" "+U.join(", ")+" "+lA[1]}(D,C,R)):R[0]+C+R[1]}function L(U){return"["+Error.prototype.toString.call(U)+"]"}function rA(U,O,lA,LA,JA,$A){var IA,gA,C;if((C=Object.getOwnPropertyDescriptor(O,JA)||{value:O[JA]}).get?gA=U.stylize(C.set?"[Getter/Setter]":"[Getter]","special"):C.set&&(gA=U.stylize("[Setter]","special")),Ee(LA,JA)||(IA="["+JA+"]"),gA||(U.seen.indexOf(C.value)<0?(gA=uA(lA)?aA(U,C.value,null):aA(U,C.value,lA-1)).indexOf("\n")>-1&&(gA=$A?gA.split("\n").map(function(b){return" "+b}).join("\n").slice(2):"\n"+gA.split("\n").map(function(b){return" "+b}).join("\n")):gA=U.stylize("[Circular]","special")),pA(IA)){if($A&&JA.match(/^\d+$/))return gA;(IA=JSON.stringify(""+JA)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(IA=IA.slice(1,-1),IA=U.stylize(IA,"name")):(IA=IA.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),IA=U.stylize(IA,"string"))}return IA+": "+gA}function NA(U){return Array.isArray(U)}function oA(U){return"boolean"==typeof U}function uA(U){return null===U}function RA(U){return"number"==typeof U}function nA(U){return"string"==typeof U}function pA(U){return void 0===U}function z(U){return OA(U)&&"[object RegExp]"===fA(U)}function OA(U){return"object"==typeof U&&null!==U}function wA(U){return OA(U)&&"[object Date]"===fA(U)}function VA(U){return OA(U)&&("[object Error]"===fA(U)||U instanceof Error)}function kA(U){return"function"==typeof U}function fA(U){return Object.prototype.toString.call(U)}function UA(U){return U<10?"0"+U.toString(10):U.toString(10)}Q.debuglog=function(U){if(U=U.toUpperCase(),!N[U])if(K.test(U)){var O=t.pid;N[U]=function(){var lA=Q.format.apply(Q,arguments);console.error("%s %d: %s",U,O,lA)}}else N[U]=function(){};return N[U]},Q.inspect=B,B.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},B.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.types=f(9490),Q.isArray=NA,Q.isBoolean=oA,Q.isNull=uA,Q.isNullOrUndefined=function dA(U){return null==U},Q.isNumber=RA,Q.isString=nA,Q.isSymbol=function H(U){return"symbol"==typeof U},Q.isUndefined=pA,Q.isRegExp=z,Q.types.isRegExp=z,Q.isObject=OA,Q.isDate=wA,Q.types.isDate=wA,Q.isError=VA,Q.types.isNativeError=VA,Q.isFunction=kA,Q.isPrimitive=function hA(U){return null===U||"boolean"==typeof U||"number"==typeof U||"string"==typeof U||"symbol"==typeof U||typeof U>"u"},Q.isBuffer=f(1201);var yA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(U,O){return Object.prototype.hasOwnProperty.call(U,O)}Q.log=function(){console.log("%s - %s",function xA(){var U=new Date,O=[UA(U.getHours()),UA(U.getMinutes()),UA(U.getSeconds())].join(":");return[U.getDate(),yA[U.getMonth()],O].join(" ")}(),Q.format.apply(Q,arguments))},Q.inherits=f(9784),Q._extend=function(U,O){if(!O||!OA(O))return U;for(var lA=Object.keys(O),LA=lA.length;LA--;)U[lA[LA]]=O[lA[LA]];return U};var HA=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function cA(U,O){if(!U){var lA=new Error("Promise was rejected with a falsy value");lA.reason=U,U=lA}return O(U)}Q.promisify=function(O){if("function"!=typeof O)throw new TypeError('The "original" argument must be of type Function');if(HA&&O[HA]){var lA;if("function"!=typeof(lA=O[HA]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(lA,HA,{value:lA,enumerable:!1,writable:!1,configurable:!0}),lA}function lA(){for(var LA,JA,$A=new Promise(function(C,b){LA=C,JA=b}),IA=[],gA=0;gA"u"?f.g:globalThis,w=g(),aA=N("String.prototype.slice"),AA=N("Array.prototype.indexOf",!0)||function(oA,uA){for(var dA=0;dA-1}(uA)?uA:"Object"===uA&&function rA(NA){var oA=!1;return t(L,function(uA,dA){if(!oA)try{uA(NA),oA=aA(dA,1)}catch{}}),oA}(oA)}return K?function P(NA){var oA=!1;return t(L,function(uA,dA){if(!oA)try{"$"+uA(NA)===dA&&(oA=aA(dA,1))}catch{}}),oA}(oA):null}},5127(eA,Q,f){var t,I;void 0!==(I="function"==typeof(t=function(){"use strict";function K(aA,AA,L){var P=new XMLHttpRequest;P.open("GET",aA),P.responseType="blob",P.onload=function(){w(P.response,AA,L)},P.onerror=function(){console.error("could not download file")},P.send()}function v(aA){var AA=new XMLHttpRequest;AA.open("HEAD",aA,!1);try{AA.send()}catch{}return 200<=AA.status&&299>=AA.status}function B(aA){try{aA.dispatchEvent(new MouseEvent("click"))}catch{var AA=document.createEvent("MouseEvents");AA.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),aA.dispatchEvent(AA)}}var j="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof f.g&&f.g.global===f.g?f.g:void 0,tA=j.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),w=j.saveAs||("object"!=typeof window||window!==j?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!tA?function(aA,AA,L){var P=j.URL||j.webkitURL,rA=document.createElement("a");rA.download=AA=AA||aA.name||"download",rA.rel="noopener","string"==typeof aA?(rA.href=aA,rA.origin===location.origin?B(rA):v(rA.href)?K(aA,AA,L):B(rA,rA.target="_blank")):(rA.href=P.createObjectURL(aA),setTimeout(function(){P.revokeObjectURL(rA.href)},4e4),setTimeout(function(){B(rA)},0))}:"msSaveOrOpenBlob"in navigator?function(aA,AA,L){if(AA=AA||aA.name||"download","string"!=typeof aA)navigator.msSaveOrOpenBlob(function N(aA,AA){return typeof AA>"u"?AA={autoBom:!1}:"object"!=typeof AA&&(console.warn("Deprecated: Expected third argument to be a object"),AA={autoBom:!AA}),AA.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(aA.type)?new Blob(["\ufeff",aA],{type:aA.type}):aA}(aA,L),AA);else if(v(aA))K(aA,AA,L);else{var P=document.createElement("a");P.href=aA,P.target="_blank",setTimeout(function(){B(P)})}}:function(aA,AA,L,P){if((P=P||open("","_blank"))&&(P.document.title=P.document.body.innerText="downloading..."),"string"==typeof aA)return K(aA,AA,L);var rA="application/octet-stream"===aA.type,QA=/constructor/i.test(j.HTMLElement)||j.safari,NA=/CriOS\/[\d]+/.test(navigator.userAgent);if((NA||rA&&QA||tA)&&typeof FileReader<"u"){var oA=new FileReader;oA.onloadend=function(){var RA=oA.result;RA=NA?RA:RA.replace(/^data:[^;]*;/,"data:attachment/file;"),P?P.location.href=RA:location=RA,P=null},oA.readAsDataURL(aA)}else{var uA=j.URL||j.webkitURL,dA=uA.createObjectURL(aA);P?P.location=dA:location.href=dA,P=null,setTimeout(function(){uA.revokeObjectURL(dA)},4e4)}});j.saveAs=w.saveAs=w,eA.exports=w})?t.apply(Q,[]):t)&&(eA.exports=I)},6274(){},8535(){},3779(){},7199(){},5117(eA){"use strict";eA.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},4074(eA,Q,f){"use strict";var yA,xA,Ee,t=f(5117),g=f(5144),I=f(7756),N=f(8681),K=f(3598),v=f(6341),B=f(9391),j=f(8819),tA=f(5719),w=f(4092),aA=f(1182),AA=f(9877),L=f(8607),P=f(443),rA=f(8663),QA=f(6044),NA=f(6921),oA=NA.enforce,uA=NA.get,dA=I.Int8Array,RA=dA&&dA.prototype,nA=I.Uint8ClampedArray,H=nA&&nA.prototype,pA=dA&&L(dA),z=RA&&L(RA),OA=Object.prototype,wA=I.TypeError,VA=rA("toStringTag"),kA=QA("TYPED_ARRAY_TAG"),hA="TypedArrayConstructor",fA=t&&!!P&&"Opera"!==B(I.opera),UA=!1,HA={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},cA={BigInt64Array:8,BigUint64Array:8},U=function(IA){var gA=L(IA);if(K(gA)){var C=uA(gA);return C&&v(C,hA)?C[hA]:U(gA)}},O=function(IA){if(!K(IA))return!1;var gA=B(IA);return v(HA,gA)||v(cA,gA)};for(yA in HA)(Ee=(xA=I[yA])&&xA.prototype)?oA(Ee)[hA]=xA:fA=!1;for(yA in cA)(Ee=(xA=I[yA])&&xA.prototype)&&(oA(Ee)[hA]=xA);if((!fA||!N(pA)||pA===Function.prototype)&&(pA=function(){throw new wA("Incorrect invocation")},fA))for(yA in HA)I[yA]&&P(I[yA],pA);if((!fA||!z||z===OA)&&(z=pA.prototype,fA))for(yA in HA)I[yA]&&P(I[yA].prototype,z);if(fA&&L(H)!==z&&P(H,z),g&&!v(z,VA))for(yA in UA=!0,aA(z,VA,{configurable:!0,get:function(){return K(this)?this[kA]:void 0}}),HA)I[yA]&&tA(I[yA].prototype,kA,yA);eA.exports={NATIVE_ARRAY_BUFFER_VIEWS:fA,TYPED_ARRAY_TAG:UA&&kA,aTypedArray:function(IA){if(O(IA))return IA;throw new wA("Target is not a typed array")},aTypedArrayConstructor:function(IA){if(N(IA)&&(!P||AA(pA,IA)))return IA;throw new wA(j(IA)+" is not a typed array constructor")},exportTypedArrayMethod:function(IA,gA,C,b){if(g){if(C)for(var R in HA){var M=I[R];if(M&&v(M.prototype,IA))try{delete M.prototype[IA]}catch{try{M.prototype[IA]=gA}catch{}}}(!z[IA]||C)&&w(z,IA,C?gA:fA&&RA[IA]||gA,b)}},exportTypedArrayStaticMethod:function(IA,gA,C){var b,R;if(g){if(P){if(C)for(b in HA)if((R=I[b])&&v(R,IA))try{delete R[IA]}catch{}if(pA[IA]&&!C)return;try{return w(pA,IA,C?gA:fA&&pA[IA]||gA)}catch{}}for(b in HA)(R=I[b])&&(!R[IA]||C)&&w(R,IA,gA)}},getTypedArrayConstructor:U,isView:function(gA){if(!K(gA))return!1;var C=B(gA);return"DataView"===C||v(HA,C)||v(cA,C)},isTypedArray:O,TypedArray:pA,TypedArrayPrototype:z}},4415(eA,Q){"use strict";Q._=function f(t,g,I){return g in t?Object.defineProperty(t,g,{value:I,enumerable:!0,configurable:!0,writable:!0}):t[g]=I,t}},8395(eA,Q,f){"use strict";Q._=f(1635).__decorate},821(eA,Q,f){"use strict";var t=f(884),g=typeof globalThis>"u"?f.g:globalThis;eA.exports=function(){for(var N=[],K=0;K1?arguments[1]:void 0,B),w=j>2?arguments[2]:void 0,aA=void 0===w?B:g(w,B);aA>tA;)v[tA++]=K;return v}},789(eA,Q,f){"use strict";var t=f(5137),g=f(4918),I=f(4730),N=function(K){return function(v,B,j){var tA=t(v),w=I(tA);if(0===w)return!K&&-1;var AA,aA=g(j,w);if(K&&B!=B){for(;w>aA;)if((AA=tA[aA++])!=AA)return!0}else for(;w>aA;aA++)if((K||aA in tA)&&tA[aA]===B)return K||aA||0;return!K&&-1}};eA.exports={includes:N(!0),indexOf:N(!1)}},2740(eA,Q,f){"use strict";var t=f(1212);eA.exports=t([].slice)},644(eA,Q,f){"use strict";var t=f(2740),g=Math.floor,I=function(N,K){var v=N.length;if(v<8)for(var j,tA,B=1;B0;)N[tA]=N[--tA];tA!==B++&&(N[tA]=j)}else for(var w=g(v/2),aA=I(t(N,0,w),K),AA=I(t(N,w),K),L=aA.length,P=AA.length,rA=0,QA=0;rA0&&B[0]<4?1:+(B[0]+B[1])),!j&&g&&(!(B=g.match(/Edge\/(\d+)/))||B[1]>=74)&&(B=g.match(/Chrome\/(\d+)/))&&(j=+B[1]),eA.exports=j},4507(eA,Q,f){"use strict";var g=f(8115).match(/AppleWebKit\/(\d+)\./);eA.exports=!!g&&+g[1]},3762(eA,Q,f){"use strict";var t=f(7756),g=f(423).f,I=f(5719),N=f(4092),K=f(7309),v=f(8032),B=f(5888);eA.exports=function(j,tA){var P,rA,QA,NA,oA,w=j.target,aA=j.global,AA=j.stat;if(P=aA?t:AA?t[w]||K(w,{}):t[w]&&t[w].prototype)for(rA in tA){if(NA=tA[rA],QA=j.dontCallGetSet?(oA=g(P,rA))&&oA.value:P[rA],!B(aA?rA:w+(AA?".":"#")+rA,j.forced)&&void 0!==QA){if(typeof NA==typeof QA)continue;v(NA,QA)}(j.sham||QA&&QA.sham)&&I(NA,"sham",!0),N(P,rA,NA,j)}}},299(eA){"use strict";eA.exports=function(Q){try{return!!Q()}catch{return!0}}},1676(eA,Q,f){"use strict";var t=f(299);eA.exports=!t(function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})},8993(eA,Q,f){"use strict";var t=f(1676),g=Function.prototype.call;eA.exports=t?g.bind(g):function(){return g.apply(g,arguments)}},4378(eA,Q,f){"use strict";var t=f(5144),g=f(6341),I=Function.prototype,N=t&&Object.getOwnPropertyDescriptor,K=g(I,"name"),v=K&&"something"===function(){}.name,B=K&&(!t||t&&N(I,"name").configurable);eA.exports={EXISTS:K,PROPER:v,CONFIGURABLE:B}},4494(eA,Q,f){"use strict";var t=f(1212),g=f(1078);eA.exports=function(I,N,K){try{return t(g(Object.getOwnPropertyDescriptor(I,N)[K]))}catch{}}},5336(eA,Q,f){"use strict";var t=f(8420),g=f(1212);eA.exports=function(I){if("Function"===t(I))return g(I)}},1212(eA,Q,f){"use strict";var t=f(1676),g=Function.prototype,I=g.call,N=t&&g.bind.bind(I,I);eA.exports=t?N:function(K){return function(){return I.apply(K,arguments)}}},7139(eA,Q,f){"use strict";var t=f(7756),g=f(8681);eA.exports=function(N,K){return arguments.length<2?function(N){return g(N)?N:void 0}(t[N]):t[N]&&t[N][K]}},9738(eA,Q,f){"use strict";var t=f(1078),g=f(6297);eA.exports=function(I,N){var K=I[N];return g(K)?void 0:t(K)}},7756(eA,Q,f){"use strict";var t=function(g){return g&&g.Math===Math&&g};eA.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof f.g&&f.g)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},6341(eA,Q,f){"use strict";var t=f(1212),g=f(3297),I=t({}.hasOwnProperty);eA.exports=Object.hasOwn||function(K,v){return I(g(K),v)}},2993(eA){"use strict";eA.exports={}},4329(eA,Q,f){"use strict";var t=f(7139);eA.exports=t("document","documentElement")},7657(eA,Q,f){"use strict";var t=f(5144),g=f(299),I=f(2283);eA.exports=!t&&!g(function(){return 7!==Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a})},2203(eA,Q,f){"use strict";var t=f(1212),g=f(299),I=f(8420),N=Object,K=t("".split);eA.exports=g(function(){return!N("z").propertyIsEnumerable(0)})?function(v){return"String"===I(v)?K(v,""):N(v)}:N},4550(eA,Q,f){"use strict";var t=f(1212),g=f(8681),I=f(3793),N=t(Function.toString);g(I.inspectSource)||(I.inspectSource=function(K){return N(K)}),eA.exports=I.inspectSource},6921(eA,Q,f){"use strict";var AA,L,P,t=f(1194),g=f(7756),I=f(3598),N=f(5719),K=f(6341),v=f(3793),B=f(7099),j=f(2993),tA="Object already initialized",w=g.TypeError;if(t||v.state){var NA=v.state||(v.state=new(0,g.WeakMap));NA.get=NA.get,NA.has=NA.has,NA.set=NA.set,AA=function(uA,dA){if(NA.has(uA))throw new w(tA);return dA.facade=uA,NA.set(uA,dA),dA},L=function(uA){return NA.get(uA)||{}},P=function(uA){return NA.has(uA)}}else{var oA=B("state");j[oA]=!0,AA=function(uA,dA){if(K(uA,oA))throw new w(tA);return dA.facade=uA,N(uA,oA,dA),dA},L=function(uA){return K(uA,oA)?uA[oA]:{}},P=function(uA){return K(uA,oA)}}eA.exports={set:AA,get:L,has:P,enforce:function(uA){return P(uA)?L(uA):AA(uA,{})},getterFor:function(uA){return function(dA){var RA;if(!I(dA)||(RA=L(dA)).type!==uA)throw new w("Incompatible receiver, "+uA+" required");return RA}}}},8468(eA,Q,f){"use strict";var t=f(8420);eA.exports=Array.isArray||function(I){return"Array"===t(I)}},8681(eA){"use strict";var Q="object"==typeof document&&document.all;eA.exports=typeof Q>"u"&&void 0!==Q?function(f){return"function"==typeof f||f===Q}:function(f){return"function"==typeof f}},5888(eA,Q,f){"use strict";var t=f(299),g=f(8681),I=/#|\.prototype\./,N=function(tA,w){var aA=v[K(tA)];return aA===j||aA!==B&&(g(w)?t(w):!!w)},K=N.normalize=function(tA){return String(tA).replace(I,".").toLowerCase()},v=N.data={},B=N.NATIVE="N",j=N.POLYFILL="P";eA.exports=N},6297(eA){"use strict";eA.exports=function(Q){return null==Q}},3598(eA,Q,f){"use strict";var t=f(8681);eA.exports=function(g){return"object"==typeof g?null!==g:t(g)}},2657(eA,Q,f){"use strict";var t=f(3598);eA.exports=function(g){return t(g)||null===g}},7695(eA){"use strict";eA.exports=!1},5985(eA,Q,f){"use strict";var t=f(7139),g=f(8681),I=f(9877),N=f(8300),K=Object;eA.exports=N?function(v){return"symbol"==typeof v}:function(v){var B=t("Symbol");return g(B)&&I(B.prototype,K(v))}},4730(eA,Q,f){"use strict";var t=f(8266);eA.exports=function(g){return t(g.length)}},3383(eA,Q,f){"use strict";var t=f(1212),g=f(299),I=f(8681),N=f(6341),K=f(5144),v=f(4378).CONFIGURABLE,B=f(4550),j=f(6921),tA=j.enforce,w=j.get,aA=String,AA=Object.defineProperty,L=t("".slice),P=t("".replace),rA=t([].join),QA=K&&!g(function(){return 8!==AA(function(){},"length",{value:8}).length}),NA=String(String).split("String"),oA=eA.exports=function(uA,dA,RA){"Symbol("===L(aA(dA),0,7)&&(dA="["+P(aA(dA),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),RA&&RA.getter&&(dA="get "+dA),RA&&RA.setter&&(dA="set "+dA),(!N(uA,"name")||v&&uA.name!==dA)&&(K?AA(uA,"name",{value:dA,configurable:!0}):uA.name=dA),QA&&RA&&N(RA,"arity")&&uA.length!==RA.arity&&AA(uA,"length",{value:RA.arity});try{RA&&N(RA,"constructor")&&RA.constructor?K&&AA(uA,"prototype",{writable:!1}):uA.prototype&&(uA.prototype=void 0)}catch{}var nA=tA(uA);return N(nA,"source")||(nA.source=rA(NA,"string"==typeof dA?dA:"")),uA};Function.prototype.toString=oA(function(){return I(this)&&w(this).source||B(this)},"toString")},2537(eA){"use strict";var Q=Math.ceil,f=Math.floor;eA.exports=Math.trunc||function(g){var I=+g;return(I>0?f:Q)(I)}},4860(eA,Q,f){"use strict";var NA,t=f(2091),g=f(2197),I=f(2555),N=f(2993),K=f(4329),v=f(2283),B=f(7099),w="prototype",AA=B("IE_PROTO"),L=function(){},P=function(uA){return"