import{C as V}from"./Container-BixSAZes.js";import{d as _,o as P,l as h,c as i,e as y,w as r,J as M,u as p,ao as $,C as L,h as c,f as n,g as k,t as g,L as T,F as C,i as R,M as w,j as B,U as b,s as m,b as u,r as A,ap as S,aq as H,ar as D}from"./index-BcUYXcPq.js";import{P as E}from"./PanelviewItemCompact-w04R_lVh.js";import{c as f,s as F}from"./ItemContextMenu.vue_vue_type_style_index_0_scoped_85c6bb69_lang-CQtpREte.js";import{r as N,z as O}from"./VListItem-DC0X47Q4.js";import{V as W,T as q}from"./Toolbar-CtV0cu85.js";import{V as z}from"./VToolbar-B-HEXsGH.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-CoH7hbKx.js";/* empty css              */import"./VCard-Dx-t9yLE.js";import"./VCardText-D-aWL0fz.js";import"./VMenu-7bd_kTRb.js";import"./VCheckbox-BEPbmvTc.js";import"./VCheckboxBtn-DvMOQpng.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-B54PMsCQ.js";import"./VList-BKlimdrv.js";import"./eventbus-CGRXT3Tn.js";const U=_({__name:"Carousel",setup(v){return P(()=>{document.documentElement.style.setProperty("--swiper-navigation-color","primary")}),(a,d)=>{const t=h("swiper");return i(),y(t,{"slides-per-view":p($)(a.$vuetify.display.width)+.5,"space-between":24,"free-mode":!0,navigation:!p(L)({breakpoint:"mobile"}),mousewheel:{forceToAxis:!0,releaseOnEdges:!0}},{default:r(()=>[M(a.$slots,"default")]),_:3},8,["slides-per-view","navigation"])}}}),j={key:0,class:"widget-row"},J={class:"mr-3"},K={key:1,class:"mr-3"},G=_({__name:"HomeWidgetRow",props:{widgetRow:{}},setup(v){const a=function(e,o,l){const s=Array.isArray(e)?e:[e];F(s,void 0,o,l)},d=function(e,o,l){if(!f(e)){a(e,o,l);return}e.media_type==w.FOLDER?b.push({name:"browse",query:{path:e.path}}):b.push({name:e.media_type,params:{itemId:e.item_id,provider:e.provider}})},t=function(e,o,l){if(!f(e)){a(e,o,l);return}if(!m.activePlayerId){m.showPlayersMenu=!0;return}u.playMedia(e.uri,void 0)};return(e,o)=>{const l=h("swiper-slide");return e.widgetRow.items.length?(i(),c("div",j,[n(z,{class:"header",color:"transparent",style:T(e.widgetRow.path?"cursor: pointer; width: fit-content;":"width: fit-content;"),onClick:o[0]||(o[0]=s=>e.widgetRow.path?e.$router.push(e.widgetRow.path):"")},{prepend:r(()=>[n(N,{icon:e.widgetRow.icon},null,8,["icon"])]),title:r(()=>[e.widgetRow.count?(i(),y(W,{key:0,inline:"",color:"grey",content:e.widgetRow.count},{default:r(()=>[k("span",J,g(e.$t(e.widgetRow.label)),1)]),_:1},8,["content"])):(i(),c("span",K,g(e.$t(e.widgetRow.label)),1))]),_:1},8,["style"]),n(U,null,{default:r(()=>[(i(!0),c(C,null,R(e.widgetRow.items,s=>(i(),y(l,{key:s.uri},{default:r(()=>[n(E,{item:s,"permanent-overlay":![p(w).ALBUM,p(w).TRACK,p(w).RADIO].includes(s.media_type),"is-available":p(f)(s),onMenu:a,onClick:d,onPlay:t},null,8,["item","permanent-overlay","is-available"])]),_:2},1024))),128))]),_:1})])):B("",!0)}}}),Q=I(G,[["__scopeId","data-v-b13744f6"]]),X=_({__name:"HomeWidgetRows",async setup(v){let a,d;const t=A({recently_played:{label:"recently_played",icon:"mdi-motion-play",items:[]},artists:{label:"artists",icon:"mdi-account-music",path:"/artists",items:[]},albums:{label:"albums",icon:"mdi-album",path:"/albums",items:[]},playlists:{label:"playlists",icon:"mdi-playlist-music",path:"/playlists",items:[]},tracks:{label:"tracks",icon:"mdi-file-music",path:"/tracks",items:[]},radios:{label:"radios",icon:"mdi-radio",path:"/radios",items:[]},browse:{label:"browse",icon:"mdi-folder",path:"/browse",items:[]}}),e=async function(){t.value.recently_played.items=await u.getRecentlyPlayedItems(10),t.value.artists.items=await u.getLibraryArtists(void 0,void 0,20,void 0,"random"),t.value.artists.count=m.libraryArtistsCount,t.value.albums.items=await u.getLibraryAlbums(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.albums.count=m.libraryAlbumsCount,t.value.playlists.items=await u.getLibraryPlaylists(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.playlists.count=m.libraryPlaylistsCount,t.value.radios.items=await u.getLibraryRadios(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.radios.count=m.libraryRadiosCount,t.value.tracks.items=await u.getLibraryTracks(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.tracks.count=m.libraryTracksCount};return[a,d]=S(()=>e()),await a,d(),H(()=>{e()}),(o,l)=>(i(!0),c(C,null,R(t.value,s=>(i(),c("div",{key:s.label},[n(Q,{"widget-row":s},null,8,["widget-row"])]))),128))}}),Y=_({__name:"HomeView",props:{player:{}},setup(v){const a=A(localStorage.getItem("frontend.settings.hide_settings")=="true");return(d,t)=>(i(),c("div",null,[n(q,{title:"Music Assistant","show-loading":!0,"menu-items":a.value?[]:[{label:"settings.settings",icon:"mdi-cog-outline",action:()=>{d.$router.push({path:"settings"})}}]},null,8,["menu-items"]),n(V,{variant:"panel"},{default:r(()=>[(i(),y(D,null,{fallback:r(()=>[n(O,{indeterminate:""})]),default:r(()=>[k("div",null,[n(X)])]),_:1}))]),_:1})]))}}),_e=I(Y,[["__scopeId","data-v-8ecfe1dc"]]);export{_e as default};
