dealposbooks 5.45.0 → 5.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-GIQOPGQF.js → chunk-34AG6ZRL.js} +1 -1
- package/{chunk-27TIOMYM.js → chunk-34WPW5D2.js} +1 -1
- package/{chunk-3FDVZDYS.js → chunk-3E76NHYR.js} +1 -1
- package/{chunk-EG4A3G2F.js → chunk-3O7PYVJB.js} +1 -1
- package/{chunk-6HX55BLY.js → chunk-3YP5GGRN.js} +1 -1
- package/{chunk-6D4IGQVY.js → chunk-4EASZOWM.js} +1 -1
- package/{chunk-4ETCCLMI.js → chunk-4LUDLDRM.js} +1 -1
- package/{chunk-PPJQN2WS.js → chunk-4OROB43Y.js} +1 -1
- package/{chunk-HPITHIZA.js → chunk-4SJCTDC5.js} +1 -1
- package/{chunk-4PUT2IIE.js → chunk-55PBPTNF.js} +1 -1
- package/{chunk-GX5CQNX3.js → chunk-5UQN26GG.js} +1 -1
- package/{chunk-O2QIO42B.js → chunk-7EJY6C3Q.js} +1 -1
- package/{chunk-Y6YUTTA4.js → chunk-7X6D62QP.js} +1 -1
- package/{chunk-T6B4BOOB.js → chunk-ADIJSTCG.js} +1 -1
- package/{chunk-5EJXAYSX.js → chunk-AYBSWMQT.js} +1 -1
- package/{chunk-EERQ53V7.js → chunk-B5ICLX2M.js} +1 -1
- package/{chunk-K5U6AQ75.js → chunk-B6BFJFA6.js} +1 -1
- package/{chunk-U7BSQJHQ.js → chunk-BCRBHPPF.js} +1 -1
- package/{chunk-FPI32FQH.js → chunk-CBAJ6F64.js} +1 -1
- package/{chunk-66D4GMNG.js → chunk-EK3VPTHC.js} +1 -1
- package/{chunk-KW4A377H.js → chunk-F4ZNQXWG.js} +1 -1
- package/{chunk-7XL26PM3.js → chunk-F5QD3IJY.js} +1 -1
- package/{chunk-N75VYDTF.js → chunk-F7JURLD3.js} +1 -1
- package/chunk-FBAUSUGQ.js +202 -0
- package/{chunk-DX2A6LIU.js → chunk-GBBQUUCQ.js} +1 -1
- package/{chunk-OTO7ELZ2.js → chunk-GVDMC4IX.js} +1 -1
- package/{chunk-ZZCT6WNV.js → chunk-IWHPWZIL.js} +1 -1
- package/{chunk-LSK6C72D.js → chunk-IYWJ4NQV.js} +1 -1
- package/{chunk-DLIPUA4K.js → chunk-KQEKK7SJ.js} +1 -1
- package/{chunk-G2DQX336.js → chunk-KV6EPP4J.js} +1 -1
- package/{chunk-R6TARUG2.js → chunk-KYNEAC2L.js} +1 -1
- package/{chunk-CSDQYXOM.js → chunk-L2MQOC56.js} +1 -1
- package/{chunk-OTMBGB3T.js → chunk-M675R5IO.js} +1 -1
- package/{chunk-VXTZNZMH.js → chunk-MAZVUNNB.js} +1 -1
- package/{chunk-IYBQ7NLP.js → chunk-NKCNDLCN.js} +1 -1
- package/{chunk-35MXFTDN.js → chunk-NVB5C5WN.js} +1 -1
- package/{chunk-BJWQQABR.js → chunk-OVSN4E2D.js} +2 -2
- package/{chunk-M6LSMNSQ.js → chunk-PPSWJ3KZ.js} +1 -1
- package/chunk-PUGHX4BL.js +1 -0
- package/{chunk-YOMVOFLB.js → chunk-Q5K47PTK.js} +1 -1
- package/{chunk-S5O44AS7.js → chunk-QMVQ67BR.js} +1 -1
- package/{chunk-ITBP232X.js → chunk-QR5KD37B.js} +2 -2
- package/{chunk-T7VJORKB.js → chunk-RIEXBPQ3.js} +1 -1
- package/{chunk-7FFVGWUP.js → chunk-ULJ2Y7SG.js} +1 -1
- package/{chunk-W5ER7276.js → chunk-V4XZTIO4.js} +1 -1
- package/{chunk-4MZNOMUN.js → chunk-VCNN5RVA.js} +1 -1
- package/{chunk-ZRCCGUC4.js → chunk-VW47RJKF.js} +1 -1
- package/{chunk-3OMEVXSG.js → chunk-WQLQI7VC.js} +1 -1
- package/{chunk-PJDNYCLD.js → chunk-X7UDCQV2.js} +1 -1
- package/{chunk-IFQIZ5KJ.js → chunk-XYDMR5UH.js} +1 -1
- package/{chunk-H3BFDSSJ.js → chunk-YN2HKWAW.js} +1 -1
- package/{chunk-QVIFRW2H.js → chunk-ZFZPBYHM.js} +2 -2
- package/index.html +2 -2
- package/{main-SLMY35VH.js → main-VBAUVWYV.js} +1 -1
- package/package.json +1 -1
- package/chunk-AUYM5P42.js +0 -202
- package/chunk-OBZRC7DX.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-IHZ55QSI.js";import{a as Zt,b as gi,c as ni}from"./chunk-HAQ36ZI6.js";import{a as kt,b as zt}from"./chunk-OVAQBQEJ.js";import{a as Xt}from"./chunk-DX2A6LIU.js";import{a as qe}from"./chunk-QF4D5YPK.js";import{a as Ot}from"./chunk-VJ3IBUVO.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{c as je}from"./chunk-Q5CVMJZC.js";import{a as Vt}from"./chunk-3GGXPPQT.js";import{a as Lt}from"./chunk-MFK5RQPJ.js";import{a as qt,b as Wt}from"./chunk-KJ2WX3FC.js";import{a as $e}from"./chunk-6GN3MGBY.js";import{a as Qe}from"./chunk-Q24GCSGD.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-H3BFDSSJ.js";import{c as Qt}from"./chunk-VGNJD35F.js";import{a as At,b as Bt}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import{i as Mt}from"./chunk-ARH3WEEF.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-OIBDX2CA.js";import{d as Tt}from"./chunk-AOOG6YOT.js";import"./chunk-M6LSMNSQ.js";import"./chunk-2MKKFLNJ.js";import{h as re,j as yt,k as G,l as Le,m as ae,s as me,t as ge}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,$c as Q,Aa as S,Ba as le,Bb as xe,Cc as pt,Db as p,Dc as ee,Ec as P,Fa as Se,Fc as te,Gc as ht,Ha as X,Hc as ut,I as Ye,Jc as mt,Kb as ne,La as it,Lb as a,Mb as at,Nc as gt,Ob as Z,Pb as j,Pc as ft,Qb as Ie,Rb as Ee,Rc as x,Tb as ke,Ub as ze,Vb as d,Vc as bt,Wb as h,Xb as I,Yb as q,Zb as W,_ as Ce,_b as T,_c as w,ca as we,cd as _t,da as et,ec as k,fb as ot,fc as m,g as J,hb as s,ia as B,kc as _,lc as E,m as Ze,mb as lt,mc as g,nb as N,nc as f,pa as tt,qa as L,qc as Y,ra as M,rc as b,sc as A,tc as ue,ua as ve,wc as st,xb as U,xc as ct,yb as nt,yc as dt,zb as rt}from"./chunk-NMCKMUY4.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
|
|
1
|
+
import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-IHZ55QSI.js";import{a as Zt,b as gi,c as ni}from"./chunk-HAQ36ZI6.js";import{a as kt,b as zt}from"./chunk-OVAQBQEJ.js";import{a as Xt}from"./chunk-GBBQUUCQ.js";import{a as qe}from"./chunk-QF4D5YPK.js";import{a as Ot}from"./chunk-VJ3IBUVO.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{c as je}from"./chunk-Q5CVMJZC.js";import{a as Vt}from"./chunk-3GGXPPQT.js";import{a as Lt}from"./chunk-MFK5RQPJ.js";import{a as qt,b as Wt}from"./chunk-KJ2WX3FC.js";import{a as $e}from"./chunk-6GN3MGBY.js";import{a as Qe}from"./chunk-Q24GCSGD.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-YN2HKWAW.js";import{c as Qt}from"./chunk-VGNJD35F.js";import{a as At,b as Bt}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import{i as Mt}from"./chunk-ARH3WEEF.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-OIBDX2CA.js";import{d as Tt}from"./chunk-AOOG6YOT.js";import"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{h as re,j as yt,k as G,l as Le,m as ae,s as me,t as ge}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,$c as Q,Aa as S,Ba as le,Bb as xe,Cc as pt,Db as p,Dc as ee,Ec as P,Fa as Se,Fc as te,Gc as ht,Ha as X,Hc as ut,I as Ye,Jc as mt,Kb as ne,La as it,Lb as a,Mb as at,Nc as gt,Ob as Z,Pb as j,Pc as ft,Qb as Ie,Rb as Ee,Rc as x,Tb as ke,Ub as ze,Vb as d,Vc as bt,Wb as h,Xb as I,Yb as q,Zb as W,_ as Ce,_b as T,_c as w,ca as we,cd as _t,da as et,ec as k,fb as ot,fc as m,g as J,hb as s,ia as B,kc as _,lc as E,m as Ze,mb as lt,mc as g,nb as N,nc as f,pa as tt,qa as L,qc as Y,ra as M,rc as b,sc as A,tc as ue,ua as ve,wc as st,xb as U,xc as ct,yb as nt,yc as dt,zb as rt}from"./chunk-NMCKMUY4.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
|
|
2
2
|
/* For PrimeNG */
|
|
3
3
|
.p-treetable {
|
|
4
4
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-XYDMR5UH.js";import"./chunk-ULJ2Y7SG.js";import{a as E,b as O}from"./chunk-VJ3IBUVO.js";import"./chunk-KJ2WX3FC.js";import{h as H}from"./chunk-YN2HKWAW.js";import{b as N,c as G}from"./chunk-VGNJD35F.js";import{a as R,b as D}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as V,x as j}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-PPSWJ3KZ.js";import{a as I}from"./chunk-2MKKFLNJ.js";import{n as A,s as F}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as P,Cc as $,Db as B,Dc as _,Lb as p,Nc as m,Ob as d,Oc as l,Rc as x,Vb as o,W as y,Wb as n,Xb as c,Y as M,_ as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as C,s as u,sa as S,ta as k,xb as w}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as oe}from"./chunk-
|
|
1
|
+
import{a as V,b as oe}from"./chunk-XYDMR5UH.js";import"./chunk-ULJ2Y7SG.js";import{a as te,b as ie}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as K,b as Q}from"./chunk-VJ3IBUVO.js";import{a as ne,b as re}from"./chunk-36OX4S7M.js";import{b as ee}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as $}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import{a as Y,b as Z}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as U,x as X}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as G,j as H,w as q}from"./chunk-OIBDX2CA.js";import"./chunk-PPSWJ3KZ.js";import{a as A}from"./chunk-2MKKFLNJ.js";import{n as z,s as R}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as h,Cc as j,Db as L,Dc as F,Ha as b,Lb as u,Nc as T,Ob as S,Oc as P,Rc as M,Vb as r,W as E,Wb as o,Xb as C,Y as B,_ as W,ec as f,fc as m,h as J,hb as s,ia as x,qa as l,ra as p,rc as _,s as y,sa as I,ta as N,wc as c,xb as O,xc as g,yc as d}from"./chunk-NMCKMUY4.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-XD7VHCRC.js";import"./chunk-R7N6BWL5.js";import{a as E}from"./chunk-QF4D5YPK.js";import{b as T}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as w}from"./chunk-
|
|
1
|
+
import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-XD7VHCRC.js";import"./chunk-R7N6BWL5.js";import{a as E}from"./chunk-QF4D5YPK.js";import{b as T}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as w}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import{a as S}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{a as P}from"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{s as M}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{Db as h,Dc as _,Ha as u,Ob as v,Rb as m,Rc as C,Tb as c,Ub as s,Vb as o,Wb as r,_ as f,ca as d,fc as g,hb as n,ia as l,rc as p,sc as x,tc as y,xb as b}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var D=(()=>{class e{constructor(){this.httpService=l(P)}getUserProfile(){return this.httpService.get(void 0,"api/MyProfile")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var A=()=>({height:"calc(100vh - 70px)"});function B(e,a){if(e&1&&(o(0,"div",10)(1,"div",11)(2,"p",12),p(3),r()()()),e&2){let t=a.$implicit;n(3),y(" ",t.roleName," ")}}function L(e,a){if(e&1&&(o(0,"div",4)(1,"div",5)(2,"div",6)(3,"span",7),p(4),r()()(),o(5,"div",8)(6,"div",9),c(7,B,4,1,"div",10,m),r()()()),e&2){let t=a.$implicit;n(4),x(t.roleGroupName),n(3),s(t.listRole)}}function $(e,a){if(e&1&&(o(0,"p-panel")(1,"p-tabs",2)(2,"p-tablist")(3,"p-tab",2),p(4,"Roles"),r()(),o(5,"p-tabpanels")(6,"p-tabpanel",2)(7,"div",3),c(8,L,9,1,"div",4,m),r()()()()()),e&2){let t,i=g();v(_(2,A)),n(8),s((t=i.roles())==null?null:t.Roles)}}var N=(()=>{class e{constructor(){this.profileService=l(D),this.roles=u(null)}ngOnInit(){this.profileService.getUserProfile().pipe(E("response"),f(t=>this.roles.set(t))).subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-my-profile"]],decls:3,vars:0,consts:[["content",""],["pageTitle","My Profile"],["value","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","50px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],[1,"col"],["formArrayName","roles",1,"row","h-100"],[1,"col-3","border-top","border-bottom","border-end","p-0","bg-white"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],[1,"fs-2","text-dark","m-0"]],template:function(i,G){i&1&&(o(0,"app-main-panel",1),h(1,$,10,3,"ng-template",null,0,C),r())},dependencies:[w,S,O,R,j,F,I,k,M,T],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding-top:0!important}"],changeDetection:0})}}return e})();var le=[{path:"",redirectTo:"my-profile",pathMatch:"full"},{path:"",children:[{path:"my-profile",component:N}]}];export{le as PROFILE_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-MAZVUNNB.js";import{b as q}from"./chunk-ULJ2Y7SG.js";import{a as J}from"./chunk-XKI7WLHE.js";import{a as z,b as H}from"./chunk-EB6NEJHF.js";import{a as O,b as W}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as I}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import{a as G,b as A}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as j,w as k,x as B}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as y,e as D,f as M,k as T,l as w,o as N,u as V,x as R}from"./chunk-OIBDX2CA.js";import{d as P}from"./chunk-AOOG6YOT.js";import"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{s as F}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as b,Bb as S,Db as p,Lb as c,Rc as a,Vb as i,Wb as t,Xb as f,_ as C,ec as E,fc as u,hb as _,ia as m,qa as x,ra as h,rc as l,xb as v}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";function L(e,d){if(e&1){let o=b();i(0,"p-button",4),E("onClick",function(){x(o);let n=u();return h(n.onSubmit())}),t()}}function Q(e,d){e&1&&(i(0,"div",13)(1,"h3",14),l(2,"General"),t(),i(3,"span",15),l(4,"Enter your closing Fiscal Date"),t()())}function U(e,d){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,Q,5,0,"ng-template",null,2,a),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),l(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),l(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=u();_(7),c("formGroup",o.form)}}var he=(()=>{class e extends J{constructor(){super(),this.closingEntriesService=m(K),this.dayjsService=m(q),this.fb=m(V),this.router=m(P)}ngOnInit(){this.initForm()}initForm(){this.form=this.fb.group({Period:this.fb.control(new Date),Note:this.fb.control("")})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{Period:o}=this.form.getRawValue(),r=Object.entries(this.form.getRawValue()).reduce((n,[s,g])=>(s==="Period"?n[s]=this.dayjsService.from(o)?this.dayjsService.format(g):"":n[s]=g,n),{});this.closingEntriesService.createClosingEntry(r).pipe(C(()=>{this.router.navigate(["/pages/accounting-setup/closing-entries"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-closing-form"]],features:[S],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Closing Entries Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"col-4"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","Period","fluid",""],["formControlName","Note","rows","5","cols","30","pTextarea",""],[1,"d-flex","flex-column","mx-2"],[1,"fs-5","m-0"],[1,"fs-3"]],template:function(r,n){r&1&&(i(0,"app-main-panel",3),p(1,L,1,0,"ng-template",null,0,a)(3,U,16,1,"ng-template",null,1,a),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[I,F,A,G,W,O,j,H,z,B,k,R,T,y,D,M,w,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{he as ClosingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Fe,b as ke}from"./chunk-
|
|
1
|
+
import{a as Fe,b as ke}from"./chunk-34AG6ZRL.js";import{a as _e,b as ve,c as be,d as xe,e as Ce,f as ye}from"./chunk-XD7VHCRC.js";import"./chunk-NCDT6JPP.js";import{a as he}from"./chunk-XKI7WLHE.js";import{a as fe,b as ge}from"./chunk-EB6NEJHF.js";import{a as se}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import"./chunk-R7N6BWL5.js";import{a as oe,b as re}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as ue}from"./chunk-YN2HKWAW.js";import{b as ce,c as de}from"./chunk-VGNJD35F.js";import{a as pe,b as me}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as ie,o as ne,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as L,c as H,e as J,f as K,k as Q,l as W,m as X,n as Y,o as Z,u as ee,x as te}from"./chunk-OIBDX2CA.js";import{b as z,d as U}from"./chunk-AOOG6YOT.js";import"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{h as B,j as $,k as j,s as q}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as O,Bb as P,Db as f,Dc as v,Ec as b,Ha as A,Lb as a,Ob as _,Pb as y,Rb as F,Rc as T,Tb as k,Ub as M,Vb as i,Vc as V,Wb as n,Xb as g,Y as I,_ as C,ec as w,fc as d,hb as r,ia as c,qa as G,ra as E,rc as h,sc as S,tc as R,ua as N,xb as D}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var Ie=()=>({height:"calc(100vh - 70px)"}),Ge=t=>({"ng-invalid ng-dirty":t}),Me=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ee(t,l){if(t&1){let e=O();i(0,"p-button",4),w("onClick",function(){G(e);let p=d(2);return E(p.onSubmit())}),n()}}function Ne(t,l){if(t&1&&f(0,Ee,1,0,"p-button",3),t&2){let e=d();a("ngIf",e.roleService.user().edit)}}function Ae(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),S(e)}}function De(t,l){if(t&1&&(i(0,"div"),f(1,Ae,3,1,"div",15),n()),t&2){let e=d(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Se)),a("binary",!0),r(2),R(" ",e.get("name").value," ")}}function Oe(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),k(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=d(3);a("formGroupName",o),r(4),S(e.get("groupName").value),r(),_(v(5,Se)),a("binary",!0),r(3),M(p.getRolesArray(o).controls)}}function we(t,l){if(t&1&&(i(0,"div",17),k(1,Oe,10,6,"div",18,F),n()),t&2){let e=d(2);r(),M(e.rolesFormArray.controls)}}function Re(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,De,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,we,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=d();_(v(13,Ie)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ge,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),y(b(16,Me,e.router.url.includes("forms"))),r(2),y(b(18,Me,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var ut=(()=>{class t extends he{constructor(){super(...arguments),this.service=c(Fe),this.fb=c(ee),this.cdr=c(V),this.route=c(z),this.router=c(U),this.roleService=c(se),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[H.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(I(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(C(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user().edit}),description:this.fb.control(m.description||"")}))),u=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Te=s.controls.every(m=>m.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.user().edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);u.get("groupChecked").setValue(m,{emitEvent:!1})}),o.push(u)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(s=>{s.get("checked").value&&e.push(s.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(C(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=N(t)))(p||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row","align-items-stretch",3,"formGroupName"],[1,"col-2","py-2","border-top","border-bottom","border-start","d-flex","justify-content-between",2,"background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],["size","small","formControlName","groupChecked",3,"binary"],[1,"col","p-0"],["formArrayName","roles",1,"roles-grid","h-100"],["tooltipPosition","top",1,"role-cell",3,"formGroupName","pTooltip"],[1,"py-2","d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,p){o&1&&(i(0,"app-main-panel",2),f(1,Ne,1,1,"ng-template",null,0,T)(3,Re,19,20,"ng-template",null,1,T),n()),o&2&&a("overflowScroll",!0)},dependencies:[ue,re,oe,te,Q,L,J,K,W,Z,X,Y,q,B,$,j,ne,ie,ye,Ce,xe,be,_e,ve,ge,fe,le,ae,ke,me,pe,de,ce],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-checkbox{display:flex!important}[_nghost-%COMP%] .p-tabs .p-tab{padding-left:0!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}.roles-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr)}.role-cell[_ngcontent-%COMP%]{border:1px solid #ddd;border-top:none;border-left:none;background:#fff}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(-n+4){border-top:1px solid #ddd}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #ddd}"],changeDetection:0})}}return t})();export{ut as GroupFormComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as st}from"./chunk-FQRRGJBE.js";import{a as we,b as De}from"./chunk-BLR3HBYP.js";import{a as Se}from"./chunk-T6B4BOOB.js";import{a as qt,b as le}from"./chunk-7FFVGWUP.js";import{b as lt}from"./chunk-HG5MKVNR.js";import{b as Ut,c as pt,d as mt}from"./chunk-B54PFCWI.js";import{a as se,b as ce}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as ie}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as Ee,b as Ie}from"./chunk-3A4BFUGD.js";import{a as ot,b as rt,d as pe,k as me}from"./chunk-EL5BUFMO.js";import{a as re,b as ae}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as at}from"./chunk-DX2A6LIU.js";import{a as ke}from"./chunk-QF4D5YPK.js";import{b as ye}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Ht,b as Te}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{d as $e}from"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as oe}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{e as it,f as nt,h as ne}from"./chunk-H3BFDSSJ.js";import{b as jt,c as zt}from"./chunk-VGNJD35F.js";import{a as Xe,b as te}from"./chunk-2XUSZCQL.js";import{a as O,b as Je,c as Qe,d as Ze,e as et,f as tt}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as Ke,o as Ye,w as Z,x as ee}from"./chunk-H6HNANYB.js";import{b as ve}from"./chunk-2D2YD753.js";import{b as We,c as Pt,e as K,f as Y,g as Ot,i as dt,k as $,l as X,o as J,u as Ce,x as Q}from"./chunk-OIBDX2CA.js";import{b as He,e as U,l as W}from"./chunk-AOOG6YOT.js";import{a as Gt,b as be}from"./chunk-M6LSMNSQ.js";import{a as Ue}from"./chunk-2MKKFLNJ.js";import{h as ze,k as z,p as qe,q,s as H,y as Bt,z as At}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,Ac as ct,Bc as de,Cc as Oe,D as Be,Db as x,Dc as F,Ec as V,Fc as Nt,Gc as je,Ha as E,Lb as s,Nc as C,Ob as Ae,Oc as y,Pc as Me,Qb as M,Rb as Re,Rc as _,Tb as Fe,Ub as Ve,Vb as o,W as Ft,Wb as r,X as Vt,Xb as T,Y as xe,Yb as Ge,Zb as Pe,_ as L,bd as R,c as ge,ca as Lt,cb as j,cd as ue,db as he,ec as I,fc as c,hb as p,ia as S,ic as Mt,qa as h,ra as b,rc as a,s as Ne,sc as f,tc as w,uc as Le,wc as A,xb as N,xc as B,yc as P,zc as kt}from"./chunk-NMCKMUY4.js";import{a as g,b as v,c as fe,e as Rt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=S(Gt),this.authService=S(Se)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetSingleCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new At({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),l=new Bt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=g({params:i,headers:l},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ri=()=>({width:"30vw"}),ai=()=>({"1199px":"75vw","575px":"90vw"}),li=t=>({"ng-dirty ng-invalid":t}),pi=t=>["/pages/journal/journal-entry/",t],mi=t=>({"text-success":t}),si=t=>({"text-danger":t});function ci(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function di(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function ui(t,m){t&1&&(o(0,"div",37),a(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",38)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function fi(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),T(2,"p-radiobutton",39),o(3,"label",40),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),f(e.value)}}function gi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),a(3,"Accounts"),r(),o(4,"p-select",18),x(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),x(9,ui,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),a(12,"From"),r(),o(13,"div",20),T(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),a(18,"Outlets"),r(),o(19,"p-multiselect",23),x(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),a(24,"Contact Type"),r(),o(25,"div",25),Fe(26,fi,5,4,"div",26,Re),r()(),x(28,gi,4,1,"div",16)(29,xi,4,1,"div",16)(30,hi,4,1,"div",16),o(31,"div",16)(32,"label",24),a(33,"Sort order"),r(),o(34,"div",25)(35,"div",26)(36,"div",27),T(37,"p-radiobutton",28),o(38,"label",29),a(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),T(42,"p-radiobutton",31),o(43,"label",32),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,l=c(2);s("formGroup",l.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.accounts)("ngClass",V(14,li,((e=l.form.get("accountID"))==null?null:e.invalid)&&(((e=l.form.get("accountID"))==null?null:e.touched)||((e=l.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=l.form.get("accountID"))==null?null:n.invalid)&&(((n=l.form.get("accountID"))==null?null:n.touched)||((n=l.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.outlets),p(7),Ve(l.loaderMetadata().options.contactTypeOptions),p(2),M((i=l.form.controls.contactType.value)===1?28:i===2?29:30),p(9),s("value",!0),p(5),s("value",!1)}}function Si(t,m){if(t&1&&x(0,bi,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Ci(t,m){if(t&1){let e=D();o(0,"p-button",45),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),a(2,"Return to Accounts"),r(),x(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function yi(t,m){t&1&&T(0,"div",52)}function Ei(t,m){t&1&&(o(0,"tr")(1,"th",53),a(2,"Outlet"),r(),o(3,"th",53),a(4,"No."),r(),o(5,"th",53),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",54),a(10,"Debit"),r(),o(11,"th",54),a(12,"Credit"),r(),o(13,"th",55),a(14,"Balance"),r()())}function Ii(t,m){if(t&1&&(o(0,"div",16)(1,"a",59),a(2),r(),T(3,"div",63),o(4,"span",64),a(5),r()()),t&2){let e=c().$implicit,n=c(3);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function Ti(t,m){if(t&1&&(o(0,"div",16),T(1,"span",63)(2,"div",63),o(3,"span",65),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function wi(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.debitAmount)," ")}}function Di(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.creditAmount)," ")}}function Ri(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.balance)," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",56),a(2),r(),o(3,"td",56)(4,"a",57),a(5),r()(),o(6,"td",56)(7,"span",58),C(8,"date"),a(9),C(10,"date"),r()(),o(11,"td",56)(12,"div",16)(13,"a",59),a(14),r(),x(15,Ii,6,4,"div",16)(16,Ti,5,3,"div",16),r()(),o(17,"td",60),x(18,wi,3,3,"ng-container",61),r(),o(19,"td",60),x(20,Di,3,3,"ng-container",61),r(),o(21,"td",62),x(22,Ri,3,3,"ng-container",61),r()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.outletName),p(2),s("routerLink",V(19,pi,e.id)),p(),f(e.number),p(2),s("pTooltip",Me(8,13,e.date,"dd MMM y")),p(2),w(" ",Me(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",V(21,mi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",V(23,si,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Vi(t,m){if(t&1&&(o(0,"tr"),T(1,"td",66),o(2,"td",67),a(3,"Total"),r(),o(4,"td",68),a(5),C(6,"number"),r(),o(7,"td",69),a(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c(3);p(5),w(" ",y(6,2,e.debitSubTotal())," "),p(3),w(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",70)(2,"span"),a(3,"No records found."),r()()())}function Mi(t,m){if(t&1){let e=D();o(0,"button",71),I("click",function(){h(e);let i=c(3);return b(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return b(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&a(0),t&2){let e=c(3);w(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",72),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Bi(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),x(2,yi,1,0,"ng-template",null,7,_)(4,Ei,15,0,"ng-template",null,8,_)(6,Fi,23,25,"ng-template",null,9,_)(8,Vi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),a(14),x(15,Mi,1,0,"button",50)(16,ki,1,1),a(17," entries "),r(),o(18,"div",33),x(19,Ni,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Le(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),M(e.totalRecords()===-1?15:16),p(4),M(e.pagination().hasNext?19:-1)}}function Ai(t,m){if(t&1&&x(0,Bi,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Gi(t,m){if(t&1&&(o(0,"div",73)(1,"div",74)(2,"div",75)(3,"div",25)(4,"div",76)(5,"label",24),a(6,"Page"),r()(),o(7,"div",76),T(8,"input",77),r()()()(),o(9,"div",78)(10,"div",27),T(11,"i",79),o(12,"span",80),a(13),C(14,"number"),C(15,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(12),Le("Exporting data from ",y(14,3,e.filter().exportPageNumber)," - ",y(15,5,e.filter().exportPageSize),"")}}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",81),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Kt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(at),this.toastr=S(Ue),this.dayjsService=S(le),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,l=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!l}}),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,l={},u=e.get("id");return be.IsNotEmpty(u)&&(l=v(g({},l),{accountID:u})),be.IsNotEmpty(n)&&be.IsNotEmpty(i)&&(l=v(g({},l),{from:n,to:i})),l})),{initialValue:null}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),ue(()=>{let e=this.filter();e&&(be.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),ue(()=>{let e=this.filter(),n=this.form.value.accountID;!e||be.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(l=>e.pageNumber===1?i:v(g({},i),{data:v(g({},i.data),{data:[...l?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return st(e)}ngOnInit(){this.route.queryParamMap.pipe(Be(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Pt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():null;break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":n[i]=l!=null?Number(l):null;break;default:n[i]=l}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let l=this.form.getRawValue(),{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(g({},l),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[1,"d-flex","gap-1"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,Si,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Ai,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),x(8,Gi,16,7,"div",13)(9,Pi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(11,ri)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(12,ai)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[ne,H,ze,z,q,qe,oe,me,pe,nt,it,ee,Z,Te,Ht,ae,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,lt,te,W,U,rt,ot,zt,jt,Ye,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var ji={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},St=Je(tt(ji),Qe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),et(t=>{let m=S(G),e=S(le),n={updateFilter(i){O(t,l=>v(g({},l),{filter:g(g({},l.filter),i)}))},getLoader:Ee(ge(xe(()=>m.getIncomeStatementLoader().pipe(Ie({next:i=>{O(t,l=>v(g({},l),{loader:i,filter:v(g({},l.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ee(ge(xe(i=>m.getIncomeStatement(i).pipe(Vt(()=>O(t,l=>v(g({},l),{isLoading:!0}))),Ie({next:l=>{O(t,u=>v(g({},u),{data:l,isLoading:!1}))},error:l=>{console.error(l)}})))))};return n}),Ze({onInit:t=>{t.getLoader()}}));var Ct=()=>({}),vt=t=>["/pages/chart-of-account/account/",t],yt=()=>["/pages/report/general-ledger"],Et=(t,m,e)=>({id:t,from:m,to:e});function qi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),x(1,qi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function Ui(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Wi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,1,e.store.totalRevenue()))}}function Yi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function $i(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),x(3,Ui,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Yi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalCOGS())),p(8),f(y(15,4,e.store.grossProfit()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),x(3,Xi,7,0,"ng-template",null,3,_)(5,Ji,10,15,"ng-template",null,4,_)(7,Qi,16,6,"ng-template",null,5,_)(9,Zi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalExpense())),p(8),f(y(15,4,e.store.profitOrLoss()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),x(3,tn,7,0,"ng-template",null,3,_)(5,nn,10,15,"ng-template",null,4,_)(7,on,16,6,"ng-template",null,5,_)(9,rn,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function ln(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),x(4,$i,11,1)(5,en,11,1)(6,an,11,1),r()()),t&2){let e,n,i,l,u,d=c();ct((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),ct((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),M(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:F(5,Ct)).length>0?4:-1),p(),M(d.Object.keys((l=(l=d.store.data().data)==null?null:l.cogs)!==null&&l!==void 0?l:F(6,Ct)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:F(7,Ct)).length>0?6:-1)}}function pn(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),r(),T(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let l=c();return b(l.onCashierSearch(i))})("onSelect",function(i){h(e);let l=c();return b(l.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),T(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var Yt=(()=>{class t{constructor(){this.dayjsService=S(le),this.store=S(St),this.fb=S(Ce),this.reportService=S(G),this.roleService=S(ie),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ue(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(ke("Cashier Suggestions"),L(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[l,u])=>(l==="from"||l==="to"?u instanceof Date&&(i[l]=this.dayjsService.from(u).format()):i[l]=u||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(ke("Export Profit & Loss"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([St])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOK())}),x(1,Hi,2,1,"ng-template",null,0,_)(3,ln,7,8,"ng-template",null,1,_)(5,pn,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,Te,ae,re,Q,$,K,Y,X,J,ce,se,oe,me,pe,te,Xe,W,U,De,we,ee,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=Rt(qt());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,It.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Je(tt(mn),Qe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),et(t=>{let m=S(G),e={updateFilter:n=>{O(t,i=>v(g({},i),{filter:n}))},fetchBalanceSheet:Ee(ge(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,l])=>l!=null&&l!=="")}),xe(n=>m.getBalanceSheet(n).pipe(Ie({next:i=>{O(t,l=>v(g({},l),{data:i}))},error:i=>{console.error(i)}}))),Ft(1))),fetchLoader:Ee(ge(xe(()=>m.getBalanceSheetLoader().pipe(Ie({next:n=>{O(t,i=>v(g({},i),{metadata:n,filter:{date:(0,It.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Ze(t=>({onInit:()=>{t.fetchLoader()}})));var $t=Rt(qt());var wt=t=>["/pages/chart-of-account/account/",t],Dt=()=>["/pages/report/general-ledger"],sn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function cn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),x(1,cn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function un(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",Nt(11,sn,e.accountID,n.store.filter().date)),p(),f(y(9,6,e.amount))}}function fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalAsset())," ")}}function gn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function xn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),x(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,fn,6,3,"ng-template",null,5,_)(9,gn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function hn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function Sn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalLiability())," ")}}function Cn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),x(3,hn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Sn,6,3,"ng-template",null,5,_)(9,Cn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().liability)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),C(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),C(11,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,2,e.store.totalEquity())," "),p(6),w(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Tn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function wn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),x(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),a(7," <"),x(8,In,12,6,"ng-template",null,5,_)(10,Tn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),x(2,xn,11,1)(3,vn,11,1)(4,wn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),M(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),M(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),M(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Rn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),x(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),T(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=S(Tt),this.ReportServiceStore=S(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=S(ie),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Ot({date:new dt(new Date),outletID:new dt([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,$t.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(ke("Export Balance Sheet"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Tt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,dn,2,1,"ng-template",null,0,_)(3,Dn,5,4,"ng-template",null,1,_)(5,Fn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,me,pe,oe,ee,Z,Q,$,K,Y,X,J,ce,se,ae,re,ye,te,Xe,W,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
|
|
1
|
+
import{a as st}from"./chunk-FQRRGJBE.js";import{a as we,b as De}from"./chunk-BLR3HBYP.js";import{a as Se}from"./chunk-ADIJSTCG.js";import{a as qt,b as le}from"./chunk-ULJ2Y7SG.js";import{b as lt}from"./chunk-HG5MKVNR.js";import{b as Ut,c as pt,d as mt}from"./chunk-B54PFCWI.js";import{a as se,b as ce}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as ie}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as Ee,b as Ie}from"./chunk-3A4BFUGD.js";import{a as ot,b as rt,d as pe,k as me}from"./chunk-EL5BUFMO.js";import{a as re,b as ae}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as at}from"./chunk-GBBQUUCQ.js";import{a as ke}from"./chunk-QF4D5YPK.js";import{b as ye}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Ht,b as Te}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{d as $e}from"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as oe}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{e as it,f as nt,h as ne}from"./chunk-YN2HKWAW.js";import{b as jt,c as zt}from"./chunk-VGNJD35F.js";import{a as Xe,b as te}from"./chunk-2XUSZCQL.js";import{a as O,b as Je,c as Qe,d as Ze,e as et,f as tt}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as Ke,o as Ye,w as Z,x as ee}from"./chunk-H6HNANYB.js";import{b as ve}from"./chunk-2D2YD753.js";import{b as We,c as Pt,e as K,f as Y,g as Ot,i as dt,k as $,l as X,o as J,u as Ce,x as Q}from"./chunk-OIBDX2CA.js";import{b as He,e as U,l as W}from"./chunk-AOOG6YOT.js";import{a as Gt,b as be}from"./chunk-PPSWJ3KZ.js";import{a as Ue}from"./chunk-2MKKFLNJ.js";import{h as ze,k as z,p as qe,q,s as H,y as Bt,z as At}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,Ac as ct,Bc as de,Cc as Oe,D as Be,Db as x,Dc as F,Ec as V,Fc as Nt,Gc as je,Ha as E,Lb as s,Nc as C,Ob as Ae,Oc as y,Pc as Me,Qb as M,Rb as Re,Rc as _,Tb as Fe,Ub as Ve,Vb as o,W as Ft,Wb as r,X as Vt,Xb as T,Y as xe,Yb as Ge,Zb as Pe,_ as L,bd as R,c as ge,ca as Lt,cb as j,cd as ue,db as he,ec as I,fc as c,hb as p,ia as S,ic as Mt,qa as h,ra as b,rc as a,s as Ne,sc as f,tc as w,uc as Le,wc as A,xb as N,xc as B,yc as P,zc as kt}from"./chunk-NMCKMUY4.js";import{a as g,b as v,c as fe,e as Rt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=S(Gt),this.authService=S(Se)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetSingleCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new At({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),l=new Bt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=g({params:i,headers:l},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ri=()=>({width:"30vw"}),ai=()=>({"1199px":"75vw","575px":"90vw"}),li=t=>({"ng-dirty ng-invalid":t}),pi=t=>["/pages/journal/journal-entry/",t],mi=t=>({"text-success":t}),si=t=>({"text-danger":t});function ci(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function di(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function ui(t,m){t&1&&(o(0,"div",37),a(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",38)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function fi(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),T(2,"p-radiobutton",39),o(3,"label",40),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),f(e.value)}}function gi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),a(3,"Accounts"),r(),o(4,"p-select",18),x(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),x(9,ui,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),a(12,"From"),r(),o(13,"div",20),T(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),a(18,"Outlets"),r(),o(19,"p-multiselect",23),x(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),a(24,"Contact Type"),r(),o(25,"div",25),Fe(26,fi,5,4,"div",26,Re),r()(),x(28,gi,4,1,"div",16)(29,xi,4,1,"div",16)(30,hi,4,1,"div",16),o(31,"div",16)(32,"label",24),a(33,"Sort order"),r(),o(34,"div",25)(35,"div",26)(36,"div",27),T(37,"p-radiobutton",28),o(38,"label",29),a(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),T(42,"p-radiobutton",31),o(43,"label",32),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,l=c(2);s("formGroup",l.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.accounts)("ngClass",V(14,li,((e=l.form.get("accountID"))==null?null:e.invalid)&&(((e=l.form.get("accountID"))==null?null:e.touched)||((e=l.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=l.form.get("accountID"))==null?null:n.invalid)&&(((n=l.form.get("accountID"))==null?null:n.touched)||((n=l.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.outlets),p(7),Ve(l.loaderMetadata().options.contactTypeOptions),p(2),M((i=l.form.controls.contactType.value)===1?28:i===2?29:30),p(9),s("value",!0),p(5),s("value",!1)}}function Si(t,m){if(t&1&&x(0,bi,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Ci(t,m){if(t&1){let e=D();o(0,"p-button",45),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),a(2,"Return to Accounts"),r(),x(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function yi(t,m){t&1&&T(0,"div",52)}function Ei(t,m){t&1&&(o(0,"tr")(1,"th",53),a(2,"Outlet"),r(),o(3,"th",53),a(4,"No."),r(),o(5,"th",53),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",54),a(10,"Debit"),r(),o(11,"th",54),a(12,"Credit"),r(),o(13,"th",55),a(14,"Balance"),r()())}function Ii(t,m){if(t&1&&(o(0,"div",16)(1,"a",59),a(2),r(),T(3,"div",63),o(4,"span",64),a(5),r()()),t&2){let e=c().$implicit,n=c(3);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function Ti(t,m){if(t&1&&(o(0,"div",16),T(1,"span",63)(2,"div",63),o(3,"span",65),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function wi(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.debitAmount)," ")}}function Di(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.creditAmount)," ")}}function Ri(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.balance)," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",56),a(2),r(),o(3,"td",56)(4,"a",57),a(5),r()(),o(6,"td",56)(7,"span",58),C(8,"date"),a(9),C(10,"date"),r()(),o(11,"td",56)(12,"div",16)(13,"a",59),a(14),r(),x(15,Ii,6,4,"div",16)(16,Ti,5,3,"div",16),r()(),o(17,"td",60),x(18,wi,3,3,"ng-container",61),r(),o(19,"td",60),x(20,Di,3,3,"ng-container",61),r(),o(21,"td",62),x(22,Ri,3,3,"ng-container",61),r()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.outletName),p(2),s("routerLink",V(19,pi,e.id)),p(),f(e.number),p(2),s("pTooltip",Me(8,13,e.date,"dd MMM y")),p(2),w(" ",Me(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",V(21,mi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",V(23,si,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Vi(t,m){if(t&1&&(o(0,"tr"),T(1,"td",66),o(2,"td",67),a(3,"Total"),r(),o(4,"td",68),a(5),C(6,"number"),r(),o(7,"td",69),a(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c(3);p(5),w(" ",y(6,2,e.debitSubTotal())," "),p(3),w(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",70)(2,"span"),a(3,"No records found."),r()()())}function Mi(t,m){if(t&1){let e=D();o(0,"button",71),I("click",function(){h(e);let i=c(3);return b(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return b(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&a(0),t&2){let e=c(3);w(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",72),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Bi(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),x(2,yi,1,0,"ng-template",null,7,_)(4,Ei,15,0,"ng-template",null,8,_)(6,Fi,23,25,"ng-template",null,9,_)(8,Vi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),a(14),x(15,Mi,1,0,"button",50)(16,ki,1,1),a(17," entries "),r(),o(18,"div",33),x(19,Ni,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Le(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),M(e.totalRecords()===-1?15:16),p(4),M(e.pagination().hasNext?19:-1)}}function Ai(t,m){if(t&1&&x(0,Bi,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Gi(t,m){if(t&1&&(o(0,"div",73)(1,"div",74)(2,"div",75)(3,"div",25)(4,"div",76)(5,"label",24),a(6,"Page"),r()(),o(7,"div",76),T(8,"input",77),r()()()(),o(9,"div",78)(10,"div",27),T(11,"i",79),o(12,"span",80),a(13),C(14,"number"),C(15,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(12),Le("Exporting data from ",y(14,3,e.filter().exportPageNumber)," - ",y(15,5,e.filter().exportPageSize),"")}}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",81),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Kt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(at),this.toastr=S(Ue),this.dayjsService=S(le),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,l=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!l}}),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,l={},u=e.get("id");return be.IsNotEmpty(u)&&(l=v(g({},l),{accountID:u})),be.IsNotEmpty(n)&&be.IsNotEmpty(i)&&(l=v(g({},l),{from:n,to:i})),l})),{initialValue:null}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),ue(()=>{let e=this.filter();e&&(be.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),ue(()=>{let e=this.filter(),n=this.form.value.accountID;!e||be.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(l=>e.pageNumber===1?i:v(g({},i),{data:v(g({},i.data),{data:[...l?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return st(e)}ngOnInit(){this.route.queryParamMap.pipe(Be(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Pt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():null;break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":n[i]=l!=null?Number(l):null;break;default:n[i]=l}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let l=this.form.getRawValue(),{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(g({},l),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[1,"d-flex","gap-1"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,Si,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Ai,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),x(8,Gi,16,7,"div",13)(9,Pi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(11,ri)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(12,ai)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[ne,H,ze,z,q,qe,oe,me,pe,nt,it,ee,Z,Te,Ht,ae,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,lt,te,W,U,rt,ot,zt,jt,Ye,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var ji={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},St=Je(tt(ji),Qe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),et(t=>{let m=S(G),e=S(le),n={updateFilter(i){O(t,l=>v(g({},l),{filter:g(g({},l.filter),i)}))},getLoader:Ee(ge(xe(()=>m.getIncomeStatementLoader().pipe(Ie({next:i=>{O(t,l=>v(g({},l),{loader:i,filter:v(g({},l.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ee(ge(xe(i=>m.getIncomeStatement(i).pipe(Vt(()=>O(t,l=>v(g({},l),{isLoading:!0}))),Ie({next:l=>{O(t,u=>v(g({},u),{data:l,isLoading:!1}))},error:l=>{console.error(l)}})))))};return n}),Ze({onInit:t=>{t.getLoader()}}));var Ct=()=>({}),vt=t=>["/pages/chart-of-account/account/",t],yt=()=>["/pages/report/general-ledger"],Et=(t,m,e)=>({id:t,from:m,to:e});function qi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),x(1,qi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function Ui(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Wi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,1,e.store.totalRevenue()))}}function Yi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function $i(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),x(3,Ui,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Yi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalCOGS())),p(8),f(y(15,4,e.store.grossProfit()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),x(3,Xi,7,0,"ng-template",null,3,_)(5,Ji,10,15,"ng-template",null,4,_)(7,Qi,16,6,"ng-template",null,5,_)(9,Zi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalExpense())),p(8),f(y(15,4,e.store.profitOrLoss()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),x(3,tn,7,0,"ng-template",null,3,_)(5,nn,10,15,"ng-template",null,4,_)(7,on,16,6,"ng-template",null,5,_)(9,rn,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function ln(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),x(4,$i,11,1)(5,en,11,1)(6,an,11,1),r()()),t&2){let e,n,i,l,u,d=c();ct((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),ct((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),M(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:F(5,Ct)).length>0?4:-1),p(),M(d.Object.keys((l=(l=d.store.data().data)==null?null:l.cogs)!==null&&l!==void 0?l:F(6,Ct)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:F(7,Ct)).length>0?6:-1)}}function pn(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),r(),T(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let l=c();return b(l.onCashierSearch(i))})("onSelect",function(i){h(e);let l=c();return b(l.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),T(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var Yt=(()=>{class t{constructor(){this.dayjsService=S(le),this.store=S(St),this.fb=S(Ce),this.reportService=S(G),this.roleService=S(ie),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ue(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(ke("Cashier Suggestions"),L(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[l,u])=>(l==="from"||l==="to"?u instanceof Date&&(i[l]=this.dayjsService.from(u).format()):i[l]=u||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(ke("Export Profit & Loss"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([St])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOK())}),x(1,Hi,2,1,"ng-template",null,0,_)(3,ln,7,8,"ng-template",null,1,_)(5,pn,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,Te,ae,re,Q,$,K,Y,X,J,ce,se,oe,me,pe,te,Xe,W,U,De,we,ee,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=Rt(qt());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,It.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Je(tt(mn),Qe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),et(t=>{let m=S(G),e={updateFilter:n=>{O(t,i=>v(g({},i),{filter:n}))},fetchBalanceSheet:Ee(ge(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,l])=>l!=null&&l!=="")}),xe(n=>m.getBalanceSheet(n).pipe(Ie({next:i=>{O(t,l=>v(g({},l),{data:i}))},error:i=>{console.error(i)}}))),Ft(1))),fetchLoader:Ee(ge(xe(()=>m.getBalanceSheetLoader().pipe(Ie({next:n=>{O(t,i=>v(g({},i),{metadata:n,filter:{date:(0,It.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Ze(t=>({onInit:()=>{t.fetchLoader()}})));var $t=Rt(qt());var wt=t=>["/pages/chart-of-account/account/",t],Dt=()=>["/pages/report/general-ledger"],sn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function cn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),x(1,cn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function un(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",Nt(11,sn,e.accountID,n.store.filter().date)),p(),f(y(9,6,e.amount))}}function fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalAsset())," ")}}function gn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function xn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),x(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,fn,6,3,"ng-template",null,5,_)(9,gn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function hn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function Sn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalLiability())," ")}}function Cn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),x(3,hn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Sn,6,3,"ng-template",null,5,_)(9,Cn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().liability)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),C(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),C(11,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,2,e.store.totalEquity())," "),p(6),w(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Tn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function wn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),x(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),a(7," <"),x(8,In,12,6,"ng-template",null,5,_)(10,Tn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),x(2,xn,11,1)(3,vn,11,1)(4,wn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),M(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),M(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),M(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Rn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),x(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),T(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=S(Tt),this.ReportServiceStore=S(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=S(ie),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Ot({date:new dt(new Date),outletID:new dt([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,$t.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(ke("Export Balance Sheet"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Tt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,dn,2,1,"ng-template",null,0,_)(3,Dn,5,4,"ng-template",null,1,_)(5,Fn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,me,pe,oe,ee,Z,Q,$,K,Y,X,J,ce,se,ae,re,ye,te,Xe,W,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
|
|
2
2
|
,
|
|
3
3
|
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-cash-flow works!"),r(),a(2,`
|
|
4
4
|
,
|