import{v as C,r as V,c as B,aE as p,ae as I,af as $,y as a,z as s,A as t,l as o,I as n,x as m,M as T,E as k,B as N,N as l,aF as S,R as r,ab as _,an as D,_ as F,H as M}from"./index-ab7e5b57.js";import{_ as L,c as A}from"./VBadge-babce8af.js";import{L as z}from"./ListItem-fd009900.js";import{f as E,g as H,c}from"./VMenu-9ab9e35f.js";import{a as R,b as O,c as f,V as P}from"./VTooltip-775ce0c0.js";import{k as y,s as G}from"./forwardRefs-d370b8e9.js";import{V as W}from"./VCard-b678de17.js";const j={key:0},q={key:1},J={key:2},ee=C({__name:"PanelviewItem",props:{item:{},size:{default:200},isSelected:{type:Boolean},showCheckboxes:{type:Boolean,default:!1},showTrackNumber:{type:Boolean,default:!0},showMediaType:{type:Boolean,default:!1}},emits:["menu","click","select"],setup(b,{emit:u}){const w=b,v=V(!1),h=B(()=>{for(const e of w.item.provider_mappings)if(e.audio_format.content_type!=null&&[p.DSF,p.FLAC,p.AIFF,p.WAV].includes(e.audio_format.content_type)&&(e.audio_format.sample_rate>48e3||e.audio_format.bit_depth>16))return`${e.audio_format.sample_rate/1e3}kHz ${e.audio_format.bit_depth} bits`;return""});return(e,i)=>{const g=I("hold");return $((a(),s(W,{class:"panel-item",onClick:i[1]||(i[1]=d=>e.showCheckboxes?null:u("click",e.item)),onContextmenu:i[2]||(i[2]=M(d=>e.showCheckboxes?null:u("menu",e.item),["right","prevent"])),onMouseover:i[3]||(i[3]=d=>v.value=!0),onMouseleave:i[4]||(i[4]=d=>v.value=!0)},{default:t(()=>[e.showCheckboxes?(a(),s(E,{key:0,"model-value":e.showCheckboxes,contained:"",scrim:e.isSelected?e.$vuetify.theme.current.dark?"rgba(0,0,0,.75)":"rgba(255,255,255,.75)":"#ffffff00",onClick:i[0]||(i[0]=d=>{u("select",e.item,!e.isSelected)})},{default:t(()=>[o(R,{class:"panel-item-checkbox",ripple:!1,"model-value":e.isSelected},null,8,["model-value"])]),_:1},8,["model-value","scrim"])):n("",!0),o(L,{item:e.item,width:"100%"},null,8,["item"]),o(z,{class:"panel-item-details",style:{"padding-top":"10px !important"}},{default:t(()=>[o(H,{class:"line-clamp-1 panel-item-details"},{default:t(()=>[e.item.media_type==m(T).FOLDER?(a(),k("span",j,[N("span",null,l(m(S)(e.item,e.$t)),1)])):(a(),k("span",q,l(e.item.name),1)),"version"in e.item&&e.item.version?(a(),k("span",J," - "+l(e.item.version),1)):n("",!0)]),_:1}),"artists"in e.item&&e.item.artists?(a(),s(c,{key:0,class:"line-clamp-1 panel-item-details"},{default:t(()=>[r(l(m(_)(e.item.artists,1)),1)]),_:1})):"owner"in e.item&&e.item.owner?(a(),s(c,{key:1,class:"line-clamp-1 panel-item-details"},{default:t(()=>[r(l(e.item.owner),1)]),_:1})):e.showMediaType?(a(),s(c,{key:2,class:"line-clamp-1 panel-item-details"},{default:t(()=>[r(l(e.$t(e.item.media_type)),1)]),_:1})):n("",!0),e.item&&e.item.media_type==="track"&&"metadata"in e.item?(a(),s(O,{key:3,style:{"min-height":"22px","padding-top":"5px"}},{default:t(()=>[o(f,null,{default:t(()=>[m(D)(e.item.metadata.explicit||!1)?(a(),s(y,{key:0,icon:"mdi-alpha-e-box"})):n("",!0)]),_:1}),o(f,null,{default:t(()=>[h.value?(a(),s(G,{key:0,src:m(A),width:"30",class:F(e.$vuetify.theme.current.dark?"hiresicondark":"hiresicon")},{default:t(()=>[o(P,{activator:"parent",location:"bottom"},{default:t(()=>[r(l(h.value),1)]),_:1})]),_:1},8,["src","class"])):n("",!0)]),_:1}),"disc_number"in e.item&&e.item.disc_number&&e.showTrackNumber?(a(),s(f,{key:0},{default:t(()=>[o(y,{style:{"margin-left":"5px"},icon:"md:album"}),r(" "+l(e.item.disc_number),1)]),_:1})):n("",!0),"track_number"in e.item&&e.item.track_number&&e.showTrackNumber?(a(),s(f,{key:1},{default:t(()=>[o(y,{style:{"margin-left":"5px"},icon:"mdi-music-circle-outline"}),r(" "+l(e.item.track_number),1)]),_:1})):n("",!0)]),_:1})):n("",!0)]),_:1})]),_:1})),[[g,()=>e.showCheckboxes?null:u("menu",e.item)]])}}});export{ee as _};
