import{b as N}from"./chunk-JRIQ2XQF.js";import{a as I}from"./chunk-OMYRNWA7.js";import"./chunk-WIPHIZE3.js";import"./chunk-AG5UR6GS.js";import"./chunk-6P3ZDNP3.js";import"./chunk-HVO2LBIZ.js";import"./chunk-JU53QNJX.js";import"./chunk-H6QVTBMZ.js";import"./chunk-5KOP4ULD.js";import"./chunk-F2X3VGZZ.js";import"./chunk-CV2ZWZQE.js";import"./chunk-R2UR7BVM.js";import{j as S,s as O,w as T}from"./chunk-HKLJ6VPZ.js";import"./chunk-MQ46LYK7.js";import"./chunk-PQ5Q7HJL.js";import"./chunk-72CHOCZD.js";import{Ab as x,Cb as v,Db as M,Eb as o,Fb as r,Gb as l,Kb as w,Pb as p,Qb as D,Ua as c,Vb as A,Wb as E,Xb as P,Y as g,ac as R,cc as k,da as f,ea as C,fa as b,gb as s,lc as u,na as _,oc as F,tb as y,xb as h}from"./chunk-56X5LYJH.js";import"./chunk-TSRGIXR5.js";var B=["menuRef"],d=class n{actions=[];onSelect=new _;router=g(O);menuRef;cardData;items=[];ngOnChanges(){this.buildMenu()}routeToPage(e,t){t.stopPropagation(),this.router.navigate([e])}buildMenu(){this.items=this.actions.filter(e=>e.visible!==!1).map(e=>({label:e.label,command:()=>this.onSelect.emit(e.id),styleClass:e.danger?"menu-danger":""}))}toggleMenu(e){this.menuRef.toggle(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=s({type:n,selectors:[["app-card"]],viewQuery:function(t,i){if(t&1&&A(B,5),t&2){let a;E(a=P())&&(i.menuRef=a.first)}},inputs:{actions:"actions",cardData:"cardData"},outputs:{onSelect:"onSelect"},features:[f],decls:6,vars:3,consts:[[1,"menu-wrapper"],[1,"main",3,"click"],[1,"icon-box","fs-1"],[1,"title"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1),p("click",function(m){return i.routeToPage(i.cardData.route,m)}),o(2,"div",2),l(3,"i"),r(),o(4,"h3",3),R(5),r()()()),t&2&&(c(3),h(i.cardData.logo),c(2),k(" ",i.cardData.title,""))},dependencies:[N,S,T],styles:[".menu-wrapper[_ngcontent-%COMP%]{position:relative}.main[_ngcontent-%COMP%]{display:inline-block;box-shadow:0 -4px 8px #0000000d,0 4px 8px #0000000d;border:1px solid #EEEEEE;min-width:250px;opacity:1;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:end;gap:24px;border-radius:8px;border-width:1px;padding:24px}.menu-btn[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:50%;border:none;background:#f1f1f1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.2s ease;position:absolute;right:10px;top:10px}.menu-btn[_ngcontent-%COMP%]:hover{background:#e5e5e5}.icon-box[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:var(--primary)}.title[_ngcontent-%COMP%]{font-family:Cairo;font-weight:700;font-style:Bold;font-size:20px;line-height:100%;letter-spacing:0%;text-align:center}"]})};var q=()=>({label:"\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0642\u064A\u062F(waiting)",id:"edit"}),z=()=>({label:"\u062A\u0639\u0637\u064A\u0644 \u0627\u0644\u0642\u064A\u062F(wainting)",id:"disable"}),$=()=>({label:"\u062D\u0630\u0641 \u0627\u0644\u0642\u064A\u062F(wainting)",id:"delete",danger:!0,visible:!0}),G=(n,e,t)=>[n,e,t];function H(n,e){if(n&1){let t=w();o(0,"app-card",3),p("onSelect",function(a){C(t);let m=D();return b(m.handleAction(a))}),r()}if(n&2){let t=e.$implicit;y("cardData",t)("actions",F(5,G,u(2,q),u(3,z),u(4,$)))}}var Q=class n{allRestrictions=[{logo:"fa-solid fa-file-lines",title:" \u0642\u064A\u062F \u064A\u062F\u0648\u0649",route:"/home/entries/manual-entries"}];title="Daily";handleAction(e){console.log("Selected action:",e)}menuOptions=[{id:"edit",name:"\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0642\u064A\u062F"},{id:"disable",name:"\u062A\u0639\u0637\u064A\u0644 \u0627\u0644\u0642\u064A\u062F"},{id:"delete",name:"\u062D\u0630\u0641 \u0627\u0644\u0642\u064A\u062F"}];handleCardAction(e){switch(e.id){case"edit":console.log("Edit clicked");break;case"disable":console.log("Disable clicked");break;case"delete":console.log("Delete clicked");break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=s({type:n,selectors:[["app-accounting-restrictions"]],decls:4,vars:0,consts:[["title","accounting_entries","Translationprefix","shared"],[1,"cards"],[3,"cardData","actions"],[3,"onSelect","cardData","actions"]],template:function(t,i){t&1&&(l(0,"app-page-title",0),o(1,"div",1),v(2,H,1,9,"app-card",2,x),r()),t&2&&(c(2),M(i.allRestrictions))},dependencies:[I,d],styles:[".cards[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}"]})};export{Q as AccountingRestrictionsComponent};
