import{I as y}from"./ItemsListing-BHlkb6-j.js";import{d as v,bw as B,i as I,N as h,c as l,o as i,b as V,w as x,a as C,F as S,r as E,e as F,q as N,t as u,g as P,ba as b,m as L,M as j}from"./index-LFx1jIjH.js";import{_ as q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Container-CuH2YNr5.js";import"./Button-SUce42c3.js";import"./VBtn-BYKkZzw0.js";import"./VContainer-or1Uze2V.js";/* empty css              */import"./Toolbar-iQxHKI_C.js";import"./VToolbar-Dc2WDt1C.js";import"./ListItem-DhvO1M3C.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B4veTxLS.js";import"./VInput-B3Z2GK8Z.js";import"./MediaItemThumb-cYqdWFcl.js";import"./PanelviewItemCompact-Bf82DAtE.js";import"./VSpacer-Cg-cZSyv.js";import"./VTextField-DyzwZgKh.js";import"./VInfiniteScroll-DH2IK80_.js";import"./layout-C6GuZOkj.js";import"./VRow-cyJLSUM5.js";import"./VVirtualScroll-DYZmdOFl.js";import"./VAlert-Cyb25ra3.js";const D={class:"breadcrumb-container"},M=["onClick"],O={key:1,class:"breadcrumb-text"},T=v({__name:"BrowseView",props:{path:{}},setup(d){const o=d,{t:f}=B(),c=I(!1),w=h(()=>""),p=h(()=>{const e=[];if(e.push({text:f("browse"),path:null,clickable:o.path&&o.path!=="root"||!1}),o.path&&o.path!=="root")if(o.path.includes("://")){const[s,t]=o.path.split("://"),a=s+"://";if(e.push({text:a,path:a,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(n=>n.length>0);r.forEach((n,m)=>{const _=a+r.slice(0,m+1).join("/");e.push({text:n,path:_,clickable:m<r.length-1})})}}else{const s=o.path.split("/").filter(t=>t.length>0);s.forEach((t,a)=>{const r=s.slice(0,a+1).join("/");e.push({text:t,path:r,clickable:a<s.length-1})})}return e}),k=async function(e){const s=await L.browse(o.path);return c.value=s.every(t=>t.media_type===j.FOLDER),s},g=e=>{e===null?b.push({name:"browse"}):b.push({name:"browse",query:{path:e}})};return(e,s)=>(i(),l("section",null,[V(y,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(e.path&&e.path!="root"&&!c.value),"load-items":k,"sort-keys":["original","name","name_desc"],path:e.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:w.value},{title:x(()=>[C("div",D,[(i(!0),l(S,null,E(p.value,(t,a)=>(i(),l("span",{key:a,class:"breadcrumb-segment"},[t.clickable?(i(),l("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},u(t.text),9,M)):(i(),l("span",O,u(t.text),1)),a<p.value.length-1?(i(),F(P,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):N("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),nt=q(T,[["__scopeId","data-v-c0cbe0e2"]]);export{nt as default};
