import{u as e,bF as a,C as t,Q as s,_ as l}from"./utils-lib.js?v=1761009159";import{c as o,X as n,Y as r,b as d,aG as i,at as u,r as c,t as v,g as m,w as f,a1 as h,q as p,a6 as b,aO as y,v as _,x as w,z as g,F as C,b0 as x,y as k,M as L,D as E,N as I,B as A,I as $,J as j,e as B,O as M,K as O,aP as R,d as T,az as V,A as S}from"./base-lib.js?v=1761009159";import{_ as z}from"./index112.js?v=1761009159";const D={class:"flex flex-col p-[1.2rem]"},F=["onClick"],P=l(o({__name:"index",props:n({options:{default:()=>[]},store:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},showContent:{type:Boolean,default:!0},contentClass:{default:"router-tabs-content"}},{modelValue:{},modelModifiers:{}}),emits:n(["cutTab","afterLeave"],["update:modelValue"]),setup(l,{emit:o}){const n=T(()=>s(()=>import("./index177.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)),P=l,W=o,q=r(l,"modelValue"),{mainWidth:G,forceLtd:J,aliyunEcsLtd:K,payment:N}=e(),Q=d(),U=i(),X=u(P.options),Y=c(!0),H=c(!1),Z=c("0px"),ee=c(0),ae=c(),te=c(),se="".concat(Q.path.split("/")[1],"_router").toUpperCase(),{authType:le}=v(N.value),oe=m(()=>"router-tabs-content"===P.contentClass);f(()=>Q.name,()=>{if(ie())de(Q.name),q.value=Q.name;else{const e=localStorage.getItem(se)||X.value[0].name;U.push({name:e}),de(e),q.value=e}});const ne=e=>{const a=e.target.offsetLeft,t=e.target.offsetWidth;Z.value="".concat(a+t-22,"px"),H.value=!0},re=h(ae,e=>{const a=e[0],{width:t}=a.contentRect;ee.value=t,Y.value=G.value-320>=ee.value}),de=e=>{localStorage.setItem(se,e)},ie=()=>{const e=Q.path.split("/");return e.length>2&&""!=e[2]},ue=(e,a=!0,t=!0)=>{q.value=e,a&&de(e),Q.name!==e&&t&&U.push({name:e})};return f(()=>t.value,e=>{var a;const t=e.find(e=>-1!==Q.path.indexOf(e.path));if((null==t?void 0:t.children)&&Array.isArray(t.children)&&X.value.forEach(e=>{const a=t.children.find(a=>e.path===a.name);e.show=!a||a.show}),!(null==(a=X.value.find(e=>e.name===Q.name))?void 0:a.show)){const e=X.value.filter(e=>e.show);e&&e.length&&ue(e[0].name)}},{immediate:!0}),f(G,()=>{Y.value=G.value-320>=ee.value}),p(()=>{var e,t,s;const l=localStorage.getItem(se);if(X.value.length||(X.value=a(null==(e=Q.matched[1])?void 0:e.children,"array",[])),"/mail"===(null==(t=Q.matched[1])?void 0:t.path)&&X.value.forEach(e=>{e.show=!0}),"/vhost"===(null==(s=Q.matched[1])?void 0:s.path)&&X.value.forEach(e=>{e.show=!0}),P.store)return ie()?ue(Q.name):ue(l||X.value[0].name)}),b(()=>{re.stop()}),(e,a)=>{const t=z,s=V,l=y("router-view");return _(),w("div",D,[g("div",{class:O(["header-tabs",{disabled:e.disabled}])},[g("div",{ref_key:"headerChildContentRef",ref:ae,class:"flex flex-wrap"},[(_(!0),w(C,null,x(k(X),(e,t)=>{var s,l;return _(),w(C,{key:t},[e.show?(_(),w("div",{key:0,ref_for:!0,ref_key:"tabListRef",ref:te,class:O(["header-child-tab",{"active-tab":q.value===e.name,"!hidden":null==(s=null==e?void 0:e.meta)?void 0:s.ignore}]),onClick:a=>((e,a=!1)=>{P.disabled||(q.value!==e||a)&&(de(e),q.value=e,U.push({name:e}),W("cutTab",e))})(e.name),onMouseenter:ne,onMouseleave:a[0]||(a[0]=e=>H.value=!1)},S(null==(l=e.meta)?void 0:l.title),43,F)):E("",!0)],64)}),128))],512),e.$slots.right?L(e.$slots,"right",{key:0},void 0,!0):E("",!0),e.$slots.right?E("",!0):(_(),I(s,{key:1,width:"580",disabled:"free"!==k(le),"show-arrow":!1,"popper-style":"padding: 0;border-radius: var(--el-border-radius-round);overflow: hidden;","popper-class":"el-product-state-popover"},{reference:A(()=>[$(B(t,{"is-home":!0,"disable-pro":!0},null,512),[[j,k(Y)&&!k(K)]])]),default:A(()=>[(_(),I(M(k(n))))]),_:1},8,["disabled"]))],2),e.showContent?(_(),w("div",{key:0,class:O(["",{"module-ui":k(oe),"mt-[1.2rem]":k(oe)}])},[e.$slots.default?(_(),w("div",{key:0,class:O(e.contentClass)},[L(e.$slots,"default",{},void 0,!0)],2)):(_(),w("div",{key:1,class:O(e.contentClass)},[B(l,null,{default:A(({Component:e})=>[B(R,{name:"fade",mode:"out-in",onAfterLeave:a[1]||(a[1]=e=>W("afterLeave"))},{default:A(()=>[(_(),I(M(e)))]),_:2},1024)]),_:1})],2))],2)):E("",!0)])}}}),[["__scopeId","data-v-c2d1147c"]]);export{P as _};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
