import{T as m}from"./app-COidJXl1.js";import{_ as T,aa as p,r as g,b2 as B,ak as x,o as n,c as S,w as C,g as l,h as s,n as A,a as h,t as N,j as _,M as w,N as I}from"./app-SC54XQDl.js";const L=t=>(w("data-v-bb8edfd5"),t=t(),I(),t),V={key:0,class:"flex items-center gap-2"},$={key:0},P=L(()=>h("i",{class:"pi pi-arrow-left"},null,-1)),E=[P],D={key:2,class:"pi pi-pen-to-square"},M={key:3,class:"pi pi-upload"},U={key:4,class:"pi pi-cog"},j={key:5,class:"pi pi-shopping-cart"},q={key:6,class:"pi pi-external-link"},H={key:0},O={key:1},R={key:7},z={key:1},F={__name:"NavTab",props:{value:{type:String,default:""},href:{type:String,default:""},target:{type:String,default:""},name:{type:String,default:""},icon:{type:String,default:""},separator:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},back:{type:Boolean,default:!1},static:{type:Boolean,default:!1},externalLink:{type:Boolean,default:!1},active:{type:Boolean,default:!1},overview:{type:Boolean,default:!1},actionCreate:{type:Boolean,default:!1},actionCreateLink:{type:Boolean,default:!1},actionUpload:{type:Boolean,default:!1},actionSetting:{type:Boolean,default:!1},actionCart:{type:Boolean,default:!1}},setup(t){const i=p("$Tea"),e=t,u=g(),o=p("$navbar"),c=()=>e.static||e.separator||e.disabled||e.actionCreate,b=a=>{if(e.externalLink){setTimeout(()=>{o.exposed.goPrevTab()});return}if(a.target.tagName=="A"){const r=a.target.getAttribute("href");if(r!=null&&r.length>0&&r!="#"){if(a.target.getAttribute("target")=="_blank"){setTimeout(()=>{o.exposed.goPrevTab()});return}return}}if(c()){setTimeout(()=>{o.exposed.goPrevTab()});return}},y=()=>{let a=e.href==null?"":e.href;if(typeof a=="string"&&a.length>0&&!a.match(/^(http|https|ftp):\/\//i)){let r=a.indexOf("?");r>=0?a=i.url(a.substring(0,r).replace(/\/+$/,""))+a.substring(r):a=i.url(a.replace(/\/+$/,""))}return a},f=()=>e.back?"TAB_BACK":e.separator?"TAB_SEPARATOR":e.value==null||e.value.length==0?e.name!=null&&e.name.length>0?e.name:e.href!=null&&e.href.length>0?e.href:"TAB_UNDEFINED":e.value,k=g(f()),v=()=>{if(e.target&&e.target.length>0)return e.target;if(e.externalLink)return"_blank"};return B(()=>{u.value=y()}),x(()=>{e.active&&o.exposed.goTab(f())}),(a,r)=>(n(),S(m,{disabled:t.separator||t.disabled,value:k.value,onClick:r[0]||(r[0]=d=>b(d)),as:c()?"SPAN":"A",href:u.value,target:v(),class:"flex"},{default:C(()=>[t.separator?s("",!0):(n(),l("span",V,[t.back?(n(),l("span",$,E)):s("",!0),t.icon.length>0?(n(),l("i",{key:1,class:A(t.icon)},null,2)):s("",!0),t.actionCreate||t.actionCreateLink?(n(),l("i",D)):s("",!0),t.actionUpload?(n(),l("i",M)):s("",!0),t.actionSetting?(n(),l("i",U)):s("",!0),t.actionCart?(n(),l("i",j)):s("",!0),t.externalLink?(n(),l("i",q)):s("",!0),h("span",null,[t.name.length>0?(n(),l("span",H,N(t.name),1)):t.overview?(n(),l("span",O,"概览")):s("",!0)]),a.$slots.name?(n(),l("span",R,[_(a.$slots,"name",{},void 0,!0)])):s("",!0)])),t.separator?(n(),l("span",z,"|")):s("",!0)]),_:3},8,["disabled","value","as","href","target"]))}},J=T(F,[["__scopeId","data-v-bb8edfd5"]]);export{J as N};
