import{d as O,D as n,aq as g,E as t,H as s,I as r,P as y,h as w,b as f,u as c,F as C,M as V,r as T,A as z,e as i,O as D,a1 as P}from"./lucide-CoF0tLOi.js";import{f as k,j as $,s as F,e as S,_ as X}from"./index-Bd8s4WQO.js";import{m as p,k as B,V as Y,b as x,d as h,B as E,G as A,c as N}from"./vuetify-DvOJDL5n.js";const j={key:1},q=O({__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:M}){const u=T(!1),m=(o,a)=>{if(o.preventDefault(),a.subItems?.length){const e=a.closeOnContentClick===!1?a.subItems.map(b=>({...b,close_on_click:b.close_on_click??!1})):a.subItems,d="clientX"in o?o.clientX:0,v="clientY"in o?o.clientY:0;S.emit("contextmenu",{items:e,posX:d,posY:v})}else a.action&&(u.value=!1,a.action())},L=M;return(o,a)=>(i(),n(E,{color:l.color,class:"header"},g({title:t(()=>[w(o.$slots,"title",{},()=>[l.title||c(F).mobileLayout&&l.home?(i(),f("button",{key:0,onClick:a[1]||(a[1]=e=>L("titleClicked"))},P(l.title||(l.home?o.$t("home"):"")),1)):r("",!0)],!0)]),_:2},[l.icon?{name:"prepend",fn:t(()=>[s(p,{icon:typeof l.icon=="string"?l.icon:void 0,size:"small",disabled:l.iconAction==null,style:{opacity:"0.8"},onClick:a[0]||(a[0]=e=>l.iconAction?.())},{default:t(()=>[typeof l.icon!="string"?(i(),n(y(l.icon),{key:0,class:"w-6 h-6"})):r("",!0)]),_:1},8,["icon","disabled"])]),key:"0"}:void 0,o.$slots.append?{name:"append",fn:t(()=>[w(o.$slots,"append",{},void 0,!0)]),key:"1"}:l.menuItems?.length?{name:"append",fn:t(()=>[l.showLoading&&c(k).syncTasks.value.length>0?(i(),n(B,{key:0,color:"primary",indeterminate:"",title:o.$t("tooltip.loading")},null,8,["title"])):r("",!0),(i(!0),f(C,null,V(l.menuItems.filter(e=>!e.hide&&!l.enforceOverflowMenu&&(c($)("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=>m(d,e)},{default:t(()=>[s(A,{"model-value":e.active==!0,color:"primary",dot:""},{default:t(()=>[typeof e.icon=="string"?(i(),n(h,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):e.icon?(i(),n(y(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"])):r("",!0)]),_:2},1032,["model-value"])]),_:2},1032,["title","disabled","onClick"]))),128)),(!c($)("bp7")||l.enforceOverflowMenu)&&l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!==!1).length?(i(),f("div",j,[s(Y,{modelValue:u.value,"onUpdate:modelValue":a[2]||(a[2]=e=>u.value=e),location:"bottom end",scrim:"","close-on-content-click":!1},{activator:t(({props:e})=>[s(p,z({variant:"plain",style:{width:"15px","margin-left":"-10px"}},e),{default:t(()=>[s(h,{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:t(()=>[s(x,{density:"compact",slim:"",tile:""},{default:t(()=>[(i(!0),f(C,null,V(l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!=!1),(e,d)=>(i(),n(N,{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(v=>m(v,e),["prevent","stop"])},g({_:2},[e.icon?{name:"prepend",fn:t(()=>[s(A,{"model-value":e.active==!0,color:"primary",dot:""},{default:t(()=>[typeof e.icon=="string"?(i(),n(h,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):(i(),n(y(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"])])):r("",!0)]),key:"2"}:l.showLoading?{name:"append",fn:t(()=>[c(k).fetchesInProgress.value.length>0||c(k).syncTasks.value.length>0?(i(),n(B,{key:0,color:"primary",indeterminate:""})):r("",!0)]),key:"3"}:void 0]),1032,["color"]))}}),J=X(q,[["__scopeId","data-v-b426da13"]]);export{J as T};
