import{K as O,J as U,i as z,l as w,F as X,L as Y,N as j,o as J,d as K,q as L,e as Q}from"./forwardRefs-b2545869.js";import{p as R,aC as W,g as F,r as E,c as V,l as f,F as p,n as T,h as Z,t as n,k as ee,a as te,aQ as ae}from"./index-2ed92f93.js";import{m as se,V as M}from"./VSlideGroup-dd4dc020.js";const G=Symbol.for("vuetify:v-tabs"),oe=R({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...W(O({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),le=F()({name:"VTab",props:oe(),setup(e,t){let{slots:s,attrs:g}=t;const{textColorClasses:x,textColorStyles:h}=U(e,"sliderColor"),r=E(),v=E(),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 C=(B=(k=r.value)==null?void 0:k.$el.parentElement)==null?void 0:B.querySelector(".v-tab--selected .v-tab__slider"),S=v.value;if(!C||!S)return;const D=getComputedStyle(C).color,d=C.getBoundingClientRect(),c=S.getBoundingClientRect(),m=a.value?"x":"y",y=a.value?"X":"Y",P=a.value?"right":"bottom",u=a.value?"width":"height",N=d[m],q=c[m],b=N>q?d[P]-c[P]:d[m]-c[m],A=Math.sign(b)>0?a.value?"right":"bottom":Math.sign(b)<0?a.value?"left":"top":"center",H=(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(S,{backgroundColor:[D,"currentcolor"],transform:[`translate${y}(${b}px) scale${y}(${I})`,`translate${y}(${b/$}px) scale${y}(${(H-1)/$+1})`,"none"],transformOrigin:Array(3).fill(A)},{duration:225,easing:j})}}return z(()=>{const i=w.filterProps(e);return f(w,T({symbol:G,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(p,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=F()({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}=Q(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")}}),z(()=>{const a=M.filterProps(e);return f(M,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:G}),{default:()=>[s.default?s.default():x.value.map(o=>f(le,T(o,{key:o.text}),null))]})}),{}}});export{be as V,le as a};
