import{r as l,b as w,d as k,o as t,c as n,w as c,a as e,z as r,f as y,t as x,g as v,F as C,e as S}from"./app-91dba96b.js";import{u as a}from"./urlGenerator-87d92adb.js";import{i as g}from"./index-0653e21c.js";import"./appFunction-1b5b1f43.js";const B={class:"navbar navbar-expand navbar-light navbar-bg"},L=["src"],P=["src"],M={key:3,class:"navbar-collapse collapse"},N={class:"navbar-nav navbar-align"},V={class:"nav-item dropdown"},$=e("a",{class:"nav-icon dropdown-toggle d-inline-block d-sm-none",href:"#","data-bs-toggle":"dropdown"},[e("i",{class:"align-middle","data-feather":"settings"})],-1),j={class:"nav-link dropdown-toggle d-none d-sm-inline-block",href:"#","data-bs-toggle":"dropdown"},F=["src"],q={class:"text-dark"},z={class:"dropdown-menu dropdown-menu-end"},A=["href"],D=e("i",{class:"align-middle me-1","data-feather":"user"},null,-1),E=e("div",{class:"dropdown-divider"},null,-1),G=["href"],T=e("div",{class:"dropdown-divider"},null,-1),U=e("i",{class:"align-middle me-1","data-feather":"log-out"},null,-1),Q={__name:"navbar",setup(H){const m=()=>{g.post("logout").then(({data:s})=>{window.location.href=a("login")})},i=l(!0),p=s=>{const o=document.querySelector(".sidebar");s==="open"?(o.classList.add("collapsed"),i.value=!1):(o.classList.remove("collapsed"),i.value=!0)},_=l({}),u=l(null),d=l(!1),f=()=>{d.value=!0,g.get("profile").then(({data:s})=>{_.value=s,u.value=s.profile&&s.profile.profile_picture?a(s.profile.profile_picture):a("assets/img/avatar.png")}).finally(()=>d.value=!1)};return w(()=>{f()}),(s,o)=>{const h=k("app-loader");return t(),n("nav",B,[i.value?(t(),n("a",{key:0,class:"sidebar js-sidebar",id:"sidebar",onClick:o[0]||(o[0]=c(b=>p("open"),["prevent"]))},[e("img",{class:"nav_arrow_icon",src:r(a)("assets/img/icons/collapse-arrow.svg"),alt:""},null,8,L)])):(t(),n("a",{key:1,class:"sidebar js-sidebar",id:"sidebar",onClick:o[1]||(o[1]=c(b=>p("close"),["prevent"]))},[e("img",{class:"nav_arrow_icon",src:r(a)("assets/img/icons/open-arrow.svg"),alt:""},null,8,P)])),d.value?(t(),y(h,{key:2})):(t(),n("div",M,[e("ul",N,[e("li",V,[$,e("a",j,[e("img",{src:u.value,class:"avatar img-fluid rounded me-1",alt:"User profile"},null,8,F),e("span",q,x(_.value.full_name),1)]),e("div",z,[e("a",{class:"dropdown-item",href:r(a)("my-profile")},[D,v(" Profile ")],8,A),s.$canAccess("view_setting")?(t(),n(C,{key:0},[E,e("a",{class:"dropdown-item",href:r(a)("setting")},"Settings",8,G)],64)):S("",!0),T,e("a",{href:"",class:"dropdown-item",onClick:c(m,["prevent"])},[U,v(" Logout ")])])])])]))])}}};export{Q as default};
