"use strict";const e=require("vue"),r=require("../Shared/base-iCmnU-fv.js"),f={key:1},E={class:"breadcrumb-item"},h=e.defineComponent({name:"ClBreadcrumb",__name:"Index",props:{className:String,list:{type:Array,default:()=>[]},title:String},emits:["onClickUrl"],setup(m,{emit:p}){const c=m,u=p,l=e.reactive({keyIndex:`breadcrumb-${r.CommonBase.getRandom(8)}`,title:"",list:[]}),k=t=>!r.CommonBase.isEmpty(t),d=e.computed(()=>{const t={breadcrumb:!0},{className:n}=c;return n&&!r.CommonBase.isEmpty(n)&&n.split(" ").forEach(s=>{r.CommonBase.isEmpty(s)||(t[s]=!0)}),t}),i=(t,n)=>{const s=[];let o="";if(!r.CommonBase.isEmpty(t)){const a=t.length;t.forEach((_,y)=>{y<a-1&&s.push(_)}),o=t[a-1].name,a>1&&(o=r.CommonBase.isEmpty(n)?o:n)}l.list=s,l.title=o},B=()=>{i(c.list,c.title)};e.onMounted(()=>{e.nextTick(()=>{B()})}),e.watch([()=>c.list,()=>c.title],([t,n])=>{i(t,n)});const C=t=>{u("onClickUrl",t)};return(t,n)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("ol",{class:e.normalizeClass(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,(o,a)=>(e.openBlock(),e.createElementBlock("li",{class:"breadcrumb-item",key:`${l.keyIndex}-${a}`},[k(o.href)?(e.openBlock(),e.createBlock(s,{key:0,to:o.href},{default:e.withCtx(()=>[e.createElementVNode("span",{onClick:C},e.toDisplayString(o.name),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(o.name),1))]))),128)),e.createElementVNode("li",E,[e.createElementVNode("span",null,e.toDisplayString(l.title),1)])],2)}}});module.exports=h;
//# sourceMappingURL=ClBreadcrumb.cjs.map
