import{I as h}from"./InfoHeader-BVLnVgWk.js";import{_ as x}from"./ProviderDetails.vue_vue_type_style_index_0_lang-CVMsU16L.js";import{C as w}from"./Container-DwB3rN_Z.js";import{T as E}from"./Toolbar-CaFrSIBc.js";import{G as b,k as V,f as _,E as g}from"./index-BTUEMLf5.js";import{e as A,b as T,c as M,n as B}from"./vuetify-BaCqMXPP.js";import{d as y,b as u,H as m,D as d,I as p,c as $,r as D,E as r,F as C,M as N,e as t,u as k,a1 as v,f as I,$ as L,w as F,o as H,a0 as S}from"./lucide-_oCiFqes.js";import"./marquee_text_sync-C0q0U3mh.js";import"./vue-router-DvALZv_2.js";import"./index-CpZ4YSWB.js";import"./reka-ui-BT9Jz-E-.js";import"./vueuse-CtSQZy69.js";import"./index-MfQlFusE.js";import"./DialogTitle.vue_vue_type_script_setup_true_lang-DOHf3CAT.js";import"./DialogFooter.vue_vue_type_script_setup_true_lang-CmePkLod.js";import"./vue-i18n-Dtd59yt5.js";import"./MediaItemThumb-BaHIgYra.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DjFjyMgl.js";import"./ListItem-MmQyHMan.js";import"./Button-GSo8rtij.js";import"./index-kQIztB-E.js";import"./qrcode-fG4AAl2w.js";import"./marked-i_gIkIP3.js";import"./color-BTziYnFN.js";/* empty css            */import"./swiper-B7iBjdLa.js";const U={style:{"margin-bottom":"10px"}},G={style:{width:"50px"}},P={key:0,class:"text-caption"},j=y({__name:"Chapters",props:{itemDetails:{}},setup(l){const i=l,o=D(!0),e=function(){o.value=!o.value},c=$(()=>[{label:"tooltip.collapse_expand",icon:o.value?"mdi-chevron-up":"mdi-chevron-down",action:e,overflowAllowed:!1}]),s=function(n){!i.itemDetails||!b(i.itemDetails)||_.playMedia(i.itemDetails.uri,void 0,void 0,n.position.toString())};return(n,f)=>(t(),u("section",U,[m(E,{title:n.$t("chapters"),"menu-items":c.value,onTitleClicked:e},null,8,["title","menu-items"]),m(A),o.value?(t(),d(w,{key:0},{default:r(()=>[m(T,null,{default:r(()=>[(t(!0),u(C,null,N(l.itemDetails?.metadata?.chapters,a=>(t(),d(M,{key:a.position,disabled:!k(b)(l.itemDetails),onClick:q=>s(a)},{prepend:r(()=>[I("div",G,[m(B,null,{default:r(()=>[L(v(a.position),1)]),_:2},1024)])]),title:r(()=>[I("div",null,v(a.name),1)]),append:r(()=>[a.end?(t(),u("span",P,v(k(V)(a.end-a.start)),1)):p("",!0)]),_:2},1032,["disabled","onClick"]))),128))]),_:1})]),_:1})):p("",!0)]))}}),_e=y({__name:"AudiobookDetails",props:{itemId:{},provider:{}},setup(l){const i=l,o=D(!1),e=D(),c=async function(){e.value=await _.getAudiobook(i.itemId,i.provider)};return F(()=>i.itemId,s=>{s&&c()},{immediate:!0}),H(()=>{const s=_.subscribe(g.MEDIA_ITEM_UPDATED,n=>{const f=n.data;e.value?.uri==f.uri&&(e.value=f,o.value=!0)});S(s)}),(s,n)=>(t(),u(C,null,[m(h,{item:e.value},null,8,["item"]),e.value&&e.value.metadata?.chapters?(t(),d(j,{key:0,"item-details":e.value},null,8,["item-details"])):p("",!0),e.value?(t(),d(x,{key:1,"item-details":e.value},null,8,["item-details"])):p("",!0)],64))}});export{_e as default};
