import{a_ as B,a$ as L,c as s,g as l,z as O,A as K,bD as F,cg as x,b7 as ae,b8 as ne,bQ as te,bN as ie,r as S,b9 as oe,D as se,bs as re,F as de,aE as ce,ck as ue,cl as ve}from"./Dtj7P_Af.js";import{b as fe,c as me}from"./__RBJw4I.js";import{m as w,b as $,u as be,c as ye}from"./BS8hYuca.js";import{m as ge,M as Ce,n as ke,a as he,s as _e}from"./Cq4X2BTN.js";import{b as Ie,m as Ve,u as Pe,d as Fe}from"./DY-texXJ.js";import{d as xe,a as Se,e as Be,b as Le,L as we,V as $e}from"./CkCl3oN9.js";const Re=B({active:Boolean,max:[Number,String],value:{type:[Number,String],default:0},...w(),...ge({transition:{component:fe}})},"VCounter"),We=L()({name:"VCounter",functional:!0,props:Re(),setup(e,r){let{slots:i}=r;const V=s(()=>e.max?`${e.value} / ${e.max}`:String(e.value));return $(()=>l(Ce,{transition:e.transition},{default:()=>[O(l("div",{class:["v-counter",e.class],style:e.style},[i.default?i.default({counter:V.value,max:e.max,value:e.value}):V.value]),[[K,e.active]])]})),{}}}),Te=B({floating:Boolean,...w()},"VFieldLabel"),I=L()({name:"VFieldLabel",props:Te(),setup(e,r){let{slots:i}=r;return $(()=>l(Ie,{class:["v-field-label",{"v-field-label--floating":e.floating},e.class],style:e.style,"aria-hidden":e.floating||void 0},i)),{}}}),De=["underlined","outlined","filled","solo","solo-inverted","solo-filled","plain"],Ee=B({appendInnerIcon:F,bgColor:String,clearable:Boolean,clearIcon:{type:F,default:"$clear"},active:Boolean,centerAffix:{type:Boolean,default:void 0},color:String,baseColor:String,dirty:Boolean,disabled:{type:Boolean,default:null},error:Boolean,flat:Boolean,label:String,persistentClear:Boolean,prependInnerIcon:F,reverse:Boolean,singleLine:Boolean,variant:{type:String,default:"filled",validator:e=>De.includes(e)},"onClick:clear":x(),"onClick:appendInner":x(),"onClick:prependInner":x(),...w(),...xe(),...Se(),...ae()},"VField"),Ae=L()({name:"VField",inheritAttrs:!1,props:{id:String,...Ve(),...Ee()},emits:{"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,r){let{attrs:i,emit:V,slots:a}=r;const{themeClasses:U}=ne(e),{loaderClasses:W}=Be(e),{focusClasses:j,isFocused:R,focus:m,blur:b}=Pe(e),{InputIcon:P}=Fe(e),{roundedClasses:q}=Le(e),{rtlClasses:z}=te(),y=s(()=>e.dirty||e.active),g=s(()=>!e.singleLine&&!!(e.label||a.label)),Q=ie(),d=s(()=>e.id||`input-${Q}`),X=s(()=>`${d.value}-messages`),T=S(),C=S(),D=S(),E=s(()=>["plain","underlined"].includes(e.variant)),{backgroundColorClasses:Y,backgroundColorStyles:G}=be(oe(e,"bgColor")),{textColorClasses:A,textColorStyles:p}=ye(s(()=>e.error||e.disabled?void 0:y.value&&R.value?e.color:e.baseColor));se(y,n=>{if(g.value){const t=T.value.$el,c=C.value.$el;requestAnimationFrame(()=>{const u=ke(t),o=c.getBoundingClientRect(),k=o.x-u.x,h=o.y-u.y-(u.height/2-o.height/2),f=o.width/.75,_=Math.abs(f-u.width)>1?{maxWidth:re(f)}:void 0,J=getComputedStyle(t),N=getComputedStyle(c),Z=parseFloat(J.transitionDuration)*1e3||150,ee=parseFloat(N.getPropertyValue("--v-field-label-scale")),le=N.getPropertyValue("color");t.style.visibility="visible",c.style.visibility="hidden",he(t,{transform:`translate(${k}px, ${h}px) scale(${ee})`,color:le,..._},{duration:Z,easing:_e,direction:n?"normal":"reverse"}).finished.then(()=>{t.style.removeProperty("visibility"),c.style.removeProperty("visibility")})})}},{flush:"post"});const v=s(()=>({isActive:y,isFocused:R,controlRef:D,blur:b,focus:m}));function H(n){n.target!==document.activeElement&&n.preventDefault()}function M(n){var t;n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),n.stopPropagation(),(t=e["onClick:clear"])==null||t.call(e,new MouseEvent("click")))}return $(()=>{var k,h,f;const n=e.variant==="outlined",t=!!(a["prepend-inner"]||e.prependInnerIcon),c=!!(e.clearable||a.clear),u=!!(a["append-inner"]||e.appendInnerIcon||c),o=()=>a.label?a.label({...v.value,label:e.label,props:{for:d.value}}):e.label;return l("div",ce({class:["v-field",{"v-field--active":y.value,"v-field--appended":u,"v-field--center-affix":e.centerAffix??!E.value,"v-field--disabled":e.disabled,"v-field--dirty":e.dirty,"v-field--error":e.error,"v-field--flat":e.flat,"v-field--has-background":!!e.bgColor,"v-field--persistent-clear":e.persistentClear,"v-field--prepended":t,"v-field--reverse":e.reverse,"v-field--single-line":e.singleLine,"v-field--no-label":!o(),[`v-field--variant-${e.variant}`]:!0},U.value,Y.value,j.value,W.value,q.value,z.value,e.class],style:[G.value,e.style],onClick:H},i),[l("div",{class:"v-field__overlay"},null),l(we,{name:"v-field",active:!!e.loading,color:e.error?"error":typeof e.loading=="string"?e.loading:e.color},{default:a.loader}),t&&l("div",{key:"prepend",class:"v-field__prepend-inner"},[e.prependInnerIcon&&l(P,{key:"prepend-icon",name:"prependInner"},null),(k=a["prepend-inner"])==null?void 0:k.call(a,v.value)]),l("div",{class:"v-field__field","data-no-activator":""},[["filled","solo","solo-inverted","solo-filled"].includes(e.variant)&&g.value&&l(I,{key:"floating-label",ref:C,class:[A.value],floating:!0,for:d.value,style:p.value},{default:()=>[o()]}),l(I,{ref:T,for:d.value},{default:()=>[o()]}),(h=a.default)==null?void 0:h.call(a,{...v.value,props:{id:d.value,class:"v-field__input","aria-describedby":X.value},focus:m,blur:b})]),c&&l(me,{key:"clear"},{default:()=>[O(l("div",{class:"v-field__clearable",onMousedown:_=>{_.preventDefault(),_.stopPropagation()}},[l($e,{defaults:{VIcon:{icon:e.clearIcon}}},{default:()=>[a.clear?a.clear({...v.value,props:{onKeydown:M,onFocus:m,onBlur:b,onClick:e["onClick:clear"]}}):l(P,{name:"clear",onKeydown:M,onFocus:m,onBlur:b},null)]})]),[[K,e.dirty]])]}),u&&l("div",{key:"append",class:"v-field__append-inner"},[(f=a["append-inner"])==null?void 0:f.call(a,v.value),e.appendInnerIcon&&l(P,{key:"append-icon",name:"appendInner"},null)]),l("div",{class:["v-field__outline",A.value],style:p.value},[n&&l(de,null,[l("div",{class:"v-field__outline__start"},null),g.value&&l("div",{class:"v-field__outline__notch"},[l(I,{ref:C,floating:!0,for:d.value},{default:()=>[o()]})]),l("div",{class:"v-field__outline__end"},null)]),E.value&&g.value&&l(I,{ref:C,floating:!0,for:d.value},{default:()=>[o()]})])])}),{controlRef:D}}});function je(e){const r=Object.keys(Ae.props).filter(i=>!ue(i)&&i!=="class"&&i!=="style");return ve(e,r)}export{Ae as V,We as a,je as f,Ee as m};
