import{g as z,E as t,G as k,j as s,H as V,O as n,o as N,c as S,M as $,X as w,a as c,L as A,y as g,V as B}from"./entry.eb978f24.js";import{u as M}from"./useFormEvents.4d081bc0.js";import{_ as j}from"./_plugin-vue_export-helper.c27b6911.js";const E=z({inheritAttrs:!1,props:{modelValue:{type:Number,default:0},name:{type:String,default:null},disabled:{type:Boolean,default:!1},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},size:{type:String,default:()=>t.ui.range.default.size,validator(e){return Object.keys(t.ui.range.size).includes(e)}},color:{type:String,default:()=>t.ui.range.default.color,validator(e){return t.ui.colors.includes(e)}},ui:{type:Object,default:()=>t.ui.range}},emits:["update:modelValue","change"],setup(e,{emit:l}){const i=k(),a=s(()=>V({},e.ui,i.ui.range)),{emitFormBlur:d}=M(),m=s({get(){return e.modelValue},set(u){l("update:modelValue",u)}}),r=u=>{l("change",u),d()},v=s(()=>n(a.value.wrapper,a.value.size[e.size])),f=s(()=>n(a.value.base,a.value.background,a.value.rounded,a.value.ring.replaceAll("{color}",e.color),a.value.size[e.size])),b=s(()=>n(a.value.thumb.base,a.value.thumb.color.replaceAll("{color}",e.color),a.value.thumb.ring,a.value.thumb.background,a.value.thumb.size[e.size])),C=s(()=>n(a.value.track.base,a.value.track.background,a.value.track.rounded,a.value.track.size[e.size])),h=s(()=>n(a.value.progress.base,a.value.progress.rounded,a.value.progress.background.replaceAll("{color}",e.color),a.value.progress.size[e.size])),y=s(()=>{const{modelValue:u,min:o,max:p}=e;return{width:`${(Math.max(o,Math.min(u,p))-o)/(p-o)*100}%`}});return{ui:a,value:m,wrapperClass:v,inputClass:f,thumbClass:b,trackClass:C,progressClass:h,progressStyle:y,onChange:r}}}),O=["id","name","min","max","disabled","step"];function F(e,l,i,a,d,m){return N(),S("div",{class:g(e.wrapperClass)},[$(c("input",A({id:e.name,ref:"input","onUpdate:modelValue":l[0]||(l[0]=r=>e.value=r),name:e.name,min:e.min,max:e.max,disabled:e.disabled,step:e.step,type:"range",class:[e.inputClass,e.thumbClass,e.trackClass]},e.$attrs,{onChange:l[1]||(l[1]=(...r)=>e.onChange&&e.onChange(...r))}),null,16,O),[[w,e.value,void 0,{number:!0}]]),c("span",{class:g(e.progressClass),style:B(e.progressStyle)},null,6)],2)}const R=j(E,[["render",F]]);export{R as default};
