dealposbooks 5.32.0 → 5.32.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.
Files changed (31) hide show
  1. package/{chunk-W4SAEISC.js → chunk-2FA22FEI.js} +1 -1
  2. package/{chunk-JPP5O2O5.js → chunk-4ZMRBRIS.js} +1 -1
  3. package/{chunk-WSZ5MU6V.js → chunk-5IH7TCZZ.js} +1 -1
  4. package/{chunk-XJEZJFWN.js → chunk-5Y5SFUMY.js} +1 -1
  5. package/{chunk-4ANXHXE3.js → chunk-6OJOOXYM.js} +1 -1
  6. package/{chunk-QSWSGP4B.js → chunk-A6AM5FZ4.js} +1 -1
  7. package/{chunk-XILGARZ5.js → chunk-BGWDOZQM.js} +1 -1
  8. package/{chunk-VYK2CQ72.js → chunk-EHUDHXDQ.js} +1 -1
  9. package/{chunk-HAZ77TED.js → chunk-EJHIGE6D.js} +1 -1
  10. package/{chunk-3WD3CTYC.js → chunk-FI3ZD46J.js} +1 -1
  11. package/{chunk-74MJ3NFN.js → chunk-FXAIEUA7.js} +1 -1
  12. package/{chunk-6OQPMZXU.js → chunk-HO2UBUXM.js} +1 -1
  13. package/chunk-HVAA6I4V.js +1 -0
  14. package/{chunk-7EZGTYA2.js → chunk-J5GPRN74.js} +1 -1
  15. package/{chunk-QLUQTLSH.js → chunk-JK7K55HA.js} +1 -1
  16. package/{chunk-RMRYZWCP.js → chunk-JLV66YQR.js} +1 -1
  17. package/{chunk-REXWFSN3.js → chunk-JRMUK54Y.js} +1 -1
  18. package/{chunk-A7EGGUJQ.js → chunk-KBHFQM5L.js} +1 -1
  19. package/{chunk-SEGRH6C4.js → chunk-M7MYXWUB.js} +1 -1
  20. package/{chunk-F5Z3IX4J.js → chunk-MVYMAQJE.js} +1 -1
  21. package/{chunk-UWNAF5OL.js → chunk-Q5XM4DLN.js} +1 -1
  22. package/{chunk-PV3NLUKC.js → chunk-RZKMT3UP.js} +1 -1
  23. package/{chunk-33YEAYJV.js → chunk-UILTGHYP.js} +1 -1
  24. package/{chunk-MFH4UZ6J.js → chunk-VZI3JZPU.js} +1 -1
  25. package/{chunk-RBTNUVT5.js → chunk-WIHAMVJN.js} +1 -1
  26. package/{chunk-BQXWTZHK.js → chunk-WMKKO7RI.js} +1 -1
  27. package/{chunk-OYHHWU2W.js → chunk-ZABJ7AB6.js} +1 -1
  28. package/index.html +2 -2
  29. package/{main-OTYR5DFR.js → main-CTDZ2YSE.js} +1 -1
  30. package/package.json +1 -1
  31. package/chunk-56GDP75Z.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as Ti}from"./chunk-MFH4UZ6J.js";import{a as un}from"./chunk-VVHTNAHQ.js";import{a as qn}from"./chunk-BTDW4G2F.js";import{a as Xn}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as Fn}from"./chunk-QCLAOAVG.js";import{a as $n}from"./chunk-Q33XIUDN.js";import{b as Wn}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import{a as Vn}from"./chunk-253IFSMV.js";import{a as Dn}from"./chunk-QYXQYPHB.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as jn}from"./chunk-5R3XKSDM.js";import{b as Yn,c as Si}from"./chunk-C7LM5UCK.js";import{b as Gn}from"./chunk-J4XRJAME.js";import{c as Mn}from"./chunk-GH5Z5SPB.js";import{a as et,c as An,f as ai,o as Bn,p as Rn,t as Hn,u as Mi,w as Nn,x as oi}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{Ea as si,H as Sn,Ja as Ln,K as Tn,Ka as kn,L as Pn,La as zn,Ma as ri,Na as ge,Q as Ie,R as _t,S as Nt,T as En,Va as Je,b as mn,e as fn,f as gn,h as hn,j as vn,ja as On,k as wn,na as In,p as bn,q as yn,r as _n,s as Cn,x as ni,y as xn}from"./chunk-FMVCTBCQ.js";import{a as cn}from"./chunk-P3V7Z3A6.js";import{a as pn}from"./chunk-VFEEFGWW.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{A as sn,D as rn,F as an,G as on,H as ln,N as Ht,c as ct,e as ii,f as Ft,g as Bt,h as Rt,i as tn,m as we,n as Oe,s as nn}from"./chunk-B63BKC6F.js";import{Aa as Wi,Ab as Ke,Ac as pe,Bc as Be,Ca as qi,Cb as X,Cc as ti,Da as xe,Ea as wt,Ga as Ee,Jb as Z,Jc as Dt,Ka as Ui,Kb as $,Kc as $t,Mb as Ki,Mc as dt,Nb as Qt,Ob as ye,Pb as Kt,Qb as Zt,Sb as Jt,Tb as ei,Ub as G,V as Xi,Vb as N,Vc as pt,Wb as te,Wc as Vt,Xb as at,Yb as ot,Yc as en,Zb as Me,_b as ve,aa as Yi,ba as Ye,bb as bi,ca as je,cb as qe,dc as ie,ec as H,fc as bt,gb as R,gc as lt,ha as ae,jc as fe,kc as yt,lc as ne,mb as Ue,mc as se,oa as ji,pa as U,pc as Lt,qa as Q,qc as le,rb as Ut,rc as Fe,s as wi,sc as yi,t as Gi,ta as Ae,tc as Zi,vc as kt,wb as he,wc as zt,xb as Qe,xc as At,yc as Ze,za as We,zb as Qi,zc as Ji}from"./chunk-JP6RBSB3.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
1
+ import{a as Ti}from"./chunk-VZI3JZPU.js";import{a as un}from"./chunk-VVHTNAHQ.js";import{a as qn}from"./chunk-BTDW4G2F.js";import{a as Xn}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as Fn}from"./chunk-QCLAOAVG.js";import{a as $n}from"./chunk-Q33XIUDN.js";import{b as Wn}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import{a as Vn}from"./chunk-253IFSMV.js";import{a as Dn}from"./chunk-QYXQYPHB.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as jn}from"./chunk-5R3XKSDM.js";import{b as Yn,c as Si}from"./chunk-C7LM5UCK.js";import{b as Gn}from"./chunk-J4XRJAME.js";import{c as Mn}from"./chunk-GH5Z5SPB.js";import{a as et,c as An,f as ai,o as Bn,p as Rn,t as Hn,u as Mi,w as Nn,x as oi}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{Ea as si,H as Sn,Ja as Ln,K as Tn,Ka as kn,L as Pn,La as zn,Ma as ri,Na as ge,Q as Ie,R as _t,S as Nt,T as En,Va as Je,b as mn,e as fn,f as gn,h as hn,j as vn,ja as On,k as wn,na as In,p as bn,q as yn,r as _n,s as Cn,x as ni,y as xn}from"./chunk-FMVCTBCQ.js";import{a as cn}from"./chunk-P3V7Z3A6.js";import{a as pn}from"./chunk-VFEEFGWW.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{A as sn,D as rn,F as an,G as on,H as ln,N as Ht,c as ct,e as ii,f as Ft,g as Bt,h as Rt,i as tn,m as we,n as Oe,s as nn}from"./chunk-B63BKC6F.js";import{Aa as Wi,Ab as Ke,Ac as pe,Bc as Be,Ca as qi,Cb as X,Cc as ti,Da as xe,Ea as wt,Ga as Ee,Jb as Z,Jc as Dt,Ka as Ui,Kb as $,Kc as $t,Mb as Ki,Mc as dt,Nb as Qt,Ob as ye,Pb as Kt,Qb as Zt,Sb as Jt,Tb as ei,Ub as G,V as Xi,Vb as N,Vc as pt,Wb as te,Wc as Vt,Xb as at,Yb as ot,Yc as en,Zb as Me,_b as ve,aa as Yi,ba as Ye,bb as bi,ca as je,cb as qe,dc as ie,ec as H,fc as bt,gb as R,gc as lt,ha as ae,jc as fe,kc as yt,lc as ne,mb as Ue,mc as se,oa as ji,pa as U,pc as Lt,qa as Q,qc as le,rb as Ut,rc as Fe,s as wi,sc as yi,t as Gi,ta as Ae,tc as Zi,vc as kt,wb as he,wc as zt,xb as Qe,xc as At,yc as Ze,za as We,zb as Qi,zc as Ji}from"./chunk-JP6RBSB3.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
2
2
  .p-inputgroup,
3
3
  .p-inputgroup .p-floatlabel,
