import{_ as $}from"./DChqHtgW.js";import{_ as y}from"./DlAUqK2U.js";import{c as p,o as d,a as e,z as B,M as f,B as M,r as N,b as l,w as i,p as u,H as L,d as x,t as P,x as S,T as A,Q as g}from"./UpFGpe05.js";import{u as I}from"./DsXiT_L-.js";const V={name:"MaterialSymbolsPersonRounded"},R={xmlns:"http://www.w3.org/2000/svg",width:"25px",height:"25px",viewBox:"0 0 24 24"};function U(w,r,m,_,n,v){return d(),p("svg",R,r[0]||(r[0]=[e("path",{fill:"currentColor",d:"M12 12q-1.65 0-2.825-1.175T8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12m-8 6v-.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2v.8q0 .825-.587 1.413T18 20H6q-.825 0-1.412-.587T4 18"},null,-1)]))}const z=y(V,[["render",U]]),D={class:"h-20 w-full px-5 shadow-lg md:px-11",style:{background:"linear-gradient(to right, var(--primary), var(--primary-shade))"}},E={class:"flex h-full items-center justify-between 2xl:px-28"},F={class:"flex items-center"},H=["src"],O={class:"flex items-center gap-8 text-xs font-medium text-white md:pr-6 md:text-lg"},j={class:"flex gap-8"},Q={key:1,class:"relative"},G={style:{color:"var(--primary)"}},J={key:0,class:"absolute right-0 z-50 mt-2 w-40 rounded-lg bg-white py-2 shadow-lg"},K={__name:"NavBar",async setup(w){let r,m;const{data:_,...n}=B(),v=f(()=>n&&n.status&&n.status.value==="authenticated"),b=f(()=>{var o;return((o=_.value)==null?void 0:o.refId)||""}),{logoSrc:h}=([r,m]=M(()=>I()),r=await r,m(),r),k=f(()=>{var o,t;return((t=(o=_.value)==null?void 0:o.nomeUsuario)==null?void 0:t.split(" ")[0])||""}),a=N(!1),C=async()=>{a.value=!1;try{await n.signOut({redirect:!1}),await g("/")}catch(o){o.message.includes("external URL")&&await g(logoutUrl,{external:!0})}},T=()=>{a.value=!1,g(`/user-profile/${b.value}`)};return window.addEventListener("click",o=>{const t=document.querySelector(".relative");t&&!t.contains(o.target)&&(a.value=!1)}),(o,t)=>{const c=$,q=z;return d(),p("div",D,[e("div",E,[e("div",F,[l(c,{to:"/",class:"block"},{default:i(()=>[e("img",{src:u(h),class:"max-h-16 w-auto cursor-pointer pt-2"},null,8,H)]),_:1})]),e("div",O,[e("div",j,[l(c,{to:"/contact"},{default:i(()=>t[5]||(t[5]=[e("p",null,"Fale Conosco",-1)])),_:1,__:[5]}),l(c,{to:"/faq"},{default:i(()=>t[6]||(t[6]=[e("p",null,"Perguntas Frequentes",-1)])),_:1,__:[6]})]),u(v)?(d(),p("div",Q,[e("button",{onClick:t[0]||(t[0]=s=>a.value=!u(a)),class:"group flex flex-row rounded-lg bg-white px-3 py-2 font-bold ease-in-out hover:underline hover:underline-offset-8"},[e("p",G,[t[8]||(t[8]=x(" Olá, ")),e("b",null,P(u(k)),1),t[9]||(t[9]=x("! "))]),l(q,{class:"ml-2",style:{color:"var(--primary)"}})]),l(A,{name:"fade"},{default:i(()=>[u(a)?(d(),p("div",J,[e("button",{onClick:C,class:"bold block w-full py-2 pr-6 text-right",onMouseover:t[1]||(t[1]=s=>s.target.style.backgroundColor="rgba(var(--primary-rgb), 0.1)"),onMouseleave:t[2]||(t[2]=s=>s.target.style.backgroundColor=""),style:{color:"var(--primary)"}}," Sair ",32),e("button",{onClick:T,class:"bold block w-full py-2 pr-6 text-right",onMouseover:t[3]||(t[3]=s=>s.target.style.backgroundColor="rgba(var(--primary-rgb), 0.1)"),onMouseleave:t[4]||(t[4]=s=>s.target.style.backgroundColor=""),style:{color:"var(--primary)"}}," Perfil ",32)])):S("",!0)]),_:1})])):(d(),L(c,{key:0,to:"/login"},{default:i(()=>t[7]||(t[7]=[e("p",{class:"group relative rounded-lg bg-white px-3 py-2 font-bold hover:underline hover:underline-offset-8",style:{color:"var(--primary)"}}," Acesse ou Cadastre-se ➜ ",-1)])),_:1,__:[7]}))])])])}}},tt=y(K,[["__scopeId","data-v-6b45366c"]]);export{tt as _};
