import{I as l}from"./ItemsListing-e8i_b9av.js";import{s,a as i,E as p}from"./index-Cc0s9xHj.js";import{d as m,r as a,o as c,a3 as f,G as b,u as v,aS as _,b as y}from"./lucide-C_a_D9Y7.js";import"./Container-C8q3OdIF.js";import"./index-kQIztB-E.js";import"./vuetify-CvGbteJu.js";import"./Toolbar-CpDb2XyG.js";import"./userPreferences-CgJSfdV_.js";import"./vue-router-lrCq0UAu.js";import"./Button-CCvS9sA_.js";import"./ListItem-Ct4Nbn6d.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DhKX4Vvj.js";import"./MediaItemThumb-CN3YtoJY.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-7ardqVNw.js";import"./vue-i18n-COI_JhGQ.js";import"./PanelviewItemCompact-CL6Psz6q.js";import"./qrcode-DICVlH4J.js";import"./marked-D9eDbhZJ.js";import"./color-CqFg8eif.js";import"./vueuse-Blk5jQ0T.js";/* empty css            */import"./swiper-UowLVX5q.js";const z=m({name:"Audiobooks",__name:"LibraryAudiobooks",setup(k){const e=a(!1),t=a(s.libraryAudiobooksCount),n=["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"],d=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,o.genreIds)},u=async function(o){if(!o.favoritesOnly&&!o.provider){t.value=s.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)=>(y(),b(l,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":d,"show-library":!0,"sort-keys":n,"update-available":e.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:v(_),"restore-state":!0,total:t.value,"show-provider-filter":!0,"show-genre-filter":!0},null,8,["update-available","title","icon","total"]))}});export{z as default};
