import{I as v}from"./ItemsListing-CqOkN5bP.js";import{d as _,bw as x,i as B,N as u,c as l,b as I,w as V,o as i,a as C,F as S,r as E,e as F,q as N,t as b,g as P,ba as d,m as L,M as j}from"./index-BLuBzgcR.js";import{_ as q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Container-BVutxj42.js";import"./index-CBho6rsP.js";import"./VContainer-DOe7JF0h.js";/* empty css              */import"./Toolbar-RSDUeNZR.js";import"./VToolbar-BFOvSQM-.js";import"./VBtn-i8gedOhv.js";import"./Button-BEhYIX-0.js";import"./ListItem-D3UfOTqB.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-Dwz4QKKd.js";import"./VInput-S8c2HXsf.js";import"./MediaItemThumb-4FqrTjbr.js";import"./PanelviewItemCompact-Czo8xJLH.js";import"./VSpacer-FdmIBMIx.js";import"./VTextField-BRzkPyuL.js";import"./VInfiniteScroll-XtiIpwbc.js";import"./layout-Dtt5lK8k.js";import"./VRow-Dw7kUaJt.js";import"./VVirtualScroll-JP5E3DQw.js";import"./VAlert-Du-laR0E.js";const D={class:"breadcrumb-container"},M=["onClick"],O={key:1,class:"breadcrumb-text"},T=_({__name:"BrowseView",props:{path:{}},setup(n){const o=n,{t:f}=x(),p=B(!1),w=u(()=>""),m=u(()=>{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[a,t]=o.path.split("://"),s=a+"://";if(e.push({text:s,path:s,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(c=>c.length>0);r.forEach((c,h)=>{const y=s+r.slice(0,h+1).join("/");e.push({text:c,path:y,clickable:h<r.length-1})})}}else{const a=o.path.split("/").filter(t=>t.length>0);a.forEach((t,s)=>{const r=a.slice(0,s+1).join("/");e.push({text:t,path:r,clickable:s<a.length-1})})}return e}),k=async function(e){const a=await L.browse(o.path);return p.value=a.every(t=>t.media_type===j.FOLDER),a},g=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,a)=>(i(),l("section",null,[I(v,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(n.path&&n.path!="root"&&!p.value),"load-items":k,"sort-keys":["original","name","name_desc"],path:n.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:w.value},{title:V(()=>[C("div",D,[(i(!0),l(S,null,E(m.value,(t,s)=>(i(),l("span",{key:s,class:"breadcrumb-segment"},[t.clickable?(i(),l("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},b(t.text),9,M)):(i(),l("span",O,b(t.text),1)),s<m.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"])]))}}),ct=q(T,[["__scopeId","data-v-c0cbe0e2"]]);export{ct as default};
