import{a as k,aC as y,aB as F,aH as R,_ as $,f as E,q as K,aK as M,aj as m,c,M as d,o as r,S as b,u as p,K as f,ap as j,R as q,a9 as z,J as h,Q as _,Y as D,P as G}from"./vue.D1BjjNmv.js";import{aK as H,u as J,o as P,L}from"./index.CL7yl-Wb.js";import{_ as Q}from"./_plugin-vue_export-helper.DlAUqK2U.js";const U={key:0,class:"layout-navbars-breadcrumb"},Y={key:0,class:"layout-navbars-breadcrumb-span"},A={key:1},O={key:2},W=["onClick"],X=k({name:"layoutBreadcrumb"}),Z=k({...X,setup(ee){const B=H(),I=J(),{themeConfig:o}=y(I),{routesList:g}=y(B),i=F(),C=R(),e=$({breadcrumbList:[],routeSplit:[],routeSplitFirst:"",routeSplitIndex:1}),w=E(()=>{u(i.path);const{layout:t,isBreadcrumb:a}=o.value;return t==="classic"||t==="transverse"?!1:!!a}),N=t=>{const{redirect:a,path:n}=t;a?C.push(a):C.push(n)},V=()=>{o.value.isCollapse=!o.value.isCollapse,x()},x=()=>{L.remove("themeConfig"),L.set("themeConfig",o.value)},S=t=>{t.forEach(a=>{e.routeSplit.forEach((n,v,l)=>{e.routeSplitFirst===a.path&&(e.routeSplitFirst+=`/${l[e.routeSplitIndex]}`,e.breadcrumbList.push(a),e.routeSplitIndex++,a.children&&S(a.children))})})},u=t=>{if(!o.value.isBreadcrumb)return!1;e.breadcrumbList=[g.value[0]],e.routeSplit=t.split("/"),e.routeSplit.shift(),e.routeSplitFirst=`/${e.routeSplit[0]}`,e.routeSplitIndex=1,S(g.value),(i.name==="home"||i.name==="notFound"&&e.breadcrumbList.length>1)&&e.breadcrumbList.shift(),e.breadcrumbList.length>0&&(e.breadcrumbList[e.breadcrumbList.length-1].meta.tagsViewName=P.setTagsViewNameI18n(i))};return K(()=>{u(i.path)}),M(t=>{u(t.path)}),(t,a)=>{const n=m("SvgIcon"),v=m("el-breadcrumb-item"),l=m("el-breadcrumb");return w.value?(r(),c("div",U,[b(n,{class:"layout-navbars-breadcrumb-icon",name:p(o).isCollapse?"ele-Expand":"ele-Fold",size:16,onClick:V},null,8,["name"]),b(l,{class:"layout-navbars-breadcrumb-hide"},{default:f(()=>[b(j,{name:"breadcrumb"},{default:f(()=>[(r(!0),c(q,null,z(e.breadcrumbList,(s,T)=>(r(),h(v,{key:s.meta.tagsViewName?s.meta.tagsViewName:s.meta.title},{default:f(()=>[T===e.breadcrumbList.length-1?(r(),c("span",Y,[p(o).isBreadcrumbIcon?(r(),h(n,{key:0,name:s.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):d("",!0),s.meta.tagsViewName?(r(),c("div",O,_(s.meta.tagsViewName),1)):(r(),c("div",A,_(t.$t(s.meta.title)),1))])):(r(),c("a",{key:1,onClick:D(te=>N(s),["prevent"])},[p(o).isBreadcrumbIcon?(r(),h(n,{key:0,name:s.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):d("",!0),G(_(t.$t(s.meta.title)),1)],8,W))]),_:2},1024))),128))]),_:1})]),_:1})])):d("",!0)}}}),oe=Q(Z,[["__scopeId","data-v-cc3d7130"]]);export{oe as default};
