dealposbooks 5.46.0 → 5.46.2

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 (69) hide show
  1. package/3rdpartylicenses.txt +5 -23
  2. package/assets/scss/components/_tables.scss +6 -4
  3. package/chunk-45JI5H5L.js +8 -0
  4. package/{chunk-3H2MG3RX.js → chunk-4IHVNLEA.js} +1 -1
  5. package/{chunk-6ETOXPS6.js → chunk-4ODQPLDW.js} +1 -1
  6. package/chunk-5GAJOO6O.js +129 -0
  7. package/{chunk-37MHHHLT.js → chunk-5RW6MEBV.js} +1 -1
  8. package/{chunk-45SKCDTK.js → chunk-6LW7PY2Z.js} +1 -1
  9. package/{chunk-FVWAFBXC.js → chunk-6VBTHQT3.js} +1 -1
  10. package/{chunk-265PINEB.js → chunk-7DJNG6VE.js} +1 -1
  11. package/{chunk-KJLM2JDU.js → chunk-B2BDKUAE.js} +2 -2
  12. package/{chunk-6KPBN6PL.js → chunk-BJBAWNDR.js} +1 -1
  13. package/{chunk-JDN7HSFT.js → chunk-BKLUYVDG.js} +1 -1
  14. package/{chunk-BEKYAQHU.js → chunk-BVXYCUBY.js} +1 -1
  15. package/{chunk-2G2COOKC.js → chunk-C6TI7B2G.js} +1 -1
  16. package/chunk-CO2UYCZ2.js +1 -0
  17. package/{chunk-X5TFTF7J.js → chunk-DFGIXWZK.js} +1 -1
  18. package/{chunk-YXJCCERT.js → chunk-EAEMBSUD.js} +1 -1
  19. package/{chunk-H5J2ODXS.js → chunk-ETHACYOI.js} +1 -1
  20. package/{chunk-RAM3BLIZ.js → chunk-EXBBFIDN.js} +1 -1
  21. package/chunk-FMHGC2MA.js +4 -0
  22. package/{chunk-6E6DIFFQ.js → chunk-G6IPI7YM.js} +1 -1
  23. package/{chunk-NA23LDSJ.js → chunk-G7QPRYOR.js} +1 -1
  24. package/{chunk-X5UUEKFM.js → chunk-GXJ3G456.js} +1 -1
  25. package/{chunk-MXWBKCQV.js → chunk-IV5AW2OY.js} +1 -1
  26. package/{chunk-YUYV2CG7.js → chunk-IWF5R5FH.js} +1 -1
  27. package/{chunk-7QXFTI7P.js → chunk-KS2JAY2L.js} +1 -1
  28. package/{chunk-5VNZJNWI.js → chunk-MJSJBCDR.js} +1 -1
  29. package/chunk-N4RQTE4T.js +1 -0
  30. package/{chunk-VDUU7T7V.js → chunk-NHIAQTUJ.js} +1 -1
  31. package/{chunk-DJSX32J5.js → chunk-NPAM3NOH.js} +1 -1
  32. package/{chunk-LVSES747.js → chunk-NQXDAWEZ.js} +1 -1
  33. package/{chunk-3UEIZQIL.js → chunk-OR5FLZPY.js} +1 -1
  34. package/{chunk-J4KTOC3S.js → chunk-PEOJDDJN.js} +1 -1
  35. package/{chunk-V4A5GTYQ.js → chunk-PFWNBHNC.js} +1 -1
  36. package/{chunk-HOHCN6MI.js → chunk-PNWKCLWA.js} +1 -1
  37. package/{chunk-NUAND7BZ.js → chunk-Q34IDOYA.js} +1 -1
  38. package/{chunk-KRHMP57P.js → chunk-QUUGFWG3.js} +1 -1
  39. package/chunk-RZHWMBFY.js +1 -0
  40. package/chunk-S7AFTSCW.js +1 -0
  41. package/{chunk-KXRN2WUT.js → chunk-T6OMUVQY.js} +1 -1
  42. package/{chunk-NCP5HSZO.js → chunk-UCDJJGO5.js} +1 -1
  43. package/{chunk-UOJZMQ6X.js → chunk-UH5YUPBR.js} +1 -1
  44. package/chunk-VKKAJODP.js +1 -0
  45. package/chunk-WFQQUFSS.js +1 -0
  46. package/{chunk-GVZFU3IL.js → chunk-WKE2HPSD.js} +1 -1
  47. package/{chunk-G3GX7TJT.js → chunk-WY2JNDES.js} +1 -1
  48. package/{chunk-6XOFO2US.js → chunk-X46QKMJY.js} +1 -1
  49. package/{chunk-CJMQPCRF.js → chunk-XFOCD2H7.js} +1 -1
  50. package/{chunk-H7WUM7IF.js → chunk-XFVMOYX7.js} +1 -1
  51. package/chunk-XXNDXSPP.js +1 -0
  52. package/{chunk-UOSXT5W7.js → chunk-Y3URGAXL.js} +1 -1
  53. package/{chunk-S2HTMYMU.js → chunk-YTZ3JIC5.js} +1 -1
  54. package/{chunk-ECB5EIQL.js → chunk-YZH7Y43Y.js} +1 -1
  55. package/{chunk-TN245HA6.js → chunk-ZWR2YCUC.js} +1 -1
  56. package/index.html +2 -2
  57. package/{main-6YJJH4E2.js → main-ON5LJQLR.js} +1 -1
  58. package/package.json +1 -1
  59. package/{styles-D4BND7FA.css → styles-4HAX3IDP.css} +1 -1
  60. package/chunk-3WWUSVNY.js +0 -1
  61. package/chunk-76ISI6NH.js +0 -8
  62. package/chunk-BXCTHZLV.js +0 -129
  63. package/chunk-FQIBBQO2.js +0 -1
  64. package/chunk-H5BCW5OG.js +0 -1
  65. package/chunk-JRVYSBUZ.js +0 -5
  66. package/chunk-NWVLHJBT.js +0 -1
  67. package/chunk-R4SNCEXI.js +0 -1
  68. package/chunk-ST5JWMO4.js +0 -1
  69. package/chunk-WLS2E4JE.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as _t}from"./chunk-KIBBRAL5.js";import{a as Gi}from"./chunk-XKI7WLHE.js";import{a as Di}from"./chunk-HG5MKVNR.js";import{a as $i,b as Ee,c as Pe,d as Ki}from"./chunk-B54PFCWI.js";import{a as Ri,b as Bi}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as ut,b as ft}from"./chunk-KGQGMXW6.js";import{a as qi,b as zi}from"./chunk-EB6NEJHF.js";import{a as we}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as lt,b as st}from"./chunk-3A4BFUGD.js";import{a as pt,b as dt,c as Oi,d as Fi,i as Li,j as Ni,k as Vi}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as X}from"./chunk-JDN7HSFT.js";import{a as V}from"./chunk-QF4D5YPK.js";import{b as Si}from"./chunk-VJ3IBUVO.js";import{a as bi}from"./chunk-2AAVNIG7.js";import{a as ct,b as mt}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as at,b as K}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{f as Mi,h as $}from"./chunk-GVZFU3IL.js";import{b as rt,c as _e}from"./chunk-VGNJD35F.js";import{a as se,b as ce}from"./chunk-2XUSZCQL.js";import{a as J,b as Ai,c as wi,e as Ei,f as Pi,g as ki}from"./chunk-YV2QJ63P.js";import{c as et,d as li,f as si}from"./chunk-ARH3WEEF.js";import{a as wt,f as Et,n as nt,o as ot,p as vi,t as Ti,u as Pt,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{Aa as hi,D as bt,Da as xi,I as ci,Ia as Ci,K as mi,La as Ae,M as pi,Ma as De,Oa as yi,Q as tt,R as it,Ua as Ii,W as di,X as vt,_ as ui,b as oe,c as fe,da as fi,e as Y,f as ye,g as ri,ga as _i,i as N,j as Je,k as ai,ka as gi,l as Ie,na as St,o as be,qa as re,u as ve,va as Tt,w as Se,wa as At,x as Te}from"./chunk-OIBDX2CA.js";import{b as ie,d as ne,e as B,l as L}from"./chunk-AOOG6YOT.js";import{a as oi}from"./chunk-3UEIZQIL.js";import"./chunk-2MKKFLNJ.js";import{h as z,j as Ye,k as O,l as Ct,m as ii,p as ni,q as Xe,s as F,t as Le}from"./chunk-VZ5CMS5O.js";import{c as yt,d as It,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{$b as w,$c as Ce,Aa as ee,Bb as Oe,Cc as he,D as Ke,Db as u,Dc as R,Ec as T,Fc as ei,Ha as v,J as qe,Kb as P,L as qt,Lb as l,Nc as de,Ob as He,Oc as xe,P as zt,Pb as Fe,Pc as ti,Qb as Qt,Rb as Wt,Rc as I,Tb as Yt,Ub as Xt,Vb as a,Wb as r,Xb as h,Y as D,Yb as H,Zb as U,_ as A,_c as ue,ba as Gt,bd as W,c as $e,ca as ze,cb as Me,cd as We,da as Ht,db as jt,ec as S,fc as m,hb as c,ia as x,kc as Ue,lc as pe,mc as j,nb as xt,nc as Z,qa as _,qc as te,ra as g,rc as p,s as G,sc as E,t as Kt,tc as Q,ua as Ge,vc as Jt,wa as Ut,wc as je,xb as M,xc as Ze,yb as Zt,yc as Qe}from"./chunk-NMCKMUY4.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var on=["class","page"],rn=t=>({id:t}),an=()=>({"overflow-x":"auto"}),ln=t=>({"table-borderless":t}),sn=t=>["fa-solid",t],cn=t=>["/pages/journal/journal-entry/",t];function mn(t,s){t&1&&h(0,"p-button",8)}function pn(t,s){if(t&1){let e=w();a(0,"p-button",9),S("onClick",function(){_(e);let n=m(2);return g(n.onDelete())}),r()}}function dn(t,s){if(t&1&&(a(0,"div",4)(1,"p-button-group"),u(2,mn,1,0,"p-button",5)(3,pn,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,i=m();c(2),l("ngIf",i.roleService.coa().edit),c(),l("ngIf",i.roleService.coa().delete),c(),l("queryParams",T(3,rn,(e=i.COAInfo())==null?null:e.id))}}function un(t,s){if(t&1&&h(0,"i",25),t&2){let e=s.checked;l("ngClass",T(1,sn,e?"fa-check":"fa-xmark"))}}function fn(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.creditAmount)," ")}}function _n(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.debitAmount)," ")}}function gn(t,s){if(t&1&&(a(0,"tr")(1,"td"),p(2),de(3,"date"),r(),a(4,"td")(5,"div",26)(6,"a",27),p(7),r()()(),a(8,"td",28),u(9,fn,3,3,"ng-container",29),r(),a(10,"td",30),u(11,_n,3,3,"ng-container",29),r(),a(12,"td",31),p(13),de(14,"number"),r()()),t&2){let e=s.$implicit;c(2),E(ti(3,6,e.date,"dd MMM yyyy")),c(4),l("routerLink",T(11,cn,e.id)),c(),E(e.number),c(2),l("ngIf",e.creditAmount!==0),c(2),l("ngIf",e.debitAmount!==0),c(2),Q(" ",xe(14,9,e.balance)," ")}}function hn(t,s){t&1&&(a(0,"tr")(1,"td",32)(2,"div",33),h(3,"img",34),a(4,"div",26)(5,"span",35),p(6,"No Data Available"),r(),a(7,"span",35),p(8,"Your data will be shown here once it's available"),r()()()()())}function xn(t,s){if(t&1){let e=w();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Outlet"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),S("onChange",function(n){_(e);let o=m(2);return g(o.onDiscontinued(n))}),u(34,un,1,3,"ng-template",null,2,I),r()()(),a(36,"div",16)(37,"div",17),p(38,"Access Type"),r(),a(39,"div",18),p(40),r()()()()(),a(41,"div",20)(42,"p-card",21)(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),p(47,"Date"),r(),a(48,"th",23),p(49,"Number"),r(),a(50,"th",24),p(51,"Credit"),r(),a(52,"th",24),p(53,"Debit"),r(),a(54,"th",24),p(55,"Balance"),r()()(),a(56,"tbody"),Yt(57,gn,15,13,"tr",null,Wt),u(59,hn,9,0,"tr"),r()()()()()}if(t&2){let e,i,n,o,d,f,b=m(2);c(8),E((e=b.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),E((i=b.COAInfo().code)!==null&&i!==void 0?i:"-"),c(5),E((n=b.COAInfo().category)!==null&&n!==void 0?n:"-"),c(5),E((o=b.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),E((d=b.COAInfo().outletName)!==null&&d!==void 0?d:"-"),c(5),l("ngModel",b.COAInfo().bin),c(7),E((f=b.COAInfo().accessType)!==null&&f!==void 0?f:"-"),c(2),He(R(11,an)),c(),l("ngClass",T(12,ln,b.COAInfo().transactions.length===0)),c(14),Xt(b.COAInfo().transactions),c(2),Qt(b.COAInfo().transactions.length===0?59:-1)}}function Cn(t,s){if(t&1&&(a(0,"div",10),u(1,xn,60,14,"div",11),r()),t&2){let e=m();c(),l("ngIf",e.COAInfo())}}var Hi=(()=>{class t{constructor(){this.#e=x(X),this.#t=x(ie),this.router=x(ne),this.COAInfo=v(null),this.checked=v(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(V("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),A(e=>this.COAInfo.set(e)),V("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let i=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(i).pipe(A(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:on,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-5"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-4"],[1,"col"],[3,"onChange","ngModel"],[1,"col","col-lg-7"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],["scope","col",1,"text-end"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-danger","text-end"],[4,"ngIf"],[1,"text-success","text-end"],[1,"text-end"],["colspan","5",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(i,n){i&1&&(a(0,"app-main-panel",3),u(1,dn,6,5,"ng-template",null,0,I)(3,Cn,2,1,"ng-template",null,1,I),r()),i&2&&l("overflowScroll",!0)},dependencies:[F,z,O,Xe,ni,Se,Y,Je,et,L,B,$,K,at,le,ae,ft,ut,Oi,Di],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var me=(()=>{class t{constructor(){this.httpService=x(oi)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let i={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",i)}renameCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,i)}updateParentCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,i).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,i={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Mt=t=>t?t.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...Mt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var Ot=(t,s,e)=>{let i=Math.ceil(e/s),n=(t-1)*s+1,o=Math.min(t*s,e);return{start:n,end:o,totalRecords:e,totalPages:i}};var yn={filter:{PageSize:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2,AccessLevel:-1},options:{entities:[],categories:[],accessLevels:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},Ft=Ai(Pi(yn),ki("ChartOfAccount"),wi(t=>({isAllChecked:W(()=>t.data().every(s=>s.checked)),checkedItems:W(()=>t.data().filter(s=>s.checked)),IDsChecked:W(()=>t.data().filter(s=>s.checked).map(s=>s.id)),categories:W(()=>Mt(t.options.categories())),first:W(()=>{let{start:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s}),last:W(()=>{let{end:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s})})),Ei(t=>{let s=x(X),e=x(me),i={updateFilter(n){J(t,{filter:C({},n)})},checkedItem(n){if(Array.isArray(n))n.forEach(o=>{let d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})});else{let o=n,d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})}},checkAllCheckbox(){let n=t.data().map(o=>y(C({},o),{checked:!o.checked}));J(t,{data:n})},fetchChartOfAccount:lt($e(Ke(()=>!!t.filter()),qt(300),zt(),D(n=>s.getPaginatedChartAccounts(n).pipe(G(o=>y(C({},o),{data:o.data.map(d=>y(C({},d),{checked:!1}))})),st({next:o=>J(t,{data:o.data,count:o.count}),error:o=>{J(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:lt($e(D(()=>s.getChartOfAccountLoader().pipe(st({next:n=>{J(t,{filter:y(C({},t.filter()),{PageSize:n.filter.pageSize,PageNumber:1,CategoryID:n.filter.categoryID||null,Text:"",listOutletID:[],AccessLevel:n.filter.accessLevel!==void 0?n.filter.accessLevel:t.filter().AccessLevel}),options:n.options}),i.fetchChartOfAccount(t.filter)},error:n=>{console.error(n)}}))))),getCategories:lt($e(qe(()=>e.fetchCOACategories().pipe(st({next:n=>{J(t,{options:y(C({},t.options()),{entities:t.options.entities(),categories:n})})},error:n=>{console.error(n)}})))))};return i}));var Sn=["class","page"],Tn=t=>["../account/",t],An=t=>({"text-decoration-line-through":t}),wn=()=>["/pages/report/general-ledger"],En=t=>({id:t});function Pn(t,s){if(t&1){let e=w();a(0,"p-button",13),S("onClick",function(){_(e);let n=m(2);return g(n.deleteCOA())}),r()}}function kn(t,s){t&1&&h(0,"p-button",14)}function Mn(t,s){if(t&1){let e=w();a(0,"p-button",15),S("onClick",function(){_(e);let n=m(2);return g(n.onExport())}),r()}}function On(t,s){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Fn(t,s){if(t&1&&(a(0,"div",8),u(1,Pn,1,0,"p-button",9),a(2,"p-button-group"),u(3,kn,1,0,"p-button",10)(4,Mn,1,0,"p-button",11),r(),u(5,On,3,0,"a",12),r()),t&2){let e=m();c(),l("ngIf",e.store.checkedItems().length&&e.roleService.coa().delete),c(2),l("ngIf",e.roleService.coa().create),c(),l("ngIf",e.roleService.global().export),c(),l("ngIf",e.roleService.coa().create)}}function Ln(t,s){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Nn(t,s){if(t&1&&(a(0,"tr"),u(1,Ln,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),l("ngIf",e.roleService.coa().delete)}}function Vn(t,s){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),l("value",e)}}function Dn(t,s){if(t&1&&(a(0,"tr"),u(1,Vn,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),de(14,"number"),r()()()),t&2){let e,i=s.$implicit,n=m(2);c(),l("ngIf",n.roleService.coa().delete),c(2),E(i.code),c(2),l("routerLink",T(12,Tn,i.id))("ngClass",T(14,An,i.bin)),c(),E(i.name),c(2),E(i.category),c(2),E(i.outletName),c(2),l("routerLink",R(16,wn))("queryParams",T(17,En,i.id)),c(),E(xe(14,10,(e=i.balance)!==null&&e!==void 0?e:0))}}function Rn(t,s){if(t&1&&p(0),t&2){let e=m(2);Jt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Bn(t,s){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function $n(t,s){if(t&1){let e=w();a(0,"p-panel")(1,"p-table",18),S("onLazyLoad",function(n){_(e);let o=m();return g(o.loadData(n))})("onRowSelect",function(n){_(e);let o=m();return g(o.onRowSelect(n))})("onRowUnselect",function(n){_(e);let o=m();return g(o.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){_(e);let o=m();return g(o.onSelectAll(n))})("onPage",function(n){_(e);let o=m();return g(o.onPageChange(n))}),u(2,Nn,12,1,"ng-template",null,3,I)(4,Dn,15,19,"ng-template",null,4,I)(6,Rn,1,3,"ng-template",null,5,I)(8,Bn,4,0,"ng-template",null,6,I),r()()}if(t&2){let e=m();c(),l("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.count())}}function Kn(t,s){if(t&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),S("onFocus",function(){_(e);let n=m(2);return g(n.onCategoryFocus())}),r()(),a(9,"div",29)(10,"label",30),p(11,"Access Level"),r(),h(12,"p-select",33),r(),a(13,"div",34)(14,"label",30),p(15,"Page Size"),r(),h(16,"input",35),r(),a(17,"div",34)(18,"label",30),p(19,"Discontinued"),r(),a(20,"div",36)(21,"div",37),h(22,"p-radiobutton",38),a(23,"label",39),p(24,"No"),r()(),a(25,"div",37),h(26,"p-radiobutton",40),a(27,"label",41),p(28,"Yes"),r()(),a(29,"div",37),h(30,"p-radiobutton",40),a(31,"label",41),p(32,"All"),r()()()()()}if(t&2){let e=m(2);l("formGroup",e.formFilter),c(4),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),l("fluid",!0)("showClear",!0)("options",e.categoryNodes()),c(4),l("showClear",!0)("options",e.store.options().accessLevels),c(10),l("value",0),c(4),l("value",1),c(4),l("value",2)}}function qn(t,s){if(t&1&&u(0,Kn,33,13,"form",27),t&2){let e=m();l("ngIf",e.formFilter)}}var ji=(()=>{class t{ngOnInit(){this.initializeFilterEffect(),this.store.fetchLoader()}#e;constructor(){this.routeInfo=Zi,this.store=x(Ft),this.#e=x(X),this.modalService=x(li),this.roleService=x(we),this.dialogVisible=v(!1),this.categoryNodes=v([]),this.fb=x(ve),this.injector=x(Ut),this.isDialogFilterVisible=v(!1)}initializeFilterEffect(){We(()=>{this.store.filter()&&this.generateFilterForm()},{injector:this.injector})}generateFilterForm(){let e=this.store.filter();this.formFilter=this.fb.group({outletID:this.fb.control(e.listOutletID||[]),categoryID:this.fb.control(null),pageSize:this.fb.control(e.PageSize),discontinued:this.fb.control(e.Discontinued),accessLevel:this.fb.control(e.AccessLevel)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(A(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,i){this.store.updateFilter(y(C({},this.store.filter()),{[e]:i}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(V("response"),A(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:1,Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:i,outletID:n,discontinued:o,accessLevel:d}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:n,CategoryID:e?e.key:"",PageSize:+i,Discontinued:o,AccessLevel:d})),this.isDialogFilterVisible.update(f=>!f)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportPageSize:1e4});this.#e.exportChartOfAccounts(e).pipe(A(i=>{let n=i.headers;console.log("All headers:",n.keys());let o=n.get("Content-Disposition"),d=n.get("content-disposition"),f=o??d,b="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(b=decodeURIComponent(q[1].replace(/"/g,"")))}let k=i.body;Ki(k,b,k.type)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[he([Ft])],attrs:Sn,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["scrollHeight","300px","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",3,"onFocus","fluid","showClear","options"],["appendTo","body","formControlName","accessLevel","optionLabel","value","optionValue","key","placeholder","Select an Access Level",3,"showClear","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(i,n){if(i&1){let o=w();a(0,"app-main-panel",7),S("search",function(f){return _(o),g(n.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(n.isDialogFilterVisible,f)||(n.isDialogFilterVisible=f),g(f)}),S("filterEmitted",function(){return _(o),g(n.onFilterEvent())})("filterConfirmed",function(){return _(o),g(n.onFilterOKEvent())}),u(1,Fn,6,4,"ng-template",null,0,I)(3,$n,10,5,"ng-template",null,1,I)(5,qn,1,1,"ng-template",null,2,I),r()}i&2&&(l("isSearchableInput",!0),je("isDialogFilterVisible",n.isDialogFilterVisible),l("isFilterable",!0)("scrollable",!0))},dependencies:[F,z,O,Xe,$,si,ft,ut,_t,Se,ai,oe,Y,ye,L,B,Te,Ie,be,et,Vi,Fi,Li,Ni,K,Mi,le,ae,mt,ct,ot,nt,_e,Bi,Ri,Pe,Ee,ce,se,dt,pt],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Gn=["class","page"],Hn=()=>["../../"],Nt=t=>({"ng-invalid ng-dirty":t}),Un=t=>({"ng-dirty ng-invalid":t});function jn(t,s){if(t&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}t&2&&(c(),l("routerLink",R(1,Hn)))}function Zn(t,s){t&1&&(a(0,"div",34),p(1," Name is required "),r())}function Qn(t,s){if(t&1&&(a(0,"div"),u(1,Zn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Name.errors.required)}}function Wn(t,s){t&1&&(a(0,"div",35)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Yn(t,s){if(t&1&&(a(0,"span",36),p(1),r()),t&2){let e=s.$implicit;l("pTooltip",e.name),c(),Q(" ",e.name," ")}}function Xn(t,s){t&1&&(a(0,"div",34),p(1," Code is required "),r())}function Jn(t,s){if(t&1&&(a(0,"div"),u(1,Xn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Code.errors.required)}}function eo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function to(t,s){if(t&1&&(a(0,"div"),u(1,eo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function io(t,s){if(t&1&&p(0),t&2){let e=s.$implicit;Q(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function no(t,s){t&1&&(a(0,"div",34),p(1," Category is required "),r())}function oo(t,s){if(t&1&&(a(0,"div"),u(1,no,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Category.errors.required)}}function ro(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function ao(t,s){if(t&1&&(a(0,"div"),u(1,ro,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function lo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function so(t,s){if(t&1&&(a(0,"div"),u(1,lo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function co(t,s){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"label",13),p(6,"Name"),r(),h(7,"input",14),u(8,Qn,2,1,"div",15),r()(),a(9,"div",11)(10,"div",16)(11,"label",13),p(12,"Outlet"),r(),a(13,"span",17),h(14,"i",18),r(),u(15,Wn,3,0,"ng-template",null,2,I),r(),a(17,"p-select",19),u(18,Yn,2,2,"ng-template",null,3,I),r()()(),a(20,"div",10)(21,"div",11)(22,"div",12)(23,"label",13),p(24,"Code"),r(),h(25,"input",20),u(26,Jn,2,1,"div",15),r()(),a(27,"div",11)(28,"div",12)(29,"label",13),p(30,"Discontinued"),r(),a(31,"div",10)(32,"div",21),h(33,"p-radiobutton",22),a(34,"label",23),p(35,"No"),r()(),a(36,"div",24),h(37,"p-radiobutton",25),a(38,"label",26),p(39,"Yes"),r()()(),u(40,to,2,1,"div",15),r()()(),a(41,"div",10)(42,"div",11)(43,"div",27)(44,"label",13),p(45,"Category"),r(),a(46,"p-treeselect",28),u(47,io,1,1,"ng-template",29),r(),u(48,oo,2,1,"div",15),r()(),a(49,"div",11)(50,"div",12)(51,"label",13),p(52,"Access Type"),r(),a(53,"div",10)(54,"div",30),h(55,"p-select",31),r()(),u(56,ao,2,1,"div",15),r()()(),a(57,"div",10)(58,"div",11)(59,"div",12)(60,"label",13),p(61,"Note"),r(),h(62,"textarea",32),u(63,so,2,1,"div",15),r()(),h(64,"div",11),r()()()),t&2){let e=te(16),i=m();l("formGroup",i.form),c(7),l("ngClass",T(21,Nt,i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched))),c(),l("ngIf",i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched)),c(5),l("pTooltip",e),c(4),l("fluid",!0)("options",i.outlets()),c(8),l("ngClass",T(23,Nt,i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched))),c(),l("ngIf",i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched)),c(7),l("value",!1),c(4),l("value",!0),c(3),l("ngIf",i.form.controls.Note.errors),c(6),l("fluid",!0)("options",i.categoryOptions())("ngClass",T(25,Un,i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched))),c(2),l("ngIf",i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched)),c(7),l("options",i.accessTypes())("fluid",!0),c(),l("ngIf",i.form.controls.Note.errors),c(6),l("ngClass",T(27,Nt,i.form.controls.Note.invalid&&(i.form.controls.Note.dirty||i.form.controls.Note.touched)))("autoResize",!0),c(),l("ngIf",i.form.controls.Note.errors)}}var Vt=(()=>{class t{constructor(){this.route=x(ie),this.coa_service=x(X),this.coa_info=v(null),this.fb=x(ve),this.isEdit=v(!1),this.categoryOptions=v([]),this.router=x(ne),this.outlets=W(()=>this.coa_info()?this.coa_info().options.entities:[]),this.accessTypes=W(()=>{let e=["This Chart of Account can be viewed by all users.","Restricted access, only visible to users with the private role"];return this.coa_info()?this.coa_info().options.coaAccessType.map((i,n)=>y(C({},i),{description:e[n]})):[]})}findParenChilds(e,i){function n(o,d=null){for(let f of o){if(f.key===i)return{parent:d,child:f};if(f.children){let b=n(f.children,f);if(b)return b}}return null}return n(e)}generateForm(e){this.form=this.fb.group({ID:new N(e.id||""),Name:new N(e.name||"",[fe.required]),Code:new N(e.code||"",[fe.required]),Note:new N(e.note||"",[]),Balance:new N(e.balance||0),Outlet:new N(e.outletID||""),AccessType:new N(e.accessTypeID||0),Category:new N(null,[fe.required]),Bin:new N(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let i=e.get("id");return this.coa_service.getChartAccountFormById(i)}else return this.coa_service.getChartAccountForm()}),V("response"),G(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),A(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:i,Category:n,Code:o,Name:d,Note:f,Outlet:b}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:n.key,name:d,bin:this.form.value.Bin||!1,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:n.key,bin:this.form.value.Bin||!1,name:d,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(V("response"),A(e=>{this.categoryOptions.set(e);let i=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(i?.child)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:Gn,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2",3,"formGroup"],[1,"d-flex","flex-column","gap-2"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],[1,"d-flex","align-items-baseline","gap-2"],[3,"pTooltip"],[1,"fa-solid","fa-circle-info"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"fluid","options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"col-3","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[1,"col","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"fluid","options","ngClass"],["pTemplate","value"],[1,"col"],["optionLabel","value","optionValue","key","formControlName","AccessType","placeholder","Select Access Type",3,"options","fluid"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass","autoResize"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"]],template:function(i,n){i&1&&(a(0,"app-main-panel",4),u(1,jn,4,2,"ng-template",null,0,I)(3,co,65,29,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,Te,oe,Y,ye,Ie,be,_t,F,z,O,L,B,Pe,Ee,Ae,K,ot,nt,zi,qi,mt,ct,_e,rt,le,ae,ce,se,dt,pt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var mo=["sublist"],po=(t,s)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":s}),uo=()=>({"p-contextmenu-item-link":!0}),Yi=()=>({class:"p-contextmenu-submenu-icon"}),fo=()=>({exact:!1}),_o=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),go=t=>({$implicit:t});function ho(t,s){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,i=m(2);He(i.getItemProp(e,"style")),l("ngClass",i.getSeparatorItemClass(e)),P("id",i.getItemId(e))("data-pc-section","separator")}}function xo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Co(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function yo(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function Io(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function bo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function vo(t,s){}function So(t,s){t&1&&u(0,vo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function To(t,s){if(t&1&&(H(0),u(1,bo,1,4,"AngleRightIcon",23)(2,So,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function Ao(t,s){if(t&1&&(a(0,"a",15),u(1,xo,1,5,"span",16)(2,Co,2,2,"span",17)(3,yo,1,2,"ng-template",null,2,I)(5,Io,1,2,"p-badge",18)(6,To,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("target",n.getItemProp(i,"target"))("ngClass",R(12,uo)),P("href",n.getItemProp(i,"url"),jt)("aria-hidden",!0)("data-automationid",n.getItemProp(i,"automationId"))("data-pc-section","action")("tabindex",-1),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function wo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Eo(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function Po(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function ko(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function Mo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Oo(t,s){}function Fo(t,s){t&1&&u(0,Oo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function Lo(t,s){if(t&1&&(H(0),u(1,Mo,1,4,"AngleRightIcon",23)(2,Fo,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function No(t,s){if(t&1&&(a(0,"a",26),u(1,wo,1,5,"span",16)(2,Eo,2,2,"span",17)(3,Po,1,2,"ng-template",null,2,I)(5,ko,1,2,"p-badge",18)(6,Lo,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("routerLink",n.getItemProp(i,"routerLink"))("queryParams",n.getItemProp(i,"queryParams"))("routerLinkActiveOptions",n.getItemProp(i,"routerLinkActiveOptions")||R(20,fo))("target",n.getItemProp(i,"target"))("ngClass",T(21,_o,n.getItemProp(i,"disabled")))("fragment",n.getItemProp(i,"fragment"))("queryParamsHandling",n.getItemProp(i,"queryParamsHandling"))("preserveFragment",n.getItemProp(i,"preserveFragment"))("skipLocationChange",n.getItemProp(i,"skipLocationChange"))("replaceUrl",n.getItemProp(i,"replaceUrl"))("state",n.getItemProp(i,"state")),P("data-automationid",n.getItemProp(i,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function Vo(t,s){if(t&1&&(H(0),u(1,Ao,7,13,"a",13)(2,No,7,23,"a",14),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngIf",!i.getItemProp(e,"routerLink")),c(),l("ngIf",i.getItemProp(e,"routerLink"))}}function Do(t,s){}function Ro(t,s){t&1&&u(0,Do,0,0,"ng-template")}function Bo(t,s){if(t&1&&(H(0),u(1,Ro,1,0,null,24),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",T(2,go,e.item))}}function $o(t,s){if(t&1){let e=w();a(0,"p-contextmenu-sub",27),S("itemClick",function(n){_(e);let o=m(4);return g(o.itemClick.emit(n))})("itemMouseEnter",function(n){_(e);let o=m(4);return g(o.onItemMouseEnter(n))}),r()}if(t&2){let e=m(2).$implicit,i=m(2);l("items",e.items)("itemTemplate",i.itemTemplate)("menuId",i.menuId)("visible",i.isItemActive(e)&&i.isItemGroup(e))("activeItemPath",i.activeItemPath)("focusedItemId",i.focusedItemId)("level",i.level+1)}}function Ko(t,s){if(t&1){let e=w();a(0,"li",9,1)(2,"div",10),S("click",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemClick(n,o))})("mouseenter",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemMouseEnter({$event:n,processedItem:o}))}),u(3,Vo,3,2,"ng-container",11)(4,Bo,2,4,"ng-container",11),r(),u(5,$o,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),i=e.$implicit,n=e.index,o=m(2);Fe(o.getItemProp(i,"styleClass")),l("ngStyle",o.getItemProp(i,"style"))("ngClass",o.getItemClass(i))("tooltipOptions",o.getItemProp(i,"tooltipOptions")),P("id",o.getItemId(i))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(i))("data-p-focused",o.isItemFocused(i))("data-p-disabled",o.isItemDisabled(i))("aria-label",o.getItemLabel(i))("aria-disabled",o.isItemDisabled(i)||void 0)("aria-haspopup",o.isItemGroup(i)&&!o.getItemProp(i,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(i)?o.isItemActive(i):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(n)),c(2),P("data-pc-section","content"),c(),l("ngIf",!o.itemTemplate),c(),l("ngIf",o.itemTemplate),c(),l("ngIf",o.isItemVisible(i)&&o.isItemGroup(i))}}function qo(t,s){if(t&1&&u(0,ho,1,5,"li",6)(1,Ko,6,21,"li",7),t&2){let e=s.$implicit,i=m(2);l("ngIf",i.isItemVisible(e)&&i.getItemProp(e,"separator")),c(),l("ngIf",i.isItemVisible(e)&&!i.getItemProp(e,"separator"))}}function zo(t,s){if(t&1){let e=w();a(0,"ul",4,0),S("@overlayAnimation.start",function(n){_(e);let o=te(1),d=m();return g(d.onEnter(n,o))})("keydown",function(n){_(e);let o=m();return g(o.menuKeydown.emit(n))})("focus",function(n){_(e);let o=m();return g(o.menuFocus.emit(n))})("blur",function(n){_(e);let o=m();return g(o.menuBlur.emit(n))}),u(2,qo,2,2,"ng-template",5),r()}if(t&2){let e=m();l("ngClass",ei(10,po,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),l("ngForOf",e.items)}}var Go=["item"],Ho=["submenuicon"],Uo=["rootmenu"],jo=["container"],Zo=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),Qo=()=>({value:"visible"});function Wo(t,s){if(t&1){let e=w();a(0,"div",3,0),S("@overlayAnimation.start",function(n){_(e);let o=m();return g(o.onOverlayAnimationStart(n))})("@overlayAnimation.done",function(n){_(e);let o=m();return g(o.onOverlayAnimationEnd(n))}),a(2,"p-contextmenu-sub",4,1),S("itemClick",function(n){_(e);let o=m();return g(o.onItemClick(n))})("menuFocus",function(n){_(e);let o=m();return g(o.onMenuFocus(n))})("menuBlur",function(n){_(e);let o=m();return g(o.onMenuBlur(n))})("menuKeydown",function(n){_(e);let o=m();return g(o.onKeyDown(n))})("itemMouseEnter",function(n){_(e);let o=m();return g(o.onItemMouseEnter(n))}),r()()}if(t&2){let e=m();Fe(e.styleClass),l("ngClass",T(20,Zo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",R(22,Qo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),l("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Yo=({dt:t})=>`
1
+ import{a as _t}from"./chunk-KIBBRAL5.js";import{a as Gi}from"./chunk-XKI7WLHE.js";import{a as Di}from"./chunk-HG5MKVNR.js";import{a as $i,b as Ee,c as Pe,d as Ki}from"./chunk-B54PFCWI.js";import{a as Ri,b as Bi}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as ut,b as ft}from"./chunk-KGQGMXW6.js";import{a as qi,b as zi}from"./chunk-EB6NEJHF.js";import{a as we}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as lt,b as st}from"./chunk-3A4BFUGD.js";import{a as pt,b as dt,c as Oi,d as Fi,i as Li,j as Ni,k as Vi}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as X}from"./chunk-BKLUYVDG.js";import{a as V}from"./chunk-QF4D5YPK.js";import{b as Si}from"./chunk-VJ3IBUVO.js";import{a as bi}from"./chunk-2AAVNIG7.js";import{a as ct,b as mt}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as at,b as K}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{f as Mi,h as $}from"./chunk-WKE2HPSD.js";import{b as rt,c as _e}from"./chunk-VGNJD35F.js";import{a as se,b as ce}from"./chunk-2XUSZCQL.js";import{a as J,b as Ai,c as wi,e as Ei,f as Pi,g as ki}from"./chunk-YV2QJ63P.js";import{c as et,d as li,f as si}from"./chunk-ARH3WEEF.js";import{a as wt,f as Et,n as nt,o as ot,p as vi,t as Ti,u as Pt,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{Aa as hi,D as bt,Da as xi,I as ci,Ia as Ci,K as mi,La as Ae,M as pi,Ma as De,Oa as yi,Q as tt,R as it,Ua as Ii,W as di,X as vt,_ as ui,b as oe,c as fe,da as fi,e as Y,f as ye,g as ri,ga as _i,i as N,j as Je,k as ai,ka as gi,l as Ie,na as St,o as be,qa as re,u as ve,va as Tt,w as Se,wa as At,x as Te}from"./chunk-OIBDX2CA.js";import{b as ie,d as ne,e as B,l as L}from"./chunk-AOOG6YOT.js";import{a as oi}from"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{h as z,j as Ye,k as O,l as Ct,m as ii,p as ni,q as Xe,s as F,t as Le}from"./chunk-VZ5CMS5O.js";import{c as yt,d as It,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{$b as w,$c as Ce,Aa as ee,Bb as Oe,Cc as he,D as Ke,Db as u,Dc as R,Ec as T,Fc as ei,Ha as v,J as qe,Kb as P,L as qt,Lb as l,Nc as de,Ob as He,Oc as xe,P as zt,Pb as Fe,Pc as ti,Qb as Qt,Rb as Wt,Rc as I,Tb as Yt,Ub as Xt,Vb as a,Wb as r,Xb as h,Y as D,Yb as H,Zb as U,_ as A,_c as ue,ba as Gt,bd as W,c as $e,ca as ze,cb as Me,cd as We,da as Ht,db as jt,ec as S,fc as m,hb as c,ia as x,kc as Ue,lc as pe,mc as j,nb as xt,nc as Z,qa as _,qc as te,ra as g,rc as p,s as G,sc as E,t as Kt,tc as Q,ua as Ge,vc as Jt,wa as Ut,wc as je,xb as M,xc as Ze,yb as Zt,yc as Qe}from"./chunk-NMCKMUY4.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var on=["class","page"],rn=t=>({id:t}),an=()=>({"overflow-x":"auto"}),ln=t=>({"table-borderless":t}),sn=t=>["fa-solid",t],cn=t=>["/pages/journal/journal-entry/",t];function mn(t,s){t&1&&h(0,"p-button",8)}function pn(t,s){if(t&1){let e=w();a(0,"p-button",9),S("onClick",function(){_(e);let n=m(2);return g(n.onDelete())}),r()}}function dn(t,s){if(t&1&&(a(0,"div",4)(1,"p-button-group"),u(2,mn,1,0,"p-button",5)(3,pn,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,i=m();c(2),l("ngIf",i.roleService.coa().edit),c(),l("ngIf",i.roleService.coa().delete),c(),l("queryParams",T(3,rn,(e=i.COAInfo())==null?null:e.id))}}function un(t,s){if(t&1&&h(0,"i",25),t&2){let e=s.checked;l("ngClass",T(1,sn,e?"fa-check":"fa-xmark"))}}function fn(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.creditAmount)," ")}}function _n(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.debitAmount)," ")}}function gn(t,s){if(t&1&&(a(0,"tr")(1,"td"),p(2),de(3,"date"),r(),a(4,"td")(5,"div",26)(6,"a",27),p(7),r()()(),a(8,"td",28),u(9,fn,3,3,"ng-container",29),r(),a(10,"td",30),u(11,_n,3,3,"ng-container",29),r(),a(12,"td",31),p(13),de(14,"number"),r()()),t&2){let e=s.$implicit;c(2),E(ti(3,6,e.date,"dd MMM yyyy")),c(4),l("routerLink",T(11,cn,e.id)),c(),E(e.number),c(2),l("ngIf",e.creditAmount!==0),c(2),l("ngIf",e.debitAmount!==0),c(2),Q(" ",xe(14,9,e.balance)," ")}}function hn(t,s){t&1&&(a(0,"tr")(1,"td",32)(2,"div",33),h(3,"img",34),a(4,"div",26)(5,"span",35),p(6,"No Data Available"),r(),a(7,"span",35),p(8,"Your data will be shown here once it's available"),r()()()()())}function xn(t,s){if(t&1){let e=w();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Outlet"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),S("onChange",function(n){_(e);let o=m(2);return g(o.onDiscontinued(n))}),u(34,un,1,3,"ng-template",null,2,I),r()()(),a(36,"div",16)(37,"div",17),p(38,"Access Type"),r(),a(39,"div",18),p(40),r()()()()(),a(41,"div",20)(42,"p-card",21)(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),p(47,"Date"),r(),a(48,"th",23),p(49,"Number"),r(),a(50,"th",24),p(51,"Credit"),r(),a(52,"th",24),p(53,"Debit"),r(),a(54,"th",24),p(55,"Balance"),r()()(),a(56,"tbody"),Yt(57,gn,15,13,"tr",null,Wt),u(59,hn,9,0,"tr"),r()()()()()}if(t&2){let e,i,n,o,d,f,b=m(2);c(8),E((e=b.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),E((i=b.COAInfo().code)!==null&&i!==void 0?i:"-"),c(5),E((n=b.COAInfo().category)!==null&&n!==void 0?n:"-"),c(5),E((o=b.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),E((d=b.COAInfo().outletName)!==null&&d!==void 0?d:"-"),c(5),l("ngModel",b.COAInfo().bin),c(7),E((f=b.COAInfo().accessType)!==null&&f!==void 0?f:"-"),c(2),He(R(11,an)),c(),l("ngClass",T(12,ln,b.COAInfo().transactions.length===0)),c(14),Xt(b.COAInfo().transactions),c(2),Qt(b.COAInfo().transactions.length===0?59:-1)}}function Cn(t,s){if(t&1&&(a(0,"div",10),u(1,xn,60,14,"div",11),r()),t&2){let e=m();c(),l("ngIf",e.COAInfo())}}var Hi=(()=>{class t{constructor(){this.#e=x(X),this.#t=x(ie),this.router=x(ne),this.COAInfo=v(null),this.checked=v(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(V("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),A(e=>this.COAInfo.set(e)),V("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let i=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(i).pipe(A(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:on,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-5"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-4"],[1,"col"],[3,"onChange","ngModel"],[1,"col","col-lg-7"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],["scope","col",1,"text-end"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-danger","text-end"],[4,"ngIf"],[1,"text-success","text-end"],[1,"text-end"],["colspan","5",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(i,n){i&1&&(a(0,"app-main-panel",3),u(1,dn,6,5,"ng-template",null,0,I)(3,Cn,2,1,"ng-template",null,1,I),r()),i&2&&l("overflowScroll",!0)},dependencies:[F,z,O,Xe,ni,Se,Y,Je,et,L,B,$,K,at,le,ae,ft,ut,Oi,Di],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var me=(()=>{class t{constructor(){this.httpService=x(oi)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let i={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",i)}renameCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,i)}updateParentCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,i).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,i={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Mt=t=>t?t.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...Mt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var Ot=(t,s,e)=>{let i=Math.ceil(e/s),n=(t-1)*s+1,o=Math.min(t*s,e);return{start:n,end:o,totalRecords:e,totalPages:i}};var yn={filter:{PageSize:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2,AccessLevel:-1},options:{entities:[],categories:[],accessLevels:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},Ft=Ai(Pi(yn),ki("ChartOfAccount"),wi(t=>({isAllChecked:W(()=>t.data().every(s=>s.checked)),checkedItems:W(()=>t.data().filter(s=>s.checked)),IDsChecked:W(()=>t.data().filter(s=>s.checked).map(s=>s.id)),categories:W(()=>Mt(t.options.categories())),first:W(()=>{let{start:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s}),last:W(()=>{let{end:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s})})),Ei(t=>{let s=x(X),e=x(me),i={updateFilter(n){J(t,{filter:C({},n)})},checkedItem(n){if(Array.isArray(n))n.forEach(o=>{let d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})});else{let o=n,d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})}},checkAllCheckbox(){let n=t.data().map(o=>y(C({},o),{checked:!o.checked}));J(t,{data:n})},fetchChartOfAccount:lt($e(Ke(()=>!!t.filter()),qt(300),zt(),D(n=>s.getPaginatedChartAccounts(n).pipe(G(o=>y(C({},o),{data:o.data.map(d=>y(C({},d),{checked:!1}))})),st({next:o=>J(t,{data:o.data,count:o.count}),error:o=>{J(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:lt($e(D(()=>s.getChartOfAccountLoader().pipe(st({next:n=>{J(t,{filter:y(C({},t.filter()),{PageSize:n.filter.pageSize,PageNumber:1,CategoryID:n.filter.categoryID||null,Text:"",listOutletID:[],AccessLevel:n.filter.accessLevel!==void 0?n.filter.accessLevel:t.filter().AccessLevel}),options:n.options}),i.fetchChartOfAccount(t.filter)},error:n=>{console.error(n)}}))))),getCategories:lt($e(qe(()=>e.fetchCOACategories().pipe(st({next:n=>{J(t,{options:y(C({},t.options()),{entities:t.options.entities(),categories:n})})},error:n=>{console.error(n)}})))))};return i}));var Sn=["class","page"],Tn=t=>["../account/",t],An=t=>({"text-decoration-line-through":t}),wn=()=>["/pages/report/general-ledger"],En=t=>({id:t});function Pn(t,s){if(t&1){let e=w();a(0,"p-button",13),S("onClick",function(){_(e);let n=m(2);return g(n.deleteCOA())}),r()}}function kn(t,s){t&1&&h(0,"p-button",14)}function Mn(t,s){if(t&1){let e=w();a(0,"p-button",15),S("onClick",function(){_(e);let n=m(2);return g(n.onExport())}),r()}}function On(t,s){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Fn(t,s){if(t&1&&(a(0,"div",8),u(1,Pn,1,0,"p-button",9),a(2,"p-button-group"),u(3,kn,1,0,"p-button",10)(4,Mn,1,0,"p-button",11),r(),u(5,On,3,0,"a",12),r()),t&2){let e=m();c(),l("ngIf",e.store.checkedItems().length&&e.roleService.coa().delete),c(2),l("ngIf",e.roleService.coa().create),c(),l("ngIf",e.roleService.global().export),c(),l("ngIf",e.roleService.coa().create)}}function Ln(t,s){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Nn(t,s){if(t&1&&(a(0,"tr"),u(1,Ln,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),l("ngIf",e.roleService.coa().delete)}}function Vn(t,s){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),l("value",e)}}function Dn(t,s){if(t&1&&(a(0,"tr"),u(1,Vn,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),de(14,"number"),r()()()),t&2){let e,i=s.$implicit,n=m(2);c(),l("ngIf",n.roleService.coa().delete),c(2),E(i.code),c(2),l("routerLink",T(12,Tn,i.id))("ngClass",T(14,An,i.bin)),c(),E(i.name),c(2),E(i.category),c(2),E(i.outletName),c(2),l("routerLink",R(16,wn))("queryParams",T(17,En,i.id)),c(),E(xe(14,10,(e=i.balance)!==null&&e!==void 0?e:0))}}function Rn(t,s){if(t&1&&p(0),t&2){let e=m(2);Jt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Bn(t,s){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function $n(t,s){if(t&1){let e=w();a(0,"p-panel")(1,"p-table",18),S("onLazyLoad",function(n){_(e);let o=m();return g(o.loadData(n))})("onRowSelect",function(n){_(e);let o=m();return g(o.onRowSelect(n))})("onRowUnselect",function(n){_(e);let o=m();return g(o.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){_(e);let o=m();return g(o.onSelectAll(n))})("onPage",function(n){_(e);let o=m();return g(o.onPageChange(n))}),u(2,Nn,12,1,"ng-template",null,3,I)(4,Dn,15,19,"ng-template",null,4,I)(6,Rn,1,3,"ng-template",null,5,I)(8,Bn,4,0,"ng-template",null,6,I),r()()}if(t&2){let e=m();c(),l("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.count())}}function Kn(t,s){if(t&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),S("onFocus",function(){_(e);let n=m(2);return g(n.onCategoryFocus())}),r()(),a(9,"div",29)(10,"label",30),p(11,"Access Level"),r(),h(12,"p-select",33),r(),a(13,"div",34)(14,"label",30),p(15,"Page Size"),r(),h(16,"input",35),r(),a(17,"div",34)(18,"label",30),p(19,"Discontinued"),r(),a(20,"div",36)(21,"div",37),h(22,"p-radiobutton",38),a(23,"label",39),p(24,"No"),r()(),a(25,"div",37),h(26,"p-radiobutton",40),a(27,"label",41),p(28,"Yes"),r()(),a(29,"div",37),h(30,"p-radiobutton",40),a(31,"label",41),p(32,"All"),r()()()()()}if(t&2){let e=m(2);l("formGroup",e.formFilter),c(4),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),l("fluid",!0)("showClear",!0)("options",e.categoryNodes()),c(4),l("showClear",!0)("options",e.store.options().accessLevels),c(10),l("value",0),c(4),l("value",1),c(4),l("value",2)}}function qn(t,s){if(t&1&&u(0,Kn,33,13,"form",27),t&2){let e=m();l("ngIf",e.formFilter)}}var ji=(()=>{class t{ngOnInit(){this.initializeFilterEffect(),this.store.fetchLoader()}#e;constructor(){this.routeInfo=Zi,this.store=x(Ft),this.#e=x(X),this.modalService=x(li),this.roleService=x(we),this.dialogVisible=v(!1),this.categoryNodes=v([]),this.fb=x(ve),this.injector=x(Ut),this.isDialogFilterVisible=v(!1)}initializeFilterEffect(){We(()=>{this.store.filter()&&this.generateFilterForm()},{injector:this.injector})}generateFilterForm(){let e=this.store.filter();this.formFilter=this.fb.group({outletID:this.fb.control(e.listOutletID||[]),categoryID:this.fb.control(null),pageSize:this.fb.control(e.PageSize),discontinued:this.fb.control(e.Discontinued),accessLevel:this.fb.control(e.AccessLevel)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(A(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,i){this.store.updateFilter(y(C({},this.store.filter()),{[e]:i}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(V("response"),A(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:1,Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:i,outletID:n,discontinued:o,accessLevel:d}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:n,CategoryID:e?e.key:"",PageSize:+i,Discontinued:o,AccessLevel:d})),this.isDialogFilterVisible.update(f=>!f)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportPageSize:1e4});this.#e.exportChartOfAccounts(e).pipe(A(i=>{let n=i.headers;console.log("All headers:",n.keys());let o=n.get("Content-Disposition"),d=n.get("content-disposition"),f=o??d,b="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(b=decodeURIComponent(q[1].replace(/"/g,"")))}let k=i.body;Ki(k,b,k.type)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[he([Ft])],attrs:Sn,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["scrollHeight","300px","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",3,"onFocus","fluid","showClear","options"],["appendTo","body","formControlName","accessLevel","optionLabel","value","optionValue","key","placeholder","Select an Access Level",3,"showClear","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(i,n){if(i&1){let o=w();a(0,"app-main-panel",7),S("search",function(f){return _(o),g(n.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(n.isDialogFilterVisible,f)||(n.isDialogFilterVisible=f),g(f)}),S("filterEmitted",function(){return _(o),g(n.onFilterEvent())})("filterConfirmed",function(){return _(o),g(n.onFilterOKEvent())}),u(1,Fn,6,4,"ng-template",null,0,I)(3,$n,10,5,"ng-template",null,1,I)(5,qn,1,1,"ng-template",null,2,I),r()}i&2&&(l("isSearchableInput",!0),je("isDialogFilterVisible",n.isDialogFilterVisible),l("isFilterable",!0)("scrollable",!0))},dependencies:[F,z,O,Xe,$,si,ft,ut,_t,Se,ai,oe,Y,ye,L,B,Te,Ie,be,et,Vi,Fi,Li,Ni,K,Mi,le,ae,mt,ct,ot,nt,_e,Bi,Ri,Pe,Ee,ce,se,dt,pt],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Gn=["class","page"],Hn=()=>["../../"],Nt=t=>({"ng-invalid ng-dirty":t}),Un=t=>({"ng-dirty ng-invalid":t});function jn(t,s){if(t&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}t&2&&(c(),l("routerLink",R(1,Hn)))}function Zn(t,s){t&1&&(a(0,"div",34),p(1," Name is required "),r())}function Qn(t,s){if(t&1&&(a(0,"div"),u(1,Zn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Name.errors.required)}}function Wn(t,s){t&1&&(a(0,"div",35)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Yn(t,s){if(t&1&&(a(0,"span",36),p(1),r()),t&2){let e=s.$implicit;l("pTooltip",e.name),c(),Q(" ",e.name," ")}}function Xn(t,s){t&1&&(a(0,"div",34),p(1," Code is required "),r())}function Jn(t,s){if(t&1&&(a(0,"div"),u(1,Xn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Code.errors.required)}}function eo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function to(t,s){if(t&1&&(a(0,"div"),u(1,eo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function io(t,s){if(t&1&&p(0),t&2){let e=s.$implicit;Q(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function no(t,s){t&1&&(a(0,"div",34),p(1," Category is required "),r())}function oo(t,s){if(t&1&&(a(0,"div"),u(1,no,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Category.errors.required)}}function ro(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function ao(t,s){if(t&1&&(a(0,"div"),u(1,ro,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function lo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function so(t,s){if(t&1&&(a(0,"div"),u(1,lo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function co(t,s){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"label",13),p(6,"Name"),r(),h(7,"input",14),u(8,Qn,2,1,"div",15),r()(),a(9,"div",11)(10,"div",16)(11,"label",13),p(12,"Outlet"),r(),a(13,"span",17),h(14,"i",18),r(),u(15,Wn,3,0,"ng-template",null,2,I),r(),a(17,"p-select",19),u(18,Yn,2,2,"ng-template",null,3,I),r()()(),a(20,"div",10)(21,"div",11)(22,"div",12)(23,"label",13),p(24,"Code"),r(),h(25,"input",20),u(26,Jn,2,1,"div",15),r()(),a(27,"div",11)(28,"div",12)(29,"label",13),p(30,"Discontinued"),r(),a(31,"div",10)(32,"div",21),h(33,"p-radiobutton",22),a(34,"label",23),p(35,"No"),r()(),a(36,"div",24),h(37,"p-radiobutton",25),a(38,"label",26),p(39,"Yes"),r()()(),u(40,to,2,1,"div",15),r()()(),a(41,"div",10)(42,"div",11)(43,"div",27)(44,"label",13),p(45,"Category"),r(),a(46,"p-treeselect",28),u(47,io,1,1,"ng-template",29),r(),u(48,oo,2,1,"div",15),r()(),a(49,"div",11)(50,"div",12)(51,"label",13),p(52,"Access Type"),r(),a(53,"div",10)(54,"div",30),h(55,"p-select",31),r()(),u(56,ao,2,1,"div",15),r()()(),a(57,"div",10)(58,"div",11)(59,"div",12)(60,"label",13),p(61,"Note"),r(),h(62,"textarea",32),u(63,so,2,1,"div",15),r()(),h(64,"div",11),r()()()),t&2){let e=te(16),i=m();l("formGroup",i.form),c(7),l("ngClass",T(21,Nt,i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched))),c(),l("ngIf",i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched)),c(5),l("pTooltip",e),c(4),l("fluid",!0)("options",i.outlets()),c(8),l("ngClass",T(23,Nt,i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched))),c(),l("ngIf",i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched)),c(7),l("value",!1),c(4),l("value",!0),c(3),l("ngIf",i.form.controls.Note.errors),c(6),l("fluid",!0)("options",i.categoryOptions())("ngClass",T(25,Un,i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched))),c(2),l("ngIf",i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched)),c(7),l("options",i.accessTypes())("fluid",!0),c(),l("ngIf",i.form.controls.Note.errors),c(6),l("ngClass",T(27,Nt,i.form.controls.Note.invalid&&(i.form.controls.Note.dirty||i.form.controls.Note.touched)))("autoResize",!0),c(),l("ngIf",i.form.controls.Note.errors)}}var Vt=(()=>{class t{constructor(){this.route=x(ie),this.coa_service=x(X),this.coa_info=v(null),this.fb=x(ve),this.isEdit=v(!1),this.categoryOptions=v([]),this.router=x(ne),this.outlets=W(()=>this.coa_info()?this.coa_info().options.entities:[]),this.accessTypes=W(()=>{let e=["This Chart of Account can be viewed by all users.","Restricted access, only visible to users with the private role"];return this.coa_info()?this.coa_info().options.coaAccessType.map((i,n)=>y(C({},i),{description:e[n]})):[]})}findParenChilds(e,i){function n(o,d=null){for(let f of o){if(f.key===i)return{parent:d,child:f};if(f.children){let b=n(f.children,f);if(b)return b}}return null}return n(e)}generateForm(e){this.form=this.fb.group({ID:new N(e.id||""),Name:new N(e.name||"",[fe.required]),Code:new N(e.code||"",[fe.required]),Note:new N(e.note||"",[]),Balance:new N(e.balance||0),Outlet:new N(e.outletID||""),AccessType:new N(e.accessTypeID||0),Category:new N(null,[fe.required]),Bin:new N(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let i=e.get("id");return this.coa_service.getChartAccountFormById(i)}else return this.coa_service.getChartAccountForm()}),V("response"),G(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),A(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:i,Category:n,Code:o,Name:d,Note:f,Outlet:b}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:n.key,name:d,bin:this.form.value.Bin||!1,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:n.key,bin:this.form.value.Bin||!1,name:d,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(V("response"),A(e=>{this.categoryOptions.set(e);let i=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(i?.child)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:Gn,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2",3,"formGroup"],[1,"d-flex","flex-column","gap-2"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],[1,"d-flex","align-items-baseline","gap-2"],[3,"pTooltip"],[1,"fa-solid","fa-circle-info"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"fluid","options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"col-3","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[1,"col","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"fluid","options","ngClass"],["pTemplate","value"],[1,"col"],["optionLabel","value","optionValue","key","formControlName","AccessType","placeholder","Select Access Type",3,"options","fluid"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass","autoResize"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"]],template:function(i,n){i&1&&(a(0,"app-main-panel",4),u(1,jn,4,2,"ng-template",null,0,I)(3,co,65,29,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,Te,oe,Y,ye,Ie,be,_t,F,z,O,L,B,Pe,Ee,Ae,K,ot,nt,zi,qi,mt,ct,_e,rt,le,ae,ce,se,dt,pt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var mo=["sublist"],po=(t,s)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":s}),uo=()=>({"p-contextmenu-item-link":!0}),Yi=()=>({class:"p-contextmenu-submenu-icon"}),fo=()=>({exact:!1}),_o=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),go=t=>({$implicit:t});function ho(t,s){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,i=m(2);He(i.getItemProp(e,"style")),l("ngClass",i.getSeparatorItemClass(e)),P("id",i.getItemId(e))("data-pc-section","separator")}}function xo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Co(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function yo(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function Io(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function bo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function vo(t,s){}function So(t,s){t&1&&u(0,vo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function To(t,s){if(t&1&&(H(0),u(1,bo,1,4,"AngleRightIcon",23)(2,So,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function Ao(t,s){if(t&1&&(a(0,"a",15),u(1,xo,1,5,"span",16)(2,Co,2,2,"span",17)(3,yo,1,2,"ng-template",null,2,I)(5,Io,1,2,"p-badge",18)(6,To,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("target",n.getItemProp(i,"target"))("ngClass",R(12,uo)),P("href",n.getItemProp(i,"url"),jt)("aria-hidden",!0)("data-automationid",n.getItemProp(i,"automationId"))("data-pc-section","action")("tabindex",-1),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function wo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Eo(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function Po(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function ko(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function Mo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Oo(t,s){}function Fo(t,s){t&1&&u(0,Oo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function Lo(t,s){if(t&1&&(H(0),u(1,Mo,1,4,"AngleRightIcon",23)(2,Fo,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function No(t,s){if(t&1&&(a(0,"a",26),u(1,wo,1,5,"span",16)(2,Eo,2,2,"span",17)(3,Po,1,2,"ng-template",null,2,I)(5,ko,1,2,"p-badge",18)(6,Lo,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("routerLink",n.getItemProp(i,"routerLink"))("queryParams",n.getItemProp(i,"queryParams"))("routerLinkActiveOptions",n.getItemProp(i,"routerLinkActiveOptions")||R(20,fo))("target",n.getItemProp(i,"target"))("ngClass",T(21,_o,n.getItemProp(i,"disabled")))("fragment",n.getItemProp(i,"fragment"))("queryParamsHandling",n.getItemProp(i,"queryParamsHandling"))("preserveFragment",n.getItemProp(i,"preserveFragment"))("skipLocationChange",n.getItemProp(i,"skipLocationChange"))("replaceUrl",n.getItemProp(i,"replaceUrl"))("state",n.getItemProp(i,"state")),P("data-automationid",n.getItemProp(i,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function Vo(t,s){if(t&1&&(H(0),u(1,Ao,7,13,"a",13)(2,No,7,23,"a",14),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngIf",!i.getItemProp(e,"routerLink")),c(),l("ngIf",i.getItemProp(e,"routerLink"))}}function Do(t,s){}function Ro(t,s){t&1&&u(0,Do,0,0,"ng-template")}function Bo(t,s){if(t&1&&(H(0),u(1,Ro,1,0,null,24),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",T(2,go,e.item))}}function $o(t,s){if(t&1){let e=w();a(0,"p-contextmenu-sub",27),S("itemClick",function(n){_(e);let o=m(4);return g(o.itemClick.emit(n))})("itemMouseEnter",function(n){_(e);let o=m(4);return g(o.onItemMouseEnter(n))}),r()}if(t&2){let e=m(2).$implicit,i=m(2);l("items",e.items)("itemTemplate",i.itemTemplate)("menuId",i.menuId)("visible",i.isItemActive(e)&&i.isItemGroup(e))("activeItemPath",i.activeItemPath)("focusedItemId",i.focusedItemId)("level",i.level+1)}}function Ko(t,s){if(t&1){let e=w();a(0,"li",9,1)(2,"div",10),S("click",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemClick(n,o))})("mouseenter",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemMouseEnter({$event:n,processedItem:o}))}),u(3,Vo,3,2,"ng-container",11)(4,Bo,2,4,"ng-container",11),r(),u(5,$o,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),i=e.$implicit,n=e.index,o=m(2);Fe(o.getItemProp(i,"styleClass")),l("ngStyle",o.getItemProp(i,"style"))("ngClass",o.getItemClass(i))("tooltipOptions",o.getItemProp(i,"tooltipOptions")),P("id",o.getItemId(i))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(i))("data-p-focused",o.isItemFocused(i))("data-p-disabled",o.isItemDisabled(i))("aria-label",o.getItemLabel(i))("aria-disabled",o.isItemDisabled(i)||void 0)("aria-haspopup",o.isItemGroup(i)&&!o.getItemProp(i,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(i)?o.isItemActive(i):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(n)),c(2),P("data-pc-section","content"),c(),l("ngIf",!o.itemTemplate),c(),l("ngIf",o.itemTemplate),c(),l("ngIf",o.isItemVisible(i)&&o.isItemGroup(i))}}function qo(t,s){if(t&1&&u(0,ho,1,5,"li",6)(1,Ko,6,21,"li",7),t&2){let e=s.$implicit,i=m(2);l("ngIf",i.isItemVisible(e)&&i.getItemProp(e,"separator")),c(),l("ngIf",i.isItemVisible(e)&&!i.getItemProp(e,"separator"))}}function zo(t,s){if(t&1){let e=w();a(0,"ul",4,0),S("@overlayAnimation.start",function(n){_(e);let o=te(1),d=m();return g(d.onEnter(n,o))})("keydown",function(n){_(e);let o=m();return g(o.menuKeydown.emit(n))})("focus",function(n){_(e);let o=m();return g(o.menuFocus.emit(n))})("blur",function(n){_(e);let o=m();return g(o.menuBlur.emit(n))}),u(2,qo,2,2,"ng-template",5),r()}if(t&2){let e=m();l("ngClass",ei(10,po,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),l("ngForOf",e.items)}}var Go=["item"],Ho=["submenuicon"],Uo=["rootmenu"],jo=["container"],Zo=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),Qo=()=>({value:"visible"});function Wo(t,s){if(t&1){let e=w();a(0,"div",3,0),S("@overlayAnimation.start",function(n){_(e);let o=m();return g(o.onOverlayAnimationStart(n))})("@overlayAnimation.done",function(n){_(e);let o=m();return g(o.onOverlayAnimationEnd(n))}),a(2,"p-contextmenu-sub",4,1),S("itemClick",function(n){_(e);let o=m();return g(o.onItemClick(n))})("menuFocus",function(n){_(e);let o=m();return g(o.onMenuFocus(n))})("menuBlur",function(n){_(e);let o=m();return g(o.onMenuBlur(n))})("menuKeydown",function(n){_(e);let o=m();return g(o.onKeyDown(n))})("itemMouseEnter",function(n){_(e);let o=m();return g(o.onItemMouseEnter(n))}),r()()}if(t&2){let e=m();Fe(e.styleClass),l("ngClass",T(20,Zo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",R(22,Qo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),l("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Yo=({dt:t})=>`
2
2
  .p-contextmenu {
3
3
  position: absolute;
4
4
  background: ${t("contextmenu.background")};
@@ -157,4 +157,4 @@ import{a as _t}from"./chunk-KIBBRAL5.js";import{a as Gi}from"./chunk-XKI7WLHE.js
157
157
  }
158
158
  `,Xo={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:t,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":t.isItemActive(s),"p-focus":t.isItemFocused(s),"p-disabled":t.isItemDisabled(s)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Wi=(()=>{class t extends Ii{name="contextmenu";theme=Yo;classes=Xo;static \u0275fac=(()=>{let e;return function(n){return(e||(e=Ge(t)))(n||t)}})();static \u0275prov=ze({token:t,factory:t.\u0275fac})}return t})();var Jo=(()=>{class t extends wt{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new ee;itemMouseEnter=new ee;menuFocus=new ee;menuBlur=new ee;menuKeydown=new ee;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,i,n=null){return e&&e.item?At(e.item[i],n):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return y(C({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return y(C({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(i=>this.isItemVisible(i)&&this.getItemProp(i,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(i=>i.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return re(e.items)}onItemMouseEnter(e){let{event:i,processedItem:n}=e;this.itemMouseEnter.emit({originalEvent:i,processedItem:n})}onItemClick(e,i){this.getItemProp(i,"command",{originalEvent:e,item:i.item}),this.itemClick.emit({originalEvent:e,processedItem:i,isFocus:!0})}onEnter(e,i){if(e.fromState==="void"&&e.toState){let n=e.element;this.position(n)}}position(e){let i=e.parentElement.parentElement,n=ui(e.parentElement.parentElement),o=bt(),d=e.offsetParent?e.offsetWidth:vt(e),f=ci(i.children[0]);e.style.top="0px",parseInt(n.left,10)+f+d>o.width-pi()?e.style.left=-1*d+"px":e.style.left=f+"px"}static \u0275fac=function(i){return new(i||t)(xt(Gt(()=>ht)))};static \u0275cmp=M({type:t,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(i,n){if(i&1&&pe(mo,5),i&2){let o;j(o=Z())&&(n.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",ue],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",ue],autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",Ce],popup:[2,"popup","popup",ue],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Ce],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Ce]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Oe],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(i,n){i&1&&u(0,zo,3,13,"ul",3),i&2&&l("ngIf",n.root?!0:n.visible)},dependencies:[t,F,z,Ye,O,ii,Ct,L,B,vi,_e,rt,bi,Pt,Ti,De],encapsulation:2,data:{animation:[yt("overlayAnimation",[Ve(":enter",[Ne({opacity:0})]),Ve(":leave",[Ne({opacity:0})])])]}})}return t})(),ht=(()=>{class t extends wt{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new ee;onHide=new ee;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=v(!1);relativeAlign;window;focused=!1;activeItemPath=v([]);focusedItemInfo=v({index:-1,level:0,parentKey:"",item:null});submenuVisible=v(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(Wi);get visibleItems(){let e=this.activeItemPath().find(i=>i.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${re(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,We(()=>{let i=this.activeItemPath();re(i)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||xi("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return _i()||fi()}bindTriggerEventListener(){Le(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(Le(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",i=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(i)&&!i.ctrlKey&&i.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,i=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(i)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,i=0,n={},o=""){let d=[];return e&&e.forEach((f,b)=>{let k=(o!==""?o+"_":"")+b,q={item:f,index:b,level:i,key:k,parent:n,parentKey:o};q.items=this.createProcessedItems(f.items,i+1,q,k),d.push(q)}),d}bindMatchMediaListener(){if(Le(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,i){return e?At(e[i]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&re(e.items)}isSelected(e){return this.activeItemPath().some(i=>i.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&re(e.items)}onItemClick(e){let{processedItem:i}=e,n=this.isProcessedItemGroup(i);if(this.isSelected(i)){let{index:d,key:f,level:b,parentKey:k,item:q}=i;this.activeItemPath.set(this.activeItemPath().filter(Be=>f!==Be.key&&f.startsWith(Be.key))),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:q}),it(this.rootmenu.sublistViewChild.nativeElement)}else n?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&hi(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let i=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}onArrowRightKey(e){let i=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo.set({index:-1,parentKey:i.key,item:i.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let i=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(i)&&this.onItemChange({originalEvent:e,processedItem:i})}this.hide(),e.preventDefault()}else{let i=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}}onArrowLeftKey(e){let i=this.visibleItems[this.focusedItemInfo().index],n=this.activeItemPath().find(f=>f.key===i.parentKey);St(i.parent)||(this.focusedItemInfo.set({index:-1,parentKey:n?n.parentKey:"",item:i.item}),this.searchValue="",this.onArrowDownKey(e));let d=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(d),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let i=this.findVisibleItem(this.findFirstFocusedItemIndex()),n=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},n),{index:this.findFirstFocusedItemIndex(),item:i.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let i=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(i)&&this.onItemChange({originalEvent:e,processedItem:i})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let i=tt(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),n=i&&tt(i,'a[data-pc-section="action"]');n?n.click():i&&i.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,i){let{processedItem:n,isFocus:o}=e;if(St(n))return;let{index:d,key:f,level:b,parentKey:k,items:q}=n,Be=re(q),Bt=this.activeItemPath().filter($t=>$t.parentKey!==k&&$t.parentKey!==f);Be&&(Bt.push(n),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:n.item}),o&&it(this.rootmenu.sublistViewChild.nativeElement),!(i==="hover"&&this.queryMatches)&&this.activeItemPath.set(Bt)}onMenuFocus(e){this.focused=!0;let i=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(i)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),it(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):mi(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&Et.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&Et.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,i=this.pageY+1,n=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:vt(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:di(this.containerViewChild.nativeElement),d=bt();e+n-this.document.scrollingElement.scrollLeft>d.width&&(e-=n),i+o-this.document.scrollingElement.scrollTop>d.height&&(i-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),i<this.document.scrollingElement.scrollTop&&(i=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=i+"px"}searchItems(e,i){this.searchValue=(this.searchValue||"")+i;let n=-1,o=!1;return this.focusedItemInfo().index!==-1?(n=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)),n=n===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)):n+this.focusedItemInfo().index):n=this.visibleItems.findIndex(d=>this.isItemMatched(d)),n!==-1&&(o=!0),n===-1&&this.focusedItemInfo().index===-1&&(n=this.findFirstFocusedItemIndex()),n!==-1&&this.changeFocusedItemIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return re(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return Tt(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let i=e>0?Tt(this.visibleItems.slice(0,e),n=>this.isValidItem(n)):-1;return i>-1?i:e}findNextItemIndex(e){let i=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(n=>this.isValidItem(n)):-1;return i>-1?i+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,i){let n=this.findVisibleItem(i),o=this.focusedItemInfo();o.index!==i&&(this.focusedItemInfo.set(y(C({},o),{index:i,item:n.item})),this.scrollInView())}scrollInView(e=-1){let i=e!==-1?`${this.id}_${e}`:this.focusedItemId,n=tt(this.rootmenu.el.nativeElement,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Le(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):gi(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(i){return new(i||t)(xt(Ci))};static \u0275cmp=M({type:t,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(i,n,o){if(i&1&&(Ue(o,Go,4),Ue(o,Ho,4),Ue(o,Ae,4)),i&2){let d;j(d=Z())&&(n.itemTemplate=d.first),j(d=Z())&&(n.submenuIconTemplate=d.first),j(d=Z())&&(n.templates=d)}},viewQuery:function(i,n){if(i&1&&(pe(Uo,5),pe(jo,5)),i&2){let o;j(o=Z())&&(n.rootmenu=o.first),j(o=Z())&&(n.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",ue],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",Ce],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Ce]},outputs:{onShow:"onShow",onHide:"onHide"},features:[he([Wi]),Oe],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(i,n){i&1&&u(0,Wo,4,23,"div",2),i&2&&l("ngIf",n.visible())},dependencies:[F,z,O,Ct,Jo,L,_e,Pt,De],encapsulation:2,data:{animation:[yt("overlayAnimation",[Ve(":enter",[Ne({opacity:0}),It("250ms")]),Ve(":leave",[It(".1s linear",Ne({opacity:0}))])])]},changeDetection:0})}return t})(),Xi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Zt({type:t});static \u0275inj=Ht({imports:[ht,De,De]})}return t})();var tr=["editInput"],ir=["tree"],nr=["class","page"];function or(t,s){t&1&&(a(0,"a",7),h(1,"i",8),p(2," Add"),r())}function rr(t,s){if(t&1&&u(0,or,3,0,"a",6),t&2){let e=m();l("ngIf",e.roleService.coa().create)}}function ar(t,s){if(t&1){let e=w();a(0,"input",15,4),Qe("ngModelChange",function(n){let o=_(e).$implicit;return Ze(o.label,n)||(o.label=n),g(n)}),S("keydown",function(n){_(e);let o=m(2);return g(o.handleEditKeydown(n))})("blur",function(n){_(e);let o=m(2);return g(o.onNodeEditBlur(n))}),r()}if(t&2){let e=s.$implicit;je("ngModel",e.label)}}function lr(t,s){if(t&1){let e=w();a(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-tree",12,2),S("onNodeContextMenuSelect",function(n){_(e);let o=m();return g(o.onNodeContextMenuSelect(n))})("onNodeSelect",function(n){_(e);let o=m();return g(o.onNodeSelect(n))})("onNodeUnselect",function(n){_(e);let o=m();return g(o.onNodeUnselect(n))})("onNodeDrop",function(n){_(e);let o=m();return g(o.onNodeDrop(n))}),u(5,ar,2,1,"ng-template",13),r(),h(6,"p-contextmenu",14,3),r()()()}if(t&2){let e=te(7),i=m();c(2),l("showHeader",!1),c(),l("value",i.categoryTree())("contextMenu",e)("selection",i.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),c(3),l("model",i.contextMenuItems())}}var Ji=(()=>{class t{constructor(){this._coaTypesService=x(me),this._router=x(ne),this.roleService=x(we),this.contextMenuItems=v([]),this.categoryTree=v([]),this.selectedCategory=null,this._shouldAutoFocus=v(!1)}ngOnInit(){this._loadCategories().subscribe(),this._initializeContextMenuItems(),this.expandAllNodes()}ngAfterViewChecked(){this.selectedCategory&&!this._shouldAutoFocus()&&this.editInputRef&&(this.editInputRef.nativeElement.focus(),this.editInputRef.nativeElement.select(),this._shouldAutoFocus.set(!0))}_loadCategories(){return this._coaTypesService.fetchCOACategories().pipe(A(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(i=>{let n=!!i.children?.length;return y(C({},i),{icon:void 0,expandedIcon:n?"fa-solid fa-folder-open":void 0,collapsedIcon:n?"fa-solid fa-folder":"fa-solid fa-file",children:n?this._assignTreeIcons(i.children):[]})})}_initializeContextMenuItems(){this.contextMenuItems.set([{label:"Add",icon:"fa-light fa-plus",disabled:!1,command:()=>this._createChildCategory()},{label:"Edit",icon:"fa-light fa-pen-to-square",disabled:!1,command:()=>this._setSelectedNodeToEditMode()},{label:"Delete",icon:"fa-light fa-trash",disabled:!1,command:()=>this._deleteSelectedCategory()},{label:"Properties",icon:"fa-light fa-file",disabled:!1,command:()=>{this._router.navigate(["/pages/chart-of-account/coa-types/info"],{queryParams:{ID:this.selectedCategory?.key}})}}])}_findNodeByKey(e){return this.treeComponent.getNodeWithKey(e,this.categoryTree())??null}_setSelectedNodeToEditMode(){let e=this._findNodeByKey(this.selectedCategory?.key);e&&(this.selectedCategory=e,e.type="edit")}_createChildCategory(){this._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(D(e=>this._loadCategories().pipe(G(()=>e))),A(e=>{let i=this._findNodeByKey(e.id);i&&(this.selectedCategory=i,this._shouldAutoFocus.set(!1),i.type="edit")})).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(D(()=>this._loadCategories())).subscribe()}renameNode(e,i=this.selectedCategory){this._coaTypesService.renameCategory(i.key,{Name:e}).pipe(D(()=>this._loadCategories())).subscribe()}onNodeSelect(e){this.selectedCategory=e.node,this._shouldAutoFocus.set(!1),e.node.children?.length&&(e.node.icon="fa-solid fa-folder-open")}onNodeUnselect(e){e.node.children?.length&&(e.node.icon="fa-solid fa-folder")}onNodeContextMenuSelect(e){this.selectedCategory=e.node,["Asset","Liability","Equity","Revenue","Expense"].includes(e.node.label)?this.contextMenuItems.set(this.contextMenuItems().map(n=>["Edit","Delete"].includes(n.label)?y(C({},n),{disabled:!0}):y(C({},n),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(n=>n.label==="Add"?y(C({},n),{disabled:!this.roleService.coa().create}):n.label==="Edit"?y(C({},n),{disabled:!this.roleService.coa().edit}):n.label==="Delete"?y(C({},n),{disabled:!this.roleService.coa().delete}):y(C({},n),{disabled:!1})))}onNodeDrop(e){let{dragNode:i,dropNode:n}=e;this._coaTypesService.updateParentCategory(i.key,{ParentID:n.key}).pipe(A(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let i=e.target;this.renameNode(i.value);let n=this._findNodeByKey(this.selectedCategory?.key);n&&delete n.type}handleEditKeydown(e){let i=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(i.value);let n=this._findNodeByKey(this.selectedCategory?.key);n&&(delete n.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,i){e.expanded=i,e.children?.forEach(n=>this._expandRecursive(n,i))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type",8,"page"]],viewQuery:function(i,n){if(i&1&&(pe(tr,5),pe(ir,5)),i&2){let o;j(o=Z())&&(n.editInputRef=o.first),j(o=Z())&&(n.treeComponent=o.first)}},features:[he([yi])],attrs:nr,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
159
159
  `,3,"scrollable"],["class","p-button","routerLink","add",4,"ngIf"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center","m-0"],[1,"col","p-0"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",1,"custom-tree-spacing",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","value","contextMenu","selection","draggableNodes","droppableNodes","propagateSelectionUp","propagateSelectionDown"],["pTemplate","edit"],["appendTo","body",3,"model"],["type","text",1,"form-control",3,"ngModelChange","keydown","blur","ngModel"]],template:function(i,n){i&1&&(a(0,"app-main-panel",5),u(1,rr,1,1,"ng-template",null,0,I)(3,lr,8,9,"ng-template",null,1,I),r()),i&2&&l("scrollable",!0)},dependencies:[$,$i,L,B,Xi,ht,Ae,F,O,Se,oe,Y,Je,K,Si,ce,se],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var sr=["class","page"],Dt=t=>({"is-invalid":t}),cr=t=>({"ng-invalid ng-dirty":t});function mr(t,s){if(t&1){let e=w();a(0,"div",3)(1,"p-button",4),S("onClick",function(){_(e);let n=m();return g(n.goBack())}),r(),a(2,"p-button",5),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}}function pr(t,s){t&1&&(a(0,"div",20),p(1," Name is required "),r())}function dr(t,s){t&1&&(a(0,"div",20),p(1," Code is required "),r())}function ur(t,s){t&1&&(a(0,"div",20),p(1," Note is required "),r())}function fr(t,s){if(t&1&&(a(0,"div")(1,"span",22),p(2),r()()),t&2){let e=s.$implicit;c(2),E(e)}}function _r(t,s){if(t&1&&(a(0,"div"),u(1,fr,3,1,"div",21),r()),t&2){let e=m(2);c(),l("ngForOf",e.getErrors("Category"))}}function gr(t,s){if(t&1){let e=w();a(0,"p-panel")(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"label",11),p(7,"Name"),r(),h(8,"input",12),u(9,pr,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),u(15,dr,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),u(21,ur,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),S("onFocus",function(){_(e);let n=m();return g(n.loadCategories())}),r(),u(27,_r,2,1,"div",19),r()()()()()()}if(t&2){let e=m();c(3),l("formGroup",e.form),c(5),l("ngClass",T(10,Dt,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),c(),l("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),c(5),l("ngClass",T(12,Dt,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),c(),l("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),c(5),l("ngClass",T(14,Dt,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),c(),l("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),c(5),l("ngClass",T(16,cr,e.isInvalid("Category")))("options",e.categories()),c(),l("ngIf",e.isInvalid("Category"))}}var Rt=(()=>{class t extends Gi{constructor(){super(...arguments),this.categories=v([]),this.COATypeService=x(me),this.COAService=x(X),this.info=v(null),this.route=x(ie),this.router=x(ne),this.fb=x(ve)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Kt([this.route.paramMap.pipe(G(e=>e.get("id")),Ke(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(V("fetchCOACategories"),D(([e,i])=>{let n=this.findNodeByKeyInArray(i,e);return this.categories.set(i),this.COATypeService.getCOACategoryByID({ID:e}).pipe(A(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:n.parent}),["Asset","Liability","Equity","Revenue","Expense"].includes(o.name)&&this.form.controls.Category.disable()}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(A(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new ri({Name:new N("",[fe.required]),Code:new N("",[]),Category:new N(null,[fe.required]),Note:new N("",[])})}findNodeByKeyInArray(e,i){for(let n of e){let o=this.findNodeByKey(n,i);if(o)return o}return null}findNodeByKey(e,i,n=null){if(e.key===i||e.label===i)return n&&(e.parent=n),e;if(e.children&&e.children.length>0)for(let o of e.children){let d=this.findNodeByKey(o,i,e);if(d)return d}return null}onSubmit(){let{Name:e,Code:i,Note:n,Category:o}=this.form.value,d=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(d=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:i,ParentID:d&&d.parent?d.parent.key:d.key,Note:n,ID:this.route.snapshot.params.id||null}):(d=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:i,ParentID:d&&d.parent?d.parent.key:d.key,Note:n}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(V("response"),A(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=Ge(t)))(n||t)}})()}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type-form",8,"page"]],features:[Oe],attrs:sr,decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Category Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["label","Cancel","variant","outlined","severity","secondary",3,"onClick"],["label","Submit",3,"onClick"],[1,"row","justify-content-center"],[1,"col"],[1,"row","row-gap-2",3,"formGroup"],[1,"ol-12","col-md-6","col-lg-6"],[1,"form-group","has-validation"],["for",""],["formControlName","Name",1,"form-control",3,"ngClass"],["id","validationServer03Feedback","class","invalid-feedback",4,"ngIf"],[1,"col-12","col-md-6","col-lg-6"],["formControlName","Code",1,"form-control",3,"ngClass"],["formControlName","Note","placeholder","Enter a description for this COA category","id","floatingTextarea2",1,"form-control",2,"height","100px",3,"ngClass"],[1,"form-group","has-validation","d-flex","flex-column"],["showClear","","placeholder","Select a Category","formControlName","Category",1,"ng-invalid","ng-dirty",3,"onFocus","ngClass","options"],[4,"ngIf"],["id","validationServer03Feedback",1,"invalid-feedback"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(i,n){i&1&&(a(0,"app-main-panel",2),u(1,mr,3,0,"ng-template",null,0,I)(3,gr,28,18,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,L,Pe,Ee,Te,oe,Y,ye,Ie,be,F,z,Ye,O,K,le,ae,ce,se],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return t})();var hr=t=>[t];function xr(t,s){if(t&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),t&2){let e=m(2);l("routerLink",T(1,hr,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function Cr(t,s){if(t&1&&(a(0,"div",6)(1,"div",7)(2,"p-card")(3,"div",8)(4,"div",9)(5,"div",10),p(6,"Name"),r(),a(7,"div",11),p(8),r()(),a(9,"div",9)(10,"div",10),p(11,"Code"),r(),a(12,"div",11),p(13),r()(),a(14,"div",9)(15,"div",10),p(16,"Category"),r(),a(17,"div",11),p(18),r()(),a(19,"div",9)(20,"div",10),p(21,"Note"),r(),a(22,"div",11),h(23,"div",12),r()()()()()()),t&2){let e=m(2);c(8),E(e.info().name),c(5),E(e.info().code),c(5),E(e.info().parentName),c(5),l("innerHTML",e.info().note,Me)}}function yr(t,s){t&1&&(H(0),a(1,"app-main-panel",3),u(2,xr,4,3,"ng-template",null,0,I)(4,Cr,24,4,"ng-template",null,1,I),r(),U())}var en=(()=>{class t{constructor(){this.COATypeService=x(me),this.route=x(ie),this.info=v(null)}ngOnInit(){this.route.queryParamMap.pipe(G(e=>e.get("ID")),D(e=>this.COATypeService.getCOACategoryByID({ID:e})),V("getCOACategoryByID"),A(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type-info"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],[4,"ngIf"],["pageTitle",`Type of Account Info
160
- `],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(i,n){i&1&&u(0,yr,6,0,"ng-container",2),i&2&&l("ngIf",n.info())},dependencies:[F,O,$,K,at,L,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ps=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:ji},{path:"account/add",component:Vt},{path:"account/import",loadComponent:()=>import("./chunk-CJMQPCRF.js").then(t=>t.CoaImportComponent)},{path:"account/:id",component:Hi},{path:"account/:id/edit",component:Vt},{path:"coa-types",component:Ji},{path:"coa-types/add",component:Rt},{path:"coa-types/info",component:en},{path:"coa-types/:id/edit",component:Rt}]}],Zi={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{Ps as CHART_OF_ACCOUNT_ROUTES,Zi as CHART_OF_ACCOUNT_ROUTE_PAGE};
160
+ `],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(i,n){i&1&&u(0,yr,6,0,"ng-container",2),i&2&&l("ngIf",n.info())},dependencies:[F,O,$,K,at,L,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ps=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:ji},{path:"account/add",component:Vt},{path:"account/import",loadComponent:()=>import("./chunk-XFOCD2H7.js").then(t=>t.CoaImportComponent)},{path:"account/:id",component:Hi},{path:"account/:id/edit",component:Vt},{path:"coa-types",component:Ji},{path:"coa-types/add",component:Rt},{path:"coa-types/info",component:en},{path:"coa-types/:id/edit",component:Rt}]}],Zi={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{Ps as CHART_OF_ACCOUNT_ROUTES,Zi as CHART_OF_ACCOUNT_ROUTE_PAGE};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-UOSXT5W7.js";import"./chunk-IGWIRCAS.js";import{d as n}from"./chunk-AOOG6YOT.js";import"./chunk-3UEIZQIL.js";import"./chunk-2MKKFLNJ.js";import"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{ia as e}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var a=(t,m)=>{let o=e(r),i=e(n),p=o.isAuthenticated(),s=!o.isTokenExpired(),u=o.checkAuthKeysExists();return p&&s&&u?(i.navigateByUrl("/pages/dashboard"),!1):!0};var C=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-3H2MG3RX.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-U5XXKH2H.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-CVL3S2HY.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6NX36ZC2.js").then(t=>t.TimeoutComponent)}];export{C as AuthenticationRoutes};
1
+ import{a as r}from"./chunk-Y3URGAXL.js";import"./chunk-IGWIRCAS.js";import{d as n}from"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{ia as e}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var a=(t,m)=>{let o=e(r),i=e(n),p=o.isAuthenticated(),s=!o.isTokenExpired(),u=o.checkAuthKeysExists();return p&&s&&u?(i.navigateByUrl("/pages/dashboard"),!1):!0};var C=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-4IHVNLEA.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-U5XXKH2H.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-CVL3S2HY.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6NX36ZC2.js").then(t=>t.TimeoutComponent)}];export{C as AuthenticationRoutes};
@@ -1 +1 @@
1
- import{a}from"./chunk-3UEIZQIL.js";import{ca as c,i as o,ia as n}from"./chunk-NMCKMUY4.js";import{a as i}from"./chunk-YQFG5XE2.js";var d=(()=>{class r{constructor(){this.httpService=n(a),this.categoryOptionsCache$=new o(1),this.isInitialized=!1}getChartOfAccountLoader(){return this.httpService.get("","api/ChartOfAccountLoader/GetPaginatedList")}getPaginatedChartAccounts(t){let e=i({},t);return this.httpService.post("","api/ChartOfAccount/GetPaginatedList",e,{observe:"body"})}getChartAccountForm(){return this.httpService.get("","api/ChartOfAccount/Form")}getChartAccountById(t){return this.httpService.get("",`api/ChartOfAccount/Info/${t}`)}getChartAccountFormById(t){return this.httpService.get("",`api/ChartOfAccount/Form/${t}`)}submitChartAccount(t,e={}){return this.httpService.post("","api/ChartOfAccount/Submit",t,e)}deleteChartAccount(t){if(t.length>1){let e={body:t};return this.httpService.delete("","api/ChartOfAccount/Batch",e)}else return this.httpService.delete("",`api/ChartOfAccount/${t[0]}`)}fetchCategoryOptions(){return this.httpService.get("","api/ChartOfAccount/CategoryOptions")}getCachedCategoriesOptions(){return this.isInitialized||(this.isInitialized=!0,this.fetchCategoryOptions().subscribe({next:t=>this.categoryOptionsCache$.next(t),error:t=>this.categoryOptionsCache$.error(t)})),this.categoryOptionsCache$.asObservable()}exportChartOfAccounts(t){return this.httpService.post(void 0,"api/ChartOfAccountExport/export",t,{observe:"response",responseType:"blob"})}importPreviewChartOfAccounts(t){return this.httpService.post(void 0,"api/chartofaccount/importpreview",t)}importConfirmChartOfAccounts(t){return this.httpService.post(void 0,"api/chartofaccount/importconfirm",t)}discountedChartAccounts(t,e){return this.httpService.put(void 0,`/api/ChartOfAccount/${t}/discontinued`,e)}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{d as a};
1
+ import{a}from"./chunk-OR5FLZPY.js";import{ca as c,i as o,ia as n}from"./chunk-NMCKMUY4.js";import{a as i}from"./chunk-YQFG5XE2.js";var d=(()=>{class r{constructor(){this.httpService=n(a),this.categoryOptionsCache$=new o(1),this.isInitialized=!1}getChartOfAccountLoader(){return this.httpService.get("","api/ChartOfAccountLoader/GetPaginatedList")}getPaginatedChartAccounts(t){let e=i({},t);return this.httpService.post("","api/ChartOfAccount/GetPaginatedList",e,{observe:"body"})}getChartAccountForm(){return this.httpService.get("","api/ChartOfAccount/Form")}getChartAccountById(t){return this.httpService.get("",`api/ChartOfAccount/Info/${t}`)}getChartAccountFormById(t){return this.httpService.get("",`api/ChartOfAccount/Form/${t}`)}submitChartAccount(t,e={}){return this.httpService.post("","api/ChartOfAccount/Submit",t,e)}deleteChartAccount(t){if(t.length>1){let e={body:t};return this.httpService.delete("","api/ChartOfAccount/Batch",e)}else return this.httpService.delete("",`api/ChartOfAccount/${t[0]}`)}fetchCategoryOptions(){return this.httpService.get("","api/ChartOfAccount/CategoryOptions")}getCachedCategoriesOptions(){return this.isInitialized||(this.isInitialized=!0,this.fetchCategoryOptions().subscribe({next:t=>this.categoryOptionsCache$.next(t),error:t=>this.categoryOptionsCache$.error(t)})),this.categoryOptionsCache$.asObservable()}exportChartOfAccounts(t){return this.httpService.post(void 0,"api/ChartOfAccountExport/export",t,{observe:"response",responseType:"blob"})}importPreviewChartOfAccounts(t){return this.httpService.post(void 0,"api/chartofaccount/importpreview",t)}importConfirmChartOfAccounts(t){return this.httpService.post(void 0,"api/chartofaccount/importconfirm",t)}discountedChartAccounts(t,e){return this.httpService.put(void 0,`/api/ChartOfAccount/${t}/discontinued`,e)}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{d as a};
@@ -1 +1 @@
1
- import{a as Fe,b as ke}from"./chunk-DJSX32J5.js";import{a as _e,b as ve,c as be,d as xe,e as Ce,f as ye}from"./chunk-XD7VHCRC.js";import"./chunk-NCDT6JPP.js";import{a as he}from"./chunk-XKI7WLHE.js";import{a as fe,b as ge}from"./chunk-EB6NEJHF.js";import{a as se}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import"./chunk-R7N6BWL5.js";import{a as oe,b as re}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as ue}from"./chunk-GVZFU3IL.js";import{b as ce,c as de}from"./chunk-VGNJD35F.js";import{a as pe,b as me}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as ie,o as ne,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as L,c as H,e as J,f as K,k as Q,l as W,m as X,n as Y,o as Z,u as ee,x as te}from"./chunk-OIBDX2CA.js";import{b as z,d as U}from"./chunk-AOOG6YOT.js";import"./chunk-3UEIZQIL.js";import"./chunk-2MKKFLNJ.js";import{h as B,j as $,k as j,s as q}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as O,Bb as P,Db as f,Dc as v,Ec as b,Ha as A,Lb as a,Ob as _,Pb as y,Rb as F,Rc as T,Tb as k,Ub as M,Vb as i,Vc as V,Wb as n,Xb as g,Y as I,_ as C,ec as w,fc as d,hb as r,ia as c,qa as G,ra as E,rc as h,sc as S,tc as R,ua as N,xb as D}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var Ie=()=>({height:"calc(100vh - 70px)"}),Ge=t=>({"ng-invalid ng-dirty":t}),Me=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ee(t,l){if(t&1){let e=O();i(0,"p-button",4),w("onClick",function(){G(e);let p=d(2);return E(p.onSubmit())}),n()}}function Ne(t,l){if(t&1&&f(0,Ee,1,0,"p-button",3),t&2){let e=d();a("ngIf",e.roleService.user().edit)}}function Ae(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),S(e)}}function De(t,l){if(t&1&&(i(0,"div"),f(1,Ae,3,1,"div",15),n()),t&2){let e=d(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Se)),a("binary",!0),r(2),R(" ",e.get("name").value," ")}}function Oe(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),k(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=d(3);a("formGroupName",o),r(4),S(e.get("groupName").value),r(),_(v(5,Se)),a("binary",!0),r(3),M(p.getRolesArray(o).controls)}}function we(t,l){if(t&1&&(i(0,"div",17),k(1,Oe,10,6,"div",18,F),n()),t&2){let e=d(2);r(),M(e.rolesFormArray.controls)}}function Re(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,De,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,we,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=d();_(v(13,Ie)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ge,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),y(b(16,Me,e.router.url.includes("forms"))),r(2),y(b(18,Me,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var ut=(()=>{class t extends he{constructor(){super(...arguments),this.service=c(Fe),this.fb=c(ee),this.cdr=c(V),this.route=c(z),this.router=c(U),this.roleService=c(se),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[H.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(I(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(C(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user().edit}),description:this.fb.control(m.description||"")}))),u=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Te=s.controls.every(m=>m.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.user().edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);u.get("groupChecked").setValue(m,{emitEvent:!1})}),o.push(u)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(s=>{s.get("checked").value&&e.push(s.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(C(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=N(t)))(p||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row","align-items-stretch",3,"formGroupName"],[1,"col-2","py-2","border-top","border-bottom","border-start","d-flex","justify-content-between",2,"background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],["size","small","formControlName","groupChecked",3,"binary"],[1,"col","p-0"],["formArrayName","roles",1,"roles-grid","h-100"],["tooltipPosition","top",1,"role-cell",3,"formGroupName","pTooltip"],[1,"py-2","d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,p){o&1&&(i(0,"app-main-panel",2),f(1,Ne,1,1,"ng-template",null,0,T)(3,Re,19,20,"ng-template",null,1,T),n()),o&2&&a("overflowScroll",!0)},dependencies:[ue,re,oe,te,Q,L,J,K,W,Z,X,Y,q,B,$,j,ne,ie,ye,Ce,xe,be,_e,ve,ge,fe,le,ae,ke,me,pe,de,ce],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-checkbox{display:flex!important}[_nghost-%COMP%] .p-tabs .p-tab{padding-left:0!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}.roles-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr)}.role-cell[_ngcontent-%COMP%]{border:1px solid #ddd;border-top:none;border-left:none;background:#fff}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(-n+4){border-top:1px solid #ddd}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #ddd}"],changeDetection:0})}}return t})();export{ut as GroupFormComponent};
1
+ import{a as Fe,b as ke}from"./chunk-NPAM3NOH.js";import{a as _e,b as ve,c as be,d as xe,e as Ce,f as ye}from"./chunk-XD7VHCRC.js";import"./chunk-NCDT6JPP.js";import{a as he}from"./chunk-XKI7WLHE.js";import{a as fe,b as ge}from"./chunk-EB6NEJHF.js";import{a as se}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import"./chunk-R7N6BWL5.js";import{a as oe,b as re}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as ue}from"./chunk-WKE2HPSD.js";import{b as ce,c as de}from"./chunk-VGNJD35F.js";import{a as pe,b as me}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as ie,o as ne,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as L,c as H,e as J,f as K,k as Q,l as W,m as X,n as Y,o as Z,u as ee,x as te}from"./chunk-OIBDX2CA.js";import{b as z,d as U}from"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{h as B,j as $,k as j,s as q}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as O,Bb as P,Db as f,Dc as v,Ec as b,Ha as A,Lb as a,Ob as _,Pb as y,Rb as F,Rc as T,Tb as k,Ub as M,Vb as i,Vc as V,Wb as n,Xb as g,Y as I,_ as C,ec as w,fc as d,hb as r,ia as c,qa as G,ra as E,rc as h,sc as S,tc as R,ua as N,xb as D}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var Ie=()=>({height:"calc(100vh - 70px)"}),Ge=t=>({"ng-invalid ng-dirty":t}),Me=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ee(t,l){if(t&1){let e=O();i(0,"p-button",4),w("onClick",function(){G(e);let p=d(2);return E(p.onSubmit())}),n()}}function Ne(t,l){if(t&1&&f(0,Ee,1,0,"p-button",3),t&2){let e=d();a("ngIf",e.roleService.user().edit)}}function Ae(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),S(e)}}function De(t,l){if(t&1&&(i(0,"div"),f(1,Ae,3,1,"div",15),n()),t&2){let e=d(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Se)),a("binary",!0),r(2),R(" ",e.get("name").value," ")}}function Oe(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),k(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=d(3);a("formGroupName",o),r(4),S(e.get("groupName").value),r(),_(v(5,Se)),a("binary",!0),r(3),M(p.getRolesArray(o).controls)}}function we(t,l){if(t&1&&(i(0,"div",17),k(1,Oe,10,6,"div",18,F),n()),t&2){let e=d(2);r(),M(e.rolesFormArray.controls)}}function Re(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,De,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,we,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=d();_(v(13,Ie)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ge,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),y(b(16,Me,e.router.url.includes("forms"))),r(2),y(b(18,Me,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var ut=(()=>{class t extends he{constructor(){super(...arguments),this.service=c(Fe),this.fb=c(ee),this.cdr=c(V),this.route=c(z),this.router=c(U),this.roleService=c(se),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[H.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(I(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(C(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user().edit}),description:this.fb.control(m.description||"")}))),u=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Te=s.controls.every(m=>m.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.user().edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);u.get("groupChecked").setValue(m,{emitEvent:!1})}),o.push(u)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(s=>{s.get("checked").value&&e.push(s.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(C(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=N(t)))(p||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row","align-items-stretch",3,"formGroupName"],[1,"col-2","py-2","border-top","border-bottom","border-start","d-flex","justify-content-between",2,"background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],["size","small","formControlName","groupChecked",3,"binary"],[1,"col","p-0"],["formArrayName","roles",1,"roles-grid","h-100"],["tooltipPosition","top",1,"role-cell",3,"formGroupName","pTooltip"],[1,"py-2","d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,p){o&1&&(i(0,"app-main-panel",2),f(1,Ne,1,1,"ng-template",null,0,T)(3,Re,19,20,"ng-template",null,1,T),n()),o&2&&a("overflowScroll",!0)},dependencies:[ue,re,oe,te,Q,L,J,K,W,Z,X,Y,q,B,$,j,ne,ie,ye,Ce,xe,be,_e,ve,ge,fe,le,ae,ke,me,pe,de,ce],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-checkbox{display:flex!important}[_nghost-%COMP%] .p-tabs .p-tab{padding-left:0!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}.roles-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr)}.role-cell[_ngcontent-%COMP%]{border:1px solid #ddd;border-top:none;border-left:none;background:#fff}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(-n+4){border-top:1px solid #ddd}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #ddd}"],changeDetection:0})}}return t})();export{ut as GroupFormComponent};
@@ -1 +1 @@
1
- import{a as V,b as oe}from"./chunk-ECB5EIQL.js";import"./chunk-X5TFTF7J.js";import{a as te,b as ie}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as K,b as Q}from"./chunk-VJ3IBUVO.js";import{a as ne,b as re}from"./chunk-36OX4S7M.js";import{b as ee}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as $}from"./chunk-GVZFU3IL.js";import"./chunk-VGNJD35F.js";import{a as Y,b as Z}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as U,x as X}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as G,j as H,w as q}from"./chunk-OIBDX2CA.js";import"./chunk-3UEIZQIL.js";import{a as A}from"./chunk-2MKKFLNJ.js";import{n as z,s as R}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as h,Cc as j,Db as L,Dc as F,Ha as b,Lb as u,Nc as T,Ob as S,Oc as P,Rc as M,Vb as r,W as E,Wb as o,Xb as C,Y as B,_ as W,ec as f,fc as m,h as J,hb as s,ia as x,qa as l,ra as p,rc as _,s as y,sa as I,ta as N,wc as c,xb as O,xc as g,yc as d}from"./chunk-NMCKMUY4.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
1
+ import{a as V,b as oe}from"./chunk-YZH7Y43Y.js";import"./chunk-DFGIXWZK.js";import{a as te,b as ie}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as K,b as Q}from"./chunk-VJ3IBUVO.js";import{a as ne,b as re}from"./chunk-36OX4S7M.js";import{b as ee}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as $}from"./chunk-WKE2HPSD.js";import"./chunk-VGNJD35F.js";import{a as Y,b as Z}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as U,x as X}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as G,j as H,w as q}from"./chunk-OIBDX2CA.js";import"./chunk-OR5FLZPY.js";import{a as A}from"./chunk-2MKKFLNJ.js";import{n as z,s as R}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as h,Cc as j,Db as L,Dc as F,Ha as b,Lb as u,Nc as T,Ob as S,Oc as P,Rc as M,Vb as r,W as E,Wb as o,Xb as C,Y as B,_ as W,ec as f,fc as m,h as J,hb as s,ia as x,qa as l,ra as p,rc as _,s as y,sa as I,ta as N,wc as c,xb as O,xc as g,yc as d}from"./chunk-NMCKMUY4.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
@@ -0,0 +1 @@
1
+ import{a as A}from"./chunk-ETHACYOI.js";import{a as Me}from"./chunk-FMHGC2MA.js";import{a as ne}from"./chunk-Y3URGAXL.js";import{b as Ae}from"./chunk-DFGIXWZK.js";import{a as Re}from"./chunk-XKI7WLHE.js";import"./chunk-IGWIRCAS.js";import{a as M,b as P}from"./chunk-3A4BFUGD.js";import{d as Je,i as De,j as ke,k as Ne}from"./chunk-EL5BUFMO.js";import{a as Ee,b as Ie}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import{a as Fe,b as Ve}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as je,h as Te}from"./chunk-WKE2HPSD.js";import{b as we,c as ye}from"./chunk-VGNJD35F.js";import{a as ge,b as he}from"./chunk-2XUSZCQL.js";import{a as w,b as xe,c as be,d as Se,e as Ce,f as ve}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as ue,o as ce,w as fe,x as _e}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as oe,e as re,f as ae,k as le,l as me,o as pe,u as se,x as de}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{h as X,j as Y,k as Z,p as ee,q as te,s as ie}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as j,Bb as L,Cc as Q,Db as g,Ec as E,Ha as D,Lb as s,Nc as I,Oc as $,Pc as R,Rc as C,Vb as a,Wb as r,Xb as b,Y as J,_ as H,bd as y,c as F,cb as B,db as G,ec as T,fc as f,hb as m,ia as v,qa as h,ra as x,rc as p,s as V,sc as S,tc as k,vc as W,wc as K,xb as U,xc as N,yc as q}from"./chunk-NMCKMUY4.js";import{a as d,b as c}from"./chunk-YQFG5XE2.js";var Oe={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},z=xe(ve(Oe),be(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))})),Ce(t=>{let l=v(A);return{updateFilter(n){w(t,i=>c(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!0}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onRowUnselect(n){w(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!1}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){w(t,i=>{let o=i.data.data.map(u=>c(d({},u),{checked:n}));return c(d({},i),{data:c(d({},i.data),{data:o})})})},getGJAdjustmentLoader:M(F(J(()=>l.getGJAdjustmentLoader().pipe(P({next:n=>{w(t,i=>c(d({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:M(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(d({},i),{data:i.data.map(o=>c(d({},o),{checked:!1}))})),P({next:i=>{w(t,o=>c(d({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Se(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function He(t,l){if(t&1){let e=j();a(0,"p-button",10),T("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function Be(t,l){if(t&1&&g(0,He,1,0,"p-button",9),t&2){let e=f();s("ngIf",e.store.hasCheckedRows())}}function Ge(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",18),r())}function Ue(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",20),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",21),r(),a(20,"td"),b(21,"p-button",22),r()()),t&2){let e=l.$implicit,n=f(2);m(2),s("value",e),m(2),S(e.outlet),m(2),s("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,G),m(),k(" ",e.number," "),m(2),S(R(10,12,e.date,"d MMM y")),m(3),S($(13,15,e.quantitySUM)),m(3),S(e.type),m(2),S(e.state),m(2),s("innerHTML",e.note,B),m(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Le(t,l){if(t&1&&p(0),t&2){let e=f(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function We(t,l){t&1&&(a(0,"tr")(1,"td",23)(2,"span"),p(3,"No records found."),r()()())}function Ke(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),T("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,Ge,18,0,"ng-template",null,3,C)(4,Ue,22,17,"ng-template",null,4,C)(6,Le,1,3,"ng-template",null,5,C)(8,We,4,0,"ng-template",null,6,C),r()()}if(t&2){let e=f();m(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function qe(t,l){if(t&1&&(a(0,"span",33),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;s("pTooltip",e.name),m(),k(" ",R(2,2,e.name,30)," ")}}function Qe(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function $e(t,l){if(t&1&&(a(0,"div"),g(1,Qe,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("from"))}}function Xe(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function Ye(t,l){if(t&1&&(a(0,"div"),g(1,Xe,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("to"))}}function Ze(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function et(t,l){if(t&1&&(a(0,"div"),g(1,Ze,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("pageSize"))}}function tt(t,l){if(t&1&&(a(0,"form",24)(1,"div",25)(2,"label",26),p(3,"Outlet"),r(),a(4,"p-select",27),g(5,qe,3,5,"ng-template",null,7,C),r()(),a(7,"div",25)(8,"label",26),p(9,"From - To"),r(),a(10,"div",28),b(11,"p-datepicker",29),g(12,$e,2,1,"div",30),b(13,"p-datepicker",31),g(14,Ye,2,1,"div",30),r()(),a(15,"div",25)(16,"label",26),p(17,"Page Size"),r(),b(18,"input",32),g(19,et,2,1,"div",30),r()()),t&2){let e=f();s("formGroup",e.form),m(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),s("iconDisplay","input")("showIcon",!0)("ngClass",E(13,O,e.isInvalid("from"))),m(),s("ngIf",e.isInvalid("from")),m(),s("iconDisplay","input")("showIcon",!0)("ngClass",E(15,O,e.isInvalid("to"))),m(),s("ngIf",e.isInvalid("to")),m(4),s("ngClass",E(17,O,e.isInvalid("pageSize"))),m(),s("ngIf",e.isInvalid("pageSize"))}}var Ht=(()=>{class t extends Re{constructor(){super(),this.store=v(z),this.generateJournalService=v(A),this.authService=v(ne),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=v(se),this.dayjsService=v(Ae)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,pageSize:u,export:_,exportPageNumber:Pe,exportPageSize:ze}=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),pageSize:this.fb.control(u),export:this.fb.control(_),exportPageNumber:this.fb.control(Pe),exportPageSize:this.fb.control(ze)})}onSearch(e){this.store.updateFilter(c(d({},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(d({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(H(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-adjustment-journal"]],features:[Q([z]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[2,"width","4rem"],[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"],[1,"d-flex","flex-column","gap-2"],["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","appMaskNumber","",3,"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),q("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),T("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,Be,1,1,"ng-template",null,0,C)(3,Ke,10,5,"ng-template",null,1,C)(5,tt,20,19,"ng-template",null,2,C),r()}n&2&&(s("isSearchableInput",!0)("isFilterable",!0),K("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Te,Ne,Je,De,ke,ie,X,Y,Z,te,ee,he,ge,_e,fe,Ie,Ee,Ve,Fe,de,le,oe,re,ae,me,pe,ce,ue,je,ye,we,Me],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Ht as AdjustmentJournalComponent};
@@ -1 +1 @@
1
- import{c as rt}from"./chunk-3UEIZQIL.js";import{ca as it}from"./chunk-NMCKMUY4.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{c as rt}from"./chunk-OR5FLZPY.js";import{ca as it}from"./chunk-NMCKMUY4.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};