import{d as z,r as O,D as n,e as i,aj as h,E as a,H as s,I as c,W as k,h as w,b as f,B as r,F as C,M as V,z as x,U as D,f as $,_ as P}from"./lucide-sS6c3snl.js";import{c as u,i as B,s as E,b as F,e as N,_ as S}from"./index-HFEfURXv.js";import{q as p,o as A,V as X,b as Y,d as b,E as U,B as M,c as j}from"./vuetify-ffr1lJCG.js";const q={key:0,class:"mobile-brand"},H={key:1},W=z({__name:"Toolbar",props:{color:{default:"transparent"},icon:{default:void 0},title:{default:void 0},menuItems:{default:void 0},enforceOverflowMenu:{type:Boolean,default:!1},showLoading:{type:Boolean,default:void 0},home:{type:Boolean},iconAction:{type:Function,default:void 0}},emits:["iconClicked","titleClicked"],setup(l,{emit:L}){const v=O(!1),g=(o,t)=>{if(o.preventDefault(),t.subItems?.length){const e=t.closeOnContentClick===!1?t.subItems.map(m=>({...m,close_on_click:m.close_on_click??!1})):t.subItems,d="clientX"in o?o.clientX:0,y="clientY"in o?o.clientY:0;N.emit("contextmenu",{items:e,posX:d,posY:y})}else t.action&&(v.value=!1,t.action())},T=L;return(o,t)=>(i(),n(U,{color:l.color,class:"header"},h({title:a(()=>[w(o.$slots,"title",{},()=>[r(E).mobileLayout&&l.home?(i(),f("div",q,[...t[3]||(t[3]=[$("img",{src:F,alt:"Music Assistant",class:"mobile-brand-logo"},null,-1),$("span",{class:"mobile-brand-text"},"Music Assistant",-1)])])):l.title?(i(),f("button",{key:1,onClick:t[1]||(t[1]=e=>T("titleClicked"))},P(l.title),1)):c("",!0)],!0)]),_:2},[l.icon?{name:"prepend",fn:a(()=>[s(p,{icon:typeof l.icon=="string"?l.icon:void 0,size:"small",disabled:l.iconAction==null,style:{opacity:"0.8"},onClick:t[0]||(t[0]=e=>l.iconAction?.())},{default:a(()=>[typeof l.icon!="string"?(i(),n(k(l.icon),{key:0,class:"w-6 h-6"})):c("",!0)]),_:1},8,["icon","disabled"])]),key:"0"}:void 0,o.$slots.append?{name:"append",fn:a(()=>[w(o.$slots,"append",{},void 0,!0)]),key:"1"}:l.menuItems?.length?{name:"append",fn:a(()=>[l.showLoading&&(r(u).fetchesInProgress.value.length>0||r(u).syncTasks.value.length>0)?(i(),n(A,{key:0,color:"primary",indeterminate:"",title:o.$t("tooltip.loading")},null,8,["title"])):c("",!0),(i(!0),f(C,null,V(l.menuItems.filter(e=>!e.hide&&!l.enforceOverflowMenu&&(r(B)("bp7")||e.overflowAllowed===!1)),e=>(i(),n(p,{key:e.label,variant:"text",style:{width:"40px"},title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,onClick:d=>g(d,e)},{default:a(()=>[s(M,{"model-value":e.active==!0,color:"primary",dot:""},{default:a(()=>[typeof e.icon=="string"?(i(),n(b,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):e.icon?(i(),n(k(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"])):c("",!0)]),_:2},1032,["model-value"])]),_:2},1032,["title","disabled","onClick"]))),128)),(!r(B)("bp7")||l.enforceOverflowMenu)&&l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!==!1).length?(i(),f("div",H,[s(X,{modelValue:v.value,"onUpdate:modelValue":t[2]||(t[2]=e=>v.value=e),location:"bottom end",scrim:"","close-on-content-click":!1},{activator:a(({props:e})=>[s(p,x({variant:"plain",style:{width:"15px","margin-left":"-10px"}},e),{default:a(()=>[s(b,{icon:"mdi-dots-vertical",color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22",style:{"margin-right":"-5px",width:"15px"}},null,8,["color"])]),_:1},16)]),default:a(()=>[s(Y,{density:"compact",slim:"",tile:""},{default:a(()=>[(i(!0),f(C,null,V(l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!=!1),(e,d)=>(i(),n(j,{key:d,title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,"append-icon":e.subItems?.length?"mdi-chevron-right":void 0,onClick:D(y=>g(y,e),["prevent","stop"])},h({_:2},[e.icon?{name:"prepend",fn:a(()=>[s(M,{"model-value":e.active==!0,color:"primary",dot:""},{default:a(()=>[typeof e.icon=="string"?(i(),n(b,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):(i(),n(k(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"]))]),_:2},1032,["model-value"])]),key:"0"}:void 0]),1032,["title","disabled","append-icon","onClick"]))),128))]),_:1})]),_:1},8,["modelValue"])])):c("",!0)]),key:"2"}:l.showLoading?{name:"append",fn:a(()=>[r(u).fetchesInProgress.value.length>0||r(u).syncTasks.value.length>0?(i(),n(A,{key:0,color:"primary",indeterminate:""})):c("",!0)]),key:"3"}:void 0]),1032,["color"]))}}),Q=S(W,[["__scopeId","data-v-56a4abe4"]]);export{Q as T};
