import{v as V,r as B,c as I,aE as p,ae as $,af as T,y as a,z as s,A as t,l as o,I as n,x as r,M as N,E as c,B as S,N as l,aF as _,R as m,ab as D,an as F,_ as M,H as L}from"./index-347ebc0b.js";import{_ as A,c as z}from"./VBadge-d0688981.js";import{L as E}from"./ListItem-3474dcbd.js";import{f as H,g as R,c as k}from"./VMenu-76eea3a9.js";import{a as O,b as P,c as f,V as G}from"./VTooltip-ca5f6305.js";import{k as y,s as W}from"./forwardRefs-094784c1.js";import{V as j}from"./VCard-c0d0fdea.js";const q={key:0},J={key:1},K={key:2},te=V({__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:w}){const g=b,v=B(!1),h=I(()=>{for(const e of g.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""}),u=w;return(e,i)=>{const C=$("hold");return T((a(),s(j,{class:"panel-item",onClick:i[1]||(i[1]=d=>e.showCheckboxes?null:u("click",e.item)),onContextmenu:i[2]||(i[2]=L(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(H,{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(O,{class:"panel-item-checkbox",ripple:!1,"model-value":e.isSelected},null,8,["model-value"])]),_:1},8,["model-value","scrim"])):n("",!0),o(A,{item:e.item,width:"100%"},null,8,["item"]),o(E,{class:"panel-item-details",style:{"padding-top":"10px !important"}},{default:t(()=>[o(R,{class:"line-clamp-1 panel-item-details"},{default:t(()=>[e.item.media_type==r(N).FOLDER?(a(),c("span",q,[S("span",null,l(r(_)(e.item,e.$t)),1)])):(a(),c("span",J,l(e.item.name),1)),"version"in e.item&&e.item.version?(a(),c("span",K," - "+l(e.item.version),1)):n("",!0)]),_:1}),"artists"in e.item&&e.item.artists?(a(),s(k,{key:0,class:"line-clamp-1 panel-item-details"},{default:t(()=>[m(l(r(D)(e.item.artists,1)),1)]),_:1})):"owner"in e.item&&e.item.owner?(a(),s(k,{key:1,class:"line-clamp-1 panel-item-details"},{default:t(()=>[m(l(e.item.owner),1)]),_:1})):e.showMediaType?(a(),s(k,{key:2,class:"line-clamp-1 panel-item-details"},{default:t(()=>[m(l(e.$t(e.item.media_type)),1)]),_:1})):n("",!0),e.item&&e.item.media_type==="track"&&"metadata"in e.item?(a(),s(P,{key:3,style:{"min-height":"22px","padding-top":"5px"}},{default:t(()=>[o(f,null,{default:t(()=>[r(F)(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(W,{key:0,src:r(z),width:"30",class:M(e.$vuetify.theme.current.dark?"hiresicondark":"hiresicon")},{default:t(()=>[o(G,{activator:"parent",location:"bottom"},{default:t(()=>[m(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"}),m(" "+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"}),m(" "+l(e.item.track_number),1)]),_:1})):n("",!0)]),_:1})):n("",!0)]),_:1})]),_:1})),[[C,()=>e.showCheckboxes?null:u("menu",e.item)]])}}});export{te as _};
