import{I as l}from"./ItemsListing-BMesaHxv.js";import{s as a,d as i,E as p}from"./index-CYARjAcc.js";import{d as m,r as s,o as c,a0 as f,D as b,e as v,u as _,au as y}from"./lucide-rLvmKvE1.js";import"./Container-HA80j7kh.js";import"./index-kQIztB-E.js";import"./vuetify-BdaOaD_N.js";import"./utils-CDN07tui.js";import"./Toolbar-CVMlEKbT.js";import"./userPreferences-D01Ocpy7.js";import"./vue-router-BnaBZz9x.js";import"./Button-R4Y0VaBT.js";import"./ListItem-D3CJThrc.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-P3VhSkM6.js";import"./MediaItemThumb-BlO9IiSN.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DAC2cm1O.js";import"./vue-i18n-CXUEeRZR.js";import"./PanelviewItemCompact-DkzLoRD9.js";import"./qrcode-CYbaxYTR.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-ChcDFDJ0.js";/* empty css            */import"./swiper-DKl2QvBw.js";const H=m({name:"Audiobooks",__name:"LibraryAudiobooks",setup(k){const e=s(!1),t=s(a.libraryAudiobooksCount),d=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","timestamp_modified","timestamp_modified_desc","last_played","last_played_desc","play_count","play_count_desc"],n=async function(o){return e.value=!1,u(o),await i.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy,o.provider&&o.provider.length>0?o.provider:void 0)},u=async function(o){if(!o.favoritesOnly&&!o.provider){t.value=a.libraryAudiobooksCount;return}if(o.provider&&o.provider.length>0){t.value=void 0;return}t.value=await i.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return c(()=>{const o=i.subscribe(p.MEDIA_ITEM_ADDED,r=>{r.object_id?.startsWith("library://audiobook")&&(e.value=!0)});f(o)}),(o,r)=>(v(),b(l,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":n,"show-library":!0,"sort-keys":d,"update-available":e.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:_(y),"restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","icon","total"]))}});export{H as default};
