import{I as d}from"./ItemsListing-DdSUpMhP.js";import{I as y}from"./InfoHeader-CoNYNcZm.js";import{a as s,E as b}from"./index-CKxLfxpS.js";import{_ as k}from"./ProviderDetails.vue_vue_type_style_index_0_lang-CXtwfgiQ.js";import{d as w,w as h,o as I,r as T,a3 as g,b as D,J as E,G as m,K as p,f as u,u as B,e as l}from"./lucide-UY9XeFdQ.js";import"./Container-B1UOd5ED.js";import"./index-kQIztB-E.js";import"./vuetify-C0IIhwYL.js";import"./Toolbar-Da01lZeW.js";import"./userPreferences-BgjK7xB_.js";import"./vue-router-DNlH4vva.js";import"./Button-DdCpYaoc.js";import"./ListItem-BP0lui-9.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CnaMVQug.js";import"./MediaItemThumb-DiY2t3Gt.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DYXAnx83.js";import"./vue-i18n-DwYfJ_fn.js";import"./PanelviewItemCompact-BhrDAsYI.js";import"./marquee_text_sync-C4anEqYx.js";import"./MarqueeText-DvK0-Oq1.js";import"./color-CcshWhNz.js";import"./qrcode-CJNXjF_3.js";import"./marked-D9eDbhZJ.js";import"./vueuse-Dj-fx4H6.js";/* empty css            */import"./swiper-DNx4mJDO.js";const Z=w({__name:"TrackDetails",props:{itemId:{},provider:{},album:{}},setup(i){const t=i,e=T(),v=async function(){e.value=await s.getTrack(t.itemId,t.provider,t.album)};h(()=>t.itemId,r=>{r&&v()},{immediate:!0}),I(()=>{const r=s.subscribe(b.MEDIA_ITEM_UPDATED,a=>{const o=a.data;if(e.value?.uri==o.uri)e.value=o;else if("provider_mappings"in o){for(const n of o.provider_mappings)if(n.item_id==t.itemId&&[n.provider_instance,n.provider_domain].includes(t.provider)){e.value=o;break}}});g(r)});const f=async function(r){return await s.getTrackVersions(e.value.item_id,e.value.provider)},c=async function(r){return await s.getTrackAlbums(t.itemId,t.provider,r.libraryOnly)};return(r,a)=>(l(),D("section",null,[E(y,{item:e.value,"active-provider":i.provider},null,8,["item","active-provider"]),e.value?(l(),m(d,{key:0,itemtype:"trackalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-library-only-filter":e.value.provider=="library"&&B(s).hasStreamingProviders.value,"show-track-number":!1,"show-refresh-button":!1,"load-items":c,"sort-keys":["name","sort_name","year","year_desc"],title:r.$t("appears_on"),path:i.provider+i.itemId,"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title","path"])):p("",!0),a[0]||(a[0]=u("br",null,null,-1)),e.value?(l(),m(d,{key:1,itemtype:"trackversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","duration"],title:r.$t("other_versions"),"hide-on-empty":!0,path:i.provider+i.itemId,"allow-collapse":!0,"show-refresh-button":!1,"refresh-on-parent-update":!0},null,8,["parent-item","title","path"])):p("",!0),a[1]||(a[1]=u("br",null,null,-1)),e.value?(l(),m(k,{key:2,"item-details":e.value},null,8,["item-details"])):p("",!0),a[2]||(a[2]=u("br",null,null,-1))]))}});export{Z as default};
