import{K as O,J as U,i as M,j as w,H as X,L as Y,N as q,l as J,d as K,o as L,e as W}from"./forwardRefs-67412654.js";import{p as R,az as p,g as G,r as z,c as V,l as f,F as Q,n as T,h as Z,t as n,k as ee,a as te,aN as ae}from"./index-20675090.js";import{m as se,a as E}from"./VSlideGroup-14bb6bf6.js";const N=Symbol.for("vuetify:v-tabs"),oe=R({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...p(O({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),le=G()({name:"VTab",props:oe(),setup(e,t){let{slots:s,attrs:g}=t;const{textColorClasses:x,textColorStyles:h}=U(e,"sliderColor"),r=z(),v=z(),a=V(()=>e.direction==="horizontal"),o=V(()=>{var i,l;return((l=(i=r.value)==null?void 0:i.group)==null?void 0:l.isSelected.value)??!1});function _(i){var k,B;let{value:l}=i;if(l){const S=(B=(k=r.value)==null?void 0:k.$el.parentElement)==null?void 0:B.querySelector(".v-tab--selected .v-tab__slider"),C=v.value;if(!S||!C)return;const D=getComputedStyle(S).color,d=S.getBoundingClientRect(),c=C.getBoundingClientRect(),m=a.value?"x":"y",y=a.value?"X":"Y",P=a.value?"right":"bottom",u=a.value?"width":"height",F=d[m],H=c[m],b=F>H?d[P]-c[P]:d[m]-c[m],j=Math.sign(b)>0?a.value?"right":"bottom":Math.sign(b)<0?a.value?"left":"top":"center",A=(Math.abs(b)+(Math.sign(b)<0?d[u]:c[u]))/Math.max(d[u],c[u])||0,I=d[u]/c[u]||0,$=1.5;Y(C,{backgroundColor:[D,"currentcolor"],transform:[`translate${y}(${b}px) scale${y}(${I})`,`translate${y}(${b/$}px) scale${y}(${(A-1)/$+1})`,"none"],transformOrigin:Array(3).fill(j)},{duration:225,easing:q})}}return M(()=>{const i=w.filterProps(e);return f(w,T({symbol:N,ref:r,class:["v-tab",e.class],style:e.style,tabindex:o.value?0:-1,role:"tab","aria-selected":String(o.value),active:!1},i,g,{block:e.fixed,maxWidth:e.fixed?300:void 0,"onGroup:selected":_}),{...s,default:()=>{var l;return f(Q,null,[((l=s.default)==null?void 0:l.call(s))??e.text,!e.hideSlider&&f("div",{ref:v,class:["v-tab__slider",x.value],style:h.value},null)])}})}),X({},r)}});function ne(e){return e?e.map(t=>ae(t)?t:{text:t,value:t}):[]}const re=R({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,sliderColor:String,...se({mandatory:"force"}),...J(),...K()},"VTabs"),be=G()({name:"VTabs",props:re(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:s}=t;const g=Z(e,"modelValue"),x=V(()=>ne(e.items)),{densityClasses:h}=L(e),{backgroundColorClasses:r,backgroundColorStyles:v}=W(n(e,"bgColor"));return ee({VTab:{color:n(e,"color"),direction:n(e,"direction"),stacked:n(e,"stacked"),fixed:n(e,"fixedTabs"),sliderColor:n(e,"sliderColor"),hideSlider:n(e,"hideSlider")}}),M(()=>{const a=E.filterProps(e);return f(E,T(a,{modelValue:g.value,"onUpdate:modelValue":o=>g.value=o,class:["v-tabs",`v-tabs--${e.direction}`,`v-tabs--align-tabs-${e.alignTabs}`,{"v-tabs--fixed-tabs":e.fixedTabs,"v-tabs--grow":e.grow,"v-tabs--stacked":e.stacked},h.value,r.value,e.class],style:[{"--v-tabs-height":te(e.height)},v.value,e.style],role:"tablist",symbol:N}),{default:()=>[s.default?s.default():x.value.map(o=>f(le,T(o,{key:o.text}),null))]})}),{}}});export{be as V,le as a};