4
4
  .p-inputgroup .p-iftalabel {
@@ -1 +1 @@
1
- import{a as A}from"./chunk-W24I5WPW.js";import{a as He}from"./chunk-MDH73MG3.js";import{b as ze}from"./chunk-XILGARZ5.js";import"./chunk-MFH4UZ6J.js";import{a as re}from"./chunk-VVHTNAHQ.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-C2GO6SPF.js";import{a as P,b as z}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Re,k as Me}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import{a as Je,b as De}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ie,h as Ae}from"./chunk-UYC454VQ.js";import{b as Ee,c as Te}from"./chunk-C7LM5UCK.js";import{a as be,b as Ce}from"./chunk-J4XRJAME.js";import{a as v,b as Se,c as we,d as ve,e as ye,f as je}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as ae,c as le,e as me,f as pe,k as se,l as de,o as ue,v as ce,y as fe}from"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as Z,e as ee,f as te,k as ie,l as ne,m as oe}from"./chunk-B63BKC6F.js";import{Ab as W,Ac as T,Cb as g,Ga as D,Jc as I,Kb as d,Kc as Y,Lc as M,Mc as S,Nb as K,Ub as a,Vb as r,Wb as b,X as J,Yc as y,Z as B,_b as j,bb as G,c as F,cb as U,dc as E,ec as f,gb as m,ha as w,pa as h,qa as x,qc as p,rc as C,s as V,sc as k,uc as q,vc as Q,wb as L,wc as N,xc as $,yc as X,zc as R}from"./chunk-JP6RBSB3.js";import{a as s,b as c}from"./chunk-YQFG5XE2.js";var Ue={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},H=Se(je(Ue),we(t=>({first:y(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:y(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:y(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:y(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),ye(t=>{let l=w(A);return{updateFilter(n){v(t,i=>c(s({},i),{filter:s(s({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!0}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onRowUnselect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!1}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){v(t,i=>{let o=i.data.data.map(u=>c(s({},u),{checked:n}));return c(s({},i),{data:c(s({},i.data),{data:o})})})},getGJAdjustmentLoader:P(F(J(()=>l.getGJAdjustmentLoader().pipe(z({next:n=>{v(t,i=>c(s({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:P(F(V(n=>Object.entries(n).reduce((i,[o,u])=>(u!=null&&(i[o]=u),i),{})),J(n=>l.getAdjustmentJournal(n).pipe(V(i=>c(s({},i),{data:i.data.map(o=>c(s({},o),{checked:!1}))})),z({next:i=>{v(t,o=>c(s({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var Le=()=>({height:"calc(100vh - 70px)"}),O=t=>({"ng-invalid ng-dirty":t}),We=()=>({});function Ke(t,l){if(t&1){let e=j();a(0,"p-button",10),E("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function qe(t,l){if(t&1&&g(0,Ke,1,0,"p-button",9),t&2){let e=f();d("ngIf",e.store.hasCheckedRows())}}function Qe(t,l){t&1&&(a(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),p(4,"Outlet"),r(),a(5,"th",14),p(6,"Number"),r(),a(7,"th",15),p(8,"Date"),r(),a(9,"th",14),p(10,"Adjustment Qty"),r(),a(11,"th",13),p(12,"Type"),r(),a(13,"th",16),p(14,"State"),r(),a(15,"th",17),p(16,"Note"),r(),b(17,"th",12),r())}function $e(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",18),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",19),p(7),r()(),a(8,"td"),p(9),I(10,"date"),r(),a(11,"td"),p(12),I(13,"number"),r(),a(14,"td"),p(15),r(),a(16,"td"),p(17),r(),a(18,"td"),b(19,"div",20),r(),a(20,"td"),b(21,"p-button",21),r()()),t&2){let e=l.$implicit,n=f(2);m(2),d("value",e),m(2),C(e.outlet),m(2),d("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,U),m(),k(" ",e.number," "),m(2),C(M(10,12,e.date,"d MMM y")),m(3),C(Y(13,15,e.quantitySUM)),m(3),C(e.type),m(2),C(e.state),m(2),d("innerHTML",e.note,G),m(2),d("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,l){if(t&1&&p(0),t&2){let e=f(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,l){t&1&&(a(0,"tr")(1,"td",22)(2,"span"),p(3,"No records found."),r()()())}function Ze(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),E("onRowSelect",function(i){h(e);let o=f();return x(o.onRowSelect(i))})("onRowUnselect",function(i){h(e);let o=f();return x(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){h(e);let o=f();return x(o.onHeaderCheckboxToggle(i))})("onPage",function(i){h(e);let o=f();return x(o.onPageChange(i))}),g(2,Qe,18,0,"ng-template",null,3,S)(4,$e,22,17,"ng-template",null,4,S)(6,Xe,1,3,"ng-template",null,5,S)(8,Ye,4,0,"ng-template",null,6,S),r()()}if(t&2){let e=f();K(R(9,Le)),m(),d("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function et(t,l){if(t&1&&(a(0,"span",31),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;d("pTooltip",e.name),m(),k(" ",M(2,2,e.name,30)," ")}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function it(t,l){if(t&1&&(a(0,"div"),g(1,tt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("from"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function ot(t,l){if(t&1&&(a(0,"div"),g(1,nt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("to"))}}function rt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function at(t,l){if(t&1&&(a(0,"div"),g(1,rt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("pageSize"))}}function lt(t,l){if(t&1&&(a(0,"form",23)(1,"div",24)(2,"label",25),p(3,"Outlet"),r(),a(4,"p-select",26),g(5,et,3,5,"ng-template",null,7,S),r()(),a(7,"div",24)(8,"label",25),p(9,"From"),r(),b(10,"p-datepicker",27),g(11,it,2,1,"div",28),r(),a(12,"div",24)(13,"label",25),p(14,"To"),r(),b(15,"p-datepicker",29),g(16,ot,2,1,"div",28),r(),a(17,"div",24)(18,"label",25),p(19,"Page Size"),r(),b(20,"input",30),g(21,at,2,1,"div",28),r()()),t&2){let e=f();d("formGroup",e.form),m(4),d("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(6),d("iconDisplay","input")("showIcon",!0)("ngClass",T(14,O,e.isInvalid("from"))),m(),d("ngIf",e.isInvalid("from")),m(4),d("iconDisplay","input")("showIcon",!0)("ngClass",T(16,O,e.isInvalid("to"))),m(),d("ngIf",e.isInvalid("to")),m(4),d("autoNumeric",R(18,We))("ngClass",T(19,O,e.isInvalid("pageSize"))),m(),d("ngIf",e.isInvalid("pageSize"))}}var Kt=(()=>{class t extends Pe{constructor(){super(),this.store=w(H),this.generateJournalService=w(A),this.authService=w(re),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=w(ce),this.dayjsService=w(ze)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,rowCount:u,pageSize:_,export:Oe,exportPageNumber:Be,exportRowCount:Ge}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),rowCount:this.fb.control(u),pageSize:this.fb.control(_,[le.required]),export:this.fb.control(Oe),exportPageNumber:this.fb.control(Be),exportRowCount:this.fb.control(Ge)})}onSearch(e){this.store.updateFilter(c(s({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(s({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(B(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=L({type:t,selectors:[["app-adjustment-journal"]],features:[X([H]),W],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","4rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=j();a(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),E("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,qe,1,1,"ng-template",null,0,S)(3,Ze,10,10,"ng-template",null,1,S)(5,lt,22,21,"ng-template",null,2,S),r()}n&2&&(d("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible))},dependencies:[Ae,Me,ke,Ne,Re,oe,Z,ee,te,ne,ie,Ce,be,xe,he,Ve,Fe,De,Je,fe,se,ae,me,pe,de,ue,ge,_e,Ie,Te,Ee,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Kt as AdjustmentJournalComponent};
1
+ import{a as A}from"./chunk-W24I5WPW.js";import{a as He}from"./chunk-MDH73MG3.js";import{b as ze}from"./chunk-BGWDOZQM.js";import"./chunk-VZI3JZPU.js";import{a as re}from"./chunk-VVHTNAHQ.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-C2GO6SPF.js";import{a as P,b as z}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Re,k as Me}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import{a as Je,b as De}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ie,h as Ae}from"./chunk-UYC454VQ.js";import{b as Ee,c as Te}from"./chunk-C7LM5UCK.js";import{a as be,b as Ce}from"./chunk-J4XRJAME.js";import{a as v,b as Se,c as we,d as ve,e as ye,f as je}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as ae,c as le,e as me,f as pe,k as se,l as de,o as ue,v as ce,y as fe}from"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as Z,e as ee,f as te,k as ie,l as ne,m as oe}from"./chunk-B63BKC6F.js";import{Ab as W,Ac as T,Cb as g,Ga as D,Jc as I,Kb as d,Kc as Y,Lc as M,Mc as S,Nb as K,Ub as a,Vb as r,Wb as b,X as J,Yc as y,Z as B,_b as j,bb as G,c as F,cb as U,dc as E,ec as f,gb as m,ha as w,pa as h,qa as x,qc as p,rc as C,s as V,sc as k,uc as q,vc as Q,wb as L,wc as N,xc as $,yc as X,zc as R}from"./chunk-JP6RBSB3.js";import{a as s,b as c}from"./chunk-YQFG5XE2.js";var Ue={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},H=Se(je(Ue),we(t=>({first:y(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:y(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:y(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:y(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),ye(t=>{let l=w(A);return{updateFilter(n){v(t,i=>c(s({},i),{filter:s(s({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!0}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onRowUnselect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!1}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){v(t,i=>{let o=i.data.data.map(u=>c(s({},u),{checked:n}));return c(s({},i),{data:c(s({},i.data),{data:o})})})},getGJAdjustmentLoader:P(F(J(()=>l.getGJAdjustmentLoader().pipe(z({next:n=>{v(t,i=>c(s({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:P(F(V(n=>Object.entries(n).reduce((i,[o,u])=>(u!=null&&(i[o]=u),i),{})),J(n=>l.getAdjustmentJournal(n).pipe(V(i=>c(s({},i),{data:i.data.map(o=>c(s({},o),{checked:!1}))})),z({next:i=>{v(t,o=>c(s({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var Le=()=>({height:"calc(100vh - 70px)"}),O=t=>({"ng-invalid ng-dirty":t}),We=()=>({});function Ke(t,l){if(t&1){let e=j();a(0,"p-button",10),E("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function qe(t,l){if(t&1&&g(0,Ke,1,0,"p-button",9),t&2){let e=f();d("ngIf",e.store.hasCheckedRows())}}function Qe(t,l){t&1&&(a(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),p(4,"Outlet"),r(),a(5,"th",14),p(6,"Number"),r(),a(7,"th",15),p(8,"Date"),r(),a(9,"th",14),p(10,"Adjustment Qty"),r(),a(11,"th",13),p(12,"Type"),r(),a(13,"th",16),p(14,"State"),r(),a(15,"th",17),p(16,"Note"),r(),b(17,"th",12),r())}function $e(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",18),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",19),p(7),r()(),a(8,"td"),p(9),I(10,"date"),r(),a(11,"td"),p(12),I(13,"number"),r(),a(14,"td"),p(15),r(),a(16,"td"),p(17),r(),a(18,"td"),b(19,"div",20),r(),a(20,"td"),b(21,"p-button",21),r()()),t&2){let e=l.$implicit,n=f(2);m(2),d("value",e),m(2),C(e.outlet),m(2),d("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,U),m(),k(" ",e.number," "),m(2),C(M(10,12,e.date,"d MMM y")),m(3),C(Y(13,15,e.quantitySUM)),m(3),C(e.type),m(2),C(e.state),m(2),d("innerHTML",e.note,G),m(2),d("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,l){if(t&1&&p(0),t&2){let e=f(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,l){t&1&&(a(0,"tr")(1,"td",22)(2,"span"),p(3,"No records found."),r()()())}function Ze(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),E("onRowSelect",function(i){h(e);let o=f();return x(o.onRowSelect(i))})("onRowUnselect",function(i){h(e);let o=f();return x(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){h(e);let o=f();return x(o.onHeaderCheckboxToggle(i))})("onPage",function(i){h(e);let o=f();return x(o.onPageChange(i))}),g(2,Qe,18,0,"ng-template",null,3,S)(4,$e,22,17,"ng-template",null,4,S)(6,Xe,1,3,"ng-template",null,5,S)(8,Ye,4,0,"ng-template",null,6,S),r()()}if(t&2){let e=f();K(R(9,Le)),m(),d("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function et(t,l){if(t&1&&(a(0,"span",31),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;d("pTooltip",e.name),m(),k(" ",M(2,2,e.name,30)," ")}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function it(t,l){if(t&1&&(a(0,"div"),g(1,tt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("from"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function ot(t,l){if(t&1&&(a(0,"div"),g(1,nt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("to"))}}function rt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function at(t,l){if(t&1&&(a(0,"div"),g(1,rt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("pageSize"))}}function lt(t,l){if(t&1&&(a(0,"form",23)(1,"div",24)(2,"label",25),p(3,"Outlet"),r(),a(4,"p-select",26),g(5,et,3,5,"ng-template",null,7,S),r()(),a(7,"div",24)(8,"label",25),p(9,"From"),r(),b(10,"p-datepicker",27),g(11,it,2,1,"div",28),r(),a(12,"div",24)(13,"label",25),p(14,"To"),r(),b(15,"p-datepicker",29),g(16,ot,2,1,"div",28),r(),a(17,"div",24)(18,"label",25),p(19,"Page Size"),r(),b(20,"input",30),g(21,at,2,1,"div",28),r()()),t&2){let e=f();d("formGroup",e.form),m(4),d("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(6),d("iconDisplay","input")("showIcon",!0)("ngClass",T(14,O,e.isInvalid("from"))),m(),d("ngIf",e.isInvalid("from")),m(4),d("iconDisplay","input")("showIcon",!0)("ngClass",T(16,O,e.isInvalid("to"))),m(),d("ngIf",e.isInvalid("to")),m(4),d("autoNumeric",R(18,We))("ngClass",T(19,O,e.isInvalid("pageSize"))),m(),d("ngIf",e.isInvalid("pageSize"))}}var Kt=(()=>{class t extends Pe{constructor(){super(),this.store=w(H),this.generateJournalService=w(A),this.authService=w(re),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=w(ce),this.dayjsService=w(ze)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,rowCount:u,pageSize:_,export:Oe,exportPageNumber:Be,exportRowCount:Ge}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),rowCount:this.fb.control(u),pageSize:this.fb.control(_,[le.required]),export:this.fb.control(Oe),exportPageNumber:this.fb.control(Be),exportRowCount:this.fb.control(Ge)})}onSearch(e){this.store.updateFilter(c(s({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(s({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(B(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=L({type:t,selectors:[["app-adjustment-journal"]],features:[X([H]),W],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","4rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=j();a(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),E("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,qe,1,1,"ng-template",null,0,S)(3,Ze,10,10,"ng-template",null,1,S)(5,lt,22,21,"ng-template",null,2,S),r()}n&2&&(d("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible))},dependencies:[Ae,Me,ke,Ne,Re,oe,Z,ee,te,ne,ie,Ce,be,xe,he,Ve,Fe,De,Je,fe,se,ae,me,pe,de,ue,ge,_e,Ie,Te,Ee,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Kt as AdjustmentJournalComponent};
@@ -1 +1 @@
1
- import{a as V,b as oe}from"./chunk-VYK2CQ72.js";import"./chunk-XILGARZ5.js";import"./chunk-MFH4UZ6J.js";import{a as te,b as ie}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import{a as ne,b as re}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import{b as ee}from"./chunk-5R3XKSDM.js";import{h as $}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as Y,b as Z}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as U,x as X}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as G,j as H,x as q}from"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import{a as A}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as z,m as R}from"./chunk-B63BKC6F.js";import{Cb as L,Ga as b,Jc as T,Kb as u,Kc as P,Mc as M,Nb as S,Ub as r,V as E,Vb as o,Wb as C,X as B,Z as W,_b as h,dc as f,ec as m,gb as s,h as J,ha as x,pa as l,qa as p,qc as _,ra as I,s as y,sa as N,vc as c,wb as O,wc as g,xc as d,yc as j,zc as F}from"./chunk-JP6RBSB3.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
+ import{a as V,b as oe}from"./chunk-EHUDHXDQ.js";import"./chunk-BGWDOZQM.js";import"./chunk-VZI3JZPU.js";import{a as te,b as ie}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import{a as ne,b as re}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import{b as ee}from"./chunk-5R3XKSDM.js";import{h as $}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as Y,b as Z}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as U,x as X}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as G,j as H,x as q}from"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import{a as A}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as z,m as R}from"./chunk-B63BKC6F.js";import{Cb as L,Ga as b,Jc as T,Kb as u,Kc as P,Mc as M,Nb as S,Ub as r,V as E,Vb as o,Wb as C,X as B,Z as W,_b as h,dc as f,ec as m,gb as s,h as J,ha as x,pa as l,qa as p,qc as _,ra as I,s as y,sa as N,vc as c,wb as O,wc as g,xc as d,yc as j,zc as F}from"./chunk-JP6RBSB3.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{Ga as n,J as K,N as x,Qc as G,V as E,X as R,ba as c,ca as q,ea as w,ga as o,h as F,m as u,mb as A,o as f,s as H,ta as y,w as S,x as k,xb as B,y as U,za as b,zb as J}from"./chunk-JP6RBSB3.js";import{a as T}from"./chunk-YQFG5XE2.js";var m=class{},W=(()=>{class a extends m{getTranslation(e){return u({})}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),N=class{},$=(()=>{class a{handle(e){return e.key}static \u0275fac=function(t){return new(t||a)};static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})();function D(a,r){if(a===r)return!0;if(a===null||r===null)return!1;if(a!==a&&r!==r)return!0;let e=typeof a,t=typeof r,s,i,l;if(e==t&&e=="object")if(Array.isArray(a)){if(!Array.isArray(r))return!1;if((s=a.length)==r.length){for(i=0;i<s;i++)if(!D(a[i],r[i]))return!1;return!0}}else{if(Array.isArray(r))return!1;l=Object.create(null);for(i in a){if(!D(a[i],r[i]))return!1;l[i]=!0}for(i in r)if(!(i in l)&&typeof r[i]<"u")return!1;return!0}return!1}function h(a){return typeof a<"u"&&a!==null}function O(a){return a&&typeof a=="object"&&!Array.isArray(a)}function Z(a,r){let e=Object.assign({},a);return O(a)&&O(r)&&Object.keys(r).forEach(t=>{O(r[t])?t in a?e[t]=Z(a[t],r[t]):Object.assign(e,{[t]:r[t]}):Object.assign(e,{[t]:r[t]})}),e}var C=class{},X=(()=>{class a extends C{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,t){let s;return typeof e=="string"?s=this.interpolateString(e,t):typeof e=="function"?s=this.interpolateFunction(e,t):s=e,s}getValue(e,t){let s=typeof t=="string"?t.split("."):[t];t="";do t+=s.shift(),h(e)&&h(e[t])&&(typeof e[t]=="object"||!s.length)?(e=e[t],t=""):s.length?t+=".":e=void 0;while(s.length);return e}interpolateFunction(e,t){return e(t)}interpolateString(e,t){return t?e.replace(this.templateMatcher,(s,i)=>{let l=this.getValue(t,i);return h(l)?l:s}):e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),L=class{},z=(()=>{class a extends L{compile(e,t){return e}compileTranslations(e,t){return e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),j=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new b;onLangChange=new b;onDefaultLangChange=new b},M=new w("USE_STORE"),P=new w("USE_DEFAULT_LANG"),I=new w("DEFAULT_LANGUAGE"),V=new w("USE_EXTEND"),_=(()=>{class a{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;isolate;extend;loadingTranslations;pending=!1;_onTranslationChange=new b;_onLangChange=new b;_onDefaultLangChange=new b;_defaultLang;_currentLang;_langs=[];_translations={};_translationRequests={};get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(e){this.isolate?this._defaultLang=e:this.store.defaultLang=e}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(e){this.isolate?this._currentLang=e:this.store.currentLang=e}get langs(){return this.isolate?this._langs:this.store.langs}set langs(e){this.isolate?this._langs=e:this.store.langs=e}get translations(){return this.isolate?this._translations:this.store.translations}set translations(e){this.isolate?this._translations=e:this.store.translations=e}constructor(e,t,s,i,l,d=!0,g=!1,p=!1,v){this.store=e,this.currentLoader=t,this.compiler=s,this.parser=i,this.missingTranslationHandler=l,this.useDefaultLang=d,this.isolate=g,this.extend=p,v&&this.setDefaultLang(v)}setDefaultLang(e){if(e===this.defaultLang)return;let t=this.retrieveTranslations(e);typeof t<"u"?(this.defaultLang==null&&(this.defaultLang=e),t.pipe(x(1)).subscribe(s=>{this.changeDefaultLang(e)})):this.changeDefaultLang(e)}getDefaultLang(){return this.defaultLang}use(e){if(e===this.currentLang)return u(this.translations[e]);let t=this.retrieveTranslations(e);return typeof t<"u"?(this.currentLang||(this.currentLang=e),t.pipe(x(1)).subscribe(s=>{this.changeLang(e)}),t):(this.changeLang(e),u(this.translations[e]))}retrieveTranslations(e){let t;return(typeof this.translations[e]>"u"||this.extend)&&(this._translationRequests[e]=this._translationRequests[e]||this.getTranslation(e),t=this._translationRequests[e]),t}getTranslation(e){this.pending=!0;let t=this.currentLoader.getTranslation(e).pipe(E(1),x(1));return this.loadingTranslations=t.pipe(H(s=>this.compiler.compileTranslations(s,e)),E(1),x(1)),this.loadingTranslations.subscribe({next:s=>{this.translations[e]=this.extend&&this.translations[e]?T(T({},s),this.translations[e]):s,this.updateLangs(),this.pending=!1},error:s=>{this.pending=!1}}),t}setTranslation(e,t,s=!1){t=this.compiler.compileTranslations(t,e),(s||this.extend)&&this.translations[e]?this.translations[e]=Z(this.translations[e],t):this.translations[e]=t,this.updateLangs(),this.onTranslationChange.emit({lang:e,translations:this.translations[e]})}getLangs(){return this.langs}addLangs(e){e.forEach(t=>{this.langs.indexOf(t)===-1&&this.langs.push(t)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(e,t,s){let i;if(t instanceof Array){let l={},d=!1;for(let g of t)l[g]=this.getParsedResult(e,g,s),f(l[g])&&(d=!0);if(d){let g=t.map(p=>f(l[p])?l[p]:u(l[p]));return U(g).pipe(H(p=>{let v={};return p.forEach((Y,ee)=>{v[t[ee]]=Y}),v}))}return l}if(e&&(i=this.parser.interpolate(this.parser.getValue(e,t),s)),typeof i>"u"&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(i=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],t),s)),typeof i>"u"){let l={key:t,translateService:this};typeof s<"u"&&(l.interpolateParams=s),i=this.missingTranslationHandler.handle(l)}return typeof i<"u"?i:t}get(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe(K(s=>(s=this.getParsedResult(s,e,t),f(s)?s:u(s))));{let s=this.getParsedResult(this.translations[this.currentLang],e,t);return f(s)?s:u(s)}}getStreamOnTranslationChange(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return S(k(()=>this.get(e,t)),this.onTranslationChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return typeof i.subscribe=="function"?i:u(i)})))}stream(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return S(k(()=>this.get(e,t)),this.onLangChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return f(i)?i:u(i)})))}instant(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');let s=this.getParsedResult(this.translations[this.currentLang],e,t);if(f(s)){if(e instanceof Array){let i={};return e.forEach((l,d)=>{i[e[d]]=e[d]}),i}return e}else return s}set(e,t,s=this.currentLang){this.translations[s][e]=this.compiler.compile(t,s),this.updateLangs(),this.onTranslationChange.emit({lang:s,translations:this.translations[s]})}changeLang(e){this.currentLang=e,this.onLangChange.emit({lang:e,translations:this.translations[e]}),this.defaultLang==null&&this.changeDefaultLang(e)}changeDefaultLang(e){this.defaultLang=e,this.onDefaultLangChange.emit({lang:e,translations:this.translations[e]})}reloadLang(e){return this.resetLang(e),this.getTranslation(e)}resetLang(e){this._translationRequests[e]=void 0,this.translations[e]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;if(e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,!(typeof e>"u"))return e.indexOf("-")!==-1&&(e=e.split("-")[0]),e.indexOf("_")!==-1&&(e=e.split("_")[0]),e}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;return e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,e}static \u0275fac=function(t){return new(t||a)(o(j),o(m),o(L),o(C),o(N),o(P),o(M),o(V),o(I))};static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})();var de=(()=>{class a{translate;_ref;value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onDefaultLangChange;constructor(e,t){this.translate=e,this._ref=t}updateValue(e,t,s){let i=l=>{this.value=l!==void 0?l:e,this.lastKey=e,this._ref.markForCheck()};if(s){let l=this.translate.getParsedResult(s,e,t);f(l.subscribe)?l.subscribe(i):i(l)}this.translate.get(e,t).subscribe(i)}transform(e,...t){if(!e||!e.length)return e;if(D(e,this.lastKey)&&D(t,this.lastParams))return this.value;let s;if(h(t[0])&&t.length)if(typeof t[0]=="string"&&t[0].length){let i=t[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{s=JSON.parse(i)}catch{throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${t[0]}`)}}else typeof t[0]=="object"&&!Array.isArray(t[0])&&(s=t[0]);return this.lastKey=e,this.lastParams=t,this.updateValue(e,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(i=>{this.lastKey&&i.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(i=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(t){return new(t||a)(A(_,16),A(G,16))};static \u0275pipe=J({name:"translate",type:a,pure:!1,standalone:!1});static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),ge=(()=>{class a{static forRoot(e={}){return{ngModule:a,providers:[e.loader||{provide:m,useClass:W},e.compiler||{provide:L,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:N,useClass:$},j,{provide:M,useValue:e.isolate},{provide:P,useValue:e.useDefaultLang},{provide:V,useValue:e.extend},{provide:I,useValue:e.defaultLanguage},_]}}static forChild(e={}){return{ngModule:a,providers:[e.loader||{provide:m,useClass:W},e.compiler||{provide:L,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:N,useClass:$},{provide:M,useValue:e.isolate},{provide:P,useValue:e.useDefaultLang},{provide:V,useValue:e.extend},{provide:I,useValue:e.defaultLanguage},_]}}static \u0275fac=function(t){return new(t||a)};static \u0275mod=B({type:a});static \u0275inj=q({})}return a})();var Q=[{path:"/pages/dashboard",title:"Dashboard",iconName:"fa-light fa-display-chart-up",class:"",extralink:!1,label:"",labelClass:"",submenu:[],requiredRoles:["Report"],isHidden:n(!1)},{path:"/pages/cash-bank",title:"Cash and Bank",requiredRoles:["Report"],iconName:"fa-light fa-building-columns",class:"",extralink:!1,label:"",labelClass:"",submenu:[],isHidden:n(!1)},{path:"",title:"COA",iconName:"fa-light fa-calculator",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Coa"],submenu:[{path:"/pages/chart-of-account/account",title:"Accounts",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/chart-of-account/coa-types",title:"Category",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/journal",title:"Journal",iconName:"fa-light fa-file-lines",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Journal"],submenu:[{path:"/pages/journal/journal-entry",title:"Manual Journal",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/journal/record-expense",title:"Record Expense",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/journal/receive-money",title:"Receive Money",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/report",title:"Reports",iconName:"fa-light fa-chart-column",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Report"],submenu:[{path:"/pages/report/general-ledger",title:"General Ledger",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/report/profit-loss",title:"Profit & Loss",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/report/balance-sheet",title:"Balance Sheet",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"",title:"Recurring",iconName:"fa-light fa-money-bill-1",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Recurring"],submenu:[{path:"/pages/recurring/recurring-expense",title:"Recurring Expenses",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/recurring/asset-value",title:"Asset Value",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/recurring/post-to-journal",title:"Post Recurring Expenses",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"",title:"Tools",iconName:"fa-light fa-wrench",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Tools"],submenu:[{path:"/pages/tools/generate-coa",title:"Update COA Balance",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/tools/unbalance-journal",title:"Unbalance Journal",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/migrate",title:"Migrate",iconName:"fa-light fa-paste",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Migrate"],submenu:[{path:"/pages/migrate/coa-category",title:"COA Category",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/chart-of-account",title:"Chart of Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/coa-configuration",title:"COA Configuration",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/outlet-account",title:"COA Outlet Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/payment-account",title:"Payment Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/writeoff-outlet",title:"Write Off Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/tax-account",title:"Tax Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/expense-account",title:"Expense Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/manual-journal",title:"Manual Journals",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/ticket",title:"Generate Journal",iconName:"fa-light fa-book",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Tools"],submenu:[{path:"/pages/generate-journal/invoice",title:"Customer Invoice",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/supplier-bill",title:"Supplier Bill",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/shift",title:"Shift",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/adjustment",title:"Adjustment",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/join-invoice",title:"Join Invoce",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/join-bill",title:"Join Bill",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/pos-setup",title:"POS Setup",iconName:"fa-light fa-gears",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Setup"],submenu:[{path:"/pages/pos-setup/global",title:"Global",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/outlets",title:"Outlet",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/payments",title:"Payments",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/taxs",title:"Tax",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/expense-option",title:"Expense Option",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/writeoff",title:"Write Off",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/ticket",title:"Accounting Setup",iconName:"fa-light fa-gears",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Setup"],submenu:[{path:"/pages/accounting-setup/accounting-integration",title:"Configuration",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/closing-entries",title:"Closing",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/format-journal",title:"Format Journal",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/opening-balance-form",title:"Opening Balance",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/api-crendetial",title:"API Credential",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/users",title:"Users",iconName:"fa-light fa-user",class:"",label:"",labelClass:"",extralink:!1,submenu:[],requiredRoles:["User"],isHidden:n(!1)}];var xe=(()=>{class a{constructor(){this.collapseSidebar=!1,this.fullScreen=!1,this.MENUITEMS=Q,this.items=new F(this.MENUITEMS)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{m as a,de as b,ge as c,xe as d};
1
+ import{Ga as n,J as K,N as x,Qc as G,V as E,X as R,ba as c,ca as q,ea as w,ga as o,h as F,m as u,mb as A,o as f,s as H,ta as y,w as S,x as k,xb as B,y as U,za as b,zb as J}from"./chunk-JP6RBSB3.js";import{a as T}from"./chunk-YQFG5XE2.js";var m=class{},W=(()=>{class a extends m{getTranslation(e){return u({})}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),N=class{},$=(()=>{class a{handle(e){return e.key}static \u0275fac=function(t){return new(t||a)};static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})();function D(a,r){if(a===r)return!0;if(a===null||r===null)return!1;if(a!==a&&r!==r)return!0;let e=typeof a,t=typeof r,s,i,l;if(e==t&&e=="object")if(Array.isArray(a)){if(!Array.isArray(r))return!1;if((s=a.length)==r.length){for(i=0;i<s;i++)if(!D(a[i],r[i]))return!1;return!0}}else{if(Array.isArray(r))return!1;l=Object.create(null);for(i in a){if(!D(a[i],r[i]))return!1;l[i]=!0}for(i in r)if(!(i in l)&&typeof r[i]<"u")return!1;return!0}return!1}function h(a){return typeof a<"u"&&a!==null}function O(a){return a&&typeof a=="object"&&!Array.isArray(a)}function Z(a,r){let e=Object.assign({},a);return O(a)&&O(r)&&Object.keys(r).forEach(t=>{O(r[t])?t in a?e[t]=Z(a[t],r[t]):Object.assign(e,{[t]:r[t]}):Object.assign(e,{[t]:r[t]})}),e}var C=class{},X=(()=>{class a extends C{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,t){let s;return typeof e=="string"?s=this.interpolateString(e,t):typeof e=="function"?s=this.interpolateFunction(e,t):s=e,s}getValue(e,t){let s=typeof t=="string"?t.split("."):[t];t="";do t+=s.shift(),h(e)&&h(e[t])&&(typeof e[t]=="object"||!s.length)?(e=e[t],t=""):s.length?t+=".":e=void 0;while(s.length);return e}interpolateFunction(e,t){return e(t)}interpolateString(e,t){return t?e.replace(this.templateMatcher,(s,i)=>{let l=this.getValue(t,i);return h(l)?l:s}):e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),L=class{},z=(()=>{class a extends L{compile(e,t){return e}compileTranslations(e,t){return e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(a)))(s||a)}})();static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),j=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new b;onLangChange=new b;onDefaultLangChange=new b},M=new w("USE_STORE"),P=new w("USE_DEFAULT_LANG"),I=new w("DEFAULT_LANGUAGE"),V=new w("USE_EXTEND"),_=(()=>{class a{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;isolate;extend;loadingTranslations;pending=!1;_onTranslationChange=new b;_onLangChange=new b;_onDefaultLangChange=new b;_defaultLang;_currentLang;_langs=[];_translations={};_translationRequests={};get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(e){this.isolate?this._defaultLang=e:this.store.defaultLang=e}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(e){this.isolate?this._currentLang=e:this.store.currentLang=e}get langs(){return this.isolate?this._langs:this.store.langs}set langs(e){this.isolate?this._langs=e:this.store.langs=e}get translations(){return this.isolate?this._translations:this.store.translations}set translations(e){this.isolate?this._translations=e:this.store.translations=e}constructor(e,t,s,i,l,d=!0,g=!1,p=!1,v){this.store=e,this.currentLoader=t,this.compiler=s,this.parser=i,this.missingTranslationHandler=l,this.useDefaultLang=d,this.isolate=g,this.extend=p,v&&this.setDefaultLang(v)}setDefaultLang(e){if(e===this.defaultLang)return;let t=this.retrieveTranslations(e);typeof t<"u"?(this.defaultLang==null&&(this.defaultLang=e),t.pipe(x(1)).subscribe(s=>{this.changeDefaultLang(e)})):this.changeDefaultLang(e)}getDefaultLang(){return this.defaultLang}use(e){if(e===this.currentLang)return u(this.translations[e]);let t=this.retrieveTranslations(e);return typeof t<"u"?(this.currentLang||(this.currentLang=e),t.pipe(x(1)).subscribe(s=>{this.changeLang(e)}),t):(this.changeLang(e),u(this.translations[e]))}retrieveTranslations(e){let t;return(typeof this.translations[e]>"u"||this.extend)&&(this._translationRequests[e]=this._translationRequests[e]||this.getTranslation(e),t=this._translationRequests[e]),t}getTranslation(e){this.pending=!0;let t=this.currentLoader.getTranslation(e).pipe(E(1),x(1));return this.loadingTranslations=t.pipe(H(s=>this.compiler.compileTranslations(s,e)),E(1),x(1)),this.loadingTranslations.subscribe({next:s=>{this.translations[e]=this.extend&&this.translations[e]?T(T({},s),this.translations[e]):s,this.updateLangs(),this.pending=!1},error:s=>{this.pending=!1}}),t}setTranslation(e,t,s=!1){t=this.compiler.compileTranslations(t,e),(s||this.extend)&&this.translations[e]?this.translations[e]=Z(this.translations[e],t):this.translations[e]=t,this.updateLangs(),this.onTranslationChange.emit({lang:e,translations:this.translations[e]})}getLangs(){return this.langs}addLangs(e){e.forEach(t=>{this.langs.indexOf(t)===-1&&this.langs.push(t)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(e,t,s){let i;if(t instanceof Array){let l={},d=!1;for(let g of t)l[g]=this.getParsedResult(e,g,s),f(l[g])&&(d=!0);if(d){let g=t.map(p=>f(l[p])?l[p]:u(l[p]));return U(g).pipe(H(p=>{let v={};return p.forEach((Y,ee)=>{v[t[ee]]=Y}),v}))}return l}if(e&&(i=this.parser.interpolate(this.parser.getValue(e,t),s)),typeof i>"u"&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(i=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],t),s)),typeof i>"u"){let l={key:t,translateService:this};typeof s<"u"&&(l.interpolateParams=s),i=this.missingTranslationHandler.handle(l)}return typeof i<"u"?i:t}get(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe(K(s=>(s=this.getParsedResult(s,e,t),f(s)?s:u(s))));{let s=this.getParsedResult(this.translations[this.currentLang],e,t);return f(s)?s:u(s)}}getStreamOnTranslationChange(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return S(k(()=>this.get(e,t)),this.onTranslationChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return typeof i.subscribe=="function"?i:u(i)})))}stream(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return S(k(()=>this.get(e,t)),this.onLangChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return f(i)?i:u(i)})))}instant(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');let s=this.getParsedResult(this.translations[this.currentLang],e,t);if(f(s)){if(e instanceof Array){let i={};return e.forEach((l,d)=>{i[e[d]]=e[d]}),i}return e}else return s}set(e,t,s=this.currentLang){this.translations[s][e]=this.compiler.compile(t,s),this.updateLangs(),this.onTranslationChange.emit({lang:s,translations:this.translations[s]})}changeLang(e){this.currentLang=e,this.onLangChange.emit({lang:e,translations:this.translations[e]}),this.defaultLang==null&&this.changeDefaultLang(e)}changeDefaultLang(e){this.defaultLang=e,this.onDefaultLangChange.emit({lang:e,translations:this.translations[e]})}reloadLang(e){return this.resetLang(e),this.getTranslation(e)}resetLang(e){this._translationRequests[e]=void 0,this.translations[e]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;if(e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,!(typeof e>"u"))return e.indexOf("-")!==-1&&(e=e.split("-")[0]),e.indexOf("_")!==-1&&(e=e.split("_")[0]),e}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;return e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,e}static \u0275fac=function(t){return new(t||a)(o(j),o(m),o(L),o(C),o(N),o(P),o(M),o(V),o(I))};static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})();var de=(()=>{class a{translate;_ref;value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onDefaultLangChange;constructor(e,t){this.translate=e,this._ref=t}updateValue(e,t,s){let i=l=>{this.value=l!==void 0?l:e,this.lastKey=e,this._ref.markForCheck()};if(s){let l=this.translate.getParsedResult(s,e,t);f(l.subscribe)?l.subscribe(i):i(l)}this.translate.get(e,t).subscribe(i)}transform(e,...t){if(!e||!e.length)return e;if(D(e,this.lastKey)&&D(t,this.lastParams))return this.value;let s;if(h(t[0])&&t.length)if(typeof t[0]=="string"&&t[0].length){let i=t[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{s=JSON.parse(i)}catch{throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${t[0]}`)}}else typeof t[0]=="object"&&!Array.isArray(t[0])&&(s=t[0]);return this.lastKey=e,this.lastParams=t,this.updateValue(e,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(i=>{this.lastKey&&i.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(i=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(t){return new(t||a)(A(_,16),A(G,16))};static \u0275pipe=J({name:"translate",type:a,pure:!1,standalone:!1});static \u0275prov=c({token:a,factory:a.\u0275fac})}return a})(),ge=(()=>{class a{static forRoot(e={}){return{ngModule:a,providers:[e.loader||{provide:m,useClass:W},e.compiler||{provide:L,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:N,useClass:$},j,{provide:M,useValue:e.isolate},{provide:P,useValue:e.useDefaultLang},{provide:V,useValue:e.extend},{provide:I,useValue:e.defaultLanguage},_]}}static forChild(e={}){return{ngModule:a,providers:[e.loader||{provide:m,useClass:W},e.compiler||{provide:L,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:N,useClass:$},{provide:M,useValue:e.isolate},{provide:P,useValue:e.useDefaultLang},{provide:V,useValue:e.extend},{provide:I,useValue:e.defaultLanguage},_]}}static \u0275fac=function(t){return new(t||a)};static \u0275mod=B({type:a});static \u0275inj=q({})}return a})();var Q=[{path:"/pages/dashboard",title:"Dashboard",iconName:"fa-light fa-display-chart-up",class:"",extralink:!1,label:"",labelClass:"",submenu:[],requiredRoles:["Report"],isHidden:n(!1)},{path:"/pages/cash-bank",title:"Cash and Bank",requiredRoles:["Report"],iconName:"fa-light fa-building-columns",class:"",extralink:!1,label:"",labelClass:"",submenu:[],isHidden:n(!1)},{path:"",title:"COA",iconName:"fa-light fa-calculator",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Coa"],submenu:[{path:"/pages/chart-of-account/account",title:"Accounts",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/chart-of-account/coa-types",title:"Category",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/journal",title:"Journal",iconName:"fa-light fa-file-lines",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Journal"],submenu:[{path:"/pages/journal/journal-entry",title:"Manual Journal",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/journal/record-expense",title:"Record Expense",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/journal/receive-money",title:"Receive Money",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/report",title:"Reports",iconName:"fa-light fa-chart-column",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Report"],submenu:[{path:"/pages/report/general-ledger",title:"General Ledger",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/report/profit-loss",title:"Profit & Loss",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/report/balance-sheet",title:"Balance Sheet",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"",title:"Recurring",iconName:"fa-light fa-money-bill-1",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Recurring"],submenu:[{path:"/pages/recurring/recurring-expense",title:"Recurring Expenses",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/recurring/asset-value",title:"Asset Value",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/recurring/post-to-journal",title:"Post Recurring Expenses",iconName:"",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"",title:"Tools",iconName:"fa-light fa-wrench",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Tools"],submenu:[{path:"/pages/tools/generate-coa",title:"Update COA Balance",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/tools/unbalance-journal",title:"Unbalance Journal",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/migrate",title:"Migrate",iconName:"fa-light fa-paste",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Migrate"],submenu:[{path:"/pages/migrate/manual-journal",title:"Manual Journals",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/coa-configuration",title:"COA Configuration",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/chart-of-account",title:"Chart of Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/coa-category",title:"COA Category",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/outlet-account",title:"COA Outlet Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/payment-account",title:"Payment Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/writeoff-outlet",title:"Write Off Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/tax-account",title:"Tax Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/migrate/expense-account",title:"Expense Account",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/ticket",title:"Generate Journal",iconName:"fa-light fa-book",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Tools"],submenu:[{path:"/pages/generate-journal/invoice",title:"Customer Invoice",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/supplier-bill",title:"Supplier Bill",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/shift",title:"Shift",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/adjustment",title:"Adjustment",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/join-invoice",title:"Join Invoce",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/generate-journal/join-bill",title:"Join Bill",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/pos-setup",title:"POS Setup",iconName:"fa-light fa-gears",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Setup"],submenu:[{path:"/pages/pos-setup/global",title:"Global",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/outlets",title:"Outlet",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/payments",title:"Payments",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/taxs",title:"Tax",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/expense-option",title:"Expense Option",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/pos-setup/writeoff",title:"Write Off",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/ticket",title:"Accounting Setup",iconName:"fa-light fa-gears",class:"has-arrow",label:"",labelClass:"",extralink:!1,requiredRoles:["Setup"],submenu:[{path:"/pages/accounting-setup/accounting-integration",title:"Configuration",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/closing-entries",title:"Closing",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/format-journal",title:"Format Journal",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/opening-balance-form",title:"Opening Balance",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)},{path:"/pages/accounting-setup/api-crendetial",title:"API Credential",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[],isHidden:n(!1)}],isHidden:n(!1)},{path:"/pages/users",title:"Users",iconName:"fa-light fa-user",class:"",label:"",labelClass:"",extralink:!1,submenu:[],requiredRoles:["User"],isHidden:n(!1)}];var xe=(()=>{class a{constructor(){this.collapseSidebar=!1,this.fullScreen=!1,this.MENUITEMS=Q,this.items=new F(this.MENUITEMS)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{m as a,de as b,ge as c,xe as d};
@@ -1,4 +1,4 @@
1
- import{a as Le,b as Ve}from"./chunk-HHJMN4BS.js";import{a as yt,b as be}from"./chunk-XILGARZ5.js";import"./chunk-MFH4UZ6J.js";import{a as we}from"./chunk-VVHTNAHQ.js";import{b as xt,c as St,d as Ct}from"./chunk-KJ6CKUEI.js";import{a as ye,b as ve}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{b as ht}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as me}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as q,b as H}from"./chunk-O4QM64EH.js";import{a as _t,b as ft,d as Se,k as Ce}from"./chunk-EW3R2HAB.js";import{a as he,b as xe}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as gt}from"./chunk-C6U3U6SW.js";import{a as Ie}from"./chunk-XKCLERWG.js";import{a as oe,b as Re}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{b as Te}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import{d as st}from"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as ge}from"./chunk-5R3XKSDM.js";import{f as ut,h as fe}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as le,b as pe}from"./chunk-J4XRJAME.js";import{a as V,b as ce,c as se,d as de,e as ue,f as _e,g as dt}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as re,x as ae}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as X,f as Z,g as mt,i as G,k as ee,l as te,o as ie,t as ct,v as De,y as ne}from"./chunk-FMVCTBCQ.js";import{a as pt}from"./chunk-P3V7Z3A6.js";import{a as lt}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as at,G as J,N as Q,f as z,k as ot,l as U,m as $,s as rt}from"./chunk-B63BKC6F.js";import{Ac as F,Cb as x,D as Fe,Ga as L,Jc as S,Kb as c,Kc as C,L as Je,Lc as it,Mc as s,Nb as j,Pb as O,Qb as ke,Sb as Be,Tb as Oe,Ub as n,V as Qe,Vb as i,W as Xe,Wb as I,X as P,Yc as T,Z as M,Zc as nt,_b as D,ba as Ze,c as A,cb as et,dc as w,ec as d,gb as l,ha as g,hc as tt,pa as v,qa as b,qc as a,rc as _,s as $e,sc as R,vc as Y,wb as k,wc as N,xc as W,yc as K,zc as E}from"./chunk-JP6RBSB3.js";import{a as h,b as y,c as Me,e as Ue}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=g(pt),this.authService=g(we)}fetchGeneralLedgerLoader(){return this.httpService.get(void 0,"api/GeneralLedgerLoader/GetFilter")}fetchGeneralLedgerReport(e){return this.httpService.post(void 0,"api/GeneralLedger/Get",e)}exportGeneralLedger(e){let o={responseType:"blob"};return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,o)}getCustomerSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:o})}getSupplierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:o})}getCashierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:o})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,o={}){let r=new rt({fromObject:Object.fromEntries(Object.entries(e).map(([f,u])=>[f,String(u)]))}),m=h({params:r},o);return this.httpService.get(void 0,"/api/BalanceSheet",m)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,o={}){return this.httpService.post(void 0,"api/IncomeStatement/List",h({},e),o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={metadata:{filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:0,contactID:""},options:{accounts:[],outlets:[],contactTypeOptions:[]},roles:{isInEmptyOutletRole:!1}},items:{data:[],pageTitle:""},filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:1,contactID:null}},Ge=ce(_e(Gt),dt("General Ledger Store"),se(t=>({debitTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.debitAmount||0),0),0)),creditTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.creditAmount||0),0),0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},loadList:q(A(Fe(o=>o.listAccountID.length>0),P(o=>p.fetchGeneralLedgerReport(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:q(A(P(()=>p.fetchGeneralLedgerLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:y(h({},r.filter),{listCategoryID:o.filter.listCategoryID})})),e.loadList(t.filter)},error:o=>{console.error(o)}})))))};return e}),de({onInit:t=>{t.loadLoader()}}));var jt=()=>({height:"calc(100vh - 70px)"}),Nt=()=>({height:"calc(100vh - 100px)"}),qt=t=>["/pages/journal/journal-entry/",t],Ht=()=>({scrollHeight:"250px"});function Yt(t,p){if(t&1){let e=D();n(0,"p-button",14),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Wt(t,p){if(t&1&&(n(0,"div",11)(1,"a",12),a(2,"Return to Accounts"),i(),x(3,Yt,1,0,"p-button",13),i()),t&2){let e=d();l(3),c("ngIf",e.roleService.global.export)}}function Kt(t,p){if(t&1&&(n(0,"div",11)(1,"span",17)(2,"h2",18),a(3),i()(),n(4,"span",17)(5,"h2",18),a(6),i()()()),t&2){let e=d().$implicit;l(3),_(e.name),l(3),R(" (",e.chartOfAccountCode,") ")}}function zt(t,p){t&1&&(n(0,"tr")(1,"th",19),a(2,"Outlet"),i(),n(3,"th",19),a(4,"No."),i(),n(5,"th",19),a(6,"Date"),i(),n(7,"th",19),a(8,"Name"),i(),n(9,"th",19),a(10,"Description"),i(),n(11,"th",20),a(12,"Debit"),i(),n(13,"th",21),a(14,"Credit"),i(),n(15,"th",21),a(16,"Balance"),i()())}function Ut(t,p){if(t&1&&(n(0,"td",26),a(1,"Starting Balance"),i(),n(2,"td",27),a(3),S(4,"number"),i()),t&2){let e=d(2).$implicit;l(3),R(" ",C(4,1,e.startBalance)," ")}}function $t(t,p){if(t&1&&(n(0,"tr"),x(1,Ut,5,3),i(),n(2,"tr")(3,"td",22),a(4),i(),n(5,"td",22)(6,"a",23),a(7),i()(),n(8,"td",22),a(9),S(10,"date"),i(),n(11,"td",22)(12,"a",24),a(13),i()(),I(14,"td"),n(15,"td",25),a(16),S(17,"number"),i(),n(18,"td",25),a(19),S(20,"number"),i(),n(21,"td",25),a(22),S(23,"number"),i()()),t&2){let e=p.$implicit,o=p.rowIndex,r=d(4);l(),O(o===0&&r.store.items().data.length>1?1:-1),l(3),_(e.outletName),l(2),c("routerLink",F(19,qt,e.id)),l(),_(e.number),l(2),_(it(10,10,e.date,"dd MMM yyyy")),l(3),c("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,et),l(),_(e.contactName),l(3),R(" ",C(17,13,e.debitAmount)," "),l(3),R(" ",C(20,15,e.creditAmount)," "),l(3),_(C(23,17,e.balance))}}function Jt(t,p){if(t&1&&(n(0,"tr"),I(1,"td",28),n(2,"td",29),a(3,"Total"),i(),n(4,"td",29),a(5),S(6,"number"),i(),n(7,"td",29),a(8),S(9,"number"),i(),I(10,"td"),i()),t&2){let e=d().$index,o=d(3);l(5),R(" ",C(6,2,o.store.items().data[e].debitTotal)," "),l(3),R(" ",C(9,4,o.store.items().data[e].creditTotal)," ")}}function Qt(t,p){t&1&&(n(0,"tr")(1,"td",30)(2,"span"),a(3,"No records found."),i()()())}function Xt(t,p){if(t&1&&(n(0,"p-table",16),x(1,Kt,7,2,"ng-template",null,3,s)(3,zt,17,0,"ng-template",null,4,s)(5,$t,24,21,"ng-template",null,5,s)(7,Jt,11,6,"ng-template",null,6,s)(9,Qt,4,0,"ng-template",null,7,s),i()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function Zt(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel"),Be(2,Xt,11,2,"p-table",16,ke),i()()),t&2){let e=d(2);j(E(4,jt)),l(),j(E(5,Nt)),l(),Oe(e.store.items().data)}}function ei(t,p){if(t&1&&x(0,Zt,4,6,"p-panel",15),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function ti(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ii(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ni(t,p){if(t&1&&(n(0,"div",44)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function oi(t,p){if(t&1&&(n(0,"div",41),I(1,"p-radiobutton",45),n(2,"label",46),a(3),i()()),t&2){let e=p.$implicit;l(),c("value",e.key)("inputId",e.key),l(),tt("for",e.key),l(),_(e.value)}}function ri(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function ai(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Supplier"),i(),n(3,"p-autocomplete",48),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchSupplier(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.supplierSuggestions())}}function li(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function pi(t,p){if(t&1){let e=D();n(0,"form",31)(1,"div",32)(2,"label",33),a(3,"Accounts"),i(),n(4,"p-multiselect",34),w("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),x(5,ti,10,2,"ng-template",null,8,s)(7,ii,10,2,"ng-template",null,9,s),i()(),n(9,"div",32)(10,"label",33),a(11,"From"),i(),I(12,"p-datepicker",35),i(),n(13,"div",32)(14,"label",33),a(15,"To"),i(),I(16,"p-datepicker",36),i(),n(17,"div",32)(18,"label",33),a(19,"Outlets"),i(),n(20,"p-multiselect",37),x(21,ni,3,1,"ng-template",null,9,s),i()(),n(23,"div",32)(24,"label",33),a(25,"Category"),i(),n(26,"p-treeselect",38),w("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),i()(),n(27,"div",32)(28,"label",39),a(29,"Contact Type"),i(),n(30,"div",40),Be(31,oi,4,4,"div",41,ke),i()(),x(33,ri,4,1,"div",32)(34,ai,4,1,"div",32)(35,li,4,1,"div",32),i()}if(t&2){let e,o=d();c("formGroup",o.generalLedgerFilterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("maxlength",5)("options",o.store.metadata().options.accounts),l(8),c("iconDisplay","input")("showIcon",!0),l(4),c("iconDisplay","input")("showIcon",!0),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.store.metadata().options.outlets),l(6),c("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",E(18,Ht))("options",o.categoriesOptions()),l(5),Oe(o.store.metadata().options.contactTypeOptions),l(2),O((e=o.generalLedgerFilterForm.controls.contactType.value)===1?33:e===2?34:35)}}var Tt=(()=>{class t{constructor(){this.dialogFilterVisible=L(!1),this.reportService=g(B),this.coaService=g(gt),this.authService=g(we),this.store=g(Ge),this.roleService=g(me),this.categoriesOptions=L([]),this.customerSuggestions=L([]),this.supplierSuggestions=L([]),this.route=g(at),this.dayjsService=g(be),this.initDialogVisible=L(!0),this.fb=g(De),this.toastr=g(lt)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe($e(e=>e.get("id")),M(e=>{e&&(this.initDialogVisible.update(o=>!o),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(h({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange(),this.generalLedgerFilterForm.valueChanges.pipe(Je(500),M(e=>{Array.isArray(e.listAccountID)&&e.listAccountID.length>0?this.generalLedgerFilterForm.controls.listCategoryID.disable():this.generalLedgerFilterForm.controls.listCategoryID.enable(),e.listCategoryID&&e.listCategoryID.filter(o=>o.key).length>0?this.generalLedgerFilterForm.controls.listAccountID.disable():this.generalLedgerFilterForm.controls.listAccountID.enable()})).subscribe()}clearContactValueOnContactTypeChange(){this.generalLedgerFilterForm.get("contactType")?.valueChanges.subscribe(()=>this.generalLedgerFilterForm.get("contactID")?.setValue(""))}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at least 5 accounts for the general ledger report.","Warning")}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}generateFilterForm(){this.generalLedgerFilterForm=this.fb.group({listAccountID:new G([]),listCategoryID:new G([]),listOutletID:new G([]),contactID:new G(""),from:new G(""),to:new G(""),contactType:new G(1)})}onFilterOKEvent(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]);if(this.generalLedgerFilterForm.invalid){this.generalLedgerFilterForm.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.dialogFilterVisible.update(u=>!u),this.store.updateFilter(m),this.dialogFilterVisible.set(!1)}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(o=>this.customerSuggestions.set(o))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(o=>this.supplierSuggestions.set(o))).subscribe()}onExport(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]),m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.reportService.exportGeneralLedger(m).pipe(M(u=>{Ct(u,`general-ledger-${this.dayjsService.now.format("D-MM-YYYY")}.${u.type.split("/")[1]}`,u.type)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-general-ledger"]],features:[K([Ge])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["caption",""],["header",""],["body",""],["footer",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["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"],[3,"style",4,"ngIf"],["scrollHeight","calc(100vh - 150px)",3,"value","scrollable"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],["colspan","7",1,"text-end"],[1,"text-end"],["colspan","4"],[1,"text-end","fw-semibold"],["colspan","8"],[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","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","maxlength","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","id","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],["for",""],[1,"d-flex","gap-3"],[1,"d-flex","align-items-center","gap-2"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[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"]],template:function(o,r){if(o&1){let m=D();n(0,"app-main-panel",10),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.initDialogVisible,u)||(r.initDialogVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Wt,4,1,"ng-template",null,0,s)(3,ei,1,1,"ng-template",null,1,s)(5,pi,36,19,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.items().pageTitle.length?r.store.items().pageTitle:"General Ledger"),Y("isDialogFilterVisible",r.dialogFilterVisible),c("isFilterable",!0),Y("isInitDialogFilterVisible",r.initDialogVisible))},dependencies:[fe,$,z,U,ot,ge,Ce,Se,ut,ae,re,Te,xe,he,Ve,Le,ne,ee,X,Z,ct,te,ie,ve,ye,Re,oe,st,St,xt,ht,pe,le,Q,J,ft,_t],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var mi={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Ae=ce(_e(mi),se(t=>{let p={totalCOGS:T(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalRevenue:T(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalExpense:T(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),grossProfit:T(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:T(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:T(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),ue(t=>{let p=g(B),e=g(be),o={updateFilter(r){V(t,m=>y(h({},m),{filter:h(h({},m.filter),r)}))},getLoader:q(A(P(()=>p.getIncomeStatementLoader().pipe(H({next:r=>{V(t,m=>y(h({},m),{loader:r,filter:y(h({},m.filter),{from:e.from(r.filter.from).format(),to:e.from(r.filter.to).format()})})),o.getIncomeStatement(t.filter)},error:r=>{console.error(r)}}))))),getIncomeStatement:q(A(P(r=>p.getIncomeStatement(r).pipe(Xe(()=>V(t,m=>y(h({},m),{isLoading:!0}))),H({next:m=>{V(t,f=>y(h({},f),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return o}),de({onInit:t=>{t.getLoader()}}));var ci=()=>({height:"calc(100vh - 70px)"}),si=()=>({height:"calc(100vh - 150px)"}),Pe=()=>({}),je=t=>["/pages/chart-of-account/account/",t],Ne=()=>["/pages/report/general-ledger"],qe=t=>({id:t});function di(t,p){if(t&1){let e=D();n(0,"p-button",10),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function ui(t,p){if(t&1&&(n(0,"div",8),x(1,di,1,0,"p-button",9),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function _i(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function fi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.accountID)),l(),_(C(9,6,e.amount))}}function gi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",20),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total Revenue :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,1,e.store.totalRevenue()))}}function hi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No revenue records available"),i()()())}function xi(t,p){if(t&1&&(n(0,"h6",13),a(1,"Revenue"),i(),n(2,"p-table",14),x(3,_i,7,0,"ng-template",null,3,s)(5,fi,10,13,"ng-template",null,4,s)(7,gi,9,3,"ng-template",null,5,s)(9,hi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.revenue)}}function Si(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",26),a(6,"Total"),i()())}function Ci(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function yi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",27),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total COGS :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()(),n(9,"tr"),I(10,"td",27),n(11,"td",21)(12,"div",22)(13,"span",23),a(14,"Gross Profit :"),i(),n(15,"span",24),a(16),S(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,2,e.store.totalCOGS())),l(9),_(C(17,4,e.store.grossProfit()))}}function vi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No COGS records available"),i()()())}function bi(t,p){if(t&1&&(n(0,"h4",13),a(1,"COGS"),i(),n(2,"p-table",14),x(3,Si,7,0,"ng-template",null,3,s)(5,Ci,10,13,"ng-template",null,4,s)(7,yi,18,6,"ng-template",null,5,s)(9,vi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.cogs)}}function Ei(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ii(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function Fi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",27),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total Expense :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()(),n(9,"tr"),I(10,"td",27),n(11,"td",21)(12,"div",22)(13,"span",23),a(14,"Profit / Loss :"),i(),n(15,"span",24),a(16),S(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,2,e.store.totalExpense())),l(9),_(C(17,4,e.store.profitOrLoss()))}}function wi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No expense records available"),i()()())}function Di(t,p){if(t&1&&(n(0,"h4",13),a(1,"Expense"),i(),n(2,"p-table",14),x(3,Ei,7,0,"ng-template",null,3,s)(5,Ii,10,13,"ng-template",null,4,s)(7,Fi,18,6,"ng-template",null,5,s)(9,wi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.expense)}}function Ri(t,p){if(t&1&&(n(0,"p-scroll-panel")(1,"div",12),x(2,xi,11,1)(3,bi,11,1)(4,Di,11,1),i()()),t&2){let e,o,r,m=d(2);j(E(5,si)),l(2),O(m.Object.keys((e=m.store.data().data)!==null&&e!==void 0?e:E(6,Pe)).length>0?2:-1),l(),O(m.Object.keys((o=(o=m.store.data().data)==null?null:o.cogs)!==null&&o!==void 0?o:E(7,Pe)).length>0?3:-1),l(),O(m.Object.keys((r=(r=m.store.data().data)==null?null:r.expense)!==null&&r!==void 0?r:E(8,Pe)).length>0?4:-1)}}function Ti(t,p){if(t&1&&(n(0,"p-panel"),x(1,Ri,5,9,"p-scroll-panel",11),i()),t&2){let e=d();j(E(3,ci)),l(),c("ngIf",e.store.data())}}function Li(t,p){if(t&1){let e=D();n(0,"form",28)(1,"div",29)(2,"label",30),a(3,"Outlet"),i(),I(4,"p-multiselect",31),i(),n(5,"div",29)(6,"label",30),a(7,"Cashier"),i(),n(8,"p-autocomplete",32),w("completeMethod",function(r){v(e);let m=d();return b(m.onCashierSearch(r))})("onSelect",function(r){v(e);let m=d();return b(m.onCashierSelect(r))}),i()(),n(9,"div",29)(10,"label",30),a(11,"From"),i(),I(12,"p-datepicker",33),i(),n(13,"div",29)(14,"label",30),a(15,"To"),i(),I(16,"p-datepicker",34),i()()}if(t&2){let e=d();c("formGroup",e.formFilter),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),c("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0)}}var Lt=(()=>{class t{constructor(){this.dayjsService=g(be),this.store=g(Ae),this.fb=g(De),this.reportService=g(B),this.roleService=g(me),this.isInitDialogFilterVisible=L(!1),this.dialogFilterVisible=L(!1),this.cashierSuggestions=L([]),this.cashierHashMap=new Map,this.Object=Object,nt(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(h({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ie("Cashier Suggestions"),M(o=>this.cashierSuggestions.set(o))).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(),o=Object.entries(e).reduce((r,[m,f])=>(m==="from"||m==="to"?f instanceof Date&&(r[m]=this.dayjsService.from(f).format()):r[m]=f||null,r),{});this.store.updateFilter(h(h({},this.store.filter()),o)),this.dialogFilterVisible.update(r=>!r),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=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ie("Export Profit & Loss"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`profit-and-loss.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-income-statement"]],features:[K([Ae])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],[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","2 ",1,"fw-semibold","text-end",2,"width","50%"],[1,"text-end","fw-semibold"],[1,"row"],[1,"col-9"],[1,"col"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],["colspan","2",1,"fw-semibold"],[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"],["formControlName","from","styleClass","w-100","appendTo","body"],["formControlName","to","styleClass","w-100","appendTo","body"]],template:function(o,r){if(o&1){let m=D();n(0,"app-main-panel",7),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),x(1,ui,2,1,"ng-template",null,0,s)(3,Ti,2,4,"ng-template",null,1,s)(5,Li,17,8,"ng-template",null,2,s),i()}o&2&&(c("isFilterable",!0)("pageTitle",r.store.data().pageTitle),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Te,xe,he,ne,ee,X,Z,te,ie,ve,ye,ge,Ce,Se,pe,le,oe,Q,J,Ve,Le,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var He=Ue(yt());var Vi={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,He.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Ye=ce(_e(Vi),se(t=>({totalAsset:T(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:T(()=>t.data().liability.reduce((p,e)=>p+ +e.counterAmount,0)),totalEquity:T(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},fetchBalanceSheet:q(A(Fe(()=>{let o=t.filter();return Object.entries(o).every(([r,m])=>m!=null&&m!=="")}),P(o=>p.getBalanceSheet(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{data:r}))},error:r=>{console.error(r)}}))),Qe(1))),fetchLoader:q(A(P(()=>p.getBalanceSheetLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:{date:(0,He.default)(o.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:o=>{console.error(o)}})))))};return e}),de(t=>({onInit:()=>{t.fetchLoader()}})));var Vt=Ue(yt());var Mi=()=>({height:"calc(100vh - 70px)"}),ki=()=>({height:"calc(100vh - 100px)"}),We=t=>["/pages/chart-of-account/account/",t],Ke=()=>["/pages/report/general-ledger"],ze=t=>({id:t});function Bi(t,p){if(t&1){let e=D();n(0,"p-button",11),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Oi(t,p){if(t&1&&(n(0,"div",9),x(1,Bi,1,0,"p-button",10),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function Gi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Asset"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ai(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.amount))}}function Pi(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Asset"),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,1,e.store.totalAsset())," ")}}function ji(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),i()()())}function Ni(t,p){if(t&1&&(n(0,"h4",14),a(1,"Asset"),i(),n(2,"p-table",15),x(3,Gi,7,0,"ng-template",null,3,s)(5,Ai,10,13,"ng-template",null,4,s)(7,Pi,6,3,"ng-template",null,5,s)(9,ji,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function qi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Liability"),i(),n(5,"th",17),a(6,"Total"),i()())}function Hi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",25),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Yi(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2," Total Liability "),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,1,e.store.totalLiability())," ")}}function Wi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),i()()())}function Ki(t,p){if(t&1&&(n(0,"h4",24),a(1,"Liability"),i(),n(2,"p-table",15),x(3,qi,7,0,"ng-template",null,3,s)(5,Hi,10,13,"ng-template",null,4,s)(7,Yi,6,3,"ng-template",null,5,s)(9,Wi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function zi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Equity"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ui(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function $i(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Equity"),i(),n(3,"td",22),a(4),S(5,"number"),i()(),n(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),i(),n(9,"td",22),a(10),S(11,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,2,e.store.totalEquity())," "),l(6),R(" ",C(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Ji(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),i()()())}function Qi(t,p){if(t&1&&(n(0,"h4",24),a(1,"Equity"),i(),n(2,"p-table",15),x(3,zi,7,0,"ng-template",null,3,s)(5,Ui,10,13,"ng-template",null,4,s),a(7," <"),x(8,$i,12,6,"ng-template",null,5,s)(10,Ji,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function Xi(t,p){if(t&1&&(n(0,"p-panel",12)(1,"p-scroll-panel")(2,"div",13),x(3,Ni,11,1)(4,Ki,11,1)(5,Qi,12,1),i()()()),t&2){let e=d();j(E(8,Mi)),c("showHeader",!1),l(),j(E(9,ki)),l(2),O(e.Object.keys(e.store.data().asset).length>0?3:-1),l(),O(e.Object.keys(e.store.data().liability).length>0?4:-1),l(),O(e.Object.keys(e.store.data().equity).length>0?5:-1)}}function Zi(t,p){if(t&1&&(n(0,"div",31)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function en(t,p){if(t&1&&(n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),n(4,"p-multiselect",29),x(5,Zi,3,1,"ng-template",null,7,s),i()(),n(7,"div",27)(8,"label",28),a(9,"From"),i(),I(10,"p-datepicker",30),i()()),t&2){let e=d();c("formGroup",e.filterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),c("iconDisplay","input")("showIcon",!0)}}var Mt=(()=>{class t{constructor(){this.store=g(Ye),this.ReportServiceStore=g(B),this.dialogFilterVisible=L(!1),this.isInitDialogFilterVisible=L(!1),this.roleService=g(me),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new mt({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:o}=this.filterForm.value;this.store.updateFilter({date:(0,Vt.default)(e).format("YYYY-MM-DD"),listOutletParam:o}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ie("Export Balance Sheet"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`balance-sheet.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-balance-sheet"]],features:[K([Ye])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","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(o,r){if(o&1){let m=D();n(0,"app-main-panel",8),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Oi,2,1,"ng-template",null,0,s)(3,Xi,6,10,"ng-template",null,1,s)(5,en,11,7,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.data().pageTitle)("isFilterable",!0),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Ce,Se,ge,ae,re,ne,ee,X,Z,te,ie,ve,ye,xe,he,Re,oe,pe,le,Q,J],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-comparative-balance works!"),i(),a(2,`
1
+ import{a as Le,b as Ve}from"./chunk-HHJMN4BS.js";import{a as yt,b as be}from"./chunk-BGWDOZQM.js";import"./chunk-VZI3JZPU.js";import{a as we}from"./chunk-VVHTNAHQ.js";import{b as xt,c as St,d as Ct}from"./chunk-KJ6CKUEI.js";import{a as ye,b as ve}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{b as ht}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as me}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as q,b as H}from"./chunk-O4QM64EH.js";import{a as _t,b as ft,d as Se,k as Ce}from"./chunk-EW3R2HAB.js";import{a as he,b as xe}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as gt}from"./chunk-C6U3U6SW.js";import{a as Ie}from"./chunk-XKCLERWG.js";import{a as oe,b as Re}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{b as Te}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import{d as st}from"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as ge}from"./chunk-5R3XKSDM.js";import{f as ut,h as fe}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as le,b as pe}from"./chunk-J4XRJAME.js";import{a as V,b as ce,c as se,d as de,e as ue,f as _e,g as dt}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as re,x as ae}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as X,f as Z,g as mt,i as G,k as ee,l as te,o as ie,t as ct,v as De,y as ne}from"./chunk-FMVCTBCQ.js";import{a as pt}from"./chunk-P3V7Z3A6.js";import{a as lt}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as at,G as J,N as Q,f as z,k as ot,l as U,m as $,s as rt}from"./chunk-B63BKC6F.js";import{Ac as F,Cb as x,D as Fe,Ga as L,Jc as S,Kb as c,Kc as C,L as Je,Lc as it,Mc as s,Nb as j,Pb as O,Qb as ke,Sb as Be,Tb as Oe,Ub as n,V as Qe,Vb as i,W as Xe,Wb as I,X as P,Yc as T,Z as M,Zc as nt,_b as D,ba as Ze,c as A,cb as et,dc as w,ec as d,gb as l,ha as g,hc as tt,pa as v,qa as b,qc as a,rc as _,s as $e,sc as R,vc as Y,wb as k,wc as N,xc as W,yc as K,zc as E}from"./chunk-JP6RBSB3.js";import{a as h,b as y,c as Me,e as Ue}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=g(pt),this.authService=g(we)}fetchGeneralLedgerLoader(){return this.httpService.get(void 0,"api/GeneralLedgerLoader/GetFilter")}fetchGeneralLedgerReport(e){return this.httpService.post(void 0,"api/GeneralLedger/Get",e)}exportGeneralLedger(e){let o={responseType:"blob"};return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,o)}getCustomerSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:o})}getSupplierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:o})}getCashierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:o})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,o={}){let r=new rt({fromObject:Object.fromEntries(Object.entries(e).map(([f,u])=>[f,String(u)]))}),m=h({params:r},o);return this.httpService.get(void 0,"/api/BalanceSheet",m)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,o={}){return this.httpService.post(void 0,"api/IncomeStatement/List",h({},e),o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={metadata:{filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:0,contactID:""},options:{accounts:[],outlets:[],contactTypeOptions:[]},roles:{isInEmptyOutletRole:!1}},items:{data:[],pageTitle:""},filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:1,contactID:null}},Ge=ce(_e(Gt),dt("General Ledger Store"),se(t=>({debitTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.debitAmount||0),0),0)),creditTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.creditAmount||0),0),0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},loadList:q(A(Fe(o=>o.listAccountID.length>0),P(o=>p.fetchGeneralLedgerReport(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:q(A(P(()=>p.fetchGeneralLedgerLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:y(h({},r.filter),{listCategoryID:o.filter.listCategoryID})})),e.loadList(t.filter)},error:o=>{console.error(o)}})))))};return e}),de({onInit:t=>{t.loadLoader()}}));var jt=()=>({height:"calc(100vh - 70px)"}),Nt=()=>({height:"calc(100vh - 100px)"}),qt=t=>["/pages/journal/journal-entry/",t],Ht=()=>({scrollHeight:"250px"});function Yt(t,p){if(t&1){let e=D();n(0,"p-button",14),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Wt(t,p){if(t&1&&(n(0,"div",11)(1,"a",12),a(2,"Return to Accounts"),i(),x(3,Yt,1,0,"p-button",13),i()),t&2){let e=d();l(3),c("ngIf",e.roleService.global.export)}}function Kt(t,p){if(t&1&&(n(0,"div",11)(1,"span",17)(2,"h2",18),a(3),i()(),n(4,"span",17)(5,"h2",18),a(6),i()()()),t&2){let e=d().$implicit;l(3),_(e.name),l(3),R(" (",e.chartOfAccountCode,") ")}}function zt(t,p){t&1&&(n(0,"tr")(1,"th",19),a(2,"Outlet"),i(),n(3,"th",19),a(4,"No."),i(),n(5,"th",19),a(6,"Date"),i(),n(7,"th",19),a(8,"Name"),i(),n(9,"th",19),a(10,"Description"),i(),n(11,"th",20),a(12,"Debit"),i(),n(13,"th",21),a(14,"Credit"),i(),n(15,"th",21),a(16,"Balance"),i()())}function Ut(t,p){if(t&1&&(n(0,"td",26),a(1,"Starting Balance"),i(),n(2,"td",27),a(3),S(4,"number"),i()),t&2){let e=d(2).$implicit;l(3),R(" ",C(4,1,e.startBalance)," ")}}function $t(t,p){if(t&1&&(n(0,"tr"),x(1,Ut,5,3),i(),n(2,"tr")(3,"td",22),a(4),i(),n(5,"td",22)(6,"a",23),a(7),i()(),n(8,"td",22),a(9),S(10,"date"),i(),n(11,"td",22)(12,"a",24),a(13),i()(),I(14,"td"),n(15,"td",25),a(16),S(17,"number"),i(),n(18,"td",25),a(19),S(20,"number"),i(),n(21,"td",25),a(22),S(23,"number"),i()()),t&2){let e=p.$implicit,o=p.rowIndex,r=d(4);l(),O(o===0&&r.store.items().data.length>1?1:-1),l(3),_(e.outletName),l(2),c("routerLink",F(19,qt,e.id)),l(),_(e.number),l(2),_(it(10,10,e.date,"dd MMM yyyy")),l(3),c("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,et),l(),_(e.contactName),l(3),R(" ",C(17,13,e.debitAmount)," "),l(3),R(" ",C(20,15,e.creditAmount)," "),l(3),_(C(23,17,e.balance))}}function Jt(t,p){if(t&1&&(n(0,"tr"),I(1,"td",28),n(2,"td",29),a(3,"Total"),i(),n(4,"td",29),a(5),S(6,"number"),i(),n(7,"td",29),a(8),S(9,"number"),i(),I(10,"td"),i()),t&2){let e=d().$index,o=d(3);l(5),R(" ",C(6,2,o.store.items().data[e].debitTotal)," "),l(3),R(" ",C(9,4,o.store.items().data[e].creditTotal)," ")}}function Qt(t,p){t&1&&(n(0,"tr")(1,"td",30)(2,"span"),a(3,"No records found."),i()()())}function Xt(t,p){if(t&1&&(n(0,"p-table",16),x(1,Kt,7,2,"ng-template",null,3,s)(3,zt,17,0,"ng-template",null,4,s)(5,$t,24,21,"ng-template",null,5,s)(7,Jt,11,6,"ng-template",null,6,s)(9,Qt,4,0,"ng-template",null,7,s),i()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function Zt(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel"),Be(2,Xt,11,2,"p-table",16,ke),i()()),t&2){let e=d(2);j(E(4,jt)),l(),j(E(5,Nt)),l(),Oe(e.store.items().data)}}function ei(t,p){if(t&1&&x(0,Zt,4,6,"p-panel",15),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function ti(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ii(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ni(t,p){if(t&1&&(n(0,"div",44)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function oi(t,p){if(t&1&&(n(0,"div",41),I(1,"p-radiobutton",45),n(2,"label",46),a(3),i()()),t&2){let e=p.$implicit;l(),c("value",e.key)("inputId",e.key),l(),tt("for",e.key),l(),_(e.value)}}function ri(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function ai(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Supplier"),i(),n(3,"p-autocomplete",48),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchSupplier(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.supplierSuggestions())}}function li(t,p){if(t&1){let e=D();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),w("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function pi(t,p){if(t&1){let e=D();n(0,"form",31)(1,"div",32)(2,"label",33),a(3,"Accounts"),i(),n(4,"p-multiselect",34),w("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),x(5,ti,10,2,"ng-template",null,8,s)(7,ii,10,2,"ng-template",null,9,s),i()(),n(9,"div",32)(10,"label",33),a(11,"From"),i(),I(12,"p-datepicker",35),i(),n(13,"div",32)(14,"label",33),a(15,"To"),i(),I(16,"p-datepicker",36),i(),n(17,"div",32)(18,"label",33),a(19,"Outlets"),i(),n(20,"p-multiselect",37),x(21,ni,3,1,"ng-template",null,9,s),i()(),n(23,"div",32)(24,"label",33),a(25,"Category"),i(),n(26,"p-treeselect",38),w("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),i()(),n(27,"div",32)(28,"label",39),a(29,"Contact Type"),i(),n(30,"div",40),Be(31,oi,4,4,"div",41,ke),i()(),x(33,ri,4,1,"div",32)(34,ai,4,1,"div",32)(35,li,4,1,"div",32),i()}if(t&2){let e,o=d();c("formGroup",o.generalLedgerFilterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("maxlength",5)("options",o.store.metadata().options.accounts),l(8),c("iconDisplay","input")("showIcon",!0),l(4),c("iconDisplay","input")("showIcon",!0),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.store.metadata().options.outlets),l(6),c("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",E(18,Ht))("options",o.categoriesOptions()),l(5),Oe(o.store.metadata().options.contactTypeOptions),l(2),O((e=o.generalLedgerFilterForm.controls.contactType.value)===1?33:e===2?34:35)}}var Tt=(()=>{class t{constructor(){this.dialogFilterVisible=L(!1),this.reportService=g(B),this.coaService=g(gt),this.authService=g(we),this.store=g(Ge),this.roleService=g(me),this.categoriesOptions=L([]),this.customerSuggestions=L([]),this.supplierSuggestions=L([]),this.route=g(at),this.dayjsService=g(be),this.initDialogVisible=L(!0),this.fb=g(De),this.toastr=g(lt)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe($e(e=>e.get("id")),M(e=>{e&&(this.initDialogVisible.update(o=>!o),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(h({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange(),this.generalLedgerFilterForm.valueChanges.pipe(Je(500),M(e=>{Array.isArray(e.listAccountID)&&e.listAccountID.length>0?this.generalLedgerFilterForm.controls.listCategoryID.disable():this.generalLedgerFilterForm.controls.listCategoryID.enable(),e.listCategoryID&&e.listCategoryID.filter(o=>o.key).length>0?this.generalLedgerFilterForm.controls.listAccountID.disable():this.generalLedgerFilterForm.controls.listAccountID.enable()})).subscribe()}clearContactValueOnContactTypeChange(){this.generalLedgerFilterForm.get("contactType")?.valueChanges.subscribe(()=>this.generalLedgerFilterForm.get("contactID")?.setValue(""))}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at least 5 accounts for the general ledger report.","Warning")}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}generateFilterForm(){this.generalLedgerFilterForm=this.fb.group({listAccountID:new G([]),listCategoryID:new G([]),listOutletID:new G([]),contactID:new G(""),from:new G(""),to:new G(""),contactType:new G(1)})}onFilterOKEvent(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]);if(this.generalLedgerFilterForm.invalid){this.generalLedgerFilterForm.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.dialogFilterVisible.update(u=>!u),this.store.updateFilter(m),this.dialogFilterVisible.set(!1)}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(o=>this.customerSuggestions.set(o))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(o=>this.supplierSuggestions.set(o))).subscribe()}onExport(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]),m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.reportService.exportGeneralLedger(m).pipe(M(u=>{Ct(u,`general-ledger-${this.dayjsService.now.format("D-MM-YYYY")}.${u.type.split("/")[1]}`,u.type)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-general-ledger"]],features:[K([Ge])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["caption",""],["header",""],["body",""],["footer",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["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"],[3,"style",4,"ngIf"],["scrollHeight","calc(100vh - 150px)",3,"value","scrollable"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],["colspan","7",1,"text-end"],[1,"text-end"],["colspan","4"],[1,"text-end","fw-semibold"],["colspan","8"],[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","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","maxlength","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","id","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],["for",""],[1,"d-flex","gap-3"],[1,"d-flex","align-items-center","gap-2"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[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"]],template:function(o,r){if(o&1){let m=D();n(0,"app-main-panel",10),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.initDialogVisible,u)||(r.initDialogVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Wt,4,1,"ng-template",null,0,s)(3,ei,1,1,"ng-template",null,1,s)(5,pi,36,19,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.items().pageTitle.length?r.store.items().pageTitle:"General Ledger"),Y("isDialogFilterVisible",r.dialogFilterVisible),c("isFilterable",!0),Y("isInitDialogFilterVisible",r.initDialogVisible))},dependencies:[fe,$,z,U,ot,ge,Ce,Se,ut,ae,re,Te,xe,he,Ve,Le,ne,ee,X,Z,ct,te,ie,ve,ye,Re,oe,st,St,xt,ht,pe,le,Q,J,ft,_t],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var mi={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Ae=ce(_e(mi),se(t=>{let p={totalCOGS:T(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalRevenue:T(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalExpense:T(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),grossProfit:T(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:T(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:T(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),ue(t=>{let p=g(B),e=g(be),o={updateFilter(r){V(t,m=>y(h({},m),{filter:h(h({},m.filter),r)}))},getLoader:q(A(P(()=>p.getIncomeStatementLoader().pipe(H({next:r=>{V(t,m=>y(h({},m),{loader:r,filter:y(h({},m.filter),{from:e.from(r.filter.from).format(),to:e.from(r.filter.to).format()})})),o.getIncomeStatement(t.filter)},error:r=>{console.error(r)}}))))),getIncomeStatement:q(A(P(r=>p.getIncomeStatement(r).pipe(Xe(()=>V(t,m=>y(h({},m),{isLoading:!0}))),H({next:m=>{V(t,f=>y(h({},f),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return o}),de({onInit:t=>{t.getLoader()}}));var ci=()=>({height:"calc(100vh - 70px)"}),si=()=>({height:"calc(100vh - 150px)"}),Pe=()=>({}),je=t=>["/pages/chart-of-account/account/",t],Ne=()=>["/pages/report/general-ledger"],qe=t=>({id:t});function di(t,p){if(t&1){let e=D();n(0,"p-button",10),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function ui(t,p){if(t&1&&(n(0,"div",8),x(1,di,1,0,"p-button",9),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function _i(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function fi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.accountID)),l(),_(C(9,6,e.amount))}}function gi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",20),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total Revenue :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,1,e.store.totalRevenue()))}}function hi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No revenue records available"),i()()())}function xi(t,p){if(t&1&&(n(0,"h6",13),a(1,"Revenue"),i(),n(2,"p-table",14),x(3,_i,7,0,"ng-template",null,3,s)(5,fi,10,13,"ng-template",null,4,s)(7,gi,9,3,"ng-template",null,5,s)(9,hi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.revenue)}}function Si(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",26),a(6,"Total"),i()())}function Ci(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function yi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",27),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total COGS :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()(),n(9,"tr"),I(10,"td",27),n(11,"td",21)(12,"div",22)(13,"span",23),a(14,"Gross Profit :"),i(),n(15,"span",24),a(16),S(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,2,e.store.totalCOGS())),l(9),_(C(17,4,e.store.grossProfit()))}}function vi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No COGS records available"),i()()())}function bi(t,p){if(t&1&&(n(0,"h4",13),a(1,"COGS"),i(),n(2,"p-table",14),x(3,Si,7,0,"ng-template",null,3,s)(5,Ci,10,13,"ng-template",null,4,s)(7,yi,18,6,"ng-template",null,5,s)(9,vi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.cogs)}}function Ei(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ii(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",F(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function Fi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",27),n(2,"td",21)(3,"div",22)(4,"span",23),a(5,"Total Expense :"),i(),n(6,"span",24),a(7),S(8,"number"),i()()()(),n(9,"tr"),I(10,"td",27),n(11,"td",21)(12,"div",22)(13,"span",23),a(14,"Profit / Loss :"),i(),n(15,"span",24),a(16),S(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(C(8,2,e.store.totalExpense())),l(9),_(C(17,4,e.store.profitOrLoss()))}}function wi(t,p){t&1&&(n(0,"tr")(1,"td",25)(2,"span"),a(3,"No expense records available"),i()()())}function Di(t,p){if(t&1&&(n(0,"h4",13),a(1,"Expense"),i(),n(2,"p-table",14),x(3,Ei,7,0,"ng-template",null,3,s)(5,Ii,10,13,"ng-template",null,4,s)(7,Fi,18,6,"ng-template",null,5,s)(9,wi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.expense)}}function Ri(t,p){if(t&1&&(n(0,"p-scroll-panel")(1,"div",12),x(2,xi,11,1)(3,bi,11,1)(4,Di,11,1),i()()),t&2){let e,o,r,m=d(2);j(E(5,si)),l(2),O(m.Object.keys((e=m.store.data().data)!==null&&e!==void 0?e:E(6,Pe)).length>0?2:-1),l(),O(m.Object.keys((o=(o=m.store.data().data)==null?null:o.cogs)!==null&&o!==void 0?o:E(7,Pe)).length>0?3:-1),l(),O(m.Object.keys((r=(r=m.store.data().data)==null?null:r.expense)!==null&&r!==void 0?r:E(8,Pe)).length>0?4:-1)}}function Ti(t,p){if(t&1&&(n(0,"p-panel"),x(1,Ri,5,9,"p-scroll-panel",11),i()),t&2){let e=d();j(E(3,ci)),l(),c("ngIf",e.store.data())}}function Li(t,p){if(t&1){let e=D();n(0,"form",28)(1,"div",29)(2,"label",30),a(3,"Outlet"),i(),I(4,"p-multiselect",31),i(),n(5,"div",29)(6,"label",30),a(7,"Cashier"),i(),n(8,"p-autocomplete",32),w("completeMethod",function(r){v(e);let m=d();return b(m.onCashierSearch(r))})("onSelect",function(r){v(e);let m=d();return b(m.onCashierSelect(r))}),i()(),n(9,"div",29)(10,"label",30),a(11,"From"),i(),I(12,"p-datepicker",33),i(),n(13,"div",29)(14,"label",30),a(15,"To"),i(),I(16,"p-datepicker",34),i()()}if(t&2){let e=d();c("formGroup",e.formFilter),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),c("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0)}}var Lt=(()=>{class t{constructor(){this.dayjsService=g(be),this.store=g(Ae),this.fb=g(De),this.reportService=g(B),this.roleService=g(me),this.isInitDialogFilterVisible=L(!1),this.dialogFilterVisible=L(!1),this.cashierSuggestions=L([]),this.cashierHashMap=new Map,this.Object=Object,nt(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(h({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ie("Cashier Suggestions"),M(o=>this.cashierSuggestions.set(o))).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(),o=Object.entries(e).reduce((r,[m,f])=>(m==="from"||m==="to"?f instanceof Date&&(r[m]=this.dayjsService.from(f).format()):r[m]=f||null,r),{});this.store.updateFilter(h(h({},this.store.filter()),o)),this.dialogFilterVisible.update(r=>!r),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=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ie("Export Profit & Loss"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`profit-and-loss.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-income-statement"]],features:[K([Ae])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],[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","2 ",1,"fw-semibold","text-end",2,"width","50%"],[1,"text-end","fw-semibold"],[1,"row"],[1,"col-9"],[1,"col"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],["colspan","2",1,"fw-semibold"],[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"],["formControlName","from","styleClass","w-100","appendTo","body"],["formControlName","to","styleClass","w-100","appendTo","body"]],template:function(o,r){if(o&1){let m=D();n(0,"app-main-panel",7),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),x(1,ui,2,1,"ng-template",null,0,s)(3,Ti,2,4,"ng-template",null,1,s)(5,Li,17,8,"ng-template",null,2,s),i()}o&2&&(c("isFilterable",!0)("pageTitle",r.store.data().pageTitle),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Te,xe,he,ne,ee,X,Z,te,ie,ve,ye,ge,Ce,Se,pe,le,oe,Q,J,Ve,Le,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var He=Ue(yt());var Vi={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,He.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Ye=ce(_e(Vi),se(t=>({totalAsset:T(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:T(()=>t.data().liability.reduce((p,e)=>p+ +e.counterAmount,0)),totalEquity:T(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},fetchBalanceSheet:q(A(Fe(()=>{let o=t.filter();return Object.entries(o).every(([r,m])=>m!=null&&m!=="")}),P(o=>p.getBalanceSheet(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{data:r}))},error:r=>{console.error(r)}}))),Qe(1))),fetchLoader:q(A(P(()=>p.getBalanceSheetLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:{date:(0,He.default)(o.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:o=>{console.error(o)}})))))};return e}),de(t=>({onInit:()=>{t.fetchLoader()}})));var Vt=Ue(yt());var Mi=()=>({height:"calc(100vh - 70px)"}),ki=()=>({height:"calc(100vh - 100px)"}),We=t=>["/pages/chart-of-account/account/",t],Ke=()=>["/pages/report/general-ledger"],ze=t=>({id:t});function Bi(t,p){if(t&1){let e=D();n(0,"p-button",11),w("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Oi(t,p){if(t&1&&(n(0,"div",9),x(1,Bi,1,0,"p-button",10),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function Gi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Asset"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ai(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.amount))}}function Pi(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Asset"),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,1,e.store.totalAsset())," ")}}function ji(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),i()()())}function Ni(t,p){if(t&1&&(n(0,"h4",14),a(1,"Asset"),i(),n(2,"p-table",15),x(3,Gi,7,0,"ng-template",null,3,s)(5,Ai,10,13,"ng-template",null,4,s)(7,Pi,6,3,"ng-template",null,5,s)(9,ji,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function qi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Liability"),i(),n(5,"th",17),a(6,"Total"),i()())}function Hi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",25),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Yi(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2," Total Liability "),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,1,e.store.totalLiability())," ")}}function Wi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),i()()())}function Ki(t,p){if(t&1&&(n(0,"h4",24),a(1,"Liability"),i(),n(2,"p-table",15),x(3,qi,7,0,"ng-template",null,3,s)(5,Hi,10,13,"ng-template",null,4,s)(7,Yi,6,3,"ng-template",null,5,s)(9,Wi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function zi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Equity"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ui(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",F(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function $i(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Equity"),i(),n(3,"td",22),a(4),S(5,"number"),i()(),n(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),i(),n(9,"td",22),a(10),S(11,"number"),i()()),t&2){let e=d(3);l(4),R(" ",C(5,2,e.store.totalEquity())," "),l(6),R(" ",C(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Ji(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),i()()())}function Qi(t,p){if(t&1&&(n(0,"h4",24),a(1,"Equity"),i(),n(2,"p-table",15),x(3,zi,7,0,"ng-template",null,3,s)(5,Ui,10,13,"ng-template",null,4,s),a(7," <"),x(8,$i,12,6,"ng-template",null,5,s)(10,Ji,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function Xi(t,p){if(t&1&&(n(0,"p-panel",12)(1,"p-scroll-panel")(2,"div",13),x(3,Ni,11,1)(4,Ki,11,1)(5,Qi,12,1),i()()()),t&2){let e=d();j(E(8,Mi)),c("showHeader",!1),l(),j(E(9,ki)),l(2),O(e.Object.keys(e.store.data().asset).length>0?3:-1),l(),O(e.Object.keys(e.store.data().liability).length>0?4:-1),l(),O(e.Object.keys(e.store.data().equity).length>0?5:-1)}}function Zi(t,p){if(t&1&&(n(0,"div",31)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function en(t,p){if(t&1&&(n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),n(4,"p-multiselect",29),x(5,Zi,3,1,"ng-template",null,7,s),i()(),n(7,"div",27)(8,"label",28),a(9,"From"),i(),I(10,"p-datepicker",30),i()()),t&2){let e=d();c("formGroup",e.filterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),c("iconDisplay","input")("showIcon",!0)}}var Mt=(()=>{class t{constructor(){this.store=g(Ye),this.ReportServiceStore=g(B),this.dialogFilterVisible=L(!1),this.isInitDialogFilterVisible=L(!1),this.roleService=g(me),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new mt({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:o}=this.filterForm.value;this.store.updateFilter({date:(0,Vt.default)(e).format("YYYY-MM-DD"),listOutletParam:o}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ie("Export Balance Sheet"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`balance-sheet.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-balance-sheet"]],features:[K([Ye])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","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(o,r){if(o&1){let m=D();n(0,"app-main-panel",8),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Oi,2,1,"ng-template",null,0,s)(3,Xi,6,10,"ng-template",null,1,s)(5,en,11,7,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.data().pageTitle)("isFilterable",!0),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Ce,Se,ge,ae,re,ne,ee,X,Z,te,ie,ve,ye,xe,he,Re,oe,pe,le,Q,J],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-comparative-balance works!"),i(),a(2,`
2
2
  ,
3
3
  `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Bt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-cash-flow works!"),i(),a(2,`
4
4
  ,
@@ -1 +1 @@
1
- import{a as x,b as L}from"./chunk-VYK2CQ72.js";import"./chunk-XILGARZ5.js";import"./chunk-MFH4UZ6J.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],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&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
1
+ import{a as x,b as L}from"./chunk-EHUDHXDQ.js";import"./chunk-BGWDOZQM.js";import"./chunk-VZI3JZPU.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-P3V7Z3A6.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],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&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
@@ -1 +1 @@
1
- import{a as rt}from"./chunk-MFH4UZ6J.js";import{ba as it}from"./chunk-JP6RBSB3.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
1
+ import{a as rt}from"./chunk-VZI3JZPU.js";import{ba as it}from"./chunk-JP6RBSB3.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};