dealposbooks 6.1.0 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/{chunk-5FVLV36I.js → chunk-2LLPIDXP.js} +1 -1
  2. package/{chunk-HFBOGVOC.js → chunk-2PCXAGSU.js} +1 -1
  3. package/{chunk-4PQV7T7O.js → chunk-2T56LR43.js} +1 -1
  4. package/{chunk-K7BIGLIP.js → chunk-4O2T3UUJ.js} +1 -1
  5. package/{chunk-3KN63HEO.js → chunk-53UUIW6G.js} +1 -1
  6. package/{chunk-CTGNW5L6.js → chunk-557RGH7O.js} +1 -1
  7. package/{chunk-SGZKLLJ3.js → chunk-5FNHLN4I.js} +1 -1
  8. package/{chunk-QZUOIZEL.js → chunk-5S7UZVNC.js} +1 -1
  9. package/{chunk-UG22TPCX.js → chunk-7L7ZGQPV.js} +1 -1
  10. package/{chunk-2ISYUFG4.js → chunk-A2IU7XDU.js} +1 -1
  11. package/{chunk-TFWPK5J7.js → chunk-AAWSMVGG.js} +1 -1
  12. package/{chunk-23GVTAWH.js → chunk-ARBPTNVY.js} +2 -2
  13. package/{chunk-4P2FBAEV.js → chunk-DCHCLRHQ.js} +1 -1
  14. package/{chunk-57ZAKRGI.js → chunk-DTMRPQCT.js} +1 -1
  15. package/{chunk-C6FMCO33.js → chunk-EA5XKMOD.js} +1 -1
  16. package/{chunk-NF2REGV3.js → chunk-EFVUXO6C.js} +1 -1
  17. package/{chunk-54DASCAO.js → chunk-EXSJWIHK.js} +2 -2
  18. package/{chunk-LPQEYBQJ.js → chunk-FVZSSGLW.js} +1 -1
  19. package/{chunk-XZGQHWLM.js → chunk-G47TGGKM.js} +1 -1
  20. package/{chunk-VTWVZP43.js → chunk-H7NQQUEN.js} +1 -1
  21. package/{chunk-U7VHSRLR.js → chunk-HJBXJPMR.js} +1 -1
  22. package/{chunk-7YZVZ5BS.js → chunk-HJFIULX7.js} +1 -1
  23. package/{chunk-FN42URZ3.js → chunk-HUXMG5OD.js} +1 -1
  24. package/{chunk-XRSMVQPC.js → chunk-IGKIW34O.js} +1 -1
  25. package/{chunk-3YEWFLAB.js → chunk-IJEKBDUV.js} +1 -1
  26. package/{chunk-WNU7SPEQ.js → chunk-IOMTH2KS.js} +1 -1
  27. package/{chunk-3MU7BZQU.js → chunk-IUZTFGKU.js} +1 -1
  28. package/{chunk-N5VERGYS.js → chunk-K3TWJYF3.js} +1 -1
  29. package/{chunk-ZUVAI5XZ.js → chunk-KN3RHLBU.js} +1 -1
  30. package/{chunk-RECDKMMV.js → chunk-LDIJUGXA.js} +1 -1
  31. package/{chunk-CYXK442Y.js → chunk-LJ7A7PEL.js} +1 -1
  32. package/{chunk-5L65JV3Z.js → chunk-LKFEAG7Z.js} +1 -1
  33. package/{chunk-MLJIFWTK.js → chunk-LXY7JCAD.js} +1 -1
  34. package/{chunk-F5KRTO45.js → chunk-MNPNZBAC.js} +1 -1
  35. package/chunk-MSS4ABS2.js +1 -0
  36. package/{chunk-YG2CG5KO.js → chunk-O7BZS7EM.js} +2 -2
  37. package/{chunk-T2VQD2QW.js → chunk-P2TXZVKA.js} +1 -1
  38. package/{chunk-UYZEPPQA.js → chunk-P4PC66ZM.js} +1 -1
  39. package/{chunk-XOVBJ4EV.js → chunk-P55NY6ZS.js} +1 -1
  40. package/{chunk-VU37VDEH.js → chunk-P5IEYFQS.js} +1 -1
  41. package/{chunk-FVGNCLOK.js → chunk-P7RJNJL5.js} +1 -1
  42. package/{chunk-FUUUWWNE.js → chunk-Q3P547NE.js} +1 -1
  43. package/{chunk-WRDVJWTP.js → chunk-QECCYIYA.js} +1 -1
  44. package/{chunk-S2HC6Q76.js → chunk-QJJCNKD5.js} +1 -1
  45. package/{chunk-NZSJRTRD.js → chunk-RISAUKQA.js} +1 -1
  46. package/{chunk-K5J6NUJE.js → chunk-THFTALBJ.js} +1 -1
  47. package/{chunk-WRIMBWE3.js → chunk-TQIT2RDG.js} +1 -1
  48. package/{chunk-EX4CZ2IJ.js → chunk-U26CR2OO.js} +1 -1
  49. package/{chunk-NJPIJBIH.js → chunk-VFVVBGKX.js} +1 -1
  50. package/{chunk-TPC2WBCZ.js → chunk-VMNRU36K.js} +1 -1
  51. package/{chunk-5GRB6DBD.js → chunk-VW4UPUOQ.js} +1 -1
  52. package/{chunk-7BF6SRB6.js → chunk-W4K27G2X.js} +1 -1
  53. package/{chunk-DPPBBVUJ.js → chunk-Y6IASXHY.js} +1 -1
  54. package/{chunk-IYF3XQOZ.js → chunk-YQVFSGHO.js} +1 -1
  55. package/{chunk-GQGDL2PY.js → chunk-YY4RNU5O.js} +1 -1
  56. package/{chunk-DV6F4QO2.js → chunk-ZENRUPP3.js} +1 -1
  57. package/index.html +2 -2
  58. package/{main-SLOJLSEN.js → main-Q6OXUOM2.js} +1 -1
  59. package/package.json +1 -1
  60. package/chunk-ADDLKMW6.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as xt}from"./chunk-MTPMCC6U.js";import{a as kt,i as Et}from"./chunk-3BPX4XM7.js";import{H as Ee,I as wt,J as Dt,K as It,a as Q,b as Ie,c as ie,d as L,f as gt,g as He,h as Ae,k as ht,l as ft,o as ne,r as ke,s as Ct,t as bt,v as yt,w as vt,y as Tt,z as Mt}from"./chunk-U2ZZPRP6.js";import{Ka as Oe,S as dt,V as Se,Xa as ut,Ya as R,Z as Fe,Za as Be,ab as De,b as at,ca as Pe,da as Ve,e as lt,ga as pt,j as st,ja as ct,na as Le,qa as mt,va as _t,x as rt,xa as we}from"./chunk-OQDKL2MG.js";import{c as ot}from"./chunk-WNU7SPEQ.js";import{i as Te,l as it,m as nt,n as Me,t as te,x as se}from"./chunk-ISLNIBSF.js";import{$ as W,$b as f,Ab as p,Ac as Ue,Bc as Je,Cc as et,Da as T,Ic as J,Ja as We,Jb as D,Jc as tt,Kc as fe,Mb as I,Nb as k,Sb as l,Sc as Ce,Tb as c,Tc as be,Ub as m,Vb as F,Wb as Y,Wc as P,Xb as q,Yb as G,Zb as K,_ as pe,_b as U,_c as ee,ac as v,ad as xe,ba as ce,bb as Ze,bc as _e,bd as g,da as y,db as s,fc as C,fd as ye,gc as r,hc as ue,ic as ae,jc as ge,ka as _,kc as Ye,la as u,lc as b,ld as h,ma as H,mc as x,md as ve,pa as Xe,qc as V,rc as qe,sa as A,sc as Ge,ta as je,tc as N,ub as z,uc as M,vb as $,vc as le,wa as Z,wb as $e,wc as he,xc as Ke,yb as me,za as Qe,zb as S}from"./chunk-T6YHDD6J.js";import{a as E,b as ze}from"./chunk-PRARYYF3.js";var jt=["data-p-icon","window-maximize"],zt=(()=>{class t extends ke{pathId;onInit(){this.pathId="url(#"+Q()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["","data-p-icon","window-maximize"]],features:[S],attrs:jt,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14ZM9.77805 7.42192C9.89013 7.534 10.0415 7.59788 10.2 7.59995C10.3585 7.59788 10.5099 7.534 10.622 7.42192C10.7341 7.30985 10.798 7.15844 10.8 6.99995V3.94242C10.8066 3.90505 10.8096 3.86689 10.8089 3.82843C10.8079 3.77159 10.7988 3.7157 10.7824 3.6623C10.756 3.55552 10.701 3.45698 10.622 3.37798C10.5099 3.2659 10.3585 3.20202 10.2 3.19995H7.00002C6.84089 3.19995 6.68828 3.26317 6.57576 3.37569C6.46324 3.48821 6.40002 3.64082 6.40002 3.79995C6.40002 3.95908 6.46324 4.11169 6.57576 4.22422C6.68828 4.33674 6.84089 4.39995 7.00002 4.39995H8.80006L6.19997 7.00005C6.10158 7.11005 6.04718 7.25246 6.04718 7.40005C6.04718 7.54763 6.10158 7.69004 6.19997 7.80005C6.30202 7.91645 6.44561 7.98824 6.59997 8.00005C6.75432 7.98824 6.89791 7.91645 6.99997 7.80005L9.60002 5.26841V6.99995C9.6021 7.15844 9.66598 7.30985 9.77805 7.42192ZM1.4 14H3.8C4.17066 13.9979 4.52553 13.8498 4.78763 13.5877C5.04973 13.3256 5.1979 12.9707 5.2 12.6V10.2C5.1979 9.82939 5.04973 9.47452 4.78763 9.21242C4.52553 8.95032 4.17066 8.80215 3.8 8.80005H1.4C1.02934 8.80215 0.674468 8.95032 0.412371 9.21242C0.150274 9.47452 0.00210008 9.82939 0 10.2V12.6C0.00210008 12.9707 0.150274 13.3256 0.412371 13.5877C0.674468 13.8498 1.02934 13.9979 1.4 14ZM1.25858 10.0586C1.29609 10.0211 1.34696 10 1.4 10H3.8C3.85304 10 3.90391 10.0211 3.94142 10.0586C3.97893 10.0961 4 10.147 4 10.2V12.6C4 12.6531 3.97893 12.704 3.94142 12.7415C3.90391 12.779 3.85304 12.8 3.8 12.8H1.4C1.34696 12.8 1.29609 12.779 1.25858 12.7415C1.22107 12.704 1.2 12.6531 1.2 12.6V10.2C1.2 10.147 1.22107 10.0961 1.25858 10.0586Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(H(),Y(0,"g"),G(1,"path",0),q(),Y(2,"defs")(3,"clipPath",1),G(4,"rect",2),q()()),n&2&&(D("clip-path",i.pathId),s(3),_e("id",i.pathId))},encapsulation:2})}return t})();var Qt=["data-p-icon","window-minimize"],St=(()=>{class t extends ke{pathId;onInit(){this.pathId="url(#"+Q()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["","data-p-icon","window-minimize"]],features:[S],attrs:Qt,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0ZM6.368 7.952C6.44137 7.98326 6.52025 7.99958 6.6 8H9.8C9.95913 8 10.1117 7.93678 10.2243 7.82426C10.3368 7.71174 10.4 7.55913 10.4 7.4C10.4 7.24087 10.3368 7.08826 10.2243 6.97574C10.1117 6.86321 9.95913 6.8 9.8 6.8H8.048L10.624 4.224C10.73 4.11026 10.7877 3.95982 10.7849 3.80438C10.7822 3.64894 10.7192 3.50063 10.6093 3.3907C10.4994 3.28077 10.3511 3.2178 10.1956 3.21506C10.0402 3.21232 9.88974 3.27002 9.776 3.376L7.2 5.952V4.2C7.2 4.04087 7.13679 3.88826 7.02426 3.77574C6.91174 3.66321 6.75913 3.6 6.6 3.6C6.44087 3.6 6.28826 3.66321 6.17574 3.77574C6.06321 3.88826 6 4.04087 6 4.2V7.4C6.00042 7.47975 6.01674 7.55862 6.048 7.632C6.07656 7.70442 6.11971 7.7702 6.17475 7.82524C6.2298 7.88029 6.29558 7.92344 6.368 7.952ZM1.4 8.80005H3.8C4.17066 8.80215 4.52553 8.95032 4.78763 9.21242C5.04973 9.47452 5.1979 9.82939 5.2 10.2V12.6C5.1979 12.9707 5.04973 13.3256 4.78763 13.5877C4.52553 13.8498 4.17066 13.9979 3.8 14H1.4C1.02934 13.9979 0.674468 13.8498 0.412371 13.5877C0.150274 13.3256 0.00210008 12.9707 0 12.6V10.2C0.00210008 9.82939 0.150274 9.47452 0.412371 9.21242C0.674468 8.95032 1.02934 8.80215 1.4 8.80005ZM3.94142 12.7415C3.97893 12.704 4 12.6531 4 12.6V10.2C4 10.147 3.97893 10.0961 3.94142 10.0586C3.90391 10.0211 3.85304 10 3.8 10H1.4C1.34696 10 1.29609 10.0211 1.25858 10.0586C1.22107 10.0961 1.2 10.147 1.2 10.2V12.6C1.2 12.6531 1.22107 12.704 1.25858 12.7415C1.29609 12.779 1.34696 12.8 1.4 12.8H3.8C3.85304 12.8 3.90391 12.779 3.94142 12.7415Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(H(),Y(0,"g"),G(1,"path",0),q(),Y(2,"defs")(3,"clipPath",1),G(4,"rect",2),q()()),n&2&&(D("clip-path",i.pathId),s(3),_e("id",i.pathId))},encapsulation:2})}return t})();var Ft=(()=>{class t extends ie{pFocusTrapDisabled=!1;platformId=y(We);document=y(Xe);firstHiddenFocusableElement;lastHiddenFocusableElement;onInit(){se(this.platformId)&&!this.pFocusTrapDisabled&&!this.firstHiddenFocusableElement&&!this.lastHiddenFocusableElement&&this.createHiddenFocusableElements()}onChanges(e){e.pFocusTrapDisabled&&se(this.platformId)&&(e.pFocusTrapDisabled.currentValue?this.removeHiddenFocusableElements():this.createHiddenFocusableElements())}removeHiddenFocusableElements(){this.firstHiddenFocusableElement&&this.firstHiddenFocusableElement.parentNode&&this.firstHiddenFocusableElement.parentNode.removeChild(this.firstHiddenFocusableElement),this.lastHiddenFocusableElement&&this.lastHiddenFocusableElement.parentNode&&this.lastHiddenFocusableElement.parentNode.removeChild(this.lastHiddenFocusableElement)}getComputedSelector(e){return`:not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])${e??""}`}createHiddenFocusableElements(){let n=i=>ct("span",{class:"p-hidden-accessible p-hidden-focusable",tabindex:"0",role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:i?.bind(this)});this.firstHiddenFocusableElement=n(this.onFirstHiddenElementFocus),this.lastHiddenFocusableElement=n(this.onLastHiddenElementFocus),this.firstHiddenFocusableElement.setAttribute("data-pc-section","firstfocusableelement"),this.lastHiddenFocusableElement.setAttribute("data-pc-section","lastfocusableelement"),this.el.nativeElement.prepend(this.firstHiddenFocusableElement),this.el.nativeElement.append(this.lastHiddenFocusableElement)}onFirstHiddenElementFocus(e){let{currentTarget:n,relatedTarget:i}=e,o=i===this.lastHiddenFocusableElement||!this.el.nativeElement?.contains(i)?mt(n.parentElement,":not(.p-hidden-focusable)"):this.lastHiddenFocusableElement;Le(o)}onLastHiddenElementFocus(e){let{currentTarget:n,relatedTarget:i}=e,o=i===this.firstHiddenFocusableElement||!this.el.nativeElement?.contains(i)?_t(n.parentElement,":not(.p-hidden-focusable)"):this.firstHiddenFocusableElement;Le(o)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275dir=$e({type:t,selectors:[["","pFocusTrap",""]],inputs:{pFocusTrapDisabled:[2,"pFocusTrapDisabled","pFocusTrapDisabled",h]},features:[S]})}return t})(),Pn=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=$({type:t});static \u0275inj=W({})}return t})();var Pt=`
1
+ import{a as xt}from"./chunk-MTPMCC6U.js";import{a as kt,i as Et}from"./chunk-3BPX4XM7.js";import{H as Ee,I as wt,J as Dt,K as It,a as Q,b as Ie,c as ie,d as L,f as gt,g as He,h as Ae,k as ht,l as ft,o as ne,r as ke,s as Ct,t as bt,v as yt,w as vt,y as Tt,z as Mt}from"./chunk-U2ZZPRP6.js";import{Ka as Oe,S as dt,V as Se,Xa as ut,Ya as R,Z as Fe,Za as Be,ab as De,b as at,ca as Pe,da as Ve,e as lt,ga as pt,j as st,ja as ct,na as Le,qa as mt,va as _t,x as rt,xa as we}from"./chunk-OQDKL2MG.js";import{c as ot}from"./chunk-IOMTH2KS.js";import{i as Te,l as it,m as nt,n as Me,t as te,x as se}from"./chunk-ISLNIBSF.js";import{$ as W,$b as f,Ab as p,Ac as Ue,Bc as Je,Cc as et,Da as T,Ic as J,Ja as We,Jb as D,Jc as tt,Kc as fe,Mb as I,Nb as k,Sb as l,Sc as Ce,Tb as c,Tc as be,Ub as m,Vb as F,Wb as Y,Wc as P,Xb as q,Yb as G,Zb as K,_ as pe,_b as U,_c as ee,ac as v,ad as xe,ba as ce,bb as Ze,bc as _e,bd as g,da as y,db as s,fc as C,fd as ye,gc as r,hc as ue,ic as ae,jc as ge,ka as _,kc as Ye,la as u,lc as b,ld as h,ma as H,mc as x,md as ve,pa as Xe,qc as V,rc as qe,sa as A,sc as Ge,ta as je,tc as N,ub as z,uc as M,vb as $,vc as le,wa as Z,wb as $e,wc as he,xc as Ke,yb as me,za as Qe,zb as S}from"./chunk-T6YHDD6J.js";import{a as E,b as ze}from"./chunk-PRARYYF3.js";var jt=["data-p-icon","window-maximize"],zt=(()=>{class t extends ke{pathId;onInit(){this.pathId="url(#"+Q()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["","data-p-icon","window-maximize"]],features:[S],attrs:jt,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14ZM9.77805 7.42192C9.89013 7.534 10.0415 7.59788 10.2 7.59995C10.3585 7.59788 10.5099 7.534 10.622 7.42192C10.7341 7.30985 10.798 7.15844 10.8 6.99995V3.94242C10.8066 3.90505 10.8096 3.86689 10.8089 3.82843C10.8079 3.77159 10.7988 3.7157 10.7824 3.6623C10.756 3.55552 10.701 3.45698 10.622 3.37798C10.5099 3.2659 10.3585 3.20202 10.2 3.19995H7.00002C6.84089 3.19995 6.68828 3.26317 6.57576 3.37569C6.46324 3.48821 6.40002 3.64082 6.40002 3.79995C6.40002 3.95908 6.46324 4.11169 6.57576 4.22422C6.68828 4.33674 6.84089 4.39995 7.00002 4.39995H8.80006L6.19997 7.00005C6.10158 7.11005 6.04718 7.25246 6.04718 7.40005C6.04718 7.54763 6.10158 7.69004 6.19997 7.80005C6.30202 7.91645 6.44561 7.98824 6.59997 8.00005C6.75432 7.98824 6.89791 7.91645 6.99997 7.80005L9.60002 5.26841V6.99995C9.6021 7.15844 9.66598 7.30985 9.77805 7.42192ZM1.4 14H3.8C4.17066 13.9979 4.52553 13.8498 4.78763 13.5877C5.04973 13.3256 5.1979 12.9707 5.2 12.6V10.2C5.1979 9.82939 5.04973 9.47452 4.78763 9.21242C4.52553 8.95032 4.17066 8.80215 3.8 8.80005H1.4C1.02934 8.80215 0.674468 8.95032 0.412371 9.21242C0.150274 9.47452 0.00210008 9.82939 0 10.2V12.6C0.00210008 12.9707 0.150274 13.3256 0.412371 13.5877C0.674468 13.8498 1.02934 13.9979 1.4 14ZM1.25858 10.0586C1.29609 10.0211 1.34696 10 1.4 10H3.8C3.85304 10 3.90391 10.0211 3.94142 10.0586C3.97893 10.0961 4 10.147 4 10.2V12.6C4 12.6531 3.97893 12.704 3.94142 12.7415C3.90391 12.779 3.85304 12.8 3.8 12.8H1.4C1.34696 12.8 1.29609 12.779 1.25858 12.7415C1.22107 12.704 1.2 12.6531 1.2 12.6V10.2C1.2 10.147 1.22107 10.0961 1.25858 10.0586Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(H(),Y(0,"g"),G(1,"path",0),q(),Y(2,"defs")(3,"clipPath",1),G(4,"rect",2),q()()),n&2&&(D("clip-path",i.pathId),s(3),_e("id",i.pathId))},encapsulation:2})}return t})();var Qt=["data-p-icon","window-minimize"],St=(()=>{class t extends ke{pathId;onInit(){this.pathId="url(#"+Q()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["","data-p-icon","window-minimize"]],features:[S],attrs:Qt,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0ZM6.368 7.952C6.44137 7.98326 6.52025 7.99958 6.6 8H9.8C9.95913 8 10.1117 7.93678 10.2243 7.82426C10.3368 7.71174 10.4 7.55913 10.4 7.4C10.4 7.24087 10.3368 7.08826 10.2243 6.97574C10.1117 6.86321 9.95913 6.8 9.8 6.8H8.048L10.624 4.224C10.73 4.11026 10.7877 3.95982 10.7849 3.80438C10.7822 3.64894 10.7192 3.50063 10.6093 3.3907C10.4994 3.28077 10.3511 3.2178 10.1956 3.21506C10.0402 3.21232 9.88974 3.27002 9.776 3.376L7.2 5.952V4.2C7.2 4.04087 7.13679 3.88826 7.02426 3.77574C6.91174 3.66321 6.75913 3.6 6.6 3.6C6.44087 3.6 6.28826 3.66321 6.17574 3.77574C6.06321 3.88826 6 4.04087 6 4.2V7.4C6.00042 7.47975 6.01674 7.55862 6.048 7.632C6.07656 7.70442 6.11971 7.7702 6.17475 7.82524C6.2298 7.88029 6.29558 7.92344 6.368 7.952ZM1.4 8.80005H3.8C4.17066 8.80215 4.52553 8.95032 4.78763 9.21242C5.04973 9.47452 5.1979 9.82939 5.2 10.2V12.6C5.1979 12.9707 5.04973 13.3256 4.78763 13.5877C4.52553 13.8498 4.17066 13.9979 3.8 14H1.4C1.02934 13.9979 0.674468 13.8498 0.412371 13.5877C0.150274 13.3256 0.00210008 12.9707 0 12.6V10.2C0.00210008 9.82939 0.150274 9.47452 0.412371 9.21242C0.674468 8.95032 1.02934 8.80215 1.4 8.80005ZM3.94142 12.7415C3.97893 12.704 4 12.6531 4 12.6V10.2C4 10.147 3.97893 10.0961 3.94142 10.0586C3.90391 10.0211 3.85304 10 3.8 10H1.4C1.34696 10 1.29609 10.0211 1.25858 10.0586C1.22107 10.0961 1.2 10.147 1.2 10.2V12.6C1.2 12.6531 1.22107 12.704 1.25858 12.7415C1.29609 12.779 1.34696 12.8 1.4 12.8H3.8C3.85304 12.8 3.90391 12.779 3.94142 12.7415Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(H(),Y(0,"g"),G(1,"path",0),q(),Y(2,"defs")(3,"clipPath",1),G(4,"rect",2),q()()),n&2&&(D("clip-path",i.pathId),s(3),_e("id",i.pathId))},encapsulation:2})}return t})();var Ft=(()=>{class t extends ie{pFocusTrapDisabled=!1;platformId=y(We);document=y(Xe);firstHiddenFocusableElement;lastHiddenFocusableElement;onInit(){se(this.platformId)&&!this.pFocusTrapDisabled&&!this.firstHiddenFocusableElement&&!this.lastHiddenFocusableElement&&this.createHiddenFocusableElements()}onChanges(e){e.pFocusTrapDisabled&&se(this.platformId)&&(e.pFocusTrapDisabled.currentValue?this.removeHiddenFocusableElements():this.createHiddenFocusableElements())}removeHiddenFocusableElements(){this.firstHiddenFocusableElement&&this.firstHiddenFocusableElement.parentNode&&this.firstHiddenFocusableElement.parentNode.removeChild(this.firstHiddenFocusableElement),this.lastHiddenFocusableElement&&this.lastHiddenFocusableElement.parentNode&&this.lastHiddenFocusableElement.parentNode.removeChild(this.lastHiddenFocusableElement)}getComputedSelector(e){return`:not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])${e??""}`}createHiddenFocusableElements(){let n=i=>ct("span",{class:"p-hidden-accessible p-hidden-focusable",tabindex:"0",role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:i?.bind(this)});this.firstHiddenFocusableElement=n(this.onFirstHiddenElementFocus),this.lastHiddenFocusableElement=n(this.onLastHiddenElementFocus),this.firstHiddenFocusableElement.setAttribute("data-pc-section","firstfocusableelement"),this.lastHiddenFocusableElement.setAttribute("data-pc-section","lastfocusableelement"),this.el.nativeElement.prepend(this.firstHiddenFocusableElement),this.el.nativeElement.append(this.lastHiddenFocusableElement)}onFirstHiddenElementFocus(e){let{currentTarget:n,relatedTarget:i}=e,o=i===this.lastHiddenFocusableElement||!this.el.nativeElement?.contains(i)?mt(n.parentElement,":not(.p-hidden-focusable)"):this.lastHiddenFocusableElement;Le(o)}onLastHiddenElementFocus(e){let{currentTarget:n,relatedTarget:i}=e,o=i===this.firstHiddenFocusableElement||!this.el.nativeElement?.contains(i)?_t(n.parentElement,":not(.p-hidden-focusable)"):this.firstHiddenFocusableElement;Le(o)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(t)))(i||t)}})();static \u0275dir=$e({type:t,selectors:[["","pFocusTrap",""]],inputs:{pFocusTrapDisabled:[2,"pFocusTrapDisabled","pFocusTrapDisabled",h]},features:[S]})}return t})(),Pn=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=$({type:t});static \u0275inj=W({})}return t})();var Pt=`
2
2
  .p-dialog {
3
3
  max-height: 90%;
4
4
  transform: scale(1);
@@ -1 +1 @@
1
- import{a as K}from"./chunk-SFVYLTAA.js";import{m as A}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as H,c as J}from"./chunk-R46SVYN4.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-BEEH5PAA.js";import{h as G}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as I,b as q}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as F,I as Z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{e as D,j as W,x as j}from"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as N}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{o as P,t as R}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as u,Ac as M,Bc as b,Cc as E,Dc as L,Ec as V,Fc as g,Mb as h,Nb as v,R as C,Sb as w,Sc as k,Tb as n,Tc as B,Ub as l,V as T,Wc as p,ac as f,da as m,db as S,fc as y,gc as r,ka as c,la as d,ub as z,vc as _,wa as x}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";function O(e,s){if(e&1){let t=f();n(0,"p-button",5),y("onClick",function(){c(t);let i=r(2),a=g(0);return d(i.onSaveTimezone(a))}),l()}}function Q(e,s){if(e&1&&h(0,O,1,0,"p-button",4),e&2){let t=r();v(t.roleService.permissions().accountingSetup.create||t.roleService.permissions().accountingSetup.edit?0:-1)}}function U(e,s){e&1&&(n(0,"div",9)(1,"div",10),_(2,"Timezone Configuration"),l(),n(3,"small",11),_(4,"Set the timezone to ensure that all journals and date filtering follow this timezone"),l()())}function X(e,s){if(e&1){let t=f();n(0,"p-panel"),u(1,U,5,0,"ng-template",null,2,p),n(3,"div",6)(4,"div",7)(5,"p-select",8),E("ngModelChange",function(i){c(t);let a=r();return b(a.selectedTimezone,i)||(a.selectedTimezone=i),d(i)}),l()()()()}if(e&2){let t=r(),o=g(0);S(5),M("ngModel",t.selectedTimezone),w("filter",!0)("fluid",!0)("options",o==null||o.options==null?null:o.options.timezones)("showClear",!0)}}var ge=(()=>{class e{constructor(){this.selectedTimezone=x(null),this.roleService=m(A),this.setupService=m(K),this.loader$=this.setupService.fetchLoaderConfiguration().pipe(T(t=>{this.selectedTimezone.set(t?.form?.timeZone||null)}),C(1)),this.toastr=m(N)}onSaveTimezone(t){let o=t.form;o.timeZone=this.selectedTimezone(),this.setupService.updateAccountingIntegrationConfiguration({form:o}).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=z({type:e,selectors:[["app-timezone"]],decls:7,vars:3,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Timezone"],["icon","fa-solid fa-floppy-disk","label","Save"],["icon","fa-solid fa-floppy-disk","label","Save",3,"onClick"],[1,"row"],[1,"col-6"],["appendTo","body","optionLabel","displayName","optionValue","id","placeholder","Select Timezone",3,"ngModelChange","ngModel","filter","fluid","options","showClear"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-normal","fs-4"],[1,"fst-italic","text-muted"]],template:function(o,i){o&1&&(L(0),k(1,"async"),n(2,"app-main-panel",3),u(3,Q,1,1,"ng-template",null,0,p)(5,X,6,5,"ng-template",null,1,p),l()),o&2&&V(B(1,0,i.loader$))},dependencies:[R,j,D,W,G,q,I,Z,F,J,H,P],encapsulation:2})}}return e})();export{ge as TimezoneComponent};
1
+ import{a as K}from"./chunk-SFVYLTAA.js";import{m as A}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as H,c as J}from"./chunk-R46SVYN4.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-BEEH5PAA.js";import{h as G}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as I,b as q}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as F,I as Z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{e as D,j as W,x as j}from"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as N}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{o as P,t as R}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as u,Ac as M,Bc as b,Cc as E,Dc as L,Ec as V,Fc as g,Mb as h,Nb as v,R as C,Sb as w,Sc as k,Tb as n,Tc as B,Ub as l,V as T,Wc as p,ac as f,da as m,db as S,fc as y,gc as r,ka as c,la as d,ub as z,vc as _,wa as x}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";function O(e,s){if(e&1){let t=f();n(0,"p-button",5),y("onClick",function(){c(t);let i=r(2),a=g(0);return d(i.onSaveTimezone(a))}),l()}}function Q(e,s){if(e&1&&h(0,O,1,0,"p-button",4),e&2){let t=r();v(t.roleService.permissions().accountingSetup.create||t.roleService.permissions().accountingSetup.edit?0:-1)}}function U(e,s){e&1&&(n(0,"div",9)(1,"div",10),_(2,"Timezone Configuration"),l(),n(3,"small",11),_(4,"Set the timezone to ensure that all journals and date filtering follow this timezone"),l()())}function X(e,s){if(e&1){let t=f();n(0,"p-panel"),u(1,U,5,0,"ng-template",null,2,p),n(3,"div",6)(4,"div",7)(5,"p-select",8),E("ngModelChange",function(i){c(t);let a=r();return b(a.selectedTimezone,i)||(a.selectedTimezone=i),d(i)}),l()()()()}if(e&2){let t=r(),o=g(0);S(5),M("ngModel",t.selectedTimezone),w("filter",!0)("fluid",!0)("options",o==null||o.options==null?null:o.options.timezones)("showClear",!0)}}var ge=(()=>{class e{constructor(){this.selectedTimezone=x(null),this.roleService=m(A),this.setupService=m(K),this.loader$=this.setupService.fetchLoaderConfiguration().pipe(T(t=>{this.selectedTimezone.set(t?.form?.timeZone||null)}),C(1)),this.toastr=m(N)}onSaveTimezone(t){let o=t.form;o.timeZone=this.selectedTimezone(),this.setupService.updateAccountingIntegrationConfiguration({form:o}).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=z({type:e,selectors:[["app-timezone"]],decls:7,vars:3,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Timezone"],["icon","fa-solid fa-floppy-disk","label","Save"],["icon","fa-solid fa-floppy-disk","label","Save",3,"onClick"],[1,"row"],[1,"col-6"],["appendTo","body","optionLabel","displayName","optionValue","id","placeholder","Select Timezone",3,"ngModelChange","ngModel","filter","fluid","options","showClear"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-normal","fs-4"],[1,"fst-italic","text-muted"]],template:function(o,i){o&1&&(L(0),k(1,"async"),n(2,"app-main-panel",3),u(3,Q,1,1,"ng-template",null,0,p)(5,X,6,5,"ng-template",null,1,p),l()),o&2&&V(B(1,0,i.loader$))},dependencies:[R,j,D,W,G,q,I,Z,F,J,H,P],encapsulation:2})}}return e})();export{ge as TimezoneComponent};
@@ -1 +1 @@
1
- import{a as L}from"./chunk-XMARGQLT.js";import{a as K}from"./chunk-MDCWCEZ7.js";import{a as Y,b as H}from"./chunk-Y54QBXKN.js";import{a as U}from"./chunk-TTIQSVQF.js";import{h as Q}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as W}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as O,y as A}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as R,c as k,e as z,f as G,p as P,q as V,v as B,y as q}from"./chunk-OQDKL2MG.js";import{b as w,d as J}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{i as M}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,C as h,F as T,J as b,Kc as N,Mb as x,Nb as _,Sb as a,T as g,Tb as n,Ub as o,V as v,Vb as m,Wc as y,ac as E,da as c,db as r,fc as j,gc as u,j as C,ka as S,la as I,ub as D,vc as l}from"./chunk-T6YHDD6J.js";import{a as d,b as f}from"./chunk-PRARYYF3.js";var X=t=>({"ng-invalid ng-dirty":t});function Z(t,s){if(t&1){let e=E();n(0,"div")(1,"p-button",3),j("onClick",function(){S(e);let p=u();return I(p.onSubmit())}),o()()}}function $(t,s){t&1&&(n(0,"div",22),l(1," Name is required "),o())}function ee(t,s){if(t&1&&(n(0,"div"),x(1,$,2,0,"div",22),o()),t&2){let e=u(2);r(),_(e.form.controls.name.errors.required?1:-1)}}function te(t,s){if(t&1&&(n(0,"p-panel",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"div",9)(6,"div",7)(7,"div",10)(8,"label",11),l(9,"Type Id"),o(),n(10,"div",12)(11,"div",13),m(12,"p-radiobutton",14),n(13,"label",15),l(14,"Generic"),o()(),n(15,"div",13),m(16,"p-radiobutton",16),n(17,"label",17),l(18,"Outlet"),o()()()(),m(19,"div",18),o(),n(20,"div",19)(21,"label",11),l(22,"Name"),o(),m(23,"input",20),x(24,ee,2,1,"div"),o()(),n(25,"div",9)(26,"div",19)(27,"label",11),l(28,"Description"),o(),m(29,"textarea",21),o()()()()()()()),t&2){let e=u();r(),a("formGroup",e.form),r(11),a("value",0),r(4),a("value",1),r(7),a("ngClass",N(6,X,e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched))),r(),_(e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched)?24:-1),r(5),a("autoResize",!0)}}var ye=(()=>{class t{constructor(){this.fb=c(B),this.journalTagService=c(L),this.route=c(w),this.router=c(J)}initForm(){console.log("Initializing form"),this.form=this.fb.group({name:this.fb.control("",[k.required]),description:this.fb.control(""),typeID:this.fb.control(!1)})}ngOnInit(){this.initForm(),this.route.queryParamMap.pipe(h(e=>e.has("id")),g(e=>this.journalTagService.journalTagGet(e.get("id"))),U("Query params"),v(e=>{console.log("Got journal tag:",e),this.form.patchValue({name:e.name,description:e.description})})).subscribe()}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=this.form.getRawValue();this.route.queryParamMap.pipe(b(1),g(i=>{let p=i.get("id");return p?this.journalTagService.journalTagUpdate(f(d({},e),{typeID:Number(e.typeID)}),p):this.journalTagService.journalTagCreate(f(d({},e),{typeID:Number(e.typeID)}))}),v(()=>{console.log("Journal tag saved successfully"),this.router.navigate(["/pages/accounting-setup/journal-tag"])}),T(i=>(console.error("Failed to save journal tag:",i),C))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-journal-tag-form"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-2"],[1,"col-10"],[1,"d-flex","flex-column","h-100"],["for",""],[1,"d-flex","h-100","align-items-center","gap-3"],[1,"d-flex","justify-content-center","gap-2"],["formControlName","typeID","inputId","typeID0","name","typeID",3,"value"],["for","typeID0",1,"m-0"],["formControlName","typeID","inputId","typeID1","name","typeID",3,"value"],["for","typeID1",1,"m-0"],[1,"my-2"],[1,"d-flex","flex-column"],["formControlName","name","pInputText","","size","small","type","text",2,"font-size","14px",3,"ngClass"],["cols","30","formControlName","description","pSize","large","pTextarea","","rows","2",2,"font-size","14px",3,"autoResize"],[1,"invalid-feedback","text-danger","d-block"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),F(1,Z,2,0,"ng-template",null,0,y)(3,te,30,8,"ng-template",null,1,y),o()),i&2&&a("hasMainWrapperPadding",!0)},dependencies:[Q,A,W,q,R,z,G,V,P,K,O,M,H,Y],encapsulation:2})}}return t})();export{ye as JournalTagFormComponent};
1
+ import{a as L}from"./chunk-XMARGQLT.js";import{a as K}from"./chunk-MDCWCEZ7.js";import{a as Y,b as H}from"./chunk-Y54QBXKN.js";import{a as U}from"./chunk-TTIQSVQF.js";import{h as Q}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as W}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as O,y as A}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as R,c as k,e as z,f as G,p as P,q as V,v as B,y as q}from"./chunk-OQDKL2MG.js";import{b as w,d as J}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{i as M}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,C as h,F as T,J as b,Kc as N,Mb as x,Nb as _,Sb as a,T as g,Tb as n,Ub as o,V as v,Vb as m,Wc as y,ac as E,da as c,db as r,fc as j,gc as u,j as C,ka as S,la as I,ub as D,vc as l}from"./chunk-T6YHDD6J.js";import{a as d,b as f}from"./chunk-PRARYYF3.js";var X=t=>({"ng-invalid ng-dirty":t});function Z(t,s){if(t&1){let e=E();n(0,"div")(1,"p-button",3),j("onClick",function(){S(e);let p=u();return I(p.onSubmit())}),o()()}}function $(t,s){t&1&&(n(0,"div",22),l(1," Name is required "),o())}function ee(t,s){if(t&1&&(n(0,"div"),x(1,$,2,0,"div",22),o()),t&2){let e=u(2);r(),_(e.form.controls.name.errors.required?1:-1)}}function te(t,s){if(t&1&&(n(0,"p-panel",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"div",9)(6,"div",7)(7,"div",10)(8,"label",11),l(9,"Type Id"),o(),n(10,"div",12)(11,"div",13),m(12,"p-radiobutton",14),n(13,"label",15),l(14,"Generic"),o()(),n(15,"div",13),m(16,"p-radiobutton",16),n(17,"label",17),l(18,"Outlet"),o()()()(),m(19,"div",18),o(),n(20,"div",19)(21,"label",11),l(22,"Name"),o(),m(23,"input",20),x(24,ee,2,1,"div"),o()(),n(25,"div",9)(26,"div",19)(27,"label",11),l(28,"Description"),o(),m(29,"textarea",21),o()()()()()()()),t&2){let e=u();r(),a("formGroup",e.form),r(11),a("value",0),r(4),a("value",1),r(7),a("ngClass",N(6,X,e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched))),r(),_(e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched)?24:-1),r(5),a("autoResize",!0)}}var ye=(()=>{class t{constructor(){this.fb=c(B),this.journalTagService=c(L),this.route=c(w),this.router=c(J)}initForm(){console.log("Initializing form"),this.form=this.fb.group({name:this.fb.control("",[k.required]),description:this.fb.control(""),typeID:this.fb.control(!1)})}ngOnInit(){this.initForm(),this.route.queryParamMap.pipe(h(e=>e.has("id")),g(e=>this.journalTagService.journalTagGet(e.get("id"))),U("Query params"),v(e=>{console.log("Got journal tag:",e),this.form.patchValue({name:e.name,description:e.description})})).subscribe()}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=this.form.getRawValue();this.route.queryParamMap.pipe(b(1),g(i=>{let p=i.get("id");return p?this.journalTagService.journalTagUpdate(f(d({},e),{typeID:Number(e.typeID)}),p):this.journalTagService.journalTagCreate(f(d({},e),{typeID:Number(e.typeID)}))}),v(()=>{console.log("Journal tag saved successfully"),this.router.navigate(["/pages/accounting-setup/journal-tag"])}),T(i=>(console.error("Failed to save journal tag:",i),C))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-journal-tag-form"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-2"],[1,"col-10"],[1,"d-flex","flex-column","h-100"],["for",""],[1,"d-flex","h-100","align-items-center","gap-3"],[1,"d-flex","justify-content-center","gap-2"],["formControlName","typeID","inputId","typeID0","name","typeID",3,"value"],["for","typeID0",1,"m-0"],["formControlName","typeID","inputId","typeID1","name","typeID",3,"value"],["for","typeID1",1,"m-0"],[1,"my-2"],[1,"d-flex","flex-column"],["formControlName","name","pInputText","","size","small","type","text",2,"font-size","14px",3,"ngClass"],["cols","30","formControlName","description","pSize","large","pTextarea","","rows","2",2,"font-size","14px",3,"autoResize"],[1,"invalid-feedback","text-danger","d-block"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),F(1,Z,2,0,"ng-template",null,0,y)(3,te,30,8,"ng-template",null,1,y),o()),i&2&&a("hasMainWrapperPadding",!0)},dependencies:[Q,A,W,q,R,z,G,V,P,K,O,M,H,Y],encapsulation:2})}}return t})();export{ye as JournalTagFormComponent};
@@ -1 +1 @@
1
- import{a as U}from"./chunk-XZGQHWLM.js";import"./chunk-OS646RNF.js";import{a as W}from"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{b as K,i as Q}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as A}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as G}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import"./chunk-U2ZZPRP6.js";import{a as O}from"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{e as H}from"./chunk-7NZRUZLK.js";import{a as V}from"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{i as L,q as B,r as F,t as $}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as S,Jc as N,Kc as J,Lc as z,Mb as g,Nb as x,Sb as c,Sc as s,T as w,Tb as i,Tc as R,Ub as n,Uc as d,V as E,Vb as C,Wc as u,_ as D,_c as y,ac as P,da as _,db as l,fc as T,gc as p,ka as M,la as q,ub as I,vc as a,wa as f,wc as m,xc as v,zc as k}from"./chunk-T6YHDD6J.js";import{a as b,b as h}from"./chunk-PRARYYF3.js";var X=(()=>{class t{constructor(){this.httpService=_(V)}getJournalJobList(e={}){let o={params:{page:e.page,pageSize:e.pageSize}};return this.httpService.get(void 0,"api/JournalSquash/GetListSquashJob",o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ee=()=>({"min-width":"50rem"}),te=t=>["/pages/tools/journal-squash-job-detail",t],ne=(t,r)=>({"bg-success":t,"bg-danger":r}),ie=t=>["/pages/journal/journal-entry/",t];function ae(t,r){t&1&&(i(0,"tr")(1,"th"),a(2,"Job ID"),n(),i(3,"th"),a(4,"Date"),n(),i(5,"th"),a(6,"Message"),n(),i(7,"th"),a(8,"Duration"),n(),i(9,"th"),a(10,"Creator"),n()())}function oe(t,r){if(t&1&&(i(0,"div",12)(1,"a",17),a(2),n()()),t&2){let e=p().$implicit;l(),c("routerLink",J(2,ie,e.id)),l(),m(e.journalNumber)}}function le(t,r){if(t&1&&(i(0,"span"),a(1),s(2,"number"),n()),t&2){let e=p().$implicit,o=p(3);l(),v("",d(2,1,o.dayjsService.from(o.now()).diff(e.created,"second"),"1.1-1")," s")}}function re(t,r){if(t&1&&(i(0,"span"),a(1),s(2,"number"),n()),t&2){let e=p().$implicit;l(),v("",d(2,1,e.duration/1e3,"1.1-1")," s")}}function pe(t,r){if(t&1&&(i(0,"tr")(1,"td")(2,"a",8),a(3),n()(),i(4,"td")(5,"div",9)(6,"span"),a(7),s(8,"date"),n(),i(9,"span"),a(10,"-"),n(),i(11,"span"),a(12),s(13,"date"),n()()(),i(14,"td")(15,"div",10)(16,"div",11)(17,"span"),a(18),s(19,"number"),n(),i(20,"span"),a(21,"Journal"),n()(),g(22,oe,3,4,"div",12),n()(),i(23,"td",13)(24,"div",14),g(25,le,3,4,"span")(26,re,3,4,"span"),C(27,"p-chip",15),n()(),i(28,"td")(29,"div",16)(30,"span"),a(31),n(),i(32,"span"),a(33),s(34,"date"),n()()()()),t&2){let e=r.$implicit;l(2),c("routerLink",J(22,te,e.id)),l(),m(e.id),l(4),m(d(8,11,e.from,"d")),l(5),m(d(13,14,e.to,"d MMM y")),l(6),m(R(19,17,e.journalCount)),l(4),x(e.journalNumber?22:-1),l(3),x(e.status!==2?25:26),l(2),c("label",e.statusString)("ngClass",z(24,ne,e.status===2,e.status!==2)),l(4),m(e.creator),l(2),m(d(34,19,e.created,"d MMM y hh:mm"))}}function me(t,r){if(t&1&&a(0),t&2){let e=p(3);k(" Showing ",e.first()," to ",e.end()," of ",e.journalJobData().count," entries ")}}function se(t,r){t&1&&(i(0,"tr")(1,"td",18),C(2,"span"),a(3," No squash jobs found. "),n()())}function ce(t,r){if(t&1){let e=P();i(0,"p-table",7),T("onPage",function(j){M(e);let Y=p(2);return q(Y.onPageHandler(j))}),S(1,ae,11,0,"ng-template",null,1,u)(3,pe,35,27,"ng-template",null,2,u)(5,me,1,3,"ng-template",null,3,u)(7,se,4,0,"ng-template",null,4,u),n()}if(t&2){let e=p(2);c("lazy",!0)("paginator",!0)("rows",e.params().pageSize)("tableStyle",N(6,ee))("totalRecords",e.journalJobData().count)("value",e.journalJobData().data)}}function de(t,r){if(t&1&&(i(0,"p-panel"),g(1,ce,9,7,"p-table",6),n()),t&2){let e=p();l(),x(e.journalJobData()?1:-1)}}var Ie=(()=>{class t{constructor(){this.journalJobData=f(null),this.inf=1/0,this.count=f(-1),this.params=f({page:1,pageSize:20}),this.first=y(()=>(this.params().page-1)*this.params().pageSize+1),this.end=y(()=>this.first()+this.params().pageSize-1),this.dayjsService=_(U),this.now=f(new Date),this.journalJobService=_(X),O(this.params).pipe(w(e=>this.journalJobService.getJournalJobList(e)),E(e=>this.journalJobData.set(e))).subscribe()}onPageHandler(e){console.log(e);let o=e.first/e.rows;this.onPageChange(o+1)}onPageChange(e){this.params.update(o=>h(b({},o),{page:e}))}onPageSizeChange(e){this.params.update(o=>h(b({},o),{pageSize:e,page:1}))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-squash-job"]],decls:3,vars:1,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Squash Job",3,"scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"lazy","paginator","rows","tableStyle","totalRecords","value"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","lazy","paginator","rows","tableStyle","totalRecords","value"],["target","_blank",1,"link-primary","fs-2",3,"routerLink"],[1,"d-flex","align-items-center","gap-2","fw-normal","fs-2"],[1,"d-flex","gap-2","flex-column","fw-normal","fs-2"],[1,"d-flex","align-items-center","gap-2"],[1,"d-flex"],[1,"fw-normal"],[1,"d-flex","flex-column","align-items-start","fs-2"],[1,"py-1","px-2","text-white",3,"label","ngClass"],[1,"d-flex","flex-column","fw-normal","fs-2"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(o,j){o&1&&(i(0,"app-main-panel",5),S(1,de,2,1,"ng-template",null,0,u),n()),o&2&&c("scrollable",!0)},dependencies:[A,$,L,G,Q,K,H,W,F,B],encapsulation:2})}}return t})();export{Ie as SquashJobComponent};
1
+ import{a as U}from"./chunk-G47TGGKM.js";import"./chunk-OS646RNF.js";import{a as W}from"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{b as K,i as Q}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as A}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as G}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import"./chunk-U2ZZPRP6.js";import{a as O}from"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{e as H}from"./chunk-7NZRUZLK.js";import{a as V}from"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{i as L,q as B,r as F,t as $}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as S,Jc as N,Kc as J,Lc as z,Mb as g,Nb as x,Sb as c,Sc as s,T as w,Tb as i,Tc as R,Ub as n,Uc as d,V as E,Vb as C,Wc as u,_ as D,_c as y,ac as P,da as _,db as l,fc as T,gc as p,ka as M,la as q,ub as I,vc as a,wa as f,wc as m,xc as v,zc as k}from"./chunk-T6YHDD6J.js";import{a as b,b as h}from"./chunk-PRARYYF3.js";var X=(()=>{class t{constructor(){this.httpService=_(V)}getJournalJobList(e={}){let o={params:{page:e.page,pageSize:e.pageSize}};return this.httpService.get(void 0,"api/JournalSquash/GetListSquashJob",o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ee=()=>({"min-width":"50rem"}),te=t=>["/pages/tools/journal-squash-job-detail",t],ne=(t,r)=>({"bg-success":t,"bg-danger":r}),ie=t=>["/pages/journal/journal-entry/",t];function ae(t,r){t&1&&(i(0,"tr")(1,"th"),a(2,"Job ID"),n(),i(3,"th"),a(4,"Date"),n(),i(5,"th"),a(6,"Message"),n(),i(7,"th"),a(8,"Duration"),n(),i(9,"th"),a(10,"Creator"),n()())}function oe(t,r){if(t&1&&(i(0,"div",12)(1,"a",17),a(2),n()()),t&2){let e=p().$implicit;l(),c("routerLink",J(2,ie,e.id)),l(),m(e.journalNumber)}}function le(t,r){if(t&1&&(i(0,"span"),a(1),s(2,"number"),n()),t&2){let e=p().$implicit,o=p(3);l(),v("",d(2,1,o.dayjsService.from(o.now()).diff(e.created,"second"),"1.1-1")," s")}}function re(t,r){if(t&1&&(i(0,"span"),a(1),s(2,"number"),n()),t&2){let e=p().$implicit;l(),v("",d(2,1,e.duration/1e3,"1.1-1")," s")}}function pe(t,r){if(t&1&&(i(0,"tr")(1,"td")(2,"a",8),a(3),n()(),i(4,"td")(5,"div",9)(6,"span"),a(7),s(8,"date"),n(),i(9,"span"),a(10,"-"),n(),i(11,"span"),a(12),s(13,"date"),n()()(),i(14,"td")(15,"div",10)(16,"div",11)(17,"span"),a(18),s(19,"number"),n(),i(20,"span"),a(21,"Journal"),n()(),g(22,oe,3,4,"div",12),n()(),i(23,"td",13)(24,"div",14),g(25,le,3,4,"span")(26,re,3,4,"span"),C(27,"p-chip",15),n()(),i(28,"td")(29,"div",16)(30,"span"),a(31),n(),i(32,"span"),a(33),s(34,"date"),n()()()()),t&2){let e=r.$implicit;l(2),c("routerLink",J(22,te,e.id)),l(),m(e.id),l(4),m(d(8,11,e.from,"d")),l(5),m(d(13,14,e.to,"d MMM y")),l(6),m(R(19,17,e.journalCount)),l(4),x(e.journalNumber?22:-1),l(3),x(e.status!==2?25:26),l(2),c("label",e.statusString)("ngClass",z(24,ne,e.status===2,e.status!==2)),l(4),m(e.creator),l(2),m(d(34,19,e.created,"d MMM y hh:mm"))}}function me(t,r){if(t&1&&a(0),t&2){let e=p(3);k(" Showing ",e.first()," to ",e.end()," of ",e.journalJobData().count," entries ")}}function se(t,r){t&1&&(i(0,"tr")(1,"td",18),C(2,"span"),a(3," No squash jobs found. "),n()())}function ce(t,r){if(t&1){let e=P();i(0,"p-table",7),T("onPage",function(j){M(e);let Y=p(2);return q(Y.onPageHandler(j))}),S(1,ae,11,0,"ng-template",null,1,u)(3,pe,35,27,"ng-template",null,2,u)(5,me,1,3,"ng-template",null,3,u)(7,se,4,0,"ng-template",null,4,u),n()}if(t&2){let e=p(2);c("lazy",!0)("paginator",!0)("rows",e.params().pageSize)("tableStyle",N(6,ee))("totalRecords",e.journalJobData().count)("value",e.journalJobData().data)}}function de(t,r){if(t&1&&(i(0,"p-panel"),g(1,ce,9,7,"p-table",6),n()),t&2){let e=p();l(),x(e.journalJobData()?1:-1)}}var Ie=(()=>{class t{constructor(){this.journalJobData=f(null),this.inf=1/0,this.count=f(-1),this.params=f({page:1,pageSize:20}),this.first=y(()=>(this.params().page-1)*this.params().pageSize+1),this.end=y(()=>this.first()+this.params().pageSize-1),this.dayjsService=_(U),this.now=f(new Date),this.journalJobService=_(X),O(this.params).pipe(w(e=>this.journalJobService.getJournalJobList(e)),E(e=>this.journalJobData.set(e))).subscribe()}onPageHandler(e){console.log(e);let o=e.first/e.rows;this.onPageChange(o+1)}onPageChange(e){this.params.update(o=>h(b({},o),{page:e}))}onPageSizeChange(e){this.params.update(o=>h(b({},o),{pageSize:e,page:1}))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-squash-job"]],decls:3,vars:1,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Squash Job",3,"scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"lazy","paginator","rows","tableStyle","totalRecords","value"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","lazy","paginator","rows","tableStyle","totalRecords","value"],["target","_blank",1,"link-primary","fs-2",3,"routerLink"],[1,"d-flex","align-items-center","gap-2","fw-normal","fs-2"],[1,"d-flex","gap-2","flex-column","fw-normal","fs-2"],[1,"d-flex","align-items-center","gap-2"],[1,"d-flex"],[1,"fw-normal"],[1,"d-flex","flex-column","align-items-start","fs-2"],[1,"py-1","px-2","text-white",3,"label","ngClass"],[1,"d-flex","flex-column","fw-normal","fs-2"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(o,j){o&1&&(i(0,"app-main-panel",5),S(1,de,2,1,"ng-template",null,0,u),n()),o&2&&c("scrollable",!0)},dependencies:[A,$,L,G,Q,K,H,W,F,B],encapsulation:2})}}return t})();export{Ie as SquashJobComponent};
@@ -1 +1 @@
1
- import{a as y,b as K}from"./chunk-3MU7BZQU.js";import"./chunk-XZGQHWLM.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{o as E,t as I}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as $,Ic as F,Jc as T,Mb as C,Nb as h,R as M,Sb as c,Sc as p,T as k,Tb as o,Tc as s,Ub as n,V as O,Vb as u,Wc as b,ac as x,da as m,db as r,f as A,fc as v,gc as a,ka as g,la as _,ma as B,na as P,s as f,tc as S,ub as w}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(e,d){if(e&1){let t=x();o(0,"p-button",6),v("onClick",function(){g(t);let l=a(2);return _(l.onFormat())}),n()}}function W(e,d){if(e&1){let t=x();o(0,"p-button",7),p(1,"async"),p(2,"async"),v("onClick",function(){g(t);let l=a(2);return _(l.onMigrateOutletAccount())}),n()}if(e&2){let t=a(2);c("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(e,d){if(e&1&&(o(0,"div",3),C(1,U,1,0,"p-button",4),C(2,W,3,6,"p-button",5),n()),e&2){let t=a();r(),h(t.roleService.permissions().migrate.delete?1:-1),r(),h(t.roleService.permissions().migrate.create?2:-1)}}function Y(e,d){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),p(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),P(),u(7,"app-migration-cards",12),p(8,"async"),n()()()),e&2){let t=a();S(T(12,Q)),r(),S(T(13,Q)),r(2),c("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),c("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var ht=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new A(void 0),this.pageTitle="Outlet Account",this.roleService=m(j)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getOutletAccountCount()),O(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(f(i=>Number(i.pos))),this.countInBooks$=t.pipe(f(i=>Number(i.books)))}onMigrateOutletAccount(){this.migrateService.migrateOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=w({type:e,selectors:[["app-outlet-account"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,l){i&1&&(o(0,"app-main-panel",2),$(1,X,3,2,"ng-template",null,0,b)(3,Y,9,14,"ng-template",null,1,b),n()),i&2&&c("pageTitle",l.pageTitle)},dependencies:[J,I,G,N,D,R,L,H,z,q,K,E],encapsulation:2})}}return e})();export{ht as OutletAccountComponent};
1
+ import{a as y,b as K}from"./chunk-IUZTFGKU.js";import"./chunk-G47TGGKM.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{o as E,t as I}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as $,Ic as F,Jc as T,Mb as C,Nb as h,R as M,Sb as c,Sc as p,T as k,Tb as o,Tc as s,Ub as n,V as O,Vb as u,Wc as b,ac as x,da as m,db as r,f as A,fc as v,gc as a,ka as g,la as _,ma as B,na as P,s as f,tc as S,ub as w}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(e,d){if(e&1){let t=x();o(0,"p-button",6),v("onClick",function(){g(t);let l=a(2);return _(l.onFormat())}),n()}}function W(e,d){if(e&1){let t=x();o(0,"p-button",7),p(1,"async"),p(2,"async"),v("onClick",function(){g(t);let l=a(2);return _(l.onMigrateOutletAccount())}),n()}if(e&2){let t=a(2);c("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(e,d){if(e&1&&(o(0,"div",3),C(1,U,1,0,"p-button",4),C(2,W,3,6,"p-button",5),n()),e&2){let t=a();r(),h(t.roleService.permissions().migrate.delete?1:-1),r(),h(t.roleService.permissions().migrate.create?2:-1)}}function Y(e,d){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),p(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),P(),u(7,"app-migration-cards",12),p(8,"async"),n()()()),e&2){let t=a();S(T(12,Q)),r(),S(T(13,Q)),r(2),c("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),c("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var ht=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new A(void 0),this.pageTitle="Outlet Account",this.roleService=m(j)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getOutletAccountCount()),O(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(f(i=>Number(i.pos))),this.countInBooks$=t.pipe(f(i=>Number(i.books)))}onMigrateOutletAccount(){this.migrateService.migrateOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=w({type:e,selectors:[["app-outlet-account"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,l){i&1&&(o(0,"app-main-panel",2),$(1,X,3,2,"ng-template",null,0,b)(3,Y,9,14,"ng-template",null,1,b),n()),i&2&&c("pageTitle",l.pageTitle)},dependencies:[J,I,G,N,D,R,L,H,z,q,K,E],encapsulation:2})}}return e})();export{ht as OutletAccountComponent};
@@ -1,4 +1,4 @@
1
- import{a as ce}from"./chunk-QTJQPJZS.js";import{f as Kt}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{b as Rt}from"./chunk-KIJKVEX5.js";import{m as Ue}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as we,b as Ie}from"./chunk-YKC7ERDO.js";import{b as Pt,g as Gt,h as Dt,i as Bt}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as ft}from"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{a as Ft,b as Lt}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import{a as gt}from"./chunk-BEEH5PAA.js";import{h as Et}from"./chunk-5FVLV36I.js";import{a as _t}from"./chunk-MTPMCC6U.js";import{a as xt,b as wt}from"./chunk-RO474VQ2.js";import{a as mt}from"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as A,c as It,d as St,e as Tt,f as Vt,g as kt,h as Mt}from"./chunk-3BPX4XM7.js";import{A as yt,C as vt,H as Ot,I as Ct,a as rt,b as xe,c as ht,d as $,x as bt}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{C as O,D as F,E as Oe,H as Ce,O as tt,Ua as ct,Xa as pt,Ya as W,Z as nt,Za as dt,a as Qe,ab as ut,da as it,e as We,f as je,i as ve,ia as ot,m as Xe,ma as at,na as re,q as Je,ta as st,v as Ye,wa as lt,x as Ze,y as et,z as le}from"./chunk-OQDKL2MG.js";import{d as ze,e as qe}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{k as Ne,l as _e,m as $e,n as be,t as ye}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$ as Ee,$b as ee,Ab as f,Ac as ie,Bc as oe,Cc as ae,Da as Pe,Ic as Q,Jb as D,Jc as He,Kc as se,Lc as fe,Mb as q,Nb as U,Sb as l,T as ue,Tb as u,Ub as d,V as Y,Vb as k,Wc as S,Z as ke,Zb as B,_ as Me,_b as R,_c as M,ac as V,ba as Fe,bd as N,c as de,da as v,db as c,fc as x,gc as r,jc as Be,ka as h,kc as Re,la as m,lc as w,ld as E,ma as Z,mc as I,md as ge,nb as he,qc as te,s as Ve,sa as C,tc as Ke,ub as z,uc as y,vb as Ge,vc as b,wa as P,wc as K,xc as ne,yb as De,za as Le,zb as me,zc as Ae}from"./chunk-T6YHDD6J.js";import{a as g,b as _}from"./chunk-PRARYYF3.js";var $t={data:[],count:0,meta:{filter:{pagination:1,pageSize:10,rolesID:null,text:""},options:{roles:[]}},filter:{pagination:1,pageSize:10,rolesID:null,text:""}},Se=It(kt($t),Mt("GroupStore"),St(t=>({first:M(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:M(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:M(()=>t.data().some(s=>s.checked)),checkedData:M(()=>t.data().filter(s=>s.checked).map(s=>s.id))})),Vt(t=>{let s=v(ce),e={setFilter(n){A(t,i=>_(g({},i),{filter:n}))},onRowSelect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!0}):a);return _(g({},i),{data:o})})},onRowUnselect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!1}):a);return _(g({},i),{data:o})})},onHeaderCheckboxToggle(n){A(t,i=>{let o=i.data.map(a=>_(g({},a),{checked:n}));return _(g({},i),{data:o})})},getGroupList:we(de(ue(n=>s.getGroupList(n).pipe(Ie(i=>{A(t,o=>_(g({},o),{data:i.data,count:i.count}))},i=>{console.error("Error fetching group list:",i)}))))),getGroupLoader:we(de(ue(()=>s.getGroupLoader().pipe(Ie({next:n=>{let i=n.options.roles.map(o=>_(g({},o),{id:Rt()}));A(t,o=>_(g({},o),{meta:_(g({},n),{options:_(g({},n.options),{roles:i})}),filter:n.filter})),e.getGroupList(t.filter)},error:n=>{console.error("Error fetching group loader:",n)}})))))};return e}),Tt(t=>({onInit:()=>{t.getGroupLoader()}})));var At=`
1
+ import{a as ce}from"./chunk-QTJQPJZS.js";import{f as Kt}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{b as Rt}from"./chunk-KIJKVEX5.js";import{m as Ue}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as we,b as Ie}from"./chunk-YKC7ERDO.js";import{b as Pt,g as Gt,h as Dt,i as Bt}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as ft}from"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{a as Ft,b as Lt}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import{a as gt}from"./chunk-BEEH5PAA.js";import{h as Et}from"./chunk-2LLPIDXP.js";import{a as _t}from"./chunk-MTPMCC6U.js";import{a as xt,b as wt}from"./chunk-RO474VQ2.js";import{a as mt}from"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as A,c as It,d as St,e as Tt,f as Vt,g as kt,h as Mt}from"./chunk-3BPX4XM7.js";import{A as yt,C as vt,H as Ot,I as Ct,a as rt,b as xe,c as ht,d as $,x as bt}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{C as O,D as F,E as Oe,H as Ce,O as tt,Ua as ct,Xa as pt,Ya as W,Z as nt,Za as dt,a as Qe,ab as ut,da as it,e as We,f as je,i as ve,ia as ot,m as Xe,ma as at,na as re,q as Je,ta as st,v as Ye,wa as lt,x as Ze,y as et,z as le}from"./chunk-OQDKL2MG.js";import{d as ze,e as qe}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{k as Ne,l as _e,m as $e,n as be,t as ye}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$ as Ee,$b as ee,Ab as f,Ac as ie,Bc as oe,Cc as ae,Da as Pe,Ic as Q,Jb as D,Jc as He,Kc as se,Lc as fe,Mb as q,Nb as U,Sb as l,T as ue,Tb as u,Ub as d,V as Y,Vb as k,Wc as S,Z as ke,Zb as B,_ as Me,_b as R,_c as M,ac as V,ba as Fe,bd as N,c as de,da as v,db as c,fc as x,gc as r,jc as Be,ka as h,kc as Re,la as m,lc as w,ld as E,ma as Z,mc as I,md as ge,nb as he,qc as te,s as Ve,sa as C,tc as Ke,ub as z,uc as y,vb as Ge,vc as b,wa as P,wc as K,xc as ne,yb as De,za as Le,zb as me,zc as Ae}from"./chunk-T6YHDD6J.js";import{a as g,b as _}from"./chunk-PRARYYF3.js";var $t={data:[],count:0,meta:{filter:{pagination:1,pageSize:10,rolesID:null,text:""},options:{roles:[]}},filter:{pagination:1,pageSize:10,rolesID:null,text:""}},Se=It(kt($t),Mt("GroupStore"),St(t=>({first:M(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:M(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:M(()=>t.data().some(s=>s.checked)),checkedData:M(()=>t.data().filter(s=>s.checked).map(s=>s.id))})),Vt(t=>{let s=v(ce),e={setFilter(n){A(t,i=>_(g({},i),{filter:n}))},onRowSelect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!0}):a);return _(g({},i),{data:o})})},onRowUnselect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!1}):a);return _(g({},i),{data:o})})},onHeaderCheckboxToggle(n){A(t,i=>{let o=i.data.map(a=>_(g({},a),{checked:n}));return _(g({},i),{data:o})})},getGroupList:we(de(ue(n=>s.getGroupList(n).pipe(Ie(i=>{A(t,o=>_(g({},o),{data:i.data,count:i.count}))},i=>{console.error("Error fetching group list:",i)}))))),getGroupLoader:we(de(ue(()=>s.getGroupLoader().pipe(Ie({next:n=>{let i=n.options.roles.map(o=>_(g({},o),{id:Rt()}));A(t,o=>_(g({},o),{meta:_(g({},n),{options:_(g({},n.options),{roles:i})}),filter:n.filter})),e.getGroupList(t.filter)},error:n=>{console.error("Error fetching group loader:",n)}})))))};return e}),Tt(t=>({onInit:()=>{t.getGroupLoader()}})));var At=`
2
2
  .p-cascadeselect {
3
3
  display: inline-flex;
4
4
  cursor: pointer;
@@ -1 +1 @@
1
- import{a as i,b as T}from"./chunk-IEOE2XJ7.js";import{d as s}from"./chunk-7NZRUZLK.js";import{a as l}from"./chunk-WDFE7CAE.js";import{c as m}from"./chunk-WNU7SPEQ.js";import{V as a,_ as c,da as r}from"./chunk-T6YHDD6J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
1
+ import{a as i,b as T}from"./chunk-IEOE2XJ7.js";import{d as s}from"./chunk-7NZRUZLK.js";import{a as l}from"./chunk-WDFE7CAE.js";import{c as m}from"./chunk-IOMTH2KS.js";import{V as a,_ as c,da as r}from"./chunk-T6YHDD6J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
@@ -1 +1 @@
1
- import{a as Je}from"./chunk-T2VQD2QW.js";import"./chunk-SGZKLLJ3.js";import{a as ve,b as Ee,c as he,d as be,e as Ie,f as Se}from"./chunk-2L65SN3U.js";import{a as Ce,b as ke,c as we}from"./chunk-JM6FKNTC.js";import"./chunk-IEOE2XJ7.js";import{b as ue,d as fe,e as ge,f as xe,i as ye}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as R}from"./chunk-TTIQSVQF.js";import{a as oe}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{a as ce,b as _e}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{d as me,e as se,h as de}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as le,b as pe}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as re,I as ae}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{d as ie}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{i as Y,l as Z,q as ee,r as te,t as ne}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as u,Ac as W,Bc as z,Cc as q,F as U,Jc as T,Kc as V,Mb as h,Mc as G,Nb as b,Ob as F,Qb as P,Rb as D,Sb as m,Sc as E,T as j,Tb as n,Tc as I,Ub as i,Uc as X,V as J,Vb as c,Wc as d,ac as v,bb as K,da as A,db as l,fc as y,gc as s,ka as f,kc as L,la as g,lc as O,m as N,mc as $,qc as Q,s as B,tc as M,ub as H,vc as r,wa as w,wc as x,xc as C}from"./chunk-T6YHDD6J.js";import{g as Re}from"./chunk-PRARYYF3.js";var Te=Re(ke());var Ae=["stepper"],Fe=()=>({width:"30vw"}),Pe=()=>({"1199px":"75vw","575px":"100vw"}),De=()=>({height:"calc(100vh - 70px)"}),Me=t=>({"col-12":t}),Ne=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Ve=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return g(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return g(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function je(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return g(o.onReset())}),i()}}function Ke(t,p){if(t&1&&u(0,Be,1,1,"p-button",11)(1,Ue,1,1,"p-button",12)(2,je,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function He(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let _=s(2);return g(_.onFileUploaded(o))})("fileRemoved",function(o){f(e);let _=s(2);return g(_.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function Le(t,p){t&1&&(n(0,"tr"),c(1,"th",29),n(2,"th",30),r(3," Number "),c(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),c(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),c(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),c(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Oe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),x(e.issue),l(2),x(e.solution)}}function $e(t,p){if(t&1&&(n(0,"div",40),P(1,Oe,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function Qe(t,p){}function We(t,p){if(t&1&&h(0,$e,3,0,"div",40)(1,Qe,0,0),t&2){let e=s().$implicit;b(e.issues&&e.issues.length>0?0:1)}}function ze(t,p){if(t&1&&(n(0,"tr")(1,"td"),c(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),h(13,We,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),x(e.number),l(2),C(" ",e.outlet," "),l(2),x(X(9,12,e.date,"d MMM y")),l(2),m("ngClass",G(15,Ne,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",V(19,Ve,o.hasIssue)),l(),b(o.hasIssue?13:-1)}}function qe(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),c(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),c(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),c(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),c(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),c(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function Ge(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),x(e.issue),l(2),x(e.solution)}}function Xe(t,p){if(t&1&&(n(0,"div",40),P(1,Ge,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Ye(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),h(14,Xe,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),x(e.accountCode),l(2),x(e.accountName),l(2),x(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",V(11,Ve,e.issues&&e.issues.length>0)),l(),b(a.hasIssue?14:-1)}}function Ze(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function et(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),u(4,qe,18,0,"ng-template",null,3,d)(6,Ye,15,13,"ng-template",null,6,d)(8,Ze,3,0,"ng-template",null,8,d),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function tt(t,p){if(t&1&&(n(0,"p-table",28),u(1,Le,16,0,"ng-template",null,3,d)(3,ze,14,21,"ng-template",null,6,d)(5,et,10,1,"ng-template",null,7,d),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function nt(t,p){if(t&1&&h(0,tt,7,3,"p-table",28),t&2){let e=s(2);b(e.JournalEntryImport()?0:-1)}}function it(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function ot(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),c(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),c(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),c(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),u(24,He,6,4,"ng-template",null,1,d),i(),n(26,"p-step-panel",20),u(27,nt,1,1,"ng-template",null,1,d),i(),n(29,"p-step-panel",20),u(30,it,2,0,"ng-template",null,1,d),i()()()()()()()),t&2){let e=s();l(),M(T(11,De)),l(2),m("ngClass",V(12,Me,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function rt(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return g(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function at(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function lt(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function mt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function st(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),u(3,lt,3,0,"ng-template",null,3,d),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),u(12,pt,3,0,"ng-template",null,3,d),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),u(21,mt,3,0,"ng-template",null,3,d),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function dt(t,p){if(t&1&&h(0,st,28,9,"div",60),t&2){let e=s();b(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return g(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return g(o.onConfirmImport())}),i()}}var Kt=(()=>{class t{constructor(){this.service=A(Je),this.router=A(ie),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=w(1),this.JournalEntryImport=w(null),this.summaryDialogVisible=w(!1),this.CSVRowCount=w(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),j(o=>this.service.importConfirmJournal(o)),J(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),J(o=>{this.JournalEntryImport.set(o)})).subscribe(),Te.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),J(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),U(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),N(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,_=Array.isArray(a.items)&&a.items.some(S=>S.issues&&S.issues.length>0);return o||_}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&L(Ae,5),a&2){let _;O(_=$())&&(o.stepperRef=_.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(S){return o.handleKeyboardEvent(S)},K)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let _=v();n(0,"app-main-panel",9),u(1,Ke,3,3,"ng-template",null,0,d)(3,ot,32,14,"ng-template",null,1,d),i(),n(5,"p-dialog",10),q("visibleChange",function(k){return f(_),z(o.summaryDialogVisible,k)||(o.summaryDialogVisible=k),g(k)}),u(6,rt,1,2,"ng-template",null,2,d)(8,at,5,1,"ng-template",null,3,d)(10,dt,1,1,"ng-template",null,1,d)(12,ct,2,0,"ng-template",null,4,d),i()}if(a&2){let _=Q(7);l(5),M(T(8,Fe)),m("modal",!0),W("visible",o.summaryDialogVisible),m("breakpoints",T(9,Pe))("draggable",!1)("closeIconTemplate",_)("dismissableMask",!0)}},dependencies:[de,ne,Y,Z,pe,le,Ce,_e,ce,Se,Ie,ve,be,he,Ee,we,ae,re,ye,ue,fe,xe,ge,se,me,oe,te,ee],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{Kt as JournalEntryImportComponent};
1
+ import{a as Je}from"./chunk-P2TXZVKA.js";import"./chunk-5FNHLN4I.js";import{a as ve,b as Ee,c as he,d as be,e as Ie,f as Se}from"./chunk-2L65SN3U.js";import{a as Ce,b as ke,c as we}from"./chunk-JM6FKNTC.js";import"./chunk-IEOE2XJ7.js";import{b as ue,d as fe,e as ge,f as xe,i as ye}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as R}from"./chunk-TTIQSVQF.js";import{a as oe}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{a as ce,b as _e}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{d as me,e as se,h as de}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as le,b as pe}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as re,I as ae}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{d as ie}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{i as Y,l as Z,q as ee,r as te,t as ne}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as u,Ac as W,Bc as z,Cc as q,F as U,Jc as T,Kc as V,Mb as h,Mc as G,Nb as b,Ob as F,Qb as P,Rb as D,Sb as m,Sc as E,T as j,Tb as n,Tc as I,Ub as i,Uc as X,V as J,Vb as c,Wc as d,ac as v,bb as K,da as A,db as l,fc as y,gc as s,ka as f,kc as L,la as g,lc as O,m as N,mc as $,qc as Q,s as B,tc as M,ub as H,vc as r,wa as w,wc as x,xc as C}from"./chunk-T6YHDD6J.js";import{g as Re}from"./chunk-PRARYYF3.js";var Te=Re(ke());var Ae=["stepper"],Fe=()=>({width:"30vw"}),Pe=()=>({"1199px":"75vw","575px":"100vw"}),De=()=>({height:"calc(100vh - 70px)"}),Me=t=>({"col-12":t}),Ne=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Ve=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return g(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return g(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function je(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return g(o.onReset())}),i()}}function Ke(t,p){if(t&1&&u(0,Be,1,1,"p-button",11)(1,Ue,1,1,"p-button",12)(2,je,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function He(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let _=s(2);return g(_.onFileUploaded(o))})("fileRemoved",function(o){f(e);let _=s(2);return g(_.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function Le(t,p){t&1&&(n(0,"tr"),c(1,"th",29),n(2,"th",30),r(3," Number "),c(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),c(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),c(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),c(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Oe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),x(e.issue),l(2),x(e.solution)}}function $e(t,p){if(t&1&&(n(0,"div",40),P(1,Oe,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function Qe(t,p){}function We(t,p){if(t&1&&h(0,$e,3,0,"div",40)(1,Qe,0,0),t&2){let e=s().$implicit;b(e.issues&&e.issues.length>0?0:1)}}function ze(t,p){if(t&1&&(n(0,"tr")(1,"td"),c(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),h(13,We,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),x(e.number),l(2),C(" ",e.outlet," "),l(2),x(X(9,12,e.date,"d MMM y")),l(2),m("ngClass",G(15,Ne,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",V(19,Ve,o.hasIssue)),l(),b(o.hasIssue?13:-1)}}function qe(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),c(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),c(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),c(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),c(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),c(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function Ge(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),x(e.issue),l(2),x(e.solution)}}function Xe(t,p){if(t&1&&(n(0,"div",40),P(1,Ge,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Ye(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),h(14,Xe,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),x(e.accountCode),l(2),x(e.accountName),l(2),x(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",V(11,Ve,e.issues&&e.issues.length>0)),l(),b(a.hasIssue?14:-1)}}function Ze(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function et(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),u(4,qe,18,0,"ng-template",null,3,d)(6,Ye,15,13,"ng-template",null,6,d)(8,Ze,3,0,"ng-template",null,8,d),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function tt(t,p){if(t&1&&(n(0,"p-table",28),u(1,Le,16,0,"ng-template",null,3,d)(3,ze,14,21,"ng-template",null,6,d)(5,et,10,1,"ng-template",null,7,d),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function nt(t,p){if(t&1&&h(0,tt,7,3,"p-table",28),t&2){let e=s(2);b(e.JournalEntryImport()?0:-1)}}function it(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function ot(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),c(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),c(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),c(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),u(24,He,6,4,"ng-template",null,1,d),i(),n(26,"p-step-panel",20),u(27,nt,1,1,"ng-template",null,1,d),i(),n(29,"p-step-panel",20),u(30,it,2,0,"ng-template",null,1,d),i()()()()()()()),t&2){let e=s();l(),M(T(11,De)),l(2),m("ngClass",V(12,Me,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function rt(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return g(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function at(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function lt(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function mt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function st(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),u(3,lt,3,0,"ng-template",null,3,d),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),u(12,pt,3,0,"ng-template",null,3,d),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),u(21,mt,3,0,"ng-template",null,3,d),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function dt(t,p){if(t&1&&h(0,st,28,9,"div",60),t&2){let e=s();b(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return g(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return g(o.onConfirmImport())}),i()}}var Kt=(()=>{class t{constructor(){this.service=A(Je),this.router=A(ie),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=w(1),this.JournalEntryImport=w(null),this.summaryDialogVisible=w(!1),this.CSVRowCount=w(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),j(o=>this.service.importConfirmJournal(o)),J(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),J(o=>{this.JournalEntryImport.set(o)})).subscribe(),Te.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),J(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),U(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),N(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,_=Array.isArray(a.items)&&a.items.some(S=>S.issues&&S.issues.length>0);return o||_}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&L(Ae,5),a&2){let _;O(_=$())&&(o.stepperRef=_.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(S){return o.handleKeyboardEvent(S)},K)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let _=v();n(0,"app-main-panel",9),u(1,Ke,3,3,"ng-template",null,0,d)(3,ot,32,14,"ng-template",null,1,d),i(),n(5,"p-dialog",10),q("visibleChange",function(k){return f(_),z(o.summaryDialogVisible,k)||(o.summaryDialogVisible=k),g(k)}),u(6,rt,1,2,"ng-template",null,2,d)(8,at,5,1,"ng-template",null,3,d)(10,dt,1,1,"ng-template",null,1,d)(12,ct,2,0,"ng-template",null,4,d),i()}if(a&2){let _=Q(7);l(5),M(T(8,Fe)),m("modal",!0),W("visible",o.summaryDialogVisible),m("breakpoints",T(9,Pe))("draggable",!1)("closeIconTemplate",_)("dismissableMask",!0)}},dependencies:[de,ne,Y,Z,pe,le,Ce,_e,ce,Se,Ie,ve,be,he,Ee,we,ae,re,ye,ue,fe,xe,ge,se,me,oe,te,ee],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{Kt as JournalEntryImportComponent};
@@ -1 +1 @@
1
- import{a as Me}from"./chunk-QTJQPJZS.js";import{a as ve,b as Ce,c as be,d as xe,e as ye,f as Fe}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{a as ge,b as he}from"./chunk-MDCWCEZ7.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{m as H}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import"./chunk-BA72IEO2.js";import{a as ie,b as ne}from"./chunk-2LI4CEOF.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import{h as fe}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as me,b as ce}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as pe,I as se,J as de,K as ue,y as ae,z as le}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as J,c as K,e as Q,f as W,k as X,n as Y,o as Z,p as ee,q as te,v as oe,y as re}from"./chunk-OQDKL2MG.js";import{b as U,d as L}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{i as q,t as z}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as R,Da as D,Jc as x,Kc as y,Mb as h,Nb as _,Ob as k,Pb as O,Qb as v,Rb as C,Sb as s,T as E,Tb as i,Ub as n,V as M,Vb as g,Wc as G,ac as V,da as c,db as r,fc as B,gc as d,hd as j,ka as I,la as N,tc as b,ub as P,uc as S,vc as f,wa as A,wc as T,xc as $,zb as w}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Ge=()=>({height:"calc(100vh - 70px)"}),Ee=t=>({"ng-invalid ng-dirty":t}),ke=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ie(t,a){if(t&1){let e=V();i(0,"p-button",4),B("onClick",function(){I(e);let l=d(2);return N(l.onSubmit())}),n()}}function Ne(t,a){if(t&1&&h(0,Ie,1,0,"p-button",3),t&2){let e=d();_(e.roleService.permissions().user.edit||e.roleService.permissions().user.create?0:-1)}}function Ae(t,a){if(t&1&&(i(0,"div")(1,"span",14),f(2),n()()),t&2){let e=a.$implicit;r(2),T(e)}}function De(t,a){if(t&1&&(i(0,"div"),v(1,Ae,3,1,"div",null,O),n()),t&2){let e=d(2);r(),C(e.getErrors("name"))}}function Pe(t,a){if(t&1&&(i(0,"div",22)(1,"div",23),g(2,"p-checkbox",24),i(3,"p",25),f(4),n()()()),t&2){let e=a.$implicit,o=a.$index;s("formGroupName",o)("pTooltip",e.get("description").value),r(2),b(x(6,Se)),s("binary",!0),r(2),$(" ",e.get("name").value," ")}}function we(t,a){if(t&1&&(i(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),f(4),n()(),g(5,"p-checkbox",19),n(),i(6,"div",20)(7,"div",21),v(8,Pe,5,7,"div",22,k),n()()()),t&2){let e=a.$implicit,o=a.$index,l=d(3);s("formGroupName",o),r(4),T(e.get("groupName").value),r(),b(x(5,Se)),s("binary",!0),r(3),C(l.getRolesArray(o).controls)}}function Re(t,a){if(t&1&&(i(0,"div",11),v(1,we,10,6,"div",15,k),n()),t&2){let e=d(2);r(),C(e.rolesFormArray.controls)}}function Oe(t,a){if(t&1&&(i(0,"p-panel")(1,"div",5)(2,"form",6),g(3,"input",7),h(4,De,3,0,"div"),n(),i(5,"p-tabs",8)(6,"p-tablist")(7,"p-tab",8),f(8,"Permission"),n(),i(9,"p-tab",9),f(10,"Description"),n()(),i(11,"p-tabpanels",10)(12,"p-tabpanel",8)(13,"form",6),h(14,Re,3,0,"div",11),n()(),i(15,"p-tabpanel",9)(16,"div",12),g(17,"textarea",13),n()()()()()()),t&2){let e=d();b(x(13,Ge)),r(2),s("formGroup",e.form),r(),s("fluid",!0)("ngClass",y(14,Ee,e.isInvalid("name"))),r(),_(e.isInvalid("name")?4:-1),r(3),S(y(16,ke,e.router.url.includes("forms"))),r(2),S(y(18,ke,e.router.url.includes("forms"))),r(4),s("formGroup",e.form),r(),_(e.rolesFormArray.length>0?14:-1),r(2),s("formGroup",e.form)}}var ft=(()=>{class t extends _e{constructor(){super(...arguments),this.service=c(Me),this.fb=c(oe),this.cdr=c(j),this.route=c(U),this.router=c(L),this.roleService=c(H),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[K.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(E(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(M(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(l=>{let m=this.fb.array(l.roles.map(p=>this.fb.group({id:this.fb.control(p.id),name:this.fb.control(p.name),checked:this.fb.control({value:e.form.rolesID.includes(p.id),disabled:!this.roleService.permissions().user.edit}),description:this.fb.control(p.description||"")}))),u=this.fb.group({groupName:this.fb.control(l.name),groupChecked:this.fb.control(!1),roles:m}),Te=m.controls.every(p=>p.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.permissions().user.edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(p=>{m.controls.forEach(F=>{F.get("checked").setValue(p,{emitEvent:!1})})}),m.valueChanges.subscribe(()=>{let p=m.controls.every(F=>F.get("checked").value);u.get("groupChecked").setValue(p,{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(m=>{m.get("checked").value&&e.push(m.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(M(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(l){return(e||(e=D(t)))(l||t)}})()}static{this.\u0275cmp=P({type:t,selectors:[["app-group-form"]],features:[w],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit"],["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"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[1,"text-danger"],[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,l){o&1&&(i(0,"app-main-panel",2),R(1,Ne,1,1,"ng-template",null,0,G)(3,Oe,18,20,"ng-template",null,1,G),n()),o&2&&s("overflowScroll",!0)},dependencies:[fe,ne,ie,re,X,J,Q,W,te,ee,Y,Z,z,q,le,ae,Fe,ve,ye,xe,Ce,be,he,ge,se,pe,ce,me,ue,de],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{ft as GroupFormComponent};
1
+ import{a as Me}from"./chunk-QTJQPJZS.js";import{a as ve,b as Ce,c as be,d as xe,e as ye,f as Fe}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{a as ge,b as he}from"./chunk-MDCWCEZ7.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{m as H}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import"./chunk-BA72IEO2.js";import{a as ie,b as ne}from"./chunk-2LI4CEOF.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import{h as fe}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as me,b as ce}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as pe,I as se,J as de,K as ue,y as ae,z as le}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as J,c as K,e as Q,f as W,k as X,n as Y,o as Z,p as ee,q as te,v as oe,y as re}from"./chunk-OQDKL2MG.js";import{b as U,d as L}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{i as q,t as z}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as R,Da as D,Jc as x,Kc as y,Mb as h,Nb as _,Ob as k,Pb as O,Qb as v,Rb as C,Sb as s,T as E,Tb as i,Ub as n,V as M,Vb as g,Wc as G,ac as V,da as c,db as r,fc as B,gc as d,hd as j,ka as I,la as N,tc as b,ub as P,uc as S,vc as f,wa as A,wc as T,xc as $,zb as w}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Ge=()=>({height:"calc(100vh - 70px)"}),Ee=t=>({"ng-invalid ng-dirty":t}),ke=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ie(t,a){if(t&1){let e=V();i(0,"p-button",4),B("onClick",function(){I(e);let l=d(2);return N(l.onSubmit())}),n()}}function Ne(t,a){if(t&1&&h(0,Ie,1,0,"p-button",3),t&2){let e=d();_(e.roleService.permissions().user.edit||e.roleService.permissions().user.create?0:-1)}}function Ae(t,a){if(t&1&&(i(0,"div")(1,"span",14),f(2),n()()),t&2){let e=a.$implicit;r(2),T(e)}}function De(t,a){if(t&1&&(i(0,"div"),v(1,Ae,3,1,"div",null,O),n()),t&2){let e=d(2);r(),C(e.getErrors("name"))}}function Pe(t,a){if(t&1&&(i(0,"div",22)(1,"div",23),g(2,"p-checkbox",24),i(3,"p",25),f(4),n()()()),t&2){let e=a.$implicit,o=a.$index;s("formGroupName",o)("pTooltip",e.get("description").value),r(2),b(x(6,Se)),s("binary",!0),r(2),$(" ",e.get("name").value," ")}}function we(t,a){if(t&1&&(i(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),f(4),n()(),g(5,"p-checkbox",19),n(),i(6,"div",20)(7,"div",21),v(8,Pe,5,7,"div",22,k),n()()()),t&2){let e=a.$implicit,o=a.$index,l=d(3);s("formGroupName",o),r(4),T(e.get("groupName").value),r(),b(x(5,Se)),s("binary",!0),r(3),C(l.getRolesArray(o).controls)}}function Re(t,a){if(t&1&&(i(0,"div",11),v(1,we,10,6,"div",15,k),n()),t&2){let e=d(2);r(),C(e.rolesFormArray.controls)}}function Oe(t,a){if(t&1&&(i(0,"p-panel")(1,"div",5)(2,"form",6),g(3,"input",7),h(4,De,3,0,"div"),n(),i(5,"p-tabs",8)(6,"p-tablist")(7,"p-tab",8),f(8,"Permission"),n(),i(9,"p-tab",9),f(10,"Description"),n()(),i(11,"p-tabpanels",10)(12,"p-tabpanel",8)(13,"form",6),h(14,Re,3,0,"div",11),n()(),i(15,"p-tabpanel",9)(16,"div",12),g(17,"textarea",13),n()()()()()()),t&2){let e=d();b(x(13,Ge)),r(2),s("formGroup",e.form),r(),s("fluid",!0)("ngClass",y(14,Ee,e.isInvalid("name"))),r(),_(e.isInvalid("name")?4:-1),r(3),S(y(16,ke,e.router.url.includes("forms"))),r(2),S(y(18,ke,e.router.url.includes("forms"))),r(4),s("formGroup",e.form),r(),_(e.rolesFormArray.length>0?14:-1),r(2),s("formGroup",e.form)}}var ft=(()=>{class t extends _e{constructor(){super(...arguments),this.service=c(Me),this.fb=c(oe),this.cdr=c(j),this.route=c(U),this.router=c(L),this.roleService=c(H),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[K.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(E(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(M(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(l=>{let m=this.fb.array(l.roles.map(p=>this.fb.group({id:this.fb.control(p.id),name:this.fb.control(p.name),checked:this.fb.control({value:e.form.rolesID.includes(p.id),disabled:!this.roleService.permissions().user.edit}),description:this.fb.control(p.description||"")}))),u=this.fb.group({groupName:this.fb.control(l.name),groupChecked:this.fb.control(!1),roles:m}),Te=m.controls.every(p=>p.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.permissions().user.edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(p=>{m.controls.forEach(F=>{F.get("checked").setValue(p,{emitEvent:!1})})}),m.valueChanges.subscribe(()=>{let p=m.controls.every(F=>F.get("checked").value);u.get("groupChecked").setValue(p,{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(m=>{m.get("checked").value&&e.push(m.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(M(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(l){return(e||(e=D(t)))(l||t)}})()}static{this.\u0275cmp=P({type:t,selectors:[["app-group-form"]],features:[w],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit"],["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"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[1,"text-danger"],[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,l){o&1&&(i(0,"app-main-panel",2),R(1,Ne,1,1,"ng-template",null,0,G)(3,Oe,18,20,"ng-template",null,1,G),n()),o&2&&s("overflowScroll",!0)},dependencies:[fe,ne,ie,re,X,J,Q,W,te,ee,Y,Z,z,q,le,ae,Fe,ve,ye,xe,Ce,be,he,ge,se,pe,ce,me,ue,de],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{ft as GroupFormComponent};
@@ -1 +1 @@
1
- import{a as T,b as K}from"./chunk-3MU7BZQU.js";import"./chunk-XZGQHWLM.js";import"./chunk-OS646RNF.js";import{m as R}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as O,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as j}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{o as I,t as V}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as v,Mb as C,Nb as y,R as M,Sb as c,Sc as m,T as k,Tb as n,Tc as l,Ub as o,V as A,Vb as u,Wc as S,ac as h,da as s,db as r,f as b,fc as x,gc as a,ka as g,la as _,ma as B,na as w,s as f,tc as P,ub as $}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,d){if(t&1){let e=h();n(0,"p-button",6),x("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function W(t,d){if(t&1){let e=h();n(0,"p-button",7),m(1,"async"),m(2,"async"),x("onClick",function(){g(e);let p=a(2);return _(p.migratePaymentAccount())}),o()}if(t&2){let e=a(2);c("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,d){if(t&1&&(n(0,"div",3),C(1,U,1,0,"p-button",4),C(2,W,3,6,"p-button",5),o()),t&2){let e=a();r(),y(e.roleService.permissions().migrate.delete?1:-1),r(),y(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),m(4,"async"),B(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),m(8,"async"),o()()()),t&2){let e=a();P(v(12,Q)),r(),P(v(13,Q)),r(2),c("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),c("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ye=(()=>{class t{constructor(){this.migrateService=s(T),this.toastr=s(j),this.refresh$=new b(void 0),this.pageTitle="Payment Account",this.roleService=s(R)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getPaymentMethodAccountCount()),A(i=>console.log("API response:",i)),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-payment-account"]],features:[E([T])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),o()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[J,V,D,O,L,H,z,q,K,G,N,I],encapsulation:2})}}return t})();export{ye as PaymentAccountComponent};
1
+ import{a as T,b as K}from"./chunk-IUZTFGKU.js";import"./chunk-G47TGGKM.js";import"./chunk-OS646RNF.js";import{m as R}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as O,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as j}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{o as I,t as V}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as v,Mb as C,Nb as y,R as M,Sb as c,Sc as m,T as k,Tb as n,Tc as l,Ub as o,V as A,Vb as u,Wc as S,ac as h,da as s,db as r,f as b,fc as x,gc as a,ka as g,la as _,ma as B,na as w,s as f,tc as P,ub as $}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,d){if(t&1){let e=h();n(0,"p-button",6),x("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function W(t,d){if(t&1){let e=h();n(0,"p-button",7),m(1,"async"),m(2,"async"),x("onClick",function(){g(e);let p=a(2);return _(p.migratePaymentAccount())}),o()}if(t&2){let e=a(2);c("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,d){if(t&1&&(n(0,"div",3),C(1,U,1,0,"p-button",4),C(2,W,3,6,"p-button",5),o()),t&2){let e=a();r(),y(e.roleService.permissions().migrate.delete?1:-1),r(),y(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),m(4,"async"),B(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),m(8,"async"),o()()()),t&2){let e=a();P(v(12,Q)),r(),P(v(13,Q)),r(2),c("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),c("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ye=(()=>{class t{constructor(){this.migrateService=s(T),this.toastr=s(j),this.refresh$=new b(void 0),this.pageTitle="Payment Account",this.roleService=s(R)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getPaymentMethodAccountCount()),A(i=>console.log("API response:",i)),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-payment-account"]],features:[E([T])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),o()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[J,V,D,O,L,H,z,q,K,G,N,I],encapsulation:2})}}return t})();export{ye as PaymentAccountComponent};
@@ -1 +1 @@
1
- import{a as y,b as K}from"./chunk-3MU7BZQU.js";import"./chunk-XZGQHWLM.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{o as I,t as O}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as b,Mb as _,Nb as h,R as k,Sb as l,Sc as s,T as w,Tb as o,Tc as m,Ub as n,V as B,Vb as u,Wc as S,ac as x,da as c,db as r,f as M,fc as v,gc as a,ka as C,la as d,ma as P,na as $,s as g,tc as T,ub as A}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,f){if(t&1){let e=x();o(0,"p-button",6),v("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function W(t,f){if(t&1){let e=x();o(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,f){if(t&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ve=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(V),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(j)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[E([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[J,O,G,N,D,R,L,H,z,q,K,I],encapsulation:2})}}return t})();export{ve as CoaConfigurationComponent};
1
+ import{a as y,b as K}from"./chunk-IUZTFGKU.js";import"./chunk-G47TGGKM.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{o as I,t as O}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as b,Mb as _,Nb as h,R as k,Sb as l,Sc as s,T as w,Tb as o,Tc as m,Ub as n,V as B,Vb as u,Wc as S,ac as x,da as c,db as r,f as M,fc as v,gc as a,ka as C,la as d,ma as P,na as $,s as g,tc as T,ub as A}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,f){if(t&1){let e=x();o(0,"p-button",6),v("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function W(t,f){if(t&1){let e=x();o(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,f){if(t&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ve=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(V),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(j)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[E([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[J,O,G,N,D,R,L,H,z,q,K,I],encapsulation:2})}}return t})();export{ve as CoaConfigurationComponent};
@@ -1,8 +1,8 @@
1
- import{a as Oe,b as je}from"./chunk-YBZNHUZR.js";import{a as Je,b as ze}from"./chunk-QVBTMKUV.js";import{a as Ue,b as He}from"./chunk-NNU2L44G.js";import{a as Ge}from"./chunk-HOVGLXVU.js";import{a as S}from"./chunk-SFVYLTAA.js";import{a as Ne}from"./chunk-XZGQHWLM.js";import"./chunk-OS646RNF.js";import"./chunk-5TAKHYWV.js";import{m as z}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as Pe,g as Ve,h as Be,i as X}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as ke,b as Ie}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Re}from"./chunk-TTIQSVQF.js";import{a as De,b as Ee}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as Me}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as v}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import{a as k,b as I}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as M,I as Q,y as K,z as E}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{Ta as D,b as T,c as pe,e as A,f as U,j as we,n as Te,o as Ae,p as H,q as W,v as $,x as L,y as q}from"./chunk-OQDKL2MG.js";import{b as Se}from"./chunk-7NZRUZLK.js";import{a as Fe}from"./chunk-WDFE7CAE.js";import{a as ye}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-WNU7SPEQ.js";import{i as be,r as ve,t as J}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as _,Ac as N,Bc as G,Cc as O,I as fe,Ic as j,Jc as ae,Kc as le,Mb as y,Nb as F,Ob as Ce,Pb as ge,Qb as oe,Rb as ie,Sb as h,Sc as ce,Tb as i,Tc as me,U as he,Ub as r,V,Vb as C,Wc as d,_ as _e,_c as se,ac as g,da as p,db as s,e as de,fc as x,gc as l,ka as u,la as f,nb as ne,s as ue,tc as re,ub as b,vc as a,wa as B,wc as xe,xc as w}from"./chunk-T6YHDD6J.js";import{a as R,b as P}from"./chunk-PRARYYF3.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),y(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),F(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datepicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",27),a(2),r(),i(3,"td"),C(4,"input",28),r(),i(5,"td"),C(6,"input",29),r()()),t&2){let e,n=c.$implicit,o=c.$index,m=l(4);h("formGroupName",o),s(2),w(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),oe(14,mt,7,2,"tr",10,ge),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);h("formGroupName",n),s(2),w(" ",e.get("name").value," "),s(12),ie(o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),_(1,ct,4,0,"ng-template",null,2,d),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),oe(6,st,16,2,"div",10,Ce),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),ce(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),ce(21,"number"),r()()()()()()),t&2){let e=l(2);re(ae(11,it)),h("formGroup",e.formGroups),s(4),re(ae(12,rt)),s(2),ie(e.formsArray.controls),s(10),w(" ",me(17,7,e.subtotalDebit)," "),s(4),w(" ",me(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&y(0,pt,22,13,"p-panel",7),t&2){let e=l();F(e.formGroups?0:-1)}}var Le=(()=>{class t{constructor(){this.destroy$=new de,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p($),this.accSetupService=p(S),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(Se),this.roleService=p(z)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(fe(300),he(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ue(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),tt=o.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
1
+ import{a as Oe,b as je}from"./chunk-YBZNHUZR.js";import{a as Je,b as ze}from"./chunk-QVBTMKUV.js";import{a as Ue,b as He}from"./chunk-NNU2L44G.js";import{a as Ge}from"./chunk-HOVGLXVU.js";import{a as S}from"./chunk-SFVYLTAA.js";import{a as Ne}from"./chunk-G47TGGKM.js";import"./chunk-OS646RNF.js";import"./chunk-5TAKHYWV.js";import{m as z}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as Pe,g as Ve,h as Be,i as X}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as ke,b as Ie}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Re}from"./chunk-TTIQSVQF.js";import{a as De,b as Ee}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as Me}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as v}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import{a as k,b as I}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as M,I as Q,y as K,z as E}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{Ta as D,b as T,c as pe,e as A,f as U,j as we,n as Te,o as Ae,p as H,q as W,v as $,x as L,y as q}from"./chunk-OQDKL2MG.js";import{b as Se}from"./chunk-7NZRUZLK.js";import{a as Fe}from"./chunk-WDFE7CAE.js";import{a as ye}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-IOMTH2KS.js";import{i as be,r as ve,t as J}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as _,Ac as N,Bc as G,Cc as O,I as fe,Ic as j,Jc as ae,Kc as le,Mb as y,Nb as F,Ob as Ce,Pb as ge,Qb as oe,Rb as ie,Sb as h,Sc as ce,Tb as i,Tc as me,U as he,Ub as r,V,Vb as C,Wc as d,_ as _e,_c as se,ac as g,da as p,db as s,e as de,fc as x,gc as l,ka as u,la as f,nb as ne,s as ue,tc as re,ub as b,vc as a,wa as B,wc as xe,xc as w}from"./chunk-T6YHDD6J.js";import{a as R,b as P}from"./chunk-PRARYYF3.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),y(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),F(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datepicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",27),a(2),r(),i(3,"td"),C(4,"input",28),r(),i(5,"td"),C(6,"input",29),r()()),t&2){let e,n=c.$implicit,o=c.$index,m=l(4);h("formGroupName",o),s(2),w(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),oe(14,mt,7,2,"tr",10,ge),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);h("formGroupName",n),s(2),w(" ",e.get("name").value," "),s(12),ie(o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),_(1,ct,4,0,"ng-template",null,2,d),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),oe(6,st,16,2,"div",10,Ce),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),ce(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),ce(21,"number"),r()()()()()()),t&2){let e=l(2);re(ae(11,it)),h("formGroup",e.formGroups),s(4),re(ae(12,rt)),s(2),ie(e.formsArray.controls),s(10),w(" ",me(17,7,e.subtotalDebit)," "),s(4),w(" ",me(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&y(0,pt,22,13,"p-panel",7),t&2){let e=l();F(e.formGroups?0:-1)}}var Le=(()=>{class t{constructor(){this.destroy$=new de,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p($),this.accSetupService=p(S),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(Se),this.roleService=p(z)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(fe(300),he(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ue(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),tt=o.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
2
2
  width`,`calc(
3
3
  100% - 243px
4
4
  )`,`/* adjust width to fit the remaining space */
5
5
  z-index`,"91","background-color","white",`/* added background */
6
6
  /* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
7
7
  padding`,"8px 0",`/* added padding for height */
8
- border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-HFBOGVOC.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-LPQEYBQJ.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-FVGNCLOK.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-4PQV7T7O.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-5GRB6DBD.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-3YEWFLAB.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-XRSMVQPC.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-VU37VDEH.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
8
+ border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-2PCXAGSU.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-FVZSSGLW.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-P7RJNJL5.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-2T56LR43.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-VW4UPUOQ.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-IJEKBDUV.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-IGKIW34O.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-P5IEYFQS.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{m as p}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{h as d}from"./chunk-5FVLV36I.js";import"./chunk-MTPMCC6U.js";import"./chunk-3BPX4XM7.js";import"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WNU7SPEQ.js";import"./chunk-ISLNIBSF.js";import{Ab as l,Tb as t,Ub as n,Vb as m,Wc as c,da as r,ub as a,vc as i}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";function f(e,u){e&1&&(t(0,"div",2),m(1,"img",3),t(2,"h1",4),i(3,"You are not authorized"),n(),t(4,"p",5),i(5," This page require "),t(6,"span",6),i(7,"Journal"),n(),i(8," role. Please contact your Administrator to gain access! "),n()())}var y=(()=>{class e{constructor(){this.roleService=r(p)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-forbidden"]],decls:3,vars:0,consts:[["content",""],["pageTitle","Unauthorized"],[1,"h-100","d-flex","flex-column","justify-content-center","align-items-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg","alt","Forbidden"],[1,"fs-6","fw-semibold"],[1,"fs-3"],[1,"fw-semibold"]],template:function(o,g){o&1&&(t(0,"app-main-panel",1),l(1,f,9,0,"ng-template",null,0,c),n())},dependencies:[d],encapsulation:2})}}return e})();export{y as ForbiddenComponent};
1
+ import{m as p}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{h as d}from"./chunk-2LLPIDXP.js";import"./chunk-MTPMCC6U.js";import"./chunk-3BPX4XM7.js";import"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-IOMTH2KS.js";import"./chunk-ISLNIBSF.js";import{Ab as l,Tb as t,Ub as n,Vb as m,Wc as c,da as r,ub as a,vc as i}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";function f(e,u){e&1&&(t(0,"div",2),m(1,"img",3),t(2,"h1",4),i(3,"You are not authorized"),n(),t(4,"p",5),i(5," This page require "),t(6,"span",6),i(7,"Journal"),n(),i(8," role. Please contact your Administrator to gain access! "),n()())}var y=(()=>{class e{constructor(){this.roleService=r(p)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-forbidden"]],decls:3,vars:0,consts:[["content",""],["pageTitle","Unauthorized"],[1,"h-100","d-flex","flex-column","justify-content-center","align-items-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg","alt","Forbidden"],[1,"fs-6","fw-semibold"],[1,"fs-3"],[1,"fw-semibold"]],template:function(o,g){o&1&&(t(0,"app-main-panel",1),l(1,f,9,0,"ng-template",null,0,c),n())},dependencies:[d],encapsulation:2})}}return e})();export{y as ForbiddenComponent};