import{A as k,B as P,G as X,g as _,c as S,I as W,ax as U,bG as Y,a0 as E,d as i,K as h,F as A,aK as q,aw as j,aT as J,C as L,j as f,ba as Q,M as Z,aR as ee,a4 as ae,aU as te}from"./main-CJbVOHh0.js";import{f as se,b as oe,s as le}from"./forwardRefs-D3j0TLhE.js";import{a as G,m as ne,V as R,b as re}from"./VWindowItem-DieRQQR6.js";import{m as ie,V as z}from"./VSlideGroup-DU0HxBs4.js";import{u as de}from"./scopeId-BAP0Yo0N.js";const $=Symbol.for("vuetify:v-tabs"),ue=P({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...U(Y({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),ce=k()({name:"VTab",props:ue(),setup(e,l){let{slots:n,attrs:a}=l;const{textColorClasses:r,textColorStyles:v}=X(e,"sliderColor"),o=_(),u=_(),c=S(()=>e.direction==="horizontal"),x=S(()=>{var m,t;return((t=(m=o.value)==null?void 0:m.group)==null?void 0:t.isSelected.value)??!1});function B(m){var s,b;let{value:t}=m;if(t){const d=(b=(s=o.value)==null?void 0:s.$el.parentElement)==null?void 0:b.querySelector(".v-tab--selected .v-tab__slider"),I=u.value;if(!d||!I)return;const D=getComputedStyle(d).color,g=d.getBoundingClientRect(),V=I.getBoundingClientRect(),T=c.value?"x":"y",C=c.value?"X":"Y",p=c.value?"right":"bottom",w=c.value?"width":"height",F=g[T],H=V[T],y=F>H?g[p]-V[p]:g[T]-V[T],K=Math.sign(y)>0?c.value?"right":"bottom":Math.sign(y)<0?c.value?"left":"top":"center",N=(Math.abs(y)+(Math.sign(y)<0?g[w]:V[w]))/Math.max(g[w],V[w])||0,O=g[w]/V[w]||0,M=1.5;oe(I,{backgroundColor:[D,"currentcolor"],transform:[`translate${C}(${y}px) scale${C}(${O})`,`translate${C}(${y/M}px) scale${C}(${(N-1)/M+1})`,"none"],transformOrigin:Array(3).fill(K)},{duration:225,easing:le})}}return W(()=>{const m=E.filterProps(e);return i(E,h({symbol:$,ref:o,class:["v-tab",e.class],style:e.style,tabindex:x.value?0:-1,role:"tab","aria-selected":String(x.value),active:!1},m,a,{block:e.fixed,maxWidth:e.fixed?300:void 0,"onGroup:selected":B}),{...n,default:()=>{var t;return i(A,null,[((t=n.default)==null?void 0:t.call(n))??e.text,!e.hideSlider&&i("div",{ref:u,class:["v-tab__slider",r.value],style:v.value},null)])}})}),se({},o)}}),me=P({...U(ne(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow"),be=k()({name:"VTabsWindow",props:me(),emits:{"update:modelValue":e=>!0},setup(e,l){let{slots:n}=l;const a=q($,null),r=j(e,"modelValue"),v=S({get(){var o;return r.value!=null||!a?r.value:(o=a.items.value.find(u=>a.selected.value.includes(u.id)))==null?void 0:o.value},set(o){r.value=o}});return W(()=>{const o=G.filterProps(e);return i(G,h({_as:"VTabsWindow"},o,{modelValue:v.value,"onUpdate:modelValue":u=>v.value=u,class:["v-tabs-window",e.class],style:e.style,mandatory:!1,touch:!1}),n)}),{}}}),ve=P({...re()},"VTabsWindowItem"),fe=k()({name:"VTabsWindowItem",props:ve(),setup(e,l){let{slots:n}=l;return W(()=>{const a=R.filterProps(e);return i(R,h({_as:"VTabsWindowItem"},a,{class:["v-tabs-window-item",e.class],style:e.style}),n)}),{}}});function ge(e){return e?e.map(l=>ae(l)?l:{text:l,value:l}):[]}const Ve=P({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,...ie({mandatory:"force",selectedClass:"v-tab-item--selected"}),...ee(),...Z()},"VTabs"),Se=k()({name:"VTabs",props:Ve(),emits:{"update:modelValue":e=>!0},setup(e,l){let{attrs:n,slots:a}=l;const r=j(e,"modelValue"),v=S(()=>ge(e.items)),{densityClasses:o}=J(e),{backgroundColorClasses:u,backgroundColorStyles:c}=L(f(e,"bgColor")),{scopeId:x}=de();return Q({VTab:{color:f(e,"color"),direction:f(e,"direction"),stacked:f(e,"stacked"),fixed:f(e,"fixedTabs"),sliderColor:f(e,"sliderColor"),hideSlider:f(e,"hideSlider")}}),W(()=>{const B=z.filterProps(e),m=!!(a.window||e.items.length>0);return i(A,null,[i(z,h(B,{modelValue:r.value,"onUpdate:modelValue":t=>r.value=t,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},o.value,u.value,e.class],style:[{"--v-tabs-height":te(e.height)},c.value,e.style],role:"tablist",symbol:$},x,n),{default:()=>{var t;return[((t=a.default)==null?void 0:t.call(a))??v.value.map(s=>{var b;return((b=a.tab)==null?void 0:b.call(a,{item:s}))??i(ce,h(s,{key:s.text,value:s.value}),{default:a[`tab.${s.value}`]?()=>{var d;return(d=a[`tab.${s.value}`])==null?void 0:d.call(a,{item:s})}:void 0})})]}}),m&&i(be,h({modelValue:r.value,"onUpdate:modelValue":t=>r.value=t,key:"tabs-window"},x),{default:()=>{var t;return[v.value.map(s=>{var b;return((b=a.item)==null?void 0:b.call(a,{item:s}))??i(fe,{value:s.value},{default:()=>{var d;return(d=a[`item.${s.value}`])==null?void 0:d.call(a,{item:s})}})}),(t=a.window)==null?void 0:t.call(a)]}})])}),{}}});export{Se as V,ce as a,be as b,fe as c};
