1"use strict";(self.webpackChunktaiga=self.webpackChunktaiga||[]).push([[165],{1580:(D,T,o)=>{o.d(T,{E:()=>R});var E=o(1360),d=o(5850);let R=(()=>{class v{constructor(l){this.requestService=l}saveBlob(l,g){const u=new Blob([l],{type:g});if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(u);else{const t=window.URL.createObjectURL(u);window.open(t,"_blank"),setTimeout(()=>{window.URL.revokeObjectURL(t)},100)}}saveBlobWithFilename(l,g){const u=g.split(".").pop(),t=this.getMimeType(u),f=new Blob([l],{type:t});if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(f,g);else{const _=window.URL.createObjectURL(f),m=document.createElement("a");typeof m.download>"u"?window.open(_,"_blank"):(m.href=_,m.download=g,document.body.appendChild(m),m.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))),setTimeout(()=>{window.URL.revokeObjectURL(_),m&&m.remove()},100)}}getMimeType(l){switch(l=l.replace(".","")){case"3g2":return"video/3gpp2";case"3gp":return"video/3gpp";case"au":return"audio/basic";case"avi":return"video/x-msvideo";case"bmp":return"image/bmp";case"doc":return"application/msword";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"eps":case"ps":return"application/postscript";case"gif":return"image/gif";case"h264":return"video/h264";case"htm":case"html":return"text/html";case"ico":return"image/x-icon";case"jpe":case"jpeg":case"jpg":return"image/jpeg";case"m4v":return"video/x-m4v";case"mkv":return"video/x-matroska";case"mov":case"qt":return"video/quicktime";case"mp3":case"mpga":return"audio/mpeg";case"mp4":case"mpg4":return"video/mp4";case"mpe":case"mpeg":case"mpg":return"video/mpeg";case"ogg":return"application/ogg";case"pdf":return"application/pdf";case"png":return"image/png";case"ppt":return"application/vnd.ms-powerpoint";case"ra":case"ram":return"audio/x-pn-realaudio";case"rm":return"application/vnd.rn-realmedia";case"rtf":return"text/rtf";case"rtx":return"text/richtext";case"svg":return"image/svg+xml";case"swf":return"application/x-shockwave-flash";case"tif":case"tiff":return"image/tiff";case"txt":return"text/plain";case"wav":return"audio/x-wav";case"wbmp":return"image/vnd.wap.wbmp";case"wmv":return"video/x-ms-wmv";case"xhtml":return"application/xhtml+xml";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"xml":return"application/xml";default:return""}}getValidMediaType(l){switch(l){case"application/pdf":case"image/jpeg":case"image/png":case"image/bmp":case"image/gif":return!0;default:return!1}}getValidImageMediaType(l){switch(l){case"image/jpeg":case"image/png":case"image/bmp":case"image/gif":return!0;default:return!1}}getBlobFromUrl(l){return this.requestService.getBlobFromUrl(l)}static{this.\u0275fac=function(g){return new(g||v)(E.KVO(d.B))}}static{this.\u0275prov=E.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})()},8165:(D,T,o)=>{o.r(T),o.d(T,{InvoiceModule:()=>Jt});var E=o(5974),d=o(8018),R=o(5207),v=o(1336),b=o(9437),l=o(6695),g=o(7586),u=o.n(g),t=o(1360),f=o(2155),_=o(2043),m=o(6713),A=o(666),k=o(6471),M=o(5571),h=o(2881),G=o(1843),B=o(3013),x=o(1517),$=o(1580),F=o(1413),j=o(1584),Y=o(274),U=o(6977),Q=o(7786),w=o(5565),X=o(5850);let V=(()=>{class i{constructor(e){this.request=e}postPaymentSwish(e){return this.request.postOnce("v2/payment/swish",{ledgerNoteId:e})}getPaymentSwish(e){return this.request.get(`v2/payment/swish/${e}`,null,{cache:!1})}static{this.\u0275fac=function(n){return new(n||i)(t.KVO(X.B))}}static{this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var L=o(913),y=o(8834);function H(i,s){if(1&i&&(t.j41(0,"div"),t.nrm(1,"img",9),t.nI1(2,"translate"),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.qrCode,t.B4B)("alt",t.bMT(2,2,"SWISHQRCODE"))}}function J(i,s){1&i&&t.nrm(0,"taiga-spinner",10),2&i&&t.Y8G("diameter",36)}function W(i,s){if(1&i&&(t.j41(0,"div",11),t.EFF(1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.error," ")}}
1function z(i,s){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"div",3)(2,"div",4),t.DNE(3,H,3,4,"div",2)(4,J,1,1,"taiga-spinner",5)(5,W,2,1,"div",6),t.k0s()(),t.j41(6,"div",7)(7,"button",8),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.cancel())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()(),t.bVm()}if(2&i){const e=t.XpG();t.R7$(3),t.Y8G("ngIf",e.qrCode&&!e.error),t.R7$(),t.Y8G("ngIf",e.showSpinner),t.R7$(),t.Y8G("ngIf",e.error),t.R7$(3),t.JRh(t.bMT(9,4,"CANCEL"))}}function K(i,s){1&i&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"PAYMENTCOMPLETED")," "))}function q(i,s){1&i&&t.nrm(0,"taiga-spinner",10),2&i&&t.Y8G("diameter",36)}function Z(i,s){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"div",12)(2,"div",13),t.DNE(3,K,3,3,"div",2)(4,q,1,1,"taiga-spinner",5),t.k0s()(),t.j41(5,"div",7)(6,"button",14),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.closeDialog(!0,2500))}),t.EFF(7),t.nI1(8,"translate"),t.k0s()(),t.bVm()}if(2&i){const e=t.XpG();t.R7$(3),t.Y8G("ngIf",!e.showSpinner),t.R7$(),t.Y8G("ngIf",e.showSpinner),t.R7$(2),t.Y8G("disabled",e.showSpinner),t.R7$(),t.JRh(t.bMT(8,4,"CLOSE"))}}let O=(()=>{class i{constructor(e,n,a,r,p){this.data=e,this.swishService=n,this.dialogRef=a,this.styleService=r,this.translate=p,this.cancelEvent=new F.B,this.completeEvent=new F.B,this.componentDestroyed=new F.B,this.SWISH_PAYMENT_REQUEST="SWISH_PAYMENT_REQUEST",this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID="SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID",this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME="SWISH_PAYMENT_REQUEST_EXPIRE_TIME",this.swishLogoPath=this.styleService.isDarkMode?"assets/img/swish-primary-dark.svg":"assets/img/swish-primary.svg",this.data?.ledgerNoteId&&this.postPaymentSwish(this.data.ledgerNoteId),this.data?.swishPaymentRequest&&(this.qrCode=this.data.swishPaymentRequest.qrCode,this.startPolling(this.data.swishPaymentRequest.id))}ngOnDestroy(){this.componentDestroyed.next(!0)}postPaymentSwish(e){this.showSpinner=!0,this.swishService.postPaymentSwish(e).pipe((0,b.W)(n=>{throw this.showSpinner=!1,n})).subscribe(n=>{if(this.showSpinner=!1,n)if(this.id=n.id,n?.qrCode&&(this.qrCode=n.qrCode),n.token&&(this.swishAppUrl=`swish://paymentrequest?token=${n.token}&callbackurl=${encodeURIComponent(window.location.href)}`,this.openSwishApp()),n.error)this.error=n.error;else{this.startPolling(n.id),sessionStorage.setItem(this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID,this.data.ledgerNoteId);var a=new Date;a.setSeconds(a.getSeconds()+210),sessionStorage.setItem(this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME,a.getTime().toString()),sessionStorage.setItem(this.SWISH_PAYMENT_REQUEST,JSON.stringify(n))}})}startPolling(e){(0,j.O)(1e3,2e3).pipe((0,Y.H)(()=>this.swishService.getPaymentSwish(e)),(0,U.Q)((0,Q.h)(this.cancelEvent,this.completeEvent,this.componentDestroyed))).subscribe(n=>{this.processResponse(n)}),(0,j.O)(21e4).subscribe(()=>{this.closeDialog(!1)})}processResponse(e){switch(e.status){case"PAID":this.completeEvent.next(!0),this.paymentCompleted=!0;break;case"CANCEL":case"DECLINED":case"ERROR":this.cancelEvent.next(!0),this.error=this.translate.instant("PAYMENTFAILED")}}cancel(){this.cancelEvent.next(!0),this.closeDialog(!1)}closeDialog(e,n=0){this.showSpinner=!!n,setTimeout(()=>{sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST),sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID),sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME),this.dialogRef.close(e?"success":"")},n)}openSwishApp(){try{window.open(this.swishAppUrl,"_parent")}catch{}}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(w.e),t.rXU(V),t.rXU(w.m),t.rXU(L.J),t.rXU(d.c$))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-swish-dialog"]],standalone:!1,decls:5,vars:6,consts:[[1,"swish-logo-container"],["width","64","height","64",3,"src","alt"],[4,"ngIf"],[1,"qr-code-wrapper"],[1,"qr-code-container"],[3,"diameter",4,"ngIf"],["style","word-break: break-word;",4,"ngIf"],[1,"buttons-container"],["mat-button","","color","primary",3,"click"],["width","180","height","180",1,"qr-code",3,"src","alt"],[3,"diameter"],[2,"word-break","break-word"],[1,"success-wrapper"],[1,"success-container"],["mat-button","","color","primary",3,"click","disabled"]],template:function(n,a){1&n&&(t.j41(0,"div",0),t.nrm(1,"img",1),t.nI1(2,"translate"),t.k0s(),t.DNE(3,z,10,6,"ng-container",2)(4,Z,9,6,"ng-container",2)),2&n&&(t.R7$(),t.Y8G("src",a.swishLogoPath,t.B4B)("alt",t.bMT(2,4,"SWISHLOGO")),t.R7$(2),t.Y8G("ngIf",!a.paymentCompleted),t.R7$(),t.Y8G("ngIf",a.paymentCompleted))},dependencies:[y.$z,h.bT,x.t,d.D9],styles:[".qr-code-wrapper[_ngcontent-%COMP%], .success-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:25px}.qr-code-container[_ngcontent-%COMP%], .success-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:200px;
1width:200px}.buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:column}.buttons-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-top:15px}.swish-logo-container[_ngcontent-%COMP%]{display:flex;justify-content:center}.qr-code[_ngcontent-%COMP%]{padding:15px;background-color:#fff;border-radius:40px}"]})}}return i})();var N=o(3718),tt=o(2728),et=o(5665),nt=o(7342);function it(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",2),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.copyMessage(a.copyText))}),t.EFF(1),t.k0s()}if(2&i){const e=t.XpG();t.R7$(),t.JRh(e.text)}}function at(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",3),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.copyMessage(a.copyText))}),t.EFF(1),t.k0s()}if(2&i){const e=t.XpG();t.R7$(),t.JRh(e.text)}}let ot=(()=>{class i{constructor(e,n){this.snackBarService=e,this.translate=n}copyMessage(e){const n=document.createElement("textarea");n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.opacity="0",n.value=e,document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),this.snackBarService.info(this.translate.instant("COPIEDTOCLIPBOARD"),1500)}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(nt.z),t.rXU(d.c$))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-copy-button"]],inputs:{text:"text",copyText:"copyText",stroked:"stroked"},standalone:!1,decls:2,vars:2,consts:[["mat-raised-button","",3,"click",4,"ngIf"],["mat-stroked-button","","class","mat-elevation-z2",3,"click",4,"ngIf"],["mat-raised-button","",3,"click"],["mat-stroked-button","",1,"mat-elevation-z2",3,"click"]],template:function(n,a){1&n&&t.DNE(0,it,2,1,"button",0)(1,at,2,1,"button",1),2&n&&(t.Y8G("ngIf",!a.stroked),t.R7$(),t.Y8G("ngIf",a.stroked))},dependencies:[h.bT,y.$z],encapsulation:2})}}return i})();var st=o(1997),P=o(5596),C=o(9454),rt=o(9509),ct=o(9213),lt=o(345);function pt(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",3),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.buttonClick())}),t.EFF(1),t.nrm(2,"mat-icon",4),t.k0s()}if(2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.label," ")}}function dt(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",5),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.buttonClick())}),t.EFF(1),t.nrm(2,"mat-icon",4),t.k0s()}if(2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.label," ")}}function mt(i,s){if(1&i&&(t.qex(0),t.DNE(1,pt,3,1,"button",1)(2,dt,3,1,"button",2),t.bVm()),2&i){const e=t.XpG();t.R7$(),t.Y8G("ngIf",!e.stroked),t.R7$(),t.Y8G("ngIf",e.stroked)}}function gt(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",3),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.buttonClick())}),t.EFF(1),t.nrm(2,"mat-icon",6),t.k0s()}if(2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.label," ")}}function ut(i,s){if(1&i){const e=t.RV6();t.j41(0,"button",5),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.buttonClick())}),t.EFF(1),t.nrm(2,"mat-icon",6),t.k0s()}if(2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.label," ")}}function ht(i,s){if(1&i&&(t.qex(0),t.DNE(1,gt,3,1,"button",1)(2,ut,3,1,"button",2),t.bVm()),2&i){const e=t.XpG();t.R7$(),t.Y8G("ngIf",!e.stroked),t.R7$(),t.Y8G("ngIf",e.stroked)}}let vt=(()=>{class i{constructor(e,n,a){this.matIconRegistry=e,this.domSanitizer=n,this.styleService=a,this.clicked=new t.bkB,this.matIconRegistry.addSvgIcon("swishLogo",this.domSanitizer.bypassSecurityTrustResourceUrl("assets/img/swish-primary.svg")),this.matIconRegistry.addSvgIcon("swishLogoDark",this.domSanitizer.bypassSecurityTrustResourceUrl("assets/img/swish-primary-dark.svg"))}buttonClick(){this.clicked.emit()}get isDarkmode(){return this.styleService.isDarkMode}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(rt.M),t.rXU(lt.up),t.rXU(L.J))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-swish-button"]],inputs:{label:"label",stroked:"stroked"},outputs:{clicked:"clicked"},standalone:!1,decls:2,vars:2,consts:[[4,"ngIf"],["mat-raised-button","",3,"click",4,"ngIf"],["mat-stroked-button","","class","mat-elevation-z2",3,"click",4,"ngIf"],["mat-raised-button","",3,"click"],["svgIcon","swishLogo"],["mat-stroked-button","",1,"mat-elevation-z2",3,"click"],["svgIcon","swishLogoDark"]],template:function(n,a){1&n&&t.DNE(0,mt,3,2,"ng-container",0)(1,ht,3,2,"ng-container",0),2&n&&(t.Y8G("ngIf",!a.isDarkmode),t.R7$(),t.Y8G("ngIf",a.isDarkmode))},dependencies:[ct.An,y.$z,h.bT],encapsulation:2})}}return i})(),ft=(()=>{class i{transform(e){return this.localeString(e)}localeString(e){if(""===e)return"";let n,a,r;for(n=(e+="").split("."),a=n[0],r=/(\d+)(\d{3})/;r.test(a);)a=a.replace(r,"$1.$2");return n}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=t.EJ8({name:"numberFormat",type:i,pure:!0,standalone:!1})}}return i})();
1function _t(i,s){if(1&i&&(t.qex(0),t.j41(1,"h4"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div"),t.EFF(5),t.k0s(),t.bVm()),2&i){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"EXPIREDATE")),t.R7$(3),t.JRh(e.formatDate(e.invoice.F\u00f6rfallodag))}}function bt(i,s){if(1&i&&(t.qex(0),t.j41(1,"h4"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div"),t.EFF(5),t.k0s(),t.bVm()),2&i){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"EXPIREDATEDEFERMENT")),t.R7$(3),t.JRh(e.formatDate(e.invoice.Anst\u00e5ndsdatum))}}function It(i,s){if(1&i){const e=t.RV6();t.j41(0,"taiga-swish-button",15),t.nI1(1,"translate"),t.bIt("clicked",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.createSwishPayment(a.invoice.Typ.AviseringId.toString()))}),t.k0s()}2&i&&t.Y8G("label",t.bMT(1,2,"PAYWITHSWISH"))("stroked",!0)}function St(i,s){if(1&i&&(t.j41(0,"div")(1,"div",16)(2,"div"),t.EFF(3),t.k0s(),t.j41(4,"div"),t.EFF(5),t.nI1(6,"numberFormat"),t.nI1(7,"translate"),t.k0s()(),t.nrm(8,"mat-divider"),t.k0s()),2&i){const e=s.$implicit;t.R7$(3),t.SpI(" ",e.Aviseringstext," "),t.R7$(2),t.Lme("",t.bMT(6,3,e.Bruttobelopp)," ",t.bMT(7,5,"KR"),"")}}function Tt(i,s){if(1&i&&(t.j41(0,"div")(1,"h4")(2,"div"),t.EFF(3),t.k0s(),t.j41(4,"div"),t.EFF(5),t.k0s()(),t.DNE(6,St,9,7,"div",14),t.k0s()),2&i){const e=s.$implicit;t.R7$(3),t.JRh(e.Hyresobjekt.Nummer),t.R7$(2),t.JRh(e.Hyresobjekt.Beteckning),t.R7$(),t.Y8G("ngForOf",e.Rader)}}function Et(i,s){if(1&i){const e=t.RV6();t.j41(0,"mat-card",1)(1,"div",2)(2,"mat-card-title"),t.EFF(3),t.k0s(),t.nrm(4,"taiga-pill-badge",3),t.k0s(),t.j41(5,"mat-card-content")(6,"div",4)(7,"div",5)(8,"h4"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"div"),t.EFF(12),t.k0s(),t.DNE(13,_t,6,4,"ng-container",6)(14,bt,6,4,"ng-container",6),t.j41(15,"h4"),t.EFF(16),t.k0s(),t.j41(17,"div"),t.EFF(18),t.k0s(),t.j41(19,"h4"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"div"),t.EFF(23),t.k0s()(),t.j41(24,"div",5)(25,"h4"),t.EFF(26),t.nI1(27,"translate"),t.k0s(),t.j41(28,"div"),t.EFF(29),t.nI1(30,"numberFormat"),t.nI1(31,"translate"),t.k0s(),t.j41(32,"h4"),t.EFF(33),t.nI1(34,"translate"),t.k0s(),t.j41(35,"div"),t.EFF(36),t.nI1(37,"numberFormat"),t.nI1(38,"translate"),t.k0s(),t.j41(39,"h4"),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"div"),t.EFF(43),t.nI1(44,"numberFormat"),t.nI1(45,"translate"),t.k0s()(),t.j41(46,"div",7),t.DNE(47,It,2,4,"taiga-swish-button",8),t.nrm(48,"taiga-copy-button",9),t.nI1(49,"translate"),t.nI1(50,"translate"),t.j41(51,"button",10),t.nI1(52,"translate"),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.downloadPdf(a.invoice.Typ.AviseringId))}),t.EFF(53),t.nI1(54,"translate"),t.k0s()()(),t.nrm(55,"mat-divider"),t.j41(56,"mat-accordion",11)(57,"mat-expansion-panel",12)(58,"mat-expansion-panel-header",13),t.nI1(59,"translate"),t.j41(60,"mat-panel-title"),t.EFF(61),t.nI1(62,"translate"),t.k0s()(),t.DNE(63,Tt,7,3,"div",14),t.k0s()()()()}if(2&i){const e=t.XpG();t.R7$(3),t.SpI(" ",e.invoice.Typ.Beteckning," "),t.R7$(),t.HbH(e.getStatus(e.invoice.AttBetala,"color",e.invoice.F\u00f6rfallodag)),t.FS9("text",e.getStatus(e.invoice.AttBetala,"text",e.invoice.F\u00f6rfallodag)),t.R7$(5),t.JRh(t.bMT(10,38,"PERIOD")),t.R7$(3),t.JRh(e.invoice.Reskontror[0].Period),t.R7$(),t.Y8G("ngIf",!e.invoice.Anst\u00e5ndsdatum),t.R7$(),t.Y8G("ngIf",e.invoice.Anst\u00e5ndsdatum),t.R7$(2),t.JRh(e.invoice.Betalningsf\u00f6rmedlareBeteckning),t.R7$(2),t.JRh(e.invoice.MottagareNummer),t.R7$(2),t.JRh(t.bMT(21,40,"OCR")),t.R7$(3),t.JRh(e.invoice.Betalningsreferens),t.R7$(3),t.JRh(t.bMT(27,42,"AMOUNT")),t.R7$(3),t.Lme("",t.bMT(30,44,e.invoice.Bruttobelopp)," ",t.bMT(31,46,"KR"),""),t.R7$(4),t.JRh(t.bMT(34,48,"AMOUNTPAID")),t.R7$(3),t.Lme("",t.bMT(37,50,e.invoice.InbetaltBelopp)," ",t.bMT(38,52,"KR"),""),t.R7$(4),t.JRh(t.bMT(41,54,"LEFTTOPAY")),t.R7$(3),t.Lme("",t.bMT(44,56,e.invoice.AttBetala)," ",t.bMT(45,58,"KR"),""),t.R7$(3),t.AVh("full-width",e.mediaQueryService.isMobile()),t.R7$(),t.Y8G("ngIf",e.invoice.SwishKonfigurerad&&e.invoice.AttBetala>0),t.R7$(),t.FS9("text",t.bMT(49,60,"COPYOCR")),t.FS9("copyText",e.invoice.Betalningsreferens),t.FS9("eventLabel",t.bMT(50,62,"COPYOCR")),t.FS9("eventCategory",e.category),t.Y8G("stroked",!0),t.R7$(3),t.FS9("eventLabel",t.bMT(52,64,"SHOW")),t.FS9("eventCategory",e.category),t.R7$(2),t.Lme("",t.bMT(54,66,"SHOW")," ",null==e.invoice.Typ.Beteckning?null:e.invoice.Typ.Beteckning.toLowerCase(),""),t.R7$(5),t.FS9("eventLabel",t.bMT(59,68,"SPECIFICATION")),t.FS9("eventCategory",e.category),t.R7$(3),t.SpI(" ",t.bMT(62,70,"SPECIFICATION")," "),t.R7$(2),t.Y8G("ngForOf",e.invoice.Reskontror)}}function Rt(i,s){1&i&&(t.j41(0,"div",21),t.nrm(1,"taiga-spinner",22),t.k0s()),2&i&&(t.R7$(),t.Y8G("diameter",16))}
1function yt(i,s){if(1&i&&(t.j41(0,"div")(1,"div",16)(2,"div"),t.EFF(3),t.k0s(),t.j41(4,"div"),t.EFF(5),t.nI1(6,"numberFormat"),t.nI1(7,"translate"),t.k0s()(),t.nrm(8,"mat-divider"),t.k0s()),2&i){const e=s.$implicit;t.R7$(3),t.SpI(" ",e.text," "),t.R7$(2),t.Lme("",t.bMT(6,3,e.netAmount+e.vatAmount)," ",t.bMT(7,5,"KR"),"")}}function Ct(i,s){if(1&i&&(t.j41(0,"div")(1,"h4")(2,"div"),t.EFF(3),t.k0s(),t.j41(4,"div"),t.EFF(5),t.k0s()(),t.DNE(6,yt,9,7,"div",14),t.k0s()),2&i){const e=s.$implicit;t.R7$(3),t.JRh(e.number),t.R7$(2),t.JRh(e.displayName),t.R7$(),t.Y8G("ngForOf",e.rows)}}function xt(i,s){if(1&i&&(t.qex(0),t.DNE(1,Ct,7,3,"div",14),t.bVm()),2&i){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.ledgers)}}function Ft(i,s){if(1&i){const e=t.RV6();t.j41(0,"mat-card",1)(1,"div",2)(2,"mat-card-title"),t.EFF(3),t.k0s(),t.nrm(4,"taiga-pill-badge",3),t.k0s(),t.j41(5,"mat-card-content")(6,"div",4)(7,"div",5)(8,"h4"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"div"),t.EFF(12),t.k0s(),t.j41(13,"h4"),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.j41(16,"div"),t.EFF(17),t.k0s(),t.j41(18,"h4"),t.EFF(19),t.k0s(),t.j41(20,"div"),t.EFF(21),t.k0s()(),t.j41(22,"div",5)(23,"h4"),t.EFF(24),t.nI1(25,"translate"),t.k0s(),t.j41(26,"div"),t.EFF(27),t.k0s(),t.j41(28,"h4"),t.EFF(29),t.nI1(30,"translate"),t.k0s(),t.j41(31,"div"),t.EFF(32),t.nI1(33,"numberFormat"),t.nI1(34,"translate"),t.k0s(),t.j41(35,"h4"),t.EFF(36),t.nI1(37,"translate"),t.k0s(),t.j41(38,"div"),t.EFF(39),t.nI1(40,"numberFormat"),t.nI1(41,"translate"),t.k0s()(),t.j41(42,"div",7),t.nrm(43,"taiga-copy-button",17),t.nI1(44,"translate"),t.nI1(45,"translate"),t.j41(46,"button",18),t.nI1(47,"translate"),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.downloadPdf(a.invoiceGQL.number))}),t.EFF(48),t.nI1(49,"translate"),t.k0s()()(),t.nrm(50,"mat-divider"),t.j41(51,"mat-accordion",11)(52,"mat-expansion-panel",19),t.bIt("opened",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.getSpecification(null==a.invoiceGQL.number?null:a.invoiceGQL.number.toString()))}),t.j41(53,"mat-expansion-panel-header",13),t.nI1(54,"translate"),t.j41(55,"mat-panel-title"),t.EFF(56),t.nI1(57,"translate"),t.k0s()(),t.DNE(58,Rt,2,1,"div",20)(59,xt,2,1,"ng-container",6),t.k0s()()()()}if(2&i){let e;const n=t.XpG();t.R7$(3),t.SpI(" ",n.invoiceGQL.type.displayName," "),t.R7$(),t.HbH(n.getStatus(n.invoiceGQL.toPay,"color",n.invoiceGQL.due)),t.FS9("text",n.getStatus(n.invoiceGQL.toPay,"text",n.invoiceGQL.due)),t.R7$(5),t.JRh(t.bMT(10,34,"PERIOD")),t.R7$(3),t.JRh(n.invoiceGQL.accountingPeriod.displayName),t.R7$(2),t.JRh(t.bMT(15,36,"EXPIREDATE")),t.R7$(3),t.JRh(n.formatDate(n.invoiceGQL.due)),t.R7$(2),t.JRh(null!==(e=n.invoiceGQL.payToTypeDisplayName)&&void 0!==e?e:"-"),t.R7$(2),t.JRh(n.invoiceGQL.payToNumber),t.R7$(3),t.JRh(t.bMT(25,38,"OCR")),t.R7$(3),t.JRh(n.invoiceGQL.referenceNumber),t.R7$(2),t.JRh(t.bMT(30,40,"AMOUNT")),t.R7$(3),t.Lme("",t.bMT(33,42,n.invoiceGQL.balanceAmount)," ",t.bMT(34,44,"KR"),""),t.R7$(4),t.JRh(t.bMT(37,46,"LEFTTOPAY")),t.R7$(3),t.Lme("",t.bMT(40,48,n.invoiceGQL.toPay)," ",t.bMT(41,50,"KR"),""),t.R7$(3),t.AVh("full-width",n.mediaQueryService.isMobile()),t.R7$(),t.FS9("text",t.bMT(44,52,"COPYOCR")),t.FS9("copyText",n.invoiceGQL.referenceNumber),t.FS9("eventLabel",t.bMT(45,54,"COPYOCR")),t.FS9("eventCategory",n.category),t.R7$(3),t.FS9("eventLabel",t.bMT(47,56,"SHOW")),t.FS9("eventCategory",n.category),t.R7$(2),t.Lme("",t.bMT(49,58,"SHOW")," ",n.invoiceGQL.type.displayName.toLowerCase(),""),t.R7$(5),t.FS9("eventLabel",t.bMT(54,60,"SPECIFICATION")),t.FS9("eventCategory",n.category),t.R7$(3),t.SpI(" ",t.bMT(57,62,"SPECIFICATION")," "),t.R7$(2),t.Y8G("ngIf",n.showSpinner),t.R7$(),t.Y8G("ngIf",n.ledgers.length>0)}}let wt=(()=>{class i{constructor(e,n,a,r,p,c,I,S){this.invoiceService=e,this.mediaQueryService=n,this.translate=a,this.fileService=r,this.dialog=p,this.router=c,this.route=I,this.cacheService=S,this.ledgers=[],this.SWISH_PAYMENT_REQUEST="SWISH_PAYMENT_REQUEST",this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID="SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID",this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME="SWISH_PAYMENT_REQUEST_EXPIRE_TIME",this.category=this.translate.instant("INVOICE")}ngOnInit(){const e=JSON.parse(sessionStorage.getItem(this.SWISH_PAYMENT_REQUEST)),n=sessionStorage.getItem(this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID),a=sessionStorage.getItem(this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME);e&&n===this.invoice?.Typ?.AviseringId?.toString()&&a&&(+a>Date.now()?this.continueSwishPayment(e):(sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST),sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST_LEDGER_NOTE_ID),sessionStorage.removeItem(this.SWISH_PAYMENT_REQUEST_EXPIRE_TIME)))}formatDate(e){return u()(e).format("YYYY-MM-DD")}downloadPdf(e){this.invoiceService.getInvoicePdf(e).subscribe(n=>{this.fileService.saveBlobWithFilename(n,`Reskontra_${e}.pdf`)})}getStatus(e,n,a){const r=e>0,p=u()(a).endOf("day").isBefore(new Date);return r&&p?"color"===n?"badge-warn":this.translate.instant("OVERDUE"):r?"color"===n?"badge-info":this.translate.instant("UNPAIDSTATUS"):"color"===n?"badge-success":this.translate.instant("PAIDSTATUS")}getSpecification(e){this.ledgers.length>0||(this.showSpinner=!0,this.invoiceService.fetchLedgerRowAggregatedByLedgerN
1oteNumber(e).pipe((0,b.W)(n=>{throw this.showSpinner=!1,n})).subscribe(n=>{this.showSpinner=!1;for(const a of this.invoiceGQL.ledgers.nodes){let r,p,c,I=a.ledger?.object;I?(r=I.number,p=I.displayName,c=n?.data?.ledgerRowAggregatedByLedgerNoteNumber?.filter(S=>S.refersToObjectId===a.ledger.object.id)):c=n?.data?.ledgerRowAggregatedByLedgerNoteNumber,c?.length>0&&(c.sort((S,Wt)=>Wt.netAmount-S.netAmount),this.ledgers.push({number:r,displayName:p,rows:c}))}}))}createSwishPayment(e){this.dialog.open(O,{data:{ledgerNoteId:e},disableClose:!0}).afterClosed().subscribe(a=>{a&&"success"===a&&this.invoiceService.clearSessionCache().subscribe(()=>{this.cacheService.clear();const r=N.Q.generateUniqueId();this.router.navigate([],{relativeTo:this.route,queryParams:{[r]:""},queryParamsHandling:"merge"})})})}continueSwishPayment(e){this.dialog.open(O,{data:{swishPaymentRequest:e},disableClose:!0}).afterClosed().subscribe(a=>{a&&"success"===a&&this.invoiceService.clearSessionCache().subscribe(()=>{this.cacheService.clear();const r=N.Q.generateUniqueId();this.router.navigate([],{relativeTo:this.route,queryParams:{[r]:""},queryParamsHandling:"merge"})})})}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(m.p),t.rXU(_.M),t.rXU(d.c$),t.rXU($.E),t.rXU(w.j),t.rXU(f.Ix),t.rXU(f.nX),t.rXU(tt._))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-invoice-item"]],inputs:{invoiceGQL:"invoiceGQL",invoice:"invoice"},standalone:!1,decls:2,vars:2,consts:[["class","invoice-card",4,"ngIf"],[1,"invoice-card"],[1,"card-title"],[3,"text"],[1,"flex-contaioner"],[1,"flex-item"],[4,"ngIf"],[1,"button-row"],["style","height: 36px;",3,"label","stroked","clicked",4,"ngIf"],["taigaEventTracker","",3,"text","copyText","stroked","eventLabel","eventCategory"],["mat-stroked-button","","taigaEventTracker","","data-mom-test","MinaSidor_Betalningar_VisaHyresavi",1,"mat-elevation-z2",3,"click","eventLabel","eventCategory"],["togglePosition","before"],[1,"mat-elevation-z0"],["taigaEventTracker","",3,"eventLabel","eventCategory"],[4,"ngFor","ngForOf"],[2,"height","36px",3,"clicked","label","stroked"],[1,"specification-container"],["taigaEventTracker","",3,"text","copyText","eventLabel","eventCategory"],["mat-raised-button","","color","primary","taigaEventTracker","",3,"click","eventLabel","eventCategory"],[1,"mat-elevation-z0",3,"opened"],["class","spinner",4,"ngIf"],[1,"spinner"],[3,"diameter"]],template:function(n,a){1&n&&t.DNE(0,Et,64,72,"mat-card",0)(1,Ft,60,64,"mat-card",0),2&n&&(t.Y8G("ngIf",a.invoice),t.R7$(),t.Y8G("ngIf",a.invoiceGQL))},dependencies:[et.Y,ot,st.q,y.$z,P.RN,P.m2,P.dh,C.BS,C.GK,C.Z2,C.WN,h.Sq,h.bT,G.u,x.t,vt,d.D9,ft],styles:[".flex-contaioner[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.flex-item[_ngcontent-%COMP%]{margin:0 5px}.status[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between}.button-row[_ngcontent-%COMP%]{margin:10px 0 0;align-items:flex-end;display:flex;flex-wrap:wrap}.button-row[_ngcontent-%COMP%] taiga-swish-button[_ngcontent-%COMP%], taiga-copy-button[_ngcontent-%COMP%]{margin-right:5px}.button-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%], taiga-copy-button[_ngcontent-%COMP%]{margin-top:5px}.full-width[_ngcontent-%COMP%]{width:100%}.mat-success[_ngcontent-%COMP%]{background-color:#d4edda}.mat-warn[_ngcontent-%COMP%]{background-color:#b82e2e;color:#fff!important}.card-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.invoice-card[_ngcontent-%COMP%]{margin:10px 0}.specification-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:5px}h4[_ngcontent-%COMP%]{margin:10px 0 0;font-weight:700}.spinner[_ngcontent-%COMP%]{display:flex;justify-content:center}"]})}}return i})();function Pt(i,s){1&i&&t.nrm(0,"taiga-invoice-item",2),2&i&&t.Y8G("invoice",s.$implicit)}function kt(i,s){1&i&&t.nrm(0,"taiga-invoice-item",3),2&i&&t.Y8G("invoiceGQL",s.$implicit)}let Mt=(()=>{class i{constructor(e,n,a,r){this.invoiceService=e,this.mediaQueryService=n,this.translate=a,this.fileService=r,this.category=this.translate.instant("INVOICE")}formatDate(e){return u()(e).format("YYYY-MM-DD")}downloadPdf(e){this.invoiceService.getInvoicePdf(e).subscribe(n=>{this.fileService.saveBlobWithFilename(n,`Reskontra_${e}.pdf`)})}
1getStatus(e,n){return e>0?"color"===n?"badge-warn":this.translate.instant("UNPAIDSTATUS"):"color"===n?"badge-success":this.translate.instant("PAIDSTATUS")}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(m.p),t.rXU(_.M),t.rXU(d.c$),t.rXU($.E))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-invoice-list"]],inputs:{invoices:"invoices",invoicesGQL:"invoicesGQL"},standalone:!1,decls:2,vars:2,consts:[[3,"invoice",4,"ngFor","ngForOf"],[3,"invoiceGQL",4,"ngFor","ngForOf"],[3,"invoice"],[3,"invoiceGQL"]],template:function(n,a){1&n&&t.DNE(0,Pt,1,1,"taiga-invoice-item",0)(1,kt,1,1,"taiga-invoice-item",1),2&n&&(t.Y8G("ngForOf",a.invoices),t.R7$(),t.Y8G("ngForOf",a.invoicesGQL))},dependencies:[h.Sq,wt],styles:[".flex-contaioner[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.flex-item[_ngcontent-%COMP%]{margin:0 5px}.status[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between}.button-row[_ngcontent-%COMP%]{margin:10px 0 0;align-items:flex-end;display:flex;justify-content:space-between}.button-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:5px}.full-width[_ngcontent-%COMP%]{width:100%}.mat-success[_ngcontent-%COMP%]{background-color:#d4edda}.mat-warn[_ngcontent-%COMP%]{background-color:#b82e2e;color:#fff!important}.card-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.invoice-card[_ngcontent-%COMP%]{margin:10px 0}.specification-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:5px}h4[_ngcontent-%COMP%]{margin:10px 0 0;font-weight:700}"]})}}return i})();const Gt=()=>[1,5,10,25,100];function $t(i,s){if(1&i){const e=t.RV6();t.j41(0,"mat-chip-option",14),t.bIt("click",function(){const a=t.eBV(e).$implicit,r=t.XpG
1(2);return a.selected=!a.selected,t.Njj(r.changeSelected(r.chips))}),t.EFF(1),t.k0s()}if(2&i){const e=s.$implicit;t.Y8G("selected",e.selected),t.R7$(),t.SpI(" ",e.chipText," ")}}function jt(i,s){1&i&&(t.j41(0,"div",15),t.nrm(1,"taiga-spinner"),t.k0s())}function Lt(i,s){if(1&i&&t.nrm(0,"taiga-invoice-list",17),2&i){const e=t.XpG(3);t.Y8G("invoices",e.visibleUnPaidInvoices)}}function Ot(i,s){if(1&i&&t.nrm(0,"taiga-invoice-list",17),2&i){const e=t.XpG(3);t.Y8G("invoices",e.visibleLapsedInvoices)}}function Nt(i,s){if(1&i&&t.nrm(0,"taiga-invoice-list",17),2&i){const e=t.XpG(3);t.Y8G("invoices",e.visiblePaidInvoices)}}function Dt(i,s){if(1&i&&(t.qex(0),t.DNE(1,Lt,1,1,"taiga-invoice-list",16)(2,Ot,1,1,"taiga-invoice-list",16)(3,Nt,1,1,"taiga-invoice-list",16),t.bVm()),2&i){t.XpG();const e=t.sdS(9);t.R7$(),t.Y8G("ngIf","unpaid"===e.value||"all"===e.value),t.R7$(),t.Y8G("ngIf","lapsed"===e.value),t.R7$(),t.Y8G("ngIf","paid"===e.value||"all"===e.value)}}function At(i,s){if(1&i&&(t.j41(0,"div")(1,"div",2)(2,"div"),t.nrm(3,"taiga-medium-header",3),t.nI1(4,"translate"),t.nI1(5,"translate"),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div")(8,"mat-button-toggle-group",4,0)(10,"mat-button-toggle",5),t.nI1(11,"translate"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"mat-button-toggle",6),t.nI1(15,"translate"),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.j41(18,"mat-button-toggle",7),t.nI1(19,"translate"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"mat-button-toggle",8),t.nI1(23,"translate"),t.EFF(24),t.nI1(25,"translate"),t.k0s()()(),t.j41(26,"div",9)(27,"mat-chip-listbox",10),t.nI1(28,"translate"),t.DNE(29,$t,2,2,"mat-chip-option",11),t.k0s()(),t.DNE(30,jt,2,0,"div",12)(31,Dt,4,3,"ng-container",13),t.k0s()),2&i){const e=t.XpG();t.AVh("is-mobile",e.mediaQueryService.isMobile())("is-desktop",!e.mediaQueryService.isMobile()),t.R7$(3),t.FS9("text",t.bMT(4,27,"INVOICE")),t.yjJ("subText","",t.bMT(5,29,"BALANCE")," ",e.balance," ",t.bMT(6,31,"KR"),""),t.R7$(5),t.Y8G("value",e.selectedPaymentType),t.R7$(2),t.FS9("eventLabel",t.bMT(11,33,"UNPAID")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(13,35,"UNPAID")),t.R7$(2),t.FS9("eventLabel",t.bMT(15,37,"LAPSED")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(17,39,"LAPSED")),t.R7$(2),t.FS9("eventLabel",t.bMT(19,41,"PAID")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(21,43,"PAID")),t.R7$(2),t.FS9("eventLabel",t.bMT(23,45,"ALL")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(25,47,"ALL")),t.R7$(3),t.Y8G("selectable",!0),t.BMQ("aria-label",t.bMT(28,49,"SELECTINVOICETYPES")),t.R7$(2),t.Y8G("ngForOf",e.chips),t.R7$(),t.Y8G("ngIf",e.showSpinner),t.R7$(),t.Y8G("ngIf",!e.showSpinner)}}function Bt(i,s){if(1&i){const e=t.RV6();t.j41(0,"mat-chip-option",14),t.bIt("click",function(){const a=t.eBV(e).$implicit,r=t.XpG
1(2);return a.selected=!a.selected,t.Njj(r.changeSelectedGQL(r.chips))}),t.EFF(1),t.k0s()}if(2&i){const e=s.$implicit;t.Y8G("selected",e.selected),t.R7$(),t.SpI(" ",e.chipText," ")}}function Yt(i,s){1&i&&(t.j41(0,"div",15),t.nrm(1,"taiga-spinner"),t.k0s())}function Ut(i,s){if(1&i){const e=t.RV6();t.j41(0,"div")(1,"div",2)(2,"div"),t.nrm(3,"taiga-medium-header",3),t.nI1(4,"translate"),t.nI1(5,"translate"),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div")(8,"mat-button-toggle-group",18,0),t.bIt("change",function(a){t.eBV(e);const r=t.XpG();return t.Njj(r.changeInvoices(a.value))}),t.j41(10,"mat-button-toggle",5),t.nI1(11,"translate"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"mat-button-toggle",6),t.nI1(15,"translate"),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.j41(18,"mat-button-toggle",7),t.nI1(19,"translate"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"mat-button-toggle",8),t.nI1(23,"translate"),t.EFF(24),t.nI1(25,"translate"),t.k0s()()(),t.j41(26,"div",9)(27,"mat-chip-listbox",10),t.DNE(28,Bt,2,2,"mat-chip-option",11),t.k0s()(),t.qex(29),t.DNE(30,Yt,2,0,"div",12),t.nrm(31,"taiga-invoice-list",19),t.j41(32,"mat-paginator",20),t.bIt("page",function(a){t.eBV(e);const r=t.XpG();return t.Njj(r.onPageChange(a))}),t.k0s(),t.bVm(),t.k0s()}if(2&i){const e=t.XpG();t.AVh("is-mobile",e.mediaQueryService.isMobile())("is-desktop",!e.mediaQueryService.isMobile()),t.R7$(3),t.FS9("text",t.bMT(4,30,"INVOICE")),t.yjJ("subText","",t.bMT(5,32,"BALANCE")," ",e.balance," ",t.bMT(6,34,"KR"),""),t.R7$(5),t.Y8G("value",e.selectedPaymentType),t.R7$(2),t.FS9("eventLabel",t.bMT(11,36,"UNPAID")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(13,38,"UNPAID")),t.R7$(2),t.FS9("eventLabel",t.bMT(15,40,"LAPSED")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(17,42,"LAPSED")),t.R7$(2),t.FS9("eventLabel",t.bMT(19,44,"PAID")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(21,46,"PAID")),t.R7$(2),t.FS9("eventLabel",t.bMT(23,48,"ALL")),t.FS9("eventCategory",e.category),t.R7$(2),t.JRh(t.bMT(25,50,"ALL")),t.R7$(3),t.Y8G("selectable",!0),t.R7$(),t.Y8G("ngForOf",e.chips),t.R7$(2),t.Y8G("ngIf",e.showSpinner),t.R7$(),t.Y8G("invoicesGQL",e.invoicesGQL),t.R7$(),t.Y8G("length",e.invoicesCount)("pageIndex",e.page-1)("pageSize",e.pageSize)("pageSizeOptions",t.lJ4(52,Gt))}}let Qt=(()=>{class i{constructor(e,n,a,r,p,c){this.route=e,this.mediaQueryService=n,this.translate=a,this.invoiceService=r,this.clientConfigurationService=p,this.router=c,this.selectedPaymentType="unpaid",this.chips=[],this.pageSize=10,this.category=this.translate.instant("INVOICE")}ngOnInit(){this.selectedPaymentType=this.route.snapshot.queryParams.type??"unpaid",this.clientConfigurationService.getClientConfigurationFeatures().subscribe(e=>{this.useGraphQL=e?.graphQL?.enabled,this.useGraphQL=!1,this.useGraphQL&&(this.invoiceService.fetchTotalCountLedgerNotes(this.selectedPaymentType).subscribe(n=>{this.invoicesCount=n.data.ledgerNotes.totalCount}),this.invoiceService.fetchToPay().subscribe(n=>{this.balance=n?.data?.actors?.nodes[0]?.economy?.toPay}),this.invoiceService.fetchTotalCountLedgerNotes("all").subscribe(n=>{this.invoiceService.fetchLedgerNotesTypes(n.data.ledgerNotes.totalCount).subscribe(a=>{const r=[...new Set(a.data.ledgerNotes.nodes.map(p=>p.type.displayName))];for(const p of r)this.chips.push({chipText:p??this.translate.instant("OTHER"),chipType:p,selected:!0})})})),this.route.queryParams.subscribe(n=>{this.pageSize=n.pageSize??this.pageSize,this.page=this.route.snapshot.queryParams.page??1,this.before=n.before??null,this.after=n.after??null,this.useGraphQL?(this.showSpinner=!0,this.invoiceService.fetchLedgerNotes(this.after||!this.before&&!this.after?+this.pageSize:null,this.before?+this.pageSize:null,this.before,this.after,this.selectedPaymentType,this.chips.filter(a=>!a.selected).map(a=>a.chipText)).pipe((0,b.W)(a=>{throw this.showSpinner=!1,a})).subscribe(a=>{this.showSpinner=!1,this.invoicesGQL=a.data.ledgerNotes.nodes,this.before=a.data.ledgerNotes.pageInfo.startCursor,this.after=a.data.ledgerNotes.pageInfo.endCursor})):(this.showSpinner=!0,this.invoiceService.getInvoices().pipe((0,b.W)(a=>{throw this.showSpinner=!1,a})).subscribe(a=>{if(this.showSpinner=!1,a){const r=a.Kund.Ekonomi;this.invoices=r.Aviseringar,this.balance=r.Hyressaldo+r.Fakturasaldo,this.unPaidInvoices=this.invoices.filter(c=>c.AttBetala>0),this.lapsedInvoices=this.invoices.filter(c=>c.AttBetala>0&&u()(c.F\u00f6rfallodag).endOf("day").isBefore(new Date)),this.paidInvoices=this.invoices.filter(c=>0===c.AttBetala),this.visibleUnPaidInvoices=this.unPaidInvoices,this.visibleLapsedInvoices=this.lapsedInvoices,this.visiblePaidInvoices=this.paidInvoices,this.selectedPaymentType=this.unPaidInvoices.length>0?"unpaid":"all";const p=[...new Set(this.invoices.map(c=>c.Typ.Beteckning))];this.chips=[];for(const c of p)this.chips.push({chipText:c??this.translate.instant("OTHER"),chipType:c,selected:!0})}}))})})}ngAfterViewInit(){this.useGraphQL&&(this.paginator._intl.itemsPerPageLabel=null,this.paginator._intl.nextPageLabel=this.translate.instant("NEXTPAGE"),this.paginator._intl.previousPageLabel=this.translate.instant("PREVIOUSPAGE"),this.paginator._intl.getRangeLabel=(e,n,a)=>
1{if(0===a||0===n)return`0 ${this.translate.instant("OF")} ${a}`;const r=e*n;return`${r+1} \u2013 ${r<(a=Math.max(a,0))?Math.min(r+n,a):r+n} ${this.translate.instant("OF")} ${a}`})}changeSelected(e){this.visibleUnPaidInvoices=[],this.visiblePaidInvoices=[],this.visibleLapsedInvoices=[];for(const n of e)n.selected&&(this.visibleUnPaidInvoices.push(...this.unPaidInvoices.filter(a=>a.Typ.Beteckning===n.chipType)),this.visiblePaidInvoices.push(...this.paidInvoices.filter(a=>a.Typ.Beteckning===n.chipType)),this.visibleLapsedInvoices.push(...this.lapsedInvoices.filter(a=>a.Typ.Beteckning===n.chipType)))}changeSelectedGQL(e){this.invoicesGQL=[],this.showSpinner=!0,this.invoiceService.fetchTotalCountLedgerNotes(this.selectedPaymentType,e.filter(n=>!n.selected).map(n=>n.chipText)).pipe((0,b.W)(n=>{throw this.showSpinner=!1,n})).subscribe(n=>{this.invoicesCount=n.data.ledgerNotes.totalCount;let a={r:(Math.random()+1).toString(36).substring(7)};this.router.navigate([],{relativeTo:this.route,queryParamsHandling:"merge",queryParams:a})})}onPageChange(e){this.invoicesGQL=[],this.showSpinner=!0,window.scroll(0,0);let n=this.pageSize;this.pageSize=e.pageSize,this.page=e.pageIndex+1;let a={pageSize:this.pageSize,page:this.page,type:this.selectedPaymentType};switch(!0){case 0===e.pageIndex:break;case+n!==this.pageSize:a={...a,page:1};break;case e.pageIndex>e.previousPageIndex:a={...a,after:this.after};break;case e.pageIndex<e.previousPageIndex:a={...a,before:this.before}}this.router.navigate([],{relativeTo:this.route,queryParams:a})}changeInvoices(e){this.invoicesGQL=[],this.showSpinner=!0,this.selectedPaymentType=e,this.invoiceService.fetchTotalCountLedgerNotes(this.selectedPaymentType,this.chips.filter(n=>!n.selected).map(n=>n.chipText)).subscribe(n=>{this.invoicesCount=n.data.ledgerNotes.totalCount,this.router.navigate([],{relativeTo:this.route,queryParams:{type:this.selectedPaymentType}})})}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(f.nX),t.rXU(_.M),t.rXU(d.c$),t.rXU(m.p),t.rXU(A.t),t.rXU(f.Ix))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["taiga-invoice"]],viewQuery:function(n,a){if(1&n&&t.GBs(l.iy,5),2&n){let r;t.mGM(r=t.lsd())&&(a.paginator=r.first)}},standalone:!1,decls:2,vars:2,consts:[["group","matButtonToggleGroup"],[3,"is-mobile","is-desktop",4,"ngIf"],[1,"header"],["data-mom-test","MinaSidor_MittS\xf6kande_SidRubrik",3,"text","subText"],[1,"slim-toggle",3,"value"],["value","unpaid","taigaEventTracker","",3,"eventLabel","eventCategory"],["value","lapsed","taigaEventTracker","",3,"eventLabel","eventCategory"],["value","paid","taigaEventTracker","",3,"eventLabel","eventCategory"],["value","all","taigaEventTracker","",3,"eventLabel","eventCategory"],[1,"chip-list"],["multiple","",3,"selectable"],[3,"selected","click",4,"ngFor","ngForOf"],["class","spinner",4,"ngIf"],[4,"ngIf"],[3,"click","selected"],[1,"spinner"],[3,"invoices",4,"ngIf"],[3,"invoices"],[1,"slim-toggle",3,"change","value"],[3,"invoicesGQL"],[3,"page","length","pageIndex","pageSize","pageSizeOptions"]],template:function(n,a){1&n&&t.DNE(0,At,32,51,"div",1)(1,Ut,33,53,"div",1),2&n&&(t.Y8G("ngIf",!a.useGraphQL),t.R7$(),t.Y8G("ngIf",a.useGraphQL))},dependencies:[k.uI,k.gq,M.ec,M.pc,h.Sq,h.bT,G.u,B.o,l.iy,x.t,Mt,d.D9],styles:[".is-desktop[_ngcontent-%COMP%]{padding:30px}.is-mobile[_ngcontent-%COMP%]{padding:20px}.header[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;flex-wrap:wrap}mat-button-toggle-group[_ngcontent-%COMP%]{height:32px}.title[_ngcontent-%COMP%]{margin:0;font-weight:700}.is-desktop[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{margin:0}.chip-list[_ngcontent-%COMP%]{margin-top:15px;margin-bottom:20px}mat-chip[_ngcontent-%COMP%]{font-size:.75rem;font-weight:400;cursor:pointer}mat-paginator[_ngcontent-%COMP%]{margin-top:10px}.spinner[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:10px;margin-bottom:10p}"]})}}return i})();var Xt=o(9496);const Vt=[{path:"",component:Qt,canActivate:[v.q,Xt.u],title:"INVOICE"}];let Ht=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=t.G2t({imports:[R.iI.forChild(Vt),R.iI]})}}return i})(),Jt=(()=>
1{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=t.G2t({imports:[d.h.forChild(),Ht,E.G]})}}return i})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.