dealposbooks 5.34.0 → 5.36.0

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 (59) hide show
  1. package/{chunk-G2YSKFGD.js → chunk-2RLNYYQR.js} +1 -1
  2. package/{chunk-5LRPK5BI.js → chunk-3D3GRYF3.js} +1 -1
  3. package/{chunk-5ATZKXRQ.js → chunk-4CNNMBJW.js} +1 -1
  4. package/{chunk-5JDKHEBJ.js → chunk-5IQ6TGNN.js} +1 -1
  5. package/chunk-5SIB7PEU.js +129 -0
  6. package/{chunk-RHOQDE75.js → chunk-6UA2VGP4.js} +1 -1
  7. package/{chunk-7LVIHCFH.js → chunk-6WEZS6IX.js} +1 -1
  8. package/{chunk-EUOA6ZNN.js → chunk-74BKLSFH.js} +1 -1
  9. package/{chunk-OZ2ESPRJ.js → chunk-7C3I4R2I.js} +1 -1
  10. package/{chunk-2LSXB7YZ.js → chunk-7CHVAZTI.js} +1 -1
  11. package/{chunk-LUPSXHRX.js → chunk-7HTH3SFF.js} +1 -1
  12. package/chunk-A5HAJEPC.js +1 -0
  13. package/{chunk-LRDAZKGE.js → chunk-AMANMDZU.js} +1 -1
  14. package/{chunk-AP26QGQW.js → chunk-ANCPMGSL.js} +1 -1
  15. package/chunk-AUF6ZNSG.js +160 -0
  16. package/{chunk-6MOM7AXR.js → chunk-B54WGNWI.js} +1 -1
  17. package/{chunk-LD7LVE2B.js → chunk-BAH2FNAN.js} +1 -1
  18. package/{chunk-YWXAUVYL.js → chunk-CGK3QRS6.js} +1 -1
  19. package/{chunk-754GP2RS.js → chunk-CUVEPFZP.js} +1 -1
  20. package/{chunk-U72SOCJH.js → chunk-DG42ZBO4.js} +1 -1
  21. package/{chunk-KPWIGW52.js → chunk-DHTMHV6T.js} +1 -1
  22. package/{chunk-6KHNAQCS.js → chunk-EPJW6GIY.js} +1 -1
  23. package/{chunk-P2OCX57R.js → chunk-F3JN6BPV.js} +1 -1
  24. package/{chunk-IDDGY7P4.js → chunk-FZ7YN3KE.js} +1 -1
  25. package/{chunk-ZJ4T6ZG6.js → chunk-GAN5PRIS.js} +1 -1
  26. package/{chunk-G33PO2GU.js → chunk-GMSTFECE.js} +1 -1
  27. package/{chunk-APY3KUFM.js → chunk-L3OMRCAX.js} +1 -1
  28. package/chunk-L4XMRLHM.js +1 -0
  29. package/{chunk-6TVP5OOO.js → chunk-M2HJCLEP.js} +1 -1
  30. package/chunk-MSW4JBUU.js +7 -0
  31. package/{chunk-GWSNPXC6.js → chunk-NU67ULMO.js} +1 -1
  32. package/{chunk-TJLNG6VF.js → chunk-O2K45NCM.js} +1 -1
  33. package/{chunk-45LSSSIH.js → chunk-O3K2CNOY.js} +1 -1
  34. package/{chunk-Z2QDMAKC.js → chunk-OVQDITWG.js} +1 -1
  35. package/{chunk-V3CVBFI5.js → chunk-P4OK4B27.js} +1 -1
  36. package/{chunk-4ANXCMQU.js → chunk-PAWHO2BN.js} +1 -1
  37. package/{chunk-UZZM57TN.js → chunk-RC2E4TKB.js} +1 -1
  38. package/{chunk-VRCICMG6.js → chunk-RO3TPZFM.js} +1 -1
  39. package/chunk-SMZ363LC.js +1 -0
  40. package/{chunk-BBQIPZWM.js → chunk-T43HOKPK.js} +1 -1
  41. package/chunk-TYMCW3J6.js +1 -0
  42. package/{chunk-XVS4T3KX.js → chunk-UUMZZMTS.js} +1 -1
  43. package/{chunk-EGR3U7VD.js → chunk-V4KVFLMH.js} +1 -1
  44. package/{chunk-OHDWZ3ZU.js → chunk-VFC5APMC.js} +1 -1
  45. package/{chunk-HNBUQBBT.js → chunk-VIJVOI6Y.js} +1 -1
  46. package/{chunk-MDEJN7RJ.js → chunk-W7U7YCR2.js} +1 -1
  47. package/{chunk-2MVACU4N.js → chunk-WGJIBSIS.js} +1 -1
  48. package/{chunk-Y75WHRI7.js → chunk-WJL3LNRF.js} +1 -1
  49. package/{chunk-GBKTFERL.js → chunk-Y46HDVD4.js} +1 -1
  50. package/{chunk-DQQ6JL6H.js → chunk-Z545HOL6.js} +1 -1
  51. package/index.html +2 -2
  52. package/{main-YSVUVFRK.js → main-M6EX446M.js} +1 -1
  53. package/package.json +1 -1
  54. package/chunk-BHV2HCJY.js +0 -1
  55. package/chunk-CZNQPNZD.js +0 -160
  56. package/chunk-DYCHYHHI.js +0 -1
  57. package/chunk-IOIIEN6T.js +0 -129
  58. package/chunk-N2GNLX5X.js +0 -1
  59. package/chunk-WFQ3EPZT.js +0 -7
@@ -0,0 +1,160 @@
1
+ import{a as pt,b as ut}from"./chunk-B46T5XRJ.js";import{a as dt}from"./chunk-BTDW4G2F.js";import{a as $n,b as Pe,c as Me,d as Kn}from"./chunk-5XDCBC5Q.js";import{a as Rn,b as Bn}from"./chunk-YYVQS5LF.js";import"./chunk-FLZXCWDU.js";import{a as qn,b as zn}from"./chunk-NJO5TWIA.js";import{a as Gn}from"./chunk-XKI7WLHE.js";import{a as Dn}from"./chunk-Q23KXB3T.js";import"./chunk-DHW7UHFT.js";import{a as Ee}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as at,b as lt}from"./chunk-O4QM64EH.js";import{a as ct,b as mt,c as On,d as Fn,i as Nn,j as Vn,k as Ln}from"./chunk-SVXDMOLP.js";import"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Z}from"./chunk-OVQDITWG.js";import{a as E}from"./chunk-XKCLERWG.js";import{b as vn}from"./chunk-H57SDRPH.js";import{a as yn}from"./chunk-GDX5XEV3.js";import{a as kn,b as st}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{a as rt,b as K}from"./chunk-4CDAAU6Z.js";import{f as Mn,h as $}from"./chunk-7HTH3SFF.js";import{b as ot,c as _e}from"./chunk-X22YKT5B.js";import{a as ae,b as le}from"./chunk-JYCUE5HV.js";import{a as W,b as Tn,c as wn,e as An,f as En,g as Pn}from"./chunk-JMEBBWX4.js";import{c as Je,d as an,f as ln}from"./chunk-FUZFAJGJ.js";import{a as Tt,f as wt,n as nt,o as it,p as bn,t as Sn,u as At,w as oe,x as re}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{Aa as gn,D as It,Da as hn,I as sn,Ia as xn,K as cn,La as Ae,M as mn,Ma as Re,Oa as Cn,Q as et,R as tt,Ua as In,W as pn,X as yt,_ as un,b as ne,c as fe,da as dn,e as j,f as ye,g as on,ga as fn,i as D,j as Xe,k as rn,ka as _n,l as be,na as bt,o as ve,qa as ie,u as Se,va as vt,w as Te,wa as St,x as we}from"./chunk-G5S5AZA7.js";import{b as ee,d as te,e as B,l as L}from"./chunk-Z45NTTES.js";import{a as nn}from"./chunk-BAH2FNAN.js";import"./chunk-BLQJXMNV.js";import{c as xt,d as Ct,f as Le,h as De}from"./chunk-F2X3VGZZ.js";import{h as z,j as We,k as N,l as ht,m as en,p as tn,q as Ye,r as V,s as Ve}from"./chunk-OKCHQM5Q.js";import{Ab as Fe,Ac as S,Bc as Yt,Cb as d,D as qe,Ga as b,J as ze,Jb as P,Jc as ue,Kb as s,Kc as Ce,L as $t,Lc as Xt,Mc as y,Nb as X,O as Kt,Ob as Ne,Pb as Ut,Qb as jt,Sb as Zt,Tb as Qt,Ub as a,Vb as r,Vc as de,Wb as h,Wc as Ie,X as R,Xb as ce,Yb as me,Yc as Q,Z as w,Zc as Jt,_b as A,aa as qt,ba as Ge,bb as Oe,c as Ke,ca as zt,cb as Gt,dc as v,ec as m,gb as c,ha as x,jc as Ue,kc as pe,lc as H,mb as gt,mc as U,pa as _,pc as J,qa as g,qc as p,rc as T,s as G,sc as he,t as Bt,ta as He,uc as Wt,vc as je,wb as F,wc as Ze,xb as Ht,xc as Qe,yc as xe,za as Y,zc as M}from"./chunk-JP6RBSB3.js";import{a as C,b as I}from"./chunk-YQFG5XE2.js";var ii=["class","page"],oi=t=>({id:t}),ri=()=>({"overflow-x":"auto"}),ai=t=>({"table-borderless":t}),li=t=>["fa-solid",t],si=t=>["/pages/journal/journal-entry/",t];function ci(t,l){t&1&&h(0,"p-button",8)}function mi(t,l){if(t&1){let e=A();a(0,"p-button",9),v("onClick",function(){_(e);let i=m(2);return g(i.onDelete())}),r()}}function pi(t,l){if(t&1&&(a(0,"div",4)(1,"p-button-group"),d(2,ci,1,0,"p-button",5)(3,mi,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,n=m();c(2),s("ngIf",n.roleService.coa.edit),c(),s("ngIf",n.roleService.coa.delete),c(),s("queryParams",S(3,oi,(e=n.COAInfo())==null?null:e.id))}}function ui(t,l){if(t&1&&h(0,"i",23),t&2){let e=l.checked;s("ngClass",S(1,li,e?"fa-check":"fa-xmark"))}}function di(t,l){if(t&1&&(a(0,"tr")(1,"td")(2,"div",24)(3,"a",25),p(4),r(),a(5,"span",26),p(6),ue(7,"date"),r()()(),a(8,"td"),p(9),ue(10,"number"),r(),a(11,"td"),p(12),ue(13,"number"),r(),a(14,"td"),p(15),ue(16,"number"),r()()),t&2){let e=l.$implicit;c(3),s("routerLink",S(15,si,e.id)),c(),T(e.number),c(2),T(Xt(7,6,e.date,"dd MMM yyyy")),c(3),T(Ce(10,9,e.creditAmount)),c(3),T(Ce(13,11,e.debitAmount)),c(3),T(Ce(16,13,e.balance))}}function fi(t,l){t&1&&(a(0,"tr")(1,"td",27)(2,"div",28),h(3,"img",29),a(4,"div",24)(5,"span",30),p(6,"No Data Available"),r(),a(7,"span",30),p(8,"Your data will be shown here once it's available"),r()()()()())}function _i(t,l){if(t&1){let e=A();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Outlet"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),v("onChange",function(i){_(e);let o=m(2);return g(o.onDiscontinued(i))}),d(34,ui,1,3,"ng-template",null,2,y),r()()()()()(),a(36,"div",13)(37,"p-card",20)(38,"table",21)(39,"thead")(40,"tr")(41,"th",22),p(42,"Number"),r(),a(43,"th",22),p(44,"Credit"),r(),a(45,"th",22),p(46,"Debit"),r(),a(47,"th",22),p(48,"Balance"),r()()(),a(49,"tbody"),Zt(50,di,17,17,"tr",null,jt),d(52,fi,9,0,"tr"),r()()()()()}if(t&2){let e,n,i,o,u,f=m(2);c(8),T((e=f.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),T((n=f.COAInfo().code)!==null&&n!==void 0?n:"-"),c(5),T((i=f.COAInfo().category)!==null&&i!==void 0?i:"-"),c(5),T((o=f.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),T((u=f.COAInfo().outletName)!==null&&u!==void 0?u:"-"),c(5),s("ngModel",f.COAInfo().bin),c(4),X(M(10,ri)),c(),s("ngClass",S(11,ai,f.COAInfo().transactions.length===0)),c(12),Qt(f.COAInfo().transactions),c(2),Ut(f.COAInfo().transactions.length===0?52:-1)}}function gi(t,l){if(t&1&&(a(0,"div",10),d(1,_i,53,13,"div",11),r()),t&2){let e=m();c(),s("ngIf",e.COAInfo())}}var Hn=(()=>{class t{constructor(){this.#e=x(Z),this.#t=x(ee),this.router=x(te),this.COAInfo=b(null),this.checked=b(!1),this.roleService=x(Ee)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(E("params"),R(e=>this.#e.getChartAccountById(e.get("id"))),w(e=>this.COAInfo.set(e)),E("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let n=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(n).pipe(w(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:ii,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-6"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-3"],[1,"col"],[3,"onChange","ngModel"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"fs-2"],["colspan","4",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(n,i){n&1&&(a(0,"app-main-panel",3),d(1,pi,6,5,"ng-template",null,0,y)(3,gi,2,1,"ng-template",null,1,y),r()),n&2&&s("overflowScroll",!0)},dependencies:[V,z,N,Ye,tn,Te,j,Xe,Je,L,B,$,K,rt,re,oe,ut,pt,On,Dn],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var se=(()=>{class t{constructor(){this.httpService=x(nn)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let n={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",n)}renameCategory(e,n){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,n)}updateParentCategory(e,n){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,n).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,n={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Pt=t=>t?t.reduce((l,e)=>(l.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?l.push(...Pt(e.children)):l.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),l),[]):[];var Mt=(t,l,e)=>{let n=Math.ceil(e/l),i=(t-1)*l+1,o=Math.min(t*l,e);return{start:i,end:o,totalRecords:e,totalPages:n}};var hi={filter:{RowCount:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2},options:{entities:[],categories:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},kt=Tn(En(hi),Pn("ChartOfAccount"),wn(t=>({isAllChecked:Q(()=>t.data().every(l=>l.checked)),checkedItems:Q(()=>t.data().filter(l=>l.checked)),IDsChecked:Q(()=>t.data().filter(l=>l.checked).map(l=>l.id)),categories:Q(()=>Pt(t.options.categories())),first:Q(()=>{let{start:l}=Mt(t.filter().PageNumber,t.filter().RowCount,t.count());return l}),last:Q(()=>{let{end:l}=Mt(t.filter().PageNumber,t.filter().RowCount,t.count());return l})})),An(t=>{let l=x(Z),e=x(se),n={updateFilter(i){W(t,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let u=t.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(t,{data:u})});else{let o=i,u=t.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(t,{data:u})}},checkAllCheckbox(){let i=t.data().map(o=>I(C({},o),{checked:!o.checked}));W(t,{data:i})},fetchChartOfAccount:at(Ke(qe(()=>!!t.filter()),$t(300),Kt(),R(i=>l.getPaginatedChartAccounts(i).pipe(G(o=>I(C({},o),{data:o.data.map(u=>I(C({},u),{checked:!1}))})),lt({next:o=>W(t,{data:o.data,count:o.count}),error:o=>{W(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:at(Ke(R(()=>l.getChartOfAccountLoader().pipe(lt({next:i=>{W(t,{filter:I(C({},t.filter()),{RowCount:i.filter.rowCount,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),n.fetchChartOfAccount(t.filter)},error:i=>{console.error(i)}}))))),getCategories:at(Ke(ze(()=>e.fetchCOACategories().pipe(lt({next:i=>{W(t,{options:{entities:t.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return n}));var Ii=["class","page"],yi=t=>["../account/",t],bi=t=>({"text-decoration-line-through":t}),vi=()=>["/pages/report/general-ledger"],Si=t=>({id:t}),Ti=()=>({width:"100%"}),wi=()=>({scrollHeight:"200px"});function Ai(t,l){if(t&1){let e=A();a(0,"p-button",13),v("onClick",function(){_(e);let i=m(2);return g(i.deleteCOA())}),r()}}function Ei(t,l){t&1&&h(0,"p-button",14)}function Pi(t,l){if(t&1){let e=A();a(0,"p-button",15),v("onClick",function(){_(e);let i=m(2);return g(i.onExport())}),r()}}function Mi(t,l){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function ki(t,l){if(t&1&&(a(0,"div",8),d(1,Ai,1,0,"p-button",9),a(2,"p-button-group"),d(3,Ei,1,0,"p-button",10)(4,Pi,1,0,"p-button",11),r(),d(5,Mi,3,0,"a",12),r()),t&2){let e=m();c(),s("ngIf",e.store.checkedItems().length&&e.roleService.coa.delete),c(2),s("ngIf",e.roleService.coa.create),c(),s("ngIf",e.roleService.global.export),c(),s("ngIf",e.roleService.coa.create)}}function Oi(t,l){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Fi(t,l){if(t&1&&(a(0,"tr"),d(1,Oi,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),s("ngIf",e.roleService.coa.delete)}}function Ni(t,l){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),s("value",e)}}function Vi(t,l){if(t&1&&(a(0,"tr"),d(1,Ni,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),ue(14,"number"),r()()()),t&2){let e,n=l.$implicit,i=m(2);c(),s("ngIf",i.roleService.coa.delete),c(2),T(n.code),c(2),s("routerLink",S(12,yi,n.id))("ngClass",S(14,bi,n.bin)),c(),T(n.name),c(2),T(n.category),c(2),T(n.outletName),c(2),s("routerLink",M(16,vi))("queryParams",S(17,Si,n.id)),c(),T(Ce(14,10,(e=n.balance)!==null&&e!==void 0?e:0))}}function Li(t,l){if(t&1&&p(0),t&2){let e=m(2);Wt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Di(t,l){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function Ri(t,l){if(t&1){let e=A();a(0,"p-panel")(1,"p-table",18),v("onLazyLoad",function(i){_(e);let o=m();return g(o.loadData(i))})("onRowSelect",function(i){_(e);let o=m();return g(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=m();return g(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=m();return g(o.onSelectAll(i))})("onPage",function(i){_(e);let o=m();return g(o.onPageChange(i))}),d(2,Fi,12,1,"ng-template",null,3,y)(4,Vi,15,19,"ng-template",null,4,y)(6,Li,1,3,"ng-template",null,5,y)(8,Di,4,0,"ng-template",null,6,y),r()()}if(t&2){let e=m();c(),s("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().RowCount)("totalRecords",e.store.count())}}function Bi(t,l){if(t&1){let e=A();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),v("onFocus",function(){_(e);let i=m(2);return g(i.onCategoryFocus())}),r()(),a(9,"div",33)(10,"label",30),p(11,"Page Size"),r(),h(12,"input",34),r(),a(13,"div",33)(14,"label",30),p(15,"Discontinued"),r(),a(16,"div",35)(17,"div",36),h(18,"p-radiobutton",37),a(19,"label",38),p(20,"No"),r()(),a(21,"div",36),h(22,"p-radiobutton",39),a(23,"label",40),p(24,"Yes"),r()(),a(25,"div",36),h(26,"p-radiobutton",39),a(27,"label",40),p(28,"All"),r()()()()()}if(t&2){let e=m(2);s("formGroup",e.formFilter),c(4),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),X(M(15,Ti)),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",M(16,wi))("options",e.categoryNodes()),c(10),s("value",0),c(4),s("value",1),c(4),s("value",2)}}function $i(t,l){if(t&1&&d(0,Bi,29,17,"form",27),t&2){let e=m();s("ngIf",e.formFilter)}}var jn=(()=>{class t{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().RowCount),this.generateFilterForm()}#e;constructor(){this.routeInfo=Zn,this.store=x(kt),this.#e=x(Z),this.modalService=x(an),this.roleService=x(Ee),this.dialogVisible=b(!1),this.categoryNodes=b([]),this.fb=x(Se),this.isDialogFilterVisible=b(!1),this.generateFilterForm()}generateFilterForm(){this.formFilter=this.fb.group({outletID:this.fb.control([]),categoryID:this.fb.control(null),pageSize:this.fb.control(this.store.filter().RowCount),discontinued:this.fb.control(2)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(I(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(w(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(I(C({},this.store.filter()),{Text:e}))}updateFilter(e,n){this.store.updateFilter(I(C({},this.store.filter()),{[e]:n}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(E("response"),w(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(I(C({},this.store.filter()),{Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:n,outletID:i,discontinued:o}=this.formFilter.value;this.store.updateFilter(I(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",RowCount:+n,Discontinued:o})),this.isDialogFilterVisible.update(u=>!u)}onExport(){let e=I(C({},this.store.filter()),{ExportPageNumber:1,ExportRowCount:1e4});this.#e.exportChartOfAccounts(e).pipe(w(n=>{let i=n.headers;console.log("All headers:",i.keys());let o=i.get("Content-Disposition"),u=i.get("content-disposition"),f=o??u,k="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(k=decodeURIComponent(q[1].replace(/"/g,"")))}let O=n.body;Kn(O,k,O.type)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[xe([kt])],attrs:Ii,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["containerStyleClass","w-100","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",1,"w-100",3,"onFocus","showClear","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(n,i){if(n&1){let o=A();a(0,"app-main-panel",7),v("search",function(f){return _(o),g(i.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(i.isDialogFilterVisible,f)||(i.isDialogFilterVisible=f),g(f)}),v("filterEmitted",function(){return _(o),g(i.onFilterEvent())})("filterConfirmed",function(){return _(o),g(i.onFilterOKEvent())}),d(1,ki,6,4,"ng-template",null,0,y)(3,Ri,10,5,"ng-template",null,1,y)(5,$i,1,1,"ng-template",null,2,y),r()}n&2&&(s("isSearchableInput",!0),je("isDialogFilterVisible",i.isDialogFilterVisible),s("isFilterable",!0)("scrollable",!0))},dependencies:[V,z,N,Ye,$,ln,ut,pt,dt,Te,rn,ne,j,ye,L,B,we,be,ve,Je,Ln,Fn,Nn,Vn,K,Mn,re,oe,st,it,nt,_e,Bn,Rn,Me,Pe,le,ae,mt,ct],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var qi=["class","page"],zi=()=>["../../"],Ft=t=>({"ng-invalid ng-dirty":t}),Gi=t=>({"ng-dirty ng-invalid":t});function Hi(t,l){if(t&1){let e=A();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),v("onClick",function(){_(e);let i=m();return g(i.onSubmit())}),r()()}t&2&&(c(),s("routerLink",M(1,zi)))}function Ui(t,l){t&1&&(a(0,"div",27),p(1," Name is required "),r())}function ji(t,l){if(t&1&&(a(0,"div"),d(1,Ui,2,0,"div",26),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Name.errors.required)}}function Zi(t,l){t&1&&(a(0,"div",28)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Qi(t,l){if(t&1&&(a(0,"span",29),p(1),r()),t&2){let e=l.$implicit;s("pTooltip",e.name),c(),he(" ",e.name," ")}}function Wi(t,l){t&1&&(a(0,"div",27),p(1," Code is required "),r())}function Yi(t,l){if(t&1&&(a(0,"div"),d(1,Wi,2,0,"div",26),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Code.errors.required)}}function Xi(t,l){if(t&1&&p(0),t&2){let e=l.$implicit;he(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function Ji(t,l){t&1&&(a(0,"div",27),p(1," Category is required "),r())}function eo(t,l){if(t&1&&(a(0,"div"),d(1,Ji,2,0,"div",26),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Category.errors.required)}}function to(t,l){t&1&&(a(0,"div",27),p(1," Note is required "),r())}function no(t,l){if(t&1&&(a(0,"div"),d(1,to,2,0,"div",26),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Note.errors.required)}}function io(t,l){t&1&&(a(0,"div",27),p(1," Note is required "),r())}function oo(t,l){if(t&1&&(a(0,"div"),d(1,io,2,0,"div",26),r()),t&2){let e=m(3);c(),s("ngIf",e.form.controls.Note.errors.required)}}function ro(t,l){if(t&1&&(a(0,"div",12)(1,"div",13)(2,"label",14),p(3,"Discontinued"),r(),a(4,"div",30)(5,"div",31),h(6,"p-radiobutton",32),a(7,"label",33),p(8,"No"),r()(),a(9,"div",31),h(10,"p-radiobutton",34),a(11,"label",35),p(12,"Yes"),r()()(),d(13,oo,2,1,"div",16),r()()),t&2){let e=m(2);c(6),s("value",!1),c(4),s("value",!0),c(3),s("ngIf",e.form.controls.Note.errors)}}function ao(t,l){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"div",13)(6,"label",14),p(7,"Name"),r(),h(8,"input",15),d(9,ji,2,1,"div",16),r()(),a(10,"div",12)(11,"div",13)(12,"div")(13,"label",14),p(14,"Outlet"),r(),h(15,"p-button",17),d(16,Zi,3,0,"ng-template",null,2,y),r(),a(18,"p-select",18),d(19,Qi,2,2,"ng-template",null,3,y),r()()(),a(21,"div",12)(22,"div",13)(23,"label",14),p(24,"Code"),r(),h(25,"input",19),d(26,Yi,2,1,"div",16),r()(),a(27,"div",20)(28,"div",21)(29,"label",14),p(30,"Category"),r(),a(31,"p-treeselect",22),d(32,Xi,1,1,"ng-template",23),r(),d(33,eo,2,1,"div",16),r()(),a(34,"div",12)(35,"div",13)(36,"label",14),p(37,"Note"),r(),h(38,"textarea",24),d(39,no,2,1,"div",16),r()(),d(40,ro,14,3,"div",25),r()()()()),t&2){let e=J(17),n=m();c(),s("formGroup",n.form),c(7),s("ngClass",S(15,Ft,n.form.controls.Name.invalid&&(n.form.controls.Name.dirty||n.form.controls.Name.touched))),c(),s("ngIf",n.form.controls.Name.invalid&&(n.form.controls.Name.dirty||n.form.controls.Name.touched)),c(6),s("pTooltip",e)("rounded",!0)("text",!0),c(3),s("options",n.outlets()),c(7),s("ngClass",S(17,Ft,n.form.controls.Code.invalid&&(n.form.controls.Code.dirty||n.form.controls.Code.touched))),c(),s("ngIf",n.form.controls.Code.invalid&&(n.form.controls.Code.dirty||n.form.controls.Code.touched)),c(5),s("options",n.categoryOptions())("ngClass",S(19,Gi,n.form.controls.Category.invalid&&(n.form.controls.Category.dirty||n.form.controls.Category.touched))),c(2),s("ngIf",n.form.controls.Category.invalid&&(n.form.controls.Category.dirty||n.form.controls.Category.touched)),c(5),s("ngClass",S(21,Ft,n.form.controls.Note.invalid&&(n.form.controls.Note.dirty||n.form.controls.Note.touched))),c(),s("ngIf",n.form.controls.Note.errors),c(),s("ngIf",n.hasIdParam&&!n.coa_info().form.bin)}}var Nt=(()=>{class t{constructor(){this.route=x(ee),this.coa_service=x(Z),this.coa_info=b(null),this.fb=x(Se),this.isEdit=b(!1),this.categoryOptions=b([]),this.router=x(te),this.outlets=Q(()=>this.coa_info()?this.coa_info().options.entities:[])}findParenChilds(e,n){function i(o,u=null){for(let f of o){if(f.key===n)return{parent:u,child:f};if(f.children){let k=i(f.children,f);if(k)return k}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new D(e.id||""),Name:new D(e.name||"",[fe.required]),Code:new D(e.code||"",[fe.required]),Note:new D(e.note||"",[]),Balance:new D(e.balance||0),Outlet:new D(e.outletID||""),AccessType:new D(e.accessTypeID||0),Category:new D(null,[fe.required]),Bin:new D(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(ze(e=>{if(e.has("id")){this.isEdit.set(!0);let n=e.get("id");return this.coa_service.getChartAccountFormById(n)}else return this.coa_service.getChartAccountForm()}),E("response"),G(e=>I(C({},e),{form:I(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),w(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:n,Category:i,Code:o,Name:u,Note:f,Outlet:k}=this.form.value,O;this.hasIdParam?O={id:this.coa_info().form.id,categoryID:i.key,name:u,bin:this.form.value.Bin||!1,code:o,note:f,outletID:k||null,balance:n,accessTypeID:e}:O={id:this.coa_info().form.id,categoryID:i.key,bin:this.form.value.Bin||!1,name:u,code:o,note:f,outletID:k||null,balance:n,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(O).pipe(E("submitChartAccount"),w(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(O).pipe(E("submitChartAccount"),w(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(E("response"),w(e=>{this.categoryOptions.set(e);let n=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(n?.child)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:qi,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"row","justify-content-center",3,"formGroup"],[1,"col"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["icon","fa-solid fa-circle-info",3,"pTooltip","rounded","text"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"co","col-lg-6"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"options","ngClass"],["pTemplate","value"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass"],["class","col col-lg-6",4,"ngIf"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(n,i){n&1&&(a(0,"app-main-panel",4),d(1,Hi,4,2,"ng-template",null,0,y)(3,ao,41,23,"ng-template",null,1,y),r()),n&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,we,ne,j,ye,be,ve,dt,V,z,N,L,B,Me,Pe,Ae,K,it,nt,zn,qn,st,kn,_e,ot,re,oe,le,ae,mt,ct],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var lo=["sublist"],so=(t,l)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":l}),co=()=>({"p-contextmenu-item-link":!0}),Yn=()=>({class:"p-contextmenu-submenu-icon"}),mo=()=>({exact:!1}),po=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),uo=t=>({$implicit:t});function fo(t,l){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,n=m(2);X(n.getItemProp(e,"style")),s("ngClass",n.getSeparatorItemClass(e)),P("id",n.getItemId(e))("data-pc-section","separator")}}function _o(t,l){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,n=m(2);s("ngClass",n.getItemProp(e,"icon"))("ngStyle",n.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function go(t,l){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,n=m(2);P("data-pc-section","label"),c(),he(" ",n.getItemLabel(e)," ")}}function ho(t,l){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,n=m(2);s("innerHTML",n.getItemLabel(e),Oe),P("data-pc-section","label")}}function xo(t,l){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,n=m(2);s("styleClass",n.getItemProp(e,"badgeStyleClass"))("value",n.getItemProp(e,"badge"))}}function Co(t,l){t&1&&h(0,"AngleRightIcon"),t&2&&(Ne("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Io(t,l){}function yo(t,l){t&1&&d(0,Io,0,0,"ng-template",25),t&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function bo(t,l){if(t&1&&(ce(0),d(1,Co,1,4,"AngleRightIcon",23)(2,yo,1,2,null,24),me()),t&2){let e=m(6);c(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),s("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",M(3,Yn))}}function vo(t,l){if(t&1&&(a(0,"a",15),d(1,_o,1,5,"span",16)(2,go,2,2,"span",17)(3,ho,1,2,"ng-template",null,2,y)(5,xo,1,2,"p-badge",18)(6,bo,3,4,"ng-container",11),r()),t&2){let e=J(4),n=m(3).$implicit,i=m(2);s("target",i.getItemProp(n,"target"))("ngClass",M(12,co)),P("href",i.getItemProp(n,"url"),Gt)("aria-hidden",!0)("data-automationid",i.getItemProp(n,"automationId"))("data-pc-section","action")("tabindex",-1),c(),s("ngIf",i.getItemProp(n,"icon")),c(),s("ngIf",i.getItemProp(n,"escape"))("ngIfElse",e),c(3),s("ngIf",i.getItemProp(n,"badge")),c(),s("ngIf",i.isItemGroup(n))}}function So(t,l){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,n=m(2);s("ngClass",n.getItemProp(e,"icon"))("ngStyle",n.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function To(t,l){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,n=m(2);P("data-pc-section","label"),c(),he(" ",n.getItemLabel(e)," ")}}function wo(t,l){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,n=m(2);s("innerHTML",n.getItemLabel(e),Oe),P("data-pc-section","label")}}function Ao(t,l){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,n=m(2);s("styleClass",n.getItemProp(e,"badgeStyleClass"))("value",n.getItemProp(e,"badge"))}}function Eo(t,l){t&1&&h(0,"AngleRightIcon"),t&2&&(Ne("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Po(t,l){}function Mo(t,l){t&1&&d(0,Po,0,0,"ng-template",25),t&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function ko(t,l){if(t&1&&(ce(0),d(1,Eo,1,4,"AngleRightIcon",23)(2,Mo,1,2,null,24),me()),t&2){let e=m(6);c(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),s("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",M(3,Yn))}}function Oo(t,l){if(t&1&&(a(0,"a",26),d(1,So,1,5,"span",16)(2,To,2,2,"span",17)(3,wo,1,2,"ng-template",null,2,y)(5,Ao,1,2,"p-badge",18)(6,ko,3,4,"ng-container",11),r()),t&2){let e=J(4),n=m(3).$implicit,i=m(2);s("routerLink",i.getItemProp(n,"routerLink"))("queryParams",i.getItemProp(n,"queryParams"))("routerLinkActiveOptions",i.getItemProp(n,"routerLinkActiveOptions")||M(20,mo))("target",i.getItemProp(n,"target"))("ngClass",S(21,po,i.getItemProp(n,"disabled")))("fragment",i.getItemProp(n,"fragment"))("queryParamsHandling",i.getItemProp(n,"queryParamsHandling"))("preserveFragment",i.getItemProp(n,"preserveFragment"))("skipLocationChange",i.getItemProp(n,"skipLocationChange"))("replaceUrl",i.getItemProp(n,"replaceUrl"))("state",i.getItemProp(n,"state")),P("data-automationid",i.getItemProp(n,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),s("ngIf",i.getItemProp(n,"icon")),c(),s("ngIf",i.getItemProp(n,"escape"))("ngIfElse",e),c(3),s("ngIf",i.getItemProp(n,"badge")),c(),s("ngIf",i.isItemGroup(n))}}function Fo(t,l){if(t&1&&(ce(0),d(1,vo,7,13,"a",13)(2,Oo,7,23,"a",14),me()),t&2){let e=m(2).$implicit,n=m(2);c(),s("ngIf",!n.getItemProp(e,"routerLink")),c(),s("ngIf",n.getItemProp(e,"routerLink"))}}function No(t,l){}function Vo(t,l){t&1&&d(0,No,0,0,"ng-template")}function Lo(t,l){if(t&1&&(ce(0),d(1,Vo,1,0,null,24),me()),t&2){let e=m(2).$implicit,n=m(2);c(),s("ngTemplateOutlet",n.itemTemplate)("ngTemplateOutletContext",S(2,uo,e.item))}}function Do(t,l){if(t&1){let e=A();a(0,"p-contextmenu-sub",27),v("itemClick",function(i){_(e);let o=m(4);return g(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=m(4);return g(o.onItemMouseEnter(i))}),r()}if(t&2){let e=m(2).$implicit,n=m(2);s("items",e.items)("itemTemplate",n.itemTemplate)("menuId",n.menuId)("visible",n.isItemActive(e)&&n.isItemGroup(e))("activeItemPath",n.activeItemPath)("focusedItemId",n.focusedItemId)("level",n.level+1)}}function Ro(t,l){if(t&1){let e=A();a(0,"li",9,1)(2,"div",10),v("click",function(i){_(e);let o=m().$implicit,u=m(2);return g(u.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=m().$implicit,u=m(2);return g(u.onItemMouseEnter({$event:i,processedItem:o}))}),d(3,Fo,3,2,"ng-container",11)(4,Lo,2,4,"ng-container",11),r(),d(5,Do,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),n=e.$implicit,i=e.index,o=m(2);Ne(o.getItemProp(n,"styleClass")),s("ngStyle",o.getItemProp(n,"style"))("ngClass",o.getItemClass(n))("tooltipOptions",o.getItemProp(n,"tooltipOptions")),P("id",o.getItemId(n))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(n))("data-p-focused",o.isItemFocused(n))("data-p-disabled",o.isItemDisabled(n))("aria-label",o.getItemLabel(n))("aria-disabled",o.isItemDisabled(n)||void 0)("aria-haspopup",o.isItemGroup(n)&&!o.getItemProp(n,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(n)?o.isItemActive(n):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),P("data-pc-section","content"),c(),s("ngIf",!o.itemTemplate),c(),s("ngIf",o.itemTemplate),c(),s("ngIf",o.isItemVisible(n)&&o.isItemGroup(n))}}function Bo(t,l){if(t&1&&d(0,fo,1,5,"li",6)(1,Ro,6,21,"li",7),t&2){let e=l.$implicit,n=m(2);s("ngIf",n.isItemVisible(e)&&n.getItemProp(e,"separator")),c(),s("ngIf",n.isItemVisible(e)&&!n.getItemProp(e,"separator"))}}function $o(t,l){if(t&1){let e=A();a(0,"ul",4,0),v("@overlayAnimation.start",function(i){_(e);let o=J(1),u=m();return g(u.onEnter(i,o))})("keydown",function(i){_(e);let o=m();return g(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=m();return g(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=m();return g(o.menuBlur.emit(i))}),d(2,Bo,2,2,"ng-template",5),r()}if(t&2){let e=m();s("ngClass",Yt(10,so,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),s("ngForOf",e.items)}}var Ko=["item"],qo=["submenuicon"],zo=["rootmenu"],Go=["container"],Ho=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),Uo=()=>({value:"visible"});function jo(t,l){if(t&1){let e=A();a(0,"div",3,0),v("@overlayAnimation.start",function(i){_(e);let o=m();return g(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=m();return g(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),v("itemClick",function(i){_(e);let o=m();return g(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=m();return g(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=m();return g(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=m();return g(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=m();return g(o.onItemMouseEnter(i))}),r()()}if(t&2){let e=m();Ne(e.styleClass),s("ngClass",S(20,Ho,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",M(22,Uo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),s("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Zo=({dt:t})=>`
2
+ .p-contextmenu {
3
+ position: absolute;
4
+ background: ${t("contextmenu.background")};
5
+ color: ${t("contextmenu.color")};
6
+ border: 1px solid ${t("contextmenu.border.color")};
7
+ border-radius: ${t("contextmenu.border.radius")};
8
+ box-shadow: ${t("contextmenu.shadow")};
9
+ min-width: 12.5rem;
10
+ }
11
+
12
+ .p-contextmenu-root-list,
13
+ .p-contextmenu-submenu {
14
+ margin: 0;
15
+ padding: ${t("contextmenu.list.padding")};
16
+ list-style: none;
17
+ outline: 0 none;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: ${t("contextmenu.list.gap")};
21
+ }
22
+
23
+ .p-contextmenu-submenu {
24
+ position: absolute;
25
+ display: flex;
26
+ flex-direction: column;
27
+ min-width: 100%;
28
+ z-index: 1;
29
+ background: ${t("contextmenu.background")};
30
+ color: ${t("contextmenu.color")};
31
+ border: 1px solid ${t("contextmenu.border.color")};
32
+ border-radius: ${t("contextmenu.border.radius")};
33
+ box-shadow: ${t("contextmenu.shadow")};
34
+ }
35
+
36
+ .p-contextmenu-item {
37
+ position: relative;
38
+ }
39
+
40
+ .p-contextmenu-item-content {
41
+ transition: background ${t("contextmenu.transition.duration")}, color ${t("contextmenu.transition.duration")};
42
+ border-radius: ${t("contextmenu.item.border.radius")};
43
+ color: ${t("contextmenu.item.color")};
44
+ }
45
+
46
+ .p-contextmenu-item-link {
47
+ cursor: pointer;
48
+ display: flex;
49
+ align-items: center;
50
+ text-decoration: none;
51
+ overflow: hidden;
52
+ position: relative;
53
+ color: inherit;
54
+ padding: ${t("contextmenu.item.padding")};
55
+ gap: ${t("contextmenu.item.gap")};
56
+ user-select: none;
57
+ }
58
+
59
+ .p-contextmenu-item-label {
60
+ line-height: 1;
61
+ }
62
+
63
+ .p-contextmenu-item-icon {
64
+ color: ${t("contextmenu.item.icon.color")};
65
+ }
66
+
67
+ .p-contextmenu-submenu-icon {
68
+ color: ${t("contextmenu.submenu.icon.color")};
69
+ margin-left: auto;
70
+ font-size: ${t("contextmenu.submenu.icon.size")};
71
+ width: ${t("contextmenu.submenu.icon.size")};
72
+ height: ${t("contextmenu.submenu.icon.size")};
73
+ }
74
+
75
+ .p-contextmenu-submenu-icon:dir(rtl) {
76
+ margin-left: 0;
77
+ margin-right: auto;
78
+ }
79
+
80
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content {
81
+ color: ${t("contextmenu.item.focus.color")};
82
+ background: ${t("contextmenu.item.focus.background")};
83
+ }
84
+
85
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-item-icon {
86
+ color: ${t("contextmenu.item.icon.focus.color")};
87
+ }
88
+
89
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
90
+ color: ${t("contextmenu.submenu.icon.focus.color")};
91
+ }
92
+
93
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover {
94
+ color: ${t("contextmenu.item.focus.color")};
95
+ background: ${t("contextmenu.item.focus.background")};
96
+ }
97
+
98
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-item-icon {
99
+ color: ${t("contextmenu.item.icon.focus.color")};
100
+ }
101
+
102
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-submenu-icon {
103
+ color: ${t("contextmenu.submenu.icon.focus.color")};
104
+ }
105
+
106
+ .p-contextmenu-item-active > .p-contextmenu-item-content {
107
+ color: ${t("contextmenu.item.active.color")};
108
+ background: ${t("contextmenu.item.active.background")};
109
+ }
110
+
111
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-item-icon {
112
+ color: ${t("contextmenu.item.icon.active.color")};
113
+ }
114
+
115
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
116
+ color: ${t("contextmenu.submenu.icon.active.color")};
117
+ }
118
+
119
+ .p-contextmenu-separator {
120
+ border-top: 1px solid ${t("contextmenu.separator.border.color")};
121
+ }
122
+
123
+ .p-contextmenu-enter-from,
124
+ .p-contextmenu-leave-active {
125
+ opacity: 0;
126
+ }
127
+
128
+ .p-contextmenu-enter-active {
129
+ transition: opacity 250ms;
130
+ }
131
+
132
+ .p-contextmenu-mobile .p-contextmenu-submenu {
133
+ position: static;
134
+ box-shadow: none;
135
+ border: 0 none;
136
+ padding-left: ${t("tieredmenu.submenu.mobile.indent")};
137
+ padding-right: 0;
138
+ }
139
+
140
+ .p-contextmenu-mobile .p-contextmenu-submenu-icon {
141
+ transition: transform 0.2s;
142
+ transform: rotate(90deg);
143
+ }
144
+
145
+ .p-contextmenu-mobile .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
146
+ transform: rotate(-90deg);
147
+ }
148
+
149
+ /* For PrimeNG */
150
+ .p-contextmenu-submenu-icon.p-iconwrapper {
151
+ margin-left: auto;
152
+ }
153
+
154
+ .p-contextmenu-submenu-icon.p-iconwrapper:dir(rtl) {
155
+ margin-left: 0;
156
+ margin-right: auto;
157
+ }
158
+ `,Qo={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:t,processedItem:l})=>["p-contextmenu-item",{"p-contextmenu-item-active":t.isItemActive(l),"p-focus":t.isItemFocused(l),"p-disabled":t.isItemDisabled(l)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Wn=(()=>{class t extends In{name="contextmenu";theme=Zo;classes=Qo;static \u0275fac=(()=>{let e;return function(i){return(e||(e=He(t)))(i||t)}})();static \u0275prov=Ge({token:t,factory:t.\u0275fac})}return t})();var Wo=(()=>{class t extends Tt{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new Y;itemMouseEnter=new Y;menuFocus=new Y;menuBlur=new Y;menuKeydown=new Y;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,n,i=null){return e&&e.item?St(e.item[n],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(n=>this.isItemVisible(n)&&this.getItemProp(n,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(n=>n.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return ie(e.items)}onItemMouseEnter(e){let{event:n,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:n,processedItem:i})}onItemClick(e,n){this.getItemProp(n,"command",{originalEvent:e,item:n.item}),this.itemClick.emit({originalEvent:e,processedItem:n,isFocus:!0})}onEnter(e,n){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let n=e.parentElement.parentElement,i=un(e.parentElement.parentElement),o=It(),u=e.offsetParent?e.offsetWidth:yt(e),f=sn(n.children[0]);e.style.top="0px",parseInt(i.left,10)+f+u>o.width-mn()?e.style.left=-1*u+"px":e.style.left=f+"px"}static \u0275fac=function(n){return new(n||t)(gt(qt(()=>_t)))};static \u0275cmp=F({type:t,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(n,i){if(n&1&&pe(lo,5),n&2){let o;H(o=U())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",de],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",de],autoZIndex:[2,"autoZIndex","autoZIndex",de],baseZIndex:[2,"baseZIndex","baseZIndex",Ie],popup:[2,"popup","popup",de],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Ie],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Ie]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Fe],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(n,i){n&1&&d(0,$o,3,13,"ul",3),n&2&&s("ngIf",i.root?!0:i.visible)},dependencies:[t,V,z,We,N,en,ht,L,B,bn,_e,ot,yn,At,Sn,Re],encapsulation:2,data:{animation:[xt("overlayAnimation",[De(":enter",[Le({opacity:0})]),De(":leave",[Le({opacity:0})])])]}})}return t})(),_t=(()=>{class t extends Tt{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new Y;onHide=new Y;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=b(!1);relativeAlign;window;focused=!1;activeItemPath=b([]);focusedItemInfo=b({index:-1,level:0,parentKey:"",item:null});submenuVisible=b(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(Wn);get visibleItems(){let e=this.activeItemPath().find(n=>n.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${ie(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,Jt(()=>{let n=this.activeItemPath();ie(n)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||hn("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return fn()||dn()}bindTriggerEventListener(){Ve(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(Ve(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",n=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(n)&&!n.ctrlKey&&n.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,n=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(n)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,n=0,i={},o=""){let u=[];return e&&e.forEach((f,k)=>{let O=(o!==""?o+"_":"")+k,q={item:f,index:k,level:n,key:O,parent:i,parentKey:o};q.items=this.createProcessedItems(f.items,n+1,q,O),u.push(q)}),u}bindMatchMediaListener(){if(Ve(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,n){return e?St(e[n]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&ie(e.items)}isSelected(e){return this.activeItemPath().some(n=>n.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&ie(e.items)}onItemClick(e){let{processedItem:n}=e,i=this.isProcessedItemGroup(n);if(this.isSelected(n)){let{index:u,key:f,level:k,parentKey:O,item:q}=n;this.activeItemPath.set(this.activeItemPath().filter($e=>f!==$e.key&&f.startsWith($e.key))),this.focusedItemInfo.set({index:u,level:k,parentKey:O,item:q}),tt(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let n=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!n&&gn(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let n=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}onArrowRightKey(e){let n=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(n)&&(this.onItemChange({originalEvent:e,processedItem:n}),this.focusedItemInfo.set({index:-1,parentKey:n.key,item:n.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let n=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(n)&&this.onItemChange({originalEvent:e,processedItem:n})}this.hide(),e.preventDefault()}else{let n=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}}onArrowLeftKey(e){let n=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(f=>f.key===n.parentKey);bt(n.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:n.item}),this.searchValue="",this.onArrowDownKey(e));let u=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(u),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let n=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},i),{index:this.findFirstFocusedItemIndex(),item:n.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let n=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(n)&&this.onItemChange({originalEvent:e,processedItem:n})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let n=et(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=n&&et(n,'a[data-pc-section="action"]');i?i.click():n&&n.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,n){let{processedItem:i,isFocus:o}=e;if(bt(i))return;let{index:u,key:f,level:k,parentKey:O,items:q}=i,$e=ie(q),Dt=this.activeItemPath().filter(Rt=>Rt.parentKey!==O&&Rt.parentKey!==f);$e&&(Dt.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:u,level:k,parentKey:O,item:i.item}),o&&tt(this.rootmenu.sublistViewChild.nativeElement),!(n==="hover"&&this.queryMatches)&&this.activeItemPath.set(Dt)}onMenuFocus(e){this.focused=!0;let n=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(n)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),tt(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):cn(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&wt.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&wt.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,n=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:yt(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:pn(this.containerViewChild.nativeElement),u=It();e+i-this.document.scrollingElement.scrollLeft>u.width&&(e-=i),n+o-this.document.scrollingElement.scrollTop>u.height&&(n-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),n<this.document.scrollingElement.scrollTop&&(n=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=n+"px"}searchItems(e,n){this.searchValue=(this.searchValue||"")+n;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(u=>this.isItemMatched(u)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return ie(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return vt(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let n=e>0?vt(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return n>-1?n:e}findNextItemIndex(e){let n=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return n>-1?n+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,n){let i=this.findVisibleItem(n),o=this.focusedItemInfo();o.index!==n&&(this.focusedItemInfo.set(I(C({},o),{index:n,item:i.item})),this.scrollInView())}scrollInView(e=-1){let n=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=et(this.rootmenu.el.nativeElement,`li[id="${n}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Ve(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):_n(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(n){return new(n||t)(gt(xn))};static \u0275cmp=F({type:t,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(n,i,o){if(n&1&&(Ue(o,Ko,4),Ue(o,qo,4),Ue(o,Ae,4)),n&2){let u;H(u=U())&&(i.itemTemplate=u.first),H(u=U())&&(i.submenuIconTemplate=u.first),H(u=U())&&(i.templates=u)}},viewQuery:function(n,i){if(n&1&&(pe(zo,5),pe(Go,5)),n&2){let o;H(o=U())&&(i.rootmenu=o.first),H(o=U())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",de],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",de],baseZIndex:[2,"baseZIndex","baseZIndex",Ie],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Ie]},outputs:{onShow:"onShow",onHide:"onHide"},features:[xe([Wn]),Fe],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(n,i){n&1&&d(0,jo,4,23,"div",2),n&2&&s("ngIf",i.visible())},dependencies:[V,z,N,ht,Wo,L,_e,At,Re],encapsulation:2,data:{animation:[xt("overlayAnimation",[De(":enter",[Le({opacity:0}),Ct("250ms")]),De(":leave",[Ct(".1s linear",Le({opacity:0}))])])]},changeDetection:0})}return t})(),Xn=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ht({type:t});static \u0275inj=zt({imports:[_t,Re,Re]})}return t})();var Xo=["editInput"],Jo=["tree"],er=["class","page"],tr=()=>({height:"calc(100vh - 70px)"});function nr(t,l){t&1&&(a(0,"a",7),h(1,"i",8),p(2," Add"),r())}function ir(t,l){if(t&1&&d(0,nr,3,0,"a",6),t&2){let e=m();s("ngIf",e.roleService.coa.create)}}function or(t,l){if(t&1){let e=A();a(0,"input",15,4),Qe("ngModelChange",function(i){let o=_(e).$implicit;return Ze(o.label,i)||(o.label=i),g(i)}),v("keydown",function(i){_(e);let o=m(2);return g(o.handleEditKeydown(i))})("blur",function(i){_(e);let o=m(2);return g(o.onNodeEditBlur(i))}),r()}if(t&2){let e=l.$implicit;je("ngModel",e.label)}}function rr(t,l){if(t&1){let e=A();a(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-tree",12,2),v("onNodeContextMenuSelect",function(i){_(e);let o=m();return g(o.onNodeContextMenuSelect(i))})("onNodeSelect",function(i){_(e);let o=m();return g(o.onNodeSelect(i))})("onNodeUnselect",function(i){_(e);let o=m();return g(o.onNodeUnselect(i))})("onNodeDrop",function(i){_(e);let o=m();return g(o.onNodeDrop(i))}),d(5,or,2,1,"ng-template",13),r(),h(6,"p-contextmenu",14,3),r()()()}if(t&2){let e=J(7),n=m();c(2),X(M(14,tr)),s("showHeader",!1),c(),s("virtualScroll",!0)("virtualScrollItemSize",40)("scrollHeight","calc(100vh - 110px)")("value",n.categoryTree())("contextMenu",e)("selection",n.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),c(3),s("model",n.contextMenuItems())}}var Jn=(()=>{class t{constructor(){this._coaTypesService=x(se),this._router=x(te),this.roleService=x(Ee),this.contextMenuItems=b([]),this.categoryTree=b([]),this.selectedCategory=null,this._shouldAutoFocus=b(!1)}ngOnInit(){this._loadCategories().subscribe(),this._initializeContextMenuItems(),this.expandAllNodes()}ngAfterViewChecked(){this.selectedCategory&&!this._shouldAutoFocus()&&this.editInputRef&&(this.editInputRef.nativeElement.focus(),this.editInputRef.nativeElement.select(),this._shouldAutoFocus.set(!0))}_loadCategories(){return this._coaTypesService.fetchCOACategories().pipe(E("COA Categories"),w(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(n=>{let i=!!n.children?.length;return I(C({},n),{icon:void 0,expandedIcon:i?"fa-solid fa-folder-open":void 0,collapsedIcon:i?"fa-solid fa-folder":"fa-solid fa-file",children:i?this._assignTreeIcons(n.children):[]})})}_initializeContextMenuItems(){this.contextMenuItems.set([{label:"Add",icon:"fa-light fa-plus",disabled:!1,command:()=>this._createChildCategory()},{label:"Edit",icon:"fa-light fa-pen-to-square",disabled:!1,command:()=>this._setSelectedNodeToEditMode()},{label:"Delete",icon:"fa-light fa-trash",disabled:!1,command:()=>this._deleteSelectedCategory()},{label:"Properties",icon:"fa-light fa-file",disabled:!1,command:()=>{this._router.navigate(["/pages/chart-of-account/coa-types/info"],{queryParams:{ID:this.selectedCategory?.key}})}}])}_findNodeByKey(e){return this.treeComponent.getNodeWithKey(e,this.categoryTree())??null}_setSelectedNodeToEditMode(){let e=this._findNodeByKey(this.selectedCategory?.key);e&&(this.selectedCategory=e,e.type="edit")}_createChildCategory(){this.selectedCategory?.parent?.key&&this._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(R(e=>this._loadCategories().pipe(G(()=>e))),w(e=>{let n=this._findNodeByKey(e.id);n&&(this.selectedCategory=n,this._shouldAutoFocus.set(!1),n.type="edit")}),E("Created COA Node")).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(R(()=>this._loadCategories())).subscribe()}renameNode(e,n=this.selectedCategory){this._coaTypesService.renameCategory(n.key,{Name:e}).pipe(R(()=>this._loadCategories())).subscribe()}onNodeSelect(e){this.selectedCategory=e.node,this._shouldAutoFocus.set(!1),e.node.children?.length&&(e.node.icon="fa-solid fa-folder-open")}onNodeUnselect(e){e.node.children?.length&&(e.node.icon="fa-solid fa-folder")}onNodeContextMenuSelect(e){this.selectedCategory=e.node,["Asset","Liability","Equity","Revenue","Expense"].includes(e.node.label)?this.contextMenuItems.set(this.contextMenuItems().map(i=>["Edit","Delete"].includes(i.label)?I(C({},i),{disabled:!0}):I(C({},i),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(i=>i.label==="Add"?I(C({},i),{disabled:!this.roleService.coa.create}):i.label==="Edit"?I(C({},i),{disabled:!this.roleService.coa.edit}):i.label==="Delete"?I(C({},i),{disabled:!this.roleService.coa.delete}):I(C({},i),{disabled:!1})))}onNodeDrop(e){let{dragNode:n,dropNode:i}=e;this._coaTypesService.updateParentCategory(n.key,{ParentID:i.key}).pipe(w(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let n=e.target;this.renameNode(n.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&delete i.type}handleEditKeydown(e){let n=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(n.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&(delete i.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,n){e.expanded=n,e.children?.forEach(i=>this._expandRecursive(i,n))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-coa-type",8,"page"]],viewQuery:function(n,i){if(n&1&&(pe(Xo,5),pe(Jo,5)),n&2){let o;H(o=U())&&(i.editInputRef=o.first),H(o=U())&&(i.treeComponent=o.first)}},features:[xe([Cn])],attrs:er,decls:5,vars:0,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
159
+ `],["class","p-button","routerLink","add",4,"ngIf"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center"],[1,"col"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","virtualScroll","virtualScrollItemSize","scrollHeight","value","contextMenu","selection","draggableNodes","droppableNodes","propagateSelectionUp","propagateSelectionDown"],["pTemplate","edit"],["appendTo","body",3,"model"],["type","text",1,"form-control",3,"ngModelChange","keydown","blur","ngModel"]],template:function(n,i){n&1&&(a(0,"app-main-panel",5),d(1,ir,1,1,"ng-template",null,0,y)(3,rr,8,15,"ng-template",null,1,y),r())},dependencies:[$,$n,L,B,Xn,_t,Ae,V,N,Te,ne,j,Xe,K,vn,le,ae],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ar=["class","page"],Vt=t=>({"is-invalid":t}),lr=t=>({"ng-invalid ng-dirty":t});function sr(t,l){if(t&1){let e=A();a(0,"div",3)(1,"p-button",4),v("onClick",function(){_(e);let i=m();return g(i.goBack())}),r(),a(2,"p-button",5),v("onClick",function(){_(e);let i=m();return g(i.onSubmit())}),r()()}}function cr(t,l){t&1&&(a(0,"div",20),p(1," Name is required "),r())}function mr(t,l){t&1&&(a(0,"div",20),p(1," Code is required "),r())}function pr(t,l){t&1&&(a(0,"div",20),p(1," Note is required "),r())}function ur(t,l){if(t&1&&(a(0,"div")(1,"span",22),p(2),r()()),t&2){let e=l.$implicit;c(2),T(e)}}function dr(t,l){if(t&1&&(a(0,"div"),d(1,ur,3,1,"div",21),r()),t&2){let e=m(2);c(),s("ngForOf",e.getErrors("Category"))}}function fr(t,l){if(t&1){let e=A();a(0,"p-panel")(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"label",11),p(7,"Name"),r(),h(8,"input",12),d(9,cr,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),d(15,mr,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),d(21,pr,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),v("onFocus",function(){_(e);let i=m();return g(i.loadCategories())}),r(),d(27,dr,2,1,"div",19),r()()()()()()}if(t&2){let e=m();c(3),s("formGroup",e.form),c(5),s("ngClass",S(10,Vt,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),c(),s("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),c(5),s("ngClass",S(12,Vt,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),c(),s("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),c(5),s("ngClass",S(14,Vt,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),c(),s("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),c(5),s("ngClass",S(16,lr,e.isInvalid("Category")))("options",e.categories()),c(),s("ngIf",e.isInvalid("Category"))}}var Lt=(()=>{class t extends Gn{constructor(){super(...arguments),this.categories=b([]),this.COATypeService=x(se),this.COAService=x(Z),this.info=b(null),this.route=x(ee),this.router=x(te),this.fb=x(Se)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Bt([this.route.paramMap.pipe(G(e=>e.get("id")),qe(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(E("fetchCOACategories"),R(([e,n])=>{let i=this.findNodeByKeyInArray(n,e);return this.categories.set(n),this.COATypeService.getCOACategoryByID({ID:e}).pipe(w(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:i.parent}),["Asset","Liability","Equity","Revenue","Expense"].includes(o.name)&&this.form.controls.Category.disable()}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(w(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new on({Name:new D("",[fe.required]),Code:new D("",[]),Category:new D(null,[fe.required]),Note:new D("",[])})}findNodeByKeyInArray(e,n){for(let i of e){let o=this.findNodeByKey(i,n);if(o)return o}return null}findNodeByKey(e,n,i=null){if(e.key===n||e.label===n)return i&&(e.parent=i),e;if(e.children&&e.children.length>0)for(let o of e.children){let u=this.findNodeByKey(o,n,e);if(u)return u}return null}onSubmit(){let{Name:e,Code:n,Note:i,Category:o}=this.form.value,u=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(u=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:n,ParentID:u&&u.parent?u.parent.key:u.key,Note:i,ID:this.route.snapshot.params.id||null}):(u=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:n,ParentID:u&&u.parent?u.parent.key:u.key,Note:i}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(E("response"),w(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=He(t)))(i||t)}})()}static{this.\u0275cmp=F({type:t,selectors:[["app-coa-type-form",8,"page"]],features:[Fe],attrs:ar,decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Category Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["label","Cancel","variant","outlined","severity","secondary",3,"onClick"],["label","Submit",3,"onClick"],[1,"row","justify-content-center"],[1,"col"],[1,"row","row-gap-2",3,"formGroup"],[1,"ol-12","col-md-6","col-lg-6"],[1,"form-group","has-validation"],["for",""],["formControlName","Name",1,"form-control",3,"ngClass"],["id","validationServer03Feedback","class","invalid-feedback",4,"ngIf"],[1,"col-12","col-md-6","col-lg-6"],["formControlName","Code",1,"form-control",3,"ngClass"],["formControlName","Note","placeholder","Enter a description for this COA category","id","floatingTextarea2",1,"form-control",2,"height","100px",3,"ngClass"],[1,"form-group","has-validation","d-flex","flex-column"],["showClear","","placeholder","Select a Category","formControlName","Category",1,"ng-invalid","ng-dirty",3,"onFocus","ngClass","options"],[4,"ngIf"],["id","validationServer03Feedback",1,"invalid-feedback"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){n&1&&(a(0,"app-main-panel",2),d(1,sr,3,0,"ng-template",null,0,y)(3,fr,28,18,"ng-template",null,1,y),r()),n&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,L,Me,Pe,we,ne,j,ye,be,ve,V,z,We,N,K,re,oe,le,ae],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return t})();var _r=t=>[t];function gr(t,l){if(t&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),t&2){let e=m(2);s("routerLink",S(1,_r,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function hr(t,l){if(t&1&&(a(0,"div",6)(1,"div",7)(2,"p-card")(3,"div",8)(4,"div",9)(5,"div",10),p(6,"Name"),r(),a(7,"div",11),p(8),r()(),a(9,"div",9)(10,"div",10),p(11,"Code"),r(),a(12,"div",11),p(13),r()(),a(14,"div",9)(15,"div",10),p(16,"Category"),r(),a(17,"div",11),p(18),r()(),a(19,"div",9)(20,"div",10),p(21,"Note"),r(),a(22,"div",11),h(23,"div",12),r()()()()()()),t&2){let e=m(2);c(8),T(e.info().name),c(5),T(e.info().code),c(5),T(e.info().parentName),c(5),s("innerHTML",e.info().note,Oe)}}function xr(t,l){t&1&&(ce(0),a(1,"app-main-panel",3),d(2,gr,4,3,"ng-template",null,0,y)(4,hr,24,4,"ng-template",null,1,y),r(),me())}var ei=(()=>{class t{constructor(){this.COATypeService=x(se),this.route=x(ee),this.info=b(null)}ngOnInit(){this.route.queryParamMap.pipe(G(e=>e.get("ID")),R(e=>this.COATypeService.getCOACategoryByID({ID:e})),E("getCOACategoryByID"),w(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-coa-type-info"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],[4,"ngIf"],["pageTitle",`Type of Account Info
160
+ `],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(n,i){n&1&&d(0,xr,6,0,"ng-container",2),n&2&&s("ngIf",i.info())},dependencies:[V,N,$,K,rt,L,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ps=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:jn},{path:"account/add",component:Nt},{path:"account/import",loadComponent:()=>import("./chunk-CGK3QRS6.js").then(t=>t.CoaImportComponent)},{path:"account/:id",component:Hn},{path:"account/:id/edit",component:Nt},{path:"coa-types",component:Jn},{path:"coa-types/add",component:Lt},{path:"coa-types/info",component:ei},{path:"coa-types/:id/edit",component:Lt}]}],Zn={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{Ps as CHART_OF_ACCOUNT_ROUTES,Zn as CHART_OF_ACCOUNT_ROUTE_PAGE};
@@ -1 +1 @@
1
- import{a as y,b as C,e as F,f as M}from"./chunk-3VJJTR55.js";import{b as T}from"./chunk-YYDAQ7AW.js";import{d as L,e as S}from"./chunk-Z45NTTES.js";import{a as G}from"./chunk-LD7LVE2B.js";import{r as U}from"./chunk-OKCHQM5Q.js";import{Ac as g,Kb as n,Ob as l,Sb as m,Tb as f,Ub as a,Vb as p,ba as c,ec as h,gb as s,ha as i,qc as v,rc as b,wb as d}from"./chunk-JP6RBSB3.js";var $=(()=>{class t{constructor(){this.httpService=i(G)}getUserLoaderList(){return this.httpService.get(void 0,"api/UserLoader/List")}getUsers(e){return this.httpService.post(void 0,"api/User/List",e)}getUserFormMeta(e){return this.httpService.post(void 0,"api/UserLoader/Form",{ID:e})}inviteUser(e){return this.httpService.post(void 0,"api/User/Submit",e)}deleteUser(e){return this.httpService.post(void 0,"api/User/Delete",{ListID:e})}getGroupLoader(){return this.httpService.get(void 0,"api/UserGroupLoader/List")}getGroupList(e){return this.httpService.post(void 0,"api/UserGroup/List",e)}getGroupFormMeta(e){return this.httpService.get(void 0,e?`api/UserGroup/Form/${e}`:"api/UserGroup/Form")}assignGroupRole(e){return this.httpService.post(void 0,"api/UserGroup/AssignRole",e)}deleteGroup(e){return this.httpService.post(void 0,"api/UserGroup/Delete",{ListID:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=t=>({"ps-0":t}),x=(t,o)=>o.route;function _(t,o){if(t&1&&(a(0,"p-tab",2)(1,"span"),v(2),p()()),t&2){let e=o.$implicit,r=h();l(g(5,k,r.router.url.includes("forms"))),n("value",e.route)("routerLink",e.route),s(2),b(e.label)}}var B=(()=>{class t{constructor(){this.router=i(L),this.tabs=[{route:"/pages/users/users",label:"Users"},{route:"/pages/users/groups",label:"Groups"}]}get activeTab(){return this.tabs.find(r=>this.router.url.startsWith(r.route)).route||this.tabs[0].route}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=d({type:t,selectors:[["app-user-tabs"]],decls:4,vars:1,consts:[[3,"value"],[3,"value","routerLink","class"],[3,"value","routerLink"]],template:function(r,u){r&1&&(a(0,"p-tabs",0)(1,"p-tablist"),m(2,_,3,7,"p-tab",1,x),p()()),r&2&&(n("value",u.activeTab),s(2),f(u.tabs))},dependencies:[M,F,y,C,S,T,U],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding:0 1.125rem .6rem 0!important}"],changeDetection:0})}}return t})();export{$ as a,B as b};
1
+ import{a as y,b as C,e as F,f as M}from"./chunk-3VJJTR55.js";import{b as T}from"./chunk-YYDAQ7AW.js";import{d as L,e as S}from"./chunk-Z45NTTES.js";import{a as G}from"./chunk-BAH2FNAN.js";import{r as U}from"./chunk-OKCHQM5Q.js";import{Ac as g,Kb as n,Ob as l,Sb as m,Tb as f,Ub as a,Vb as p,ba as c,ec as h,gb as s,ha as i,qc as v,rc as b,wb as d}from"./chunk-JP6RBSB3.js";var $=(()=>{class t{constructor(){this.httpService=i(G)}getUserLoaderList(){return this.httpService.get(void 0,"api/UserLoader/List")}getUsers(e){return this.httpService.post(void 0,"api/User/List",e)}getUserFormMeta(e){return this.httpService.post(void 0,"api/UserLoader/Form",{ID:e})}inviteUser(e){return this.httpService.post(void 0,"api/User/Submit",e)}deleteUser(e){return this.httpService.post(void 0,"api/User/Delete",{ListID:e})}getGroupLoader(){return this.httpService.get(void 0,"api/UserGroupLoader/List")}getGroupList(e){return this.httpService.post(void 0,"api/UserGroup/List",e)}getGroupFormMeta(e){return this.httpService.get(void 0,e?`api/UserGroup/Form/${e}`:"api/UserGroup/Form")}assignGroupRole(e){return this.httpService.post(void 0,"api/UserGroup/AssignRole",e)}deleteGroup(e){return this.httpService.post(void 0,"api/UserGroup/Delete",{ListID:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=t=>({"ps-0":t}),x=(t,o)=>o.route;function _(t,o){if(t&1&&(a(0,"p-tab",2)(1,"span"),v(2),p()()),t&2){let e=o.$implicit,r=h();l(g(5,k,r.router.url.includes("forms"))),n("value",e.route)("routerLink",e.route),s(2),b(e.label)}}var B=(()=>{class t{constructor(){this.router=i(L),this.tabs=[{route:"/pages/users/users",label:"Users"},{route:"/pages/users/groups",label:"Groups"}]}get activeTab(){return this.tabs.find(r=>this.router.url.startsWith(r.route)).route||this.tabs[0].route}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=d({type:t,selectors:[["app-user-tabs"]],decls:4,vars:1,consts:[[3,"value"],[3,"value","routerLink","class"],[3,"value","routerLink"]],template:function(r,u){r&1&&(a(0,"p-tabs",0)(1,"p-tablist"),m(2,_,3,7,"p-tab",1,x),p()()),r&2&&(n("value",u.activeTab),s(2),f(u.tabs))},dependencies:[M,F,y,C,S,T,U],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding:0 1.125rem .6rem 0!important}"],changeDetection:0})}}return t})();export{$ as a,B as b};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-BLQJXMNV.js";import{A as I,B as g,C as D}from"./chunk-OKCHQM5Q.js";import{I as u,Z as h,ba as d,ha as f,n as y,s as l}from"./chunk-JP6RBSB3.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(h(this.handleResponse.bind(this)),l(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(h(this.handleResponse.bind(this)),l(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(h(this.handleResponse.bind(this)),l(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var m={production:!0,version:"5.34.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var p=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();window.Intercom("boot",{app_id:m.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:m.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:m.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return p.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,m as b,N as c};
1
+ import{a as b}from"./chunk-BLQJXMNV.js";import{A as I,B as g,C as D}from"./chunk-OKCHQM5Q.js";import{I as u,Z as h,ba as d,ha as f,n as y,s as l}from"./chunk-JP6RBSB3.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(h(this.handleResponse.bind(this)),l(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(h(this.handleResponse.bind(this)),l(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(h(this.handleResponse.bind(this)),l(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var m={production:!0,version:"5.36.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var p=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();window.Intercom("boot",{app_id:m.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:m.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:m.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return p.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,m as b,N as c};
@@ -1,4 +1,4 @@
1
- import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-SY6XFKYM.js";import{b as Zt,c as gi,d as ni}from"./chunk-RN2UFUFZ.js";import{a as kt,b as zt}from"./chunk-BV4GM72W.js";import{a as Xt}from"./chunk-Z2QDMAKC.js";import{a as qe}from"./chunk-XKCLERWG.js";import{a as Ot}from"./chunk-H57SDRPH.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-GDX5XEV3.js";import"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import{a as Qe}from"./chunk-ZTEDQLOG.js";import{a as $e}from"./chunk-EDGADVEY.js";import{a as Vt}from"./chunk-JTDJJORR.js";import{c as je}from"./chunk-LZUGPBFD.js";import{a as Lt}from"./chunk-2KERKGCG.js";import{a as qt,b as Wt}from"./chunk-4CDAAU6Z.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-LUPSXHRX.js";import{c as Qt}from"./chunk-X22YKT5B.js";import{a as At,b as Bt}from"./chunk-JYCUE5HV.js";import"./chunk-JMEBBWX4.js";import{i as Mt}from"./chunk-FUZFAJGJ.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-5FSMHZSY.js";import"./chunk-BHV2HCJY.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-G5S5AZA7.js";import{d as Tt}from"./chunk-Z45NTTES.js";import"./chunk-LD7LVE2B.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as re,j as yt,k as G,l as Le,m as ae,r as me,s as ge}from"./chunk-OKCHQM5Q.js";import{Aa as le,Ab as xe,Ac as P,Bc as te,Cb as p,Cc as ht,Dc as ut,Ea as Se,Fc as mt,Ga as X,I as Ye,Jb as ne,Jc as gt,Ka as it,Kb as a,Lb as at,Lc as ft,Mc as x,Nb as Z,Ob as j,Pb as Ie,Qb as Ee,Qc as bt,Sb as ke,Tb as ze,Ub as d,Vb as h,Vc as w,Wb as I,Wc as Q,Xb as q,Yb as W,Z as Ce,Zb as T,Zc as _t,_b as D,ba as we,ca as et,dc as k,eb as ot,ec as m,g as J,gb as s,ha as B,jc as _,kc as E,lb as lt,lc as g,m as Ze,mb as N,mc as f,oa as tt,pa as L,pc as Y,qa as M,qc as b,rc as A,sc as ue,ta as ve,vc as st,wb as U,wc as ct,xb as nt,xc as dt,yb as rt,yc as pt,za as S,zc as ee}from"./chunk-JP6RBSB3.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
1
+ import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-SY6XFKYM.js";import{b as Zt,c as gi,d as ni}from"./chunk-RN2UFUFZ.js";import{a as kt,b as zt}from"./chunk-BV4GM72W.js";import{a as Xt}from"./chunk-OVQDITWG.js";import{a as qe}from"./chunk-XKCLERWG.js";import{a as Ot}from"./chunk-H57SDRPH.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-GDX5XEV3.js";import"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import{a as Qe}from"./chunk-ZTEDQLOG.js";import{a as $e}from"./chunk-EDGADVEY.js";import{a as Vt}from"./chunk-JTDJJORR.js";import{c as je}from"./chunk-LZUGPBFD.js";import{a as Lt}from"./chunk-2KERKGCG.js";import{a as qt,b as Wt}from"./chunk-4CDAAU6Z.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-7HTH3SFF.js";import{c as Qt}from"./chunk-X22YKT5B.js";import{a as At,b as Bt}from"./chunk-JYCUE5HV.js";import"./chunk-JMEBBWX4.js";import{i as Mt}from"./chunk-FUZFAJGJ.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-G5S5AZA7.js";import{d as Tt}from"./chunk-Z45NTTES.js";import"./chunk-BAH2FNAN.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as re,j as yt,k as G,l as Le,m as ae,r as me,s as ge}from"./chunk-OKCHQM5Q.js";import{Aa as le,Ab as xe,Ac as P,Bc as te,Cb as p,Cc as ht,Dc as ut,Ea as Se,Fc as mt,Ga as X,I as Ye,Jb as ne,Jc as gt,Ka as it,Kb as a,Lb as at,Lc as ft,Mc as x,Nb as Z,Ob as j,Pb as Ie,Qb as Ee,Qc as bt,Sb as ke,Tb as ze,Ub as d,Vb as h,Vc as w,Wb as I,Wc as Q,Xb as q,Yb as W,Z as Ce,Zb as T,Zc as _t,_b as D,ba as we,ca as et,dc as k,eb as ot,ec as m,g as J,gb as s,ha as B,jc as _,kc as E,lb as lt,lc as g,m as Ze,mb as N,mc as f,oa as tt,pa as L,pc as Y,qa as M,qc as b,rc as A,sc as ue,ta as ve,vc as st,wb as U,wc as ct,xb as nt,xc as dt,yb as rt,yc as pt,za as S,zc as ee}from"./chunk-JP6RBSB3.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
2
2
  /* For PrimeNG */
3
3
  .p-treetable {
4
4
  position: relative;
@@ -1 +1 @@
1
- import{a as Se,b as ke}from"./chunk-6MOM7AXR.js";import{a as ve,b as be,c as xe,d as ye,e as Ce,f as Fe}from"./chunk-3VJJTR55.js";import"./chunk-YYDAQ7AW.js";import{a as ge,b as he}from"./chunk-NJO5TWIA.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{a as ce}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import"./chunk-3NU3P6NL.js";import{a as G}from"./chunk-XKCLERWG.js";import"./chunk-ZTEDQLOG.js";import{a as re,b as ie}from"./chunk-JTDJJORR.js";import"./chunk-2KERKGCG.js";import{h as fe}from"./chunk-LUPSXHRX.js";import{b as ue,c as de}from"./chunk-X22YKT5B.js";import{a as me,b as se}from"./chunk-JYCUE5HV.js";import"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as ne,o as ae,w as le,x as pe}from"./chunk-5FSMHZSY.js";import"./chunk-BHV2HCJY.js";import{b as H,c as J,e as K,f as Q,k as W,l as X,m as Y,n as Z,o as ee,u as te,x as oe}from"./chunk-G5S5AZA7.js";import{b as U,d as L}from"./chunk-Z45NTTES.js";import"./chunk-LD7LVE2B.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as $,j,k as q,r as z}from"./chunk-OKCHQM5Q.js";import{Ab as P,Ac as b,Cb as f,Ga as D,Kb as a,Mc as I,Nb as _,Ob as C,Qb as F,Qc as B,Sb as S,Tb as k,Ub as i,Vb as n,Wb as g,X as M,Z as y,_b as R,dc as V,ec as u,gb as r,ha as c,pa as E,qa as N,qc as h,rc as T,sc as O,ta as A,wb as w,zc as v}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var Me=()=>({height:"calc(100vh - 70px)"}),Ee=t=>({"ng-invalid ng-dirty":t}),Te=t=>({"ps-0":t}),Ie=()=>({display:"flex"});function Ne(t,l){if(t&1){let e=R();i(0,"p-button",4),V("onClick",function(){E(e);let p=u(2);return N(p.onSubmit())}),n()}}function Ae(t,l){if(t&1&&f(0,Ne,1,0,"p-button",3),t&2){let e=u();a("ngIf",e.roleService.user.edit)}}function De(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),T(e)}}function we(t,l){if(t&1&&(i(0,"div"),f(1,De,3,1,"div",15),n()),t&2){let e=u(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Ie)),a("binary",!0),r(2),O(" ",e.get("name").value," ")}}function Re(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),S(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=u(3);a("formGroupName",o),r(4),T(e.get("groupName").value),r(),_(v(5,Ie)),a("binary",!0),r(3),k(p.getRolesArray(o).controls)}}function Ve(t,l){if(t&1&&(i(0,"div",17),S(1,Re,10,6,"div",18,F),n()),t&2){let e=u(2);r(),k(e.rolesFormArray.controls)}}function Oe(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,we,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,Ve,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=u();_(v(13,Me)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ee,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),C(b(16,Te,e.router.url.includes("forms"))),r(2),C(b(18,Te,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var gt=(()=>{class t extends _e{constructor(){super(...arguments),this.service=c(Se),this.fb=c(te),this.cdr=c(B),this.route=c(U),this.router=c(L),this.roleService=c(ce),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[J.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=D(null)}ngOnInit(){this.route.queryParamMap.pipe(M(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(G("Group form meta loaded"),y(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user.edit}),description:this.fb.control(m.description||"")}))),d=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Ge=s.controls.every(m=>m.get("checked").value);d.get("groupChecked").setValue(Ge,{emitEvent:!1}),this.roleService.user.edit?d.get("groupChecked").enable():d.get("groupChecked").disable(),d.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);d.get("groupChecked").setValue(m,{emitEvent:!1})}),o.push(d)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(s=>{s.get("checked").value&&e.push(s.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(G("Group roles assigned successfully"),y(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe(),console.log(e)}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=A(t)))(p||t)}})()}static{this.\u0275cmp=w({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row",3,"formGroupName"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","40px","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"],["formArrayName","roles",1,"row","h-100"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",3,"formGroupName","pTooltip"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,p){o&1&&(i(0,"app-main-panel",2),f(1,Ae,1,1,"ng-template",null,0,I)(3,Oe,19,20,"ng-template",null,1,I),n()),o&2&&a("overflowScroll",!0)},dependencies:[fe,ie,re,oe,W,H,K,Q,X,ee,Y,Z,z,$,j,q,ae,ne,Fe,Ce,ye,xe,ve,be,he,ge,pe,le,ke,se,me,de,ue],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}"],changeDetection:0})}}return t})();export{gt as GroupFormComponent};
1
+ import{a as Se,b as ke}from"./chunk-B54WGNWI.js";import{a as ve,b as be,c as xe,d as ye,e as Ce,f as Fe}from"./chunk-3VJJTR55.js";import"./chunk-YYDAQ7AW.js";import{a as ge,b as he}from"./chunk-NJO5TWIA.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{a as ce}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import"./chunk-3NU3P6NL.js";import{a as G}from"./chunk-XKCLERWG.js";import"./chunk-ZTEDQLOG.js";import{a as re,b as ie}from"./chunk-JTDJJORR.js";import"./chunk-2KERKGCG.js";import{h as fe}from"./chunk-7HTH3SFF.js";import{b as ue,c as de}from"./chunk-X22YKT5B.js";import{a as me,b as se}from"./chunk-JYCUE5HV.js";import"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as ne,o as ae,w as le,x as pe}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as H,c as J,e as K,f as Q,k as W,l as X,m as Y,n as Z,o as ee,u as te,x as oe}from"./chunk-G5S5AZA7.js";import{b as U,d as L}from"./chunk-Z45NTTES.js";import"./chunk-BAH2FNAN.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as $,j,k as q,r as z}from"./chunk-OKCHQM5Q.js";import{Ab as P,Ac as b,Cb as f,Ga as D,Kb as a,Mc as I,Nb as _,Ob as C,Qb as F,Qc as B,Sb as S,Tb as k,Ub as i,Vb as n,Wb as g,X as M,Z as y,_b as R,dc as V,ec as u,gb as r,ha as c,pa as E,qa as N,qc as h,rc as T,sc as O,ta as A,wb as w,zc as v}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var Me=()=>({height:"calc(100vh - 70px)"}),Ee=t=>({"ng-invalid ng-dirty":t}),Te=t=>({"ps-0":t}),Ie=()=>({display:"flex"});function Ne(t,l){if(t&1){let e=R();i(0,"p-button",4),V("onClick",function(){E(e);let p=u(2);return N(p.onSubmit())}),n()}}function Ae(t,l){if(t&1&&f(0,Ne,1,0,"p-button",3),t&2){let e=u();a("ngIf",e.roleService.user.edit)}}function De(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),T(e)}}function we(t,l){if(t&1&&(i(0,"div"),f(1,De,3,1,"div",15),n()),t&2){let e=u(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Ie)),a("binary",!0),r(2),O(" ",e.get("name").value," ")}}function Re(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),S(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=u(3);a("formGroupName",o),r(4),T(e.get("groupName").value),r(),_(v(5,Ie)),a("binary",!0),r(3),k(p.getRolesArray(o).controls)}}function Ve(t,l){if(t&1&&(i(0,"div",17),S(1,Re,10,6,"div",18,F),n()),t&2){let e=u(2);r(),k(e.rolesFormArray.controls)}}function Oe(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,we,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,Ve,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=u();_(v(13,Me)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ee,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),C(b(16,Te,e.router.url.includes("forms"))),r(2),C(b(18,Te,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var gt=(()=>{class t extends _e{constructor(){super(...arguments),this.service=c(Se),this.fb=c(te),this.cdr=c(B),this.route=c(U),this.router=c(L),this.roleService=c(ce),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[J.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=D(null)}ngOnInit(){this.route.queryParamMap.pipe(M(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(G("Group form meta loaded"),y(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user.edit}),description:this.fb.control(m.description||"")}))),d=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Ge=s.controls.every(m=>m.get("checked").value);d.get("groupChecked").setValue(Ge,{emitEvent:!1}),this.roleService.user.edit?d.get("groupChecked").enable():d.get("groupChecked").disable(),d.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);d.get("groupChecked").setValue(m,{emitEvent:!1})}),o.push(d)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(s=>{s.get("checked").value&&e.push(s.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(G("Group roles assigned successfully"),y(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe(),console.log(e)}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=A(t)))(p||t)}})()}static{this.\u0275cmp=w({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row",3,"formGroupName"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","40px","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"],["formArrayName","roles",1,"row","h-100"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",3,"formGroupName","pTooltip"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,p){o&1&&(i(0,"app-main-panel",2),f(1,Ae,1,1,"ng-template",null,0,I)(3,Oe,19,20,"ng-template",null,1,I),n()),o&2&&a("overflowScroll",!0)},dependencies:[fe,ie,re,oe,W,H,K,Q,X,ee,Y,Z,z,$,j,q,ae,ne,Fe,Ce,ye,xe,ve,be,he,ge,pe,le,ke,se,me,de,ue],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}"],changeDetection:0})}}return t})();export{gt as GroupFormComponent};