Files
service-finder/frontend_admin/.output/public/_nuxt/CC4zKGJo.js

2 lines
12 KiB
JavaScript

import{_ as I}from"./Da4aCGAe.js";import{p as J,e as K,D as q,g as Q,E as X,y as Y,G as Z,o,c as r,i as H,a as e,b as B,w,n as d,F as p,r as b,k as L,H as A,t as u,I as S,d as R,J as ee,x as k,m as g,A as te}from"./CqYPuxVf.js";import{u as se}from"./DWjNh9rV.js";import{u as oe}from"./CWA6Xjbg.js";const ne=J("/logo.svg"),le={class:"min-h-screen bg-slate-900 text-white flex"},ae={class:"flex items-center gap-3 min-w-0"},re={class:"flex-1 px-2 py-4 space-y-2 overflow-y-auto overflow-x-hidden"},ie={key:0},de=["onClick"],ue=["innerHTML"],ce={class:"ml-2 mt-1 space-y-1 overflow-hidden transition-all duration-200"},he=["innerHTML"],ve={class:"whitespace-nowrap overflow-hidden"},pe=["innerHTML"],xe={class:"p-4 border-t border-slate-700 overflow-hidden"},fe={class:"flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out"},ke={class:"sticky top-0 z-10 bg-slate-800/95 backdrop-blur-sm border-b border-slate-700"},ge={class:"flex items-center justify-between h-16 px-4 lg:px-6"},me={class:"flex items-center gap-3"},we={class:"text-lg font-semibold text-white truncate"},be={class:"flex items-center gap-3"},ye={class:"flex items-center bg-slate-700/50 rounded-lg p-0.5"},_e=["onClick"],Ce={class:"w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-sm font-bold text-white"},ze={class:"hidden sm:block text-sm text-slate-300"},Me={key:0,class:"absolute right-0 mt-2 w-56 bg-slate-800 border border-slate-700 rounded-xl shadow-xl py-1 z-50"},je={class:"px-4 py-3 border-b border-slate-700"},He={class:"text-sm font-medium text-white"},Be={class:"flex-1 p-4 lg:p-6 overflow-auto"},Fe=K({__name:"default",setup(Le){const c=q(),$=Q(),x=oe(),C=se(),{locale:z,locales:V}=X(),F=k(()=>V.value),T=k(()=>z.value);function E(){const t=te("access_token").value;return t?{Authorization:`Bearer ${t}`}:{}}async function G(s){z.value=s;try{await $fetch("/api/v1/auth/me/language",{method:"PATCH",headers:{...E(),"Content-Type":"application/json"},body:{preferred_language:s}})}catch(t){console.error("[Layout] Failed to persist language preference:",t)}}const n=g(!1),i=g(!1),v=g(!1),y=g(null),f=g(new Set(["Központ"])),M=k(()=>x.userEmail||"admin@servicefinder.hu"),D=k(()=>{const s=x.userEmail;return s?s.split("@")[0].split(".").map(t=>t[0]).join("").toUpperCase().slice(0,2):"AD"}),N=[{title:"Központ",items:[{path:"/",label:"Dashboard",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>'}]},{title:"Felhasználók & Partnerek",items:[{label:"Garázsok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" /></svg>',children:[{path:"/garages",label:"Garázsok listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg>'}]},{label:"Felhasználók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" /></svg>',children:[{path:"/users",label:"Felhasználók listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" /></svg>'}]}]},{title:"Pénzügyek",items:[{path:"/packages",label:"Csomagok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0l-3-3m3 3l3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z" /></svg>'}]},{title:"Rendszer",items:[{path:"/permissions",label:"Jogosultságok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>'},{label:"Rendszernaplók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>',children:[{path:"/logs",label:"Rendszernaplók",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>'}]}]}],W=k(()=>c.path==="/"?"Dashboard":c.path.startsWith("/permissions")?"Jogosultság Kezelés":c.path.startsWith("/garages")?"Garázsok":c.path.startsWith("/users")?"Felhasználók":c.path.startsWith("/logs")?"Rendszernaplók":c.path.startsWith("/packages")?"Csomagok":"Admin Panel");function _(s){return s==="/"?c.path==="/":c.path.startsWith(s)}function P(s){return s.children?s.children.some(t=>_(t.path)):!1}function O(s){f.value.has(s.label)?f.value.delete(s.label):f.value.add(s.label)}function U(){x.logout(),v.value=!1,$.push("/login")}function j(s){y.value&&!y.value.contains(s.target)&&(v.value=!1)}return Y(()=>{document.addEventListener("click",j),C.fetchRegions().then(()=>{x.user?.region_code&&C.setActiveRegion(x.user.region_code)})}),Z(()=>{document.removeEventListener("click",j)}),(s,t)=>{const m=I;return o(),r("div",le,[n.value?(o(),r("div",{key:0,class:"fixed inset-0 bg-black/50 z-20 lg:hidden",onClick:t[0]||(t[0]=a=>n.value=!1)})):H("",!0),e("aside",{class:d(["fixed lg:static inset-y-0 left-0 z-30 flex flex-col bg-slate-800 border-r border-slate-700 transition-all duration-300 ease-in-out overflow-hidden",n.value||!i.value?"w-52":"w-20"])},[B(m,{to:"/",class:"flex items-center h-16 px-4 border-b border-slate-700 overflow-hidden hover:bg-slate-700/50 transition"},{default:w(()=>[e("div",ae,[t[8]||(t[8]=e("img",{src:ne,class:"h-8 w-auto flex-shrink-0",alt:"SF Logo"},null,-1)),e("div",{class:d(["transition-all duration-300 ease-in-out overflow-hidden whitespace-nowrap",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},[...t[7]||(t[7]=[e("div",{class:"text-sm font-bold text-white leading-tight"},"Service Finder",-1),e("div",{class:"text-[10px] font-semibold uppercase tracking-wider text-indigo-400 leading-tight"},"Admin",-1)])],2)])]),_:1}),e("button",{class:"hidden lg:flex items-center justify-center h-10 mx-2 mt-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition flex-shrink-0",onClick:t[1]||(t[1]=a=>i.value=!i.value)},[(o(),r("svg",{class:d(["w-5 h-5 transition-transform duration-300",{"rotate-180":i.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"},null,-1)])],2))]),e("nav",re,[(o(),r(p,null,b(N,a=>(o(),r(p,{key:a.title},[L(e("div",{class:"px-3 py-1 text-xs font-semibold uppercase tracking-wider text-slate-500 whitespace-nowrap overflow-hidden"},u(a.title),513),[[A,n.value||!i.value]]),(o(!0),r(p,null,b(a.items,l=>(o(),r(p,{key:l.label},[l.children?(o(),r("div",ie,[e("button",{class:d(["flex items-center w-full gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",P(l)?"bg-indigo-600/20 text-indigo-300":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:h=>O(l)},[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:l.icon},null,8,ue),e("span",{class:d(["flex-1 text-left whitespace-nowrap overflow-hidden transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},u(l.label),3),(o(),r("svg",{class:d(["w-4 h-4 transition-all duration-300 ease-in-out flex-shrink-0",{"rotate-90":f.value.has(l.label),"opacity-100":n.value||!i.value,"opacity-0":i.value&&!n.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2))],10,de),L(e("div",ce,[(o(!0),r(p,null,b(l.children,h=>(o(),S(m,{key:h.path,to:h.path,class:d(["flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition",_(h.path)?"bg-indigo-600 text-white":"text-slate-400 hover:bg-slate-700 hover:text-white"]),onClick:t[2]||(t[2]=Ae=>n.value=!1)},{default:w(()=>[e("span",{class:"flex-shrink-0 w-4 h-4",innerHTML:h.icon},null,8,he),e("span",ve,u(h.label),1)]),_:2},1032,["to","class"]))),128))],512),[[A,f.value.has(l.label)&&(n.value||!i.value)]])])):(o(),S(m,{key:1,to:l.path,class:d(["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",_(l.path)?"bg-indigo-600 text-white":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:t[3]||(t[3]=h=>n.value=!1)},{default:w(()=>[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:l.icon},null,8,pe),e("span",{class:d(["whitespace-nowrap overflow-hidden transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},u(l.label),3)]),_:2},1032,["to","class"]))],64))),128))],64))),64))]),e("div",xe,[e("div",{class:d(["text-xs text-slate-500 whitespace-nowrap transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])}," ServiceFinder v2.0 ",2)])],2),e("div",fe,[e("header",ke,[e("div",ge,[e("div",me,[e("button",{class:"lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",onClick:t[4]||(t[4]=a=>n.value=!0)},[...t[11]||(t[11]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("h1",we,u(W.value),1)]),e("div",be,[e("div",ye,[(o(!0),r(p,null,b(F.value,a=>(o(),r("button",{key:a.code,onClick:l=>G(a.code),class:d(["px-2.5 py-1 text-xs font-medium rounded-md transition",T.value===a.code?"bg-indigo-600 text-white shadow-sm":"text-slate-400 hover:text-white"])},u(a.code==="hu"?"HU":"EN"),11,_e))),128))]),e("div",{class:"relative",ref_key:"dropdownRef",ref:y},[e("button",{class:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition",onClick:t[5]||(t[5]=a=>v.value=!v.value)},[e("div",Ce,u(D.value),1),e("span",ze,u(M.value),1),t[12]||(t[12]=e("svg",{class:"w-4 h-4 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),v.value?(o(),r("div",Me,[e("div",je,[e("p",He,u(M.value),1),t[13]||(t[13]=e("p",{class:"text-xs text-slate-400 mt-0.5"},"Administrator",-1))]),B(m,{to:"/profile",class:"flex items-center gap-3 px-4 py-2.5 text-sm text-slate-300 hover:bg-slate-700 hover:text-white transition",onClick:t[6]||(t[6]=a=>v.value=!1)},{default:w(()=>[...t[14]||(t[14]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})],-1),R(" Profile Settings ",-1)])]),_:1}),e("button",{class:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-red-400 hover:bg-slate-700 hover:text-red-300 transition",onClick:U},[...t[15]||(t[15]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),R(" Sign Out ",-1)])])])):H("",!0)],512)])])]),e("main",Be,[ee(s.$slots,"default")])])])}}});export{Fe as default};