import{_ as T}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.EO34UlUs.js";import{d as F,aD as S,aC as R,aG as $,Z as E,k as z,j as M,aL as D,ai as L,o as r,c as i,U as m,u as d,O as b,a0 as G,F as U,a8 as j,M as p,R as f,T as h,a2 as J,J as O,S as W}from"./vue.1RczIYhx.js";import{V as Z,u as q,o as A,L as k}from"./index.fM6cvGYs.js";import{_ as H}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./elementPlus.CXoFsoPv.js";const K={key:0,class:"layout-navbars-breadcrumb"},P={key:0,class:"layout-navbars-breadcrumb-span"},Q={key:1,style:{"margin-bottom":"2px"}},X={key:2,style:{"margin-bottom":"2px"}},Y=["onClick"],ee=F({__name:"breadcrumb",setup(te){const v=Z(),x=q(),{themeConfig:o}=S(x),{routesList:_}=S(v),c=R(),g=$(),e=E({breadcrumbList:[],routeSplit:[],routeSplitFirst:"",routeSplitIndex:1}),B=z(()=>{l(c.path);const{layout:t,isBreadcrumb:s}=o.value;return t==="classic"||t==="transverse"?!1:!!s}),V=t=>{const{redirect:s,path:n}=t;s?g.push(s):g.push(n)},w=()=>{o.value.isCollapse=!o.value.isCollapse,I()},I=()=>{k.remove("themeConfig"),k.set("themeConfig",o.value)},y=t=>{t.forEach(s=>{e.routeSplit.forEach((n,C,u)=>{e.routeSplitFirst===s.path&&(e.routeSplitFirst+=`/${u[e.routeSplitIndex]}`,e.breadcrumbList.push(s),e.routeSplitIndex++,s.children&&y(s.children))})})},l=t=>{if(!o.value.isBreadcrumb)return!1;e.breadcrumbList=[_.value[0]],e.routeSplit=t.split("/"),e.routeSplit.shift(),e.routeSplitFirst=`/${e.routeSplit[0]}`,e.routeSplitIndex=1,y(_.value),(c.name==="home"||c.name==="notFound"&&e.breadcrumbList.length>1)&&e.breadcrumbList.shift(),e.breadcrumbList.length>0&&(e.breadcrumbList[e.breadcrumbList.length-1].meta.tagsViewName=A.setTagsViewNameI18n(c))};return M(()=>{l(c.path)}),D(t=>{l(t.path)}),(t,s)=>{const n=T,C=L("el-breadcrumb-item"),u=L("el-breadcrumb");return B.value?(r(),i("div",K,[m(n,{name:d(o).isCollapse?"ele-Expand":"ele-Fold",size:16,class:"layout-navbars-breadcrumb-icon",onClick:w},null,8,["name"]),m(u,{class:"layout-navbars-breadcrumb-hide"},{default:b(()=>[m(G,{name:"breadcrumb"},{default:b(()=>[(r(!0),i(U,null,j(e.breadcrumbList,(a,N)=>(r(),p(C,{class:"flex items-center",style:{"font-size":"14px"},key:a.meta.tagsViewName?a.meta.tagsViewName:a.meta.title},{default:b(()=>[N===e.breadcrumbList.length-1?(r(),i("span",P,[d(o).isBreadcrumbIcon?(r(),p(n,{key:0,name:a.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):f("",!0),a.meta.tagsViewName?(r(),i("div",X,h(a.meta.tagsViewName),1)):(r(),i("div",Q,h(t.$t(a.meta.title)),1))])):(r(),i("a",{key:1,onClick:J(ae=>V(a),["prevent"])},[d(o).isBreadcrumbIcon?(r(),p(n,{key:0,name:a.meta.icon,style:O([a.meta.icon.startsWith("el")?{"vertical-align":"middle",margin:"0 5px 1px 5px","text-align":"center"}:{}]),class:"layout-navbars-breadcrumb-iconfont"},null,8,["name","style"])):f("",!0),W(" "+h(t.$t(a.meta.title)),1)],8,Y))]),_:2},1024))),128))]),_:1})]),_:1})])):f("",!0)}}}),ce=H(ee,[["__scopeId","data-v-d940a9df"]]);export{ce as default};
