1import{n}from"./_plugin-vue2_normalizer-p4i_2SC9.js";const a={props:{step:{type:Number,default:0},scale:{type:Array,required:!0},locale:{type:String,default:"en-GB"},handleWidth:{type:String,default:"w-[80px]"}},data(){return{isDragging:!1,sliderWidth:0,sliderLeftOffset:0,selectedCap:this.scale[this.step],currentStep:this.step,stepMax:this.scale.length-1}},computed:{percentageSelected(){return this.currentStep/this.stepMax*100},sliderBackgroundGradient(){return{background:`linear-gradient(to right, transparent 0 ${this.percentageSelected}%, #E6E7EB ${this.percentageSelected}% 100%), linear-gradient(89.36deg, #914FA8 5.75%, #5A6ECB 42.36%, #43959A 75.79%, #9DB94B 107.62%)`}},handleStyleObj(){return{left:`calc(${this.percentageSelected}%)`,top:"-14px",transform:"translateX(-50%)"}}},methods:{handleSliderInput(){const r=this.scale[this.currentStep];this.$emit("cap-updated",r),this.selectedCap=r},startDrag(r){r.preventDefault(),this.isDragging=!0;const t=this.$refs.slider.getBoundingClientRect();this.sliderWidth=t.width,this.sliderLeftOffset=t.left,document.addEventListener("mousemove",this.onDrag),document.addEventListener("mouseup",this.stopDrag),document.addEventListener("touchmove",this.onDrag),document.addEventListener("touchend",this.stopDrag)},onDrag(r){if(!this.isDragging)return;const t=(r.touches?r.touches[0].clientX:r.clientX)-this.sliderLeftOffset;let s=Math.max(0,Math.min(t/this.sliderWidth,1));this.currentStep=Math.round(s*this.stepMax),this.handleSliderInput()},stopDrag(){this.isDragging=!1,document.removeEventListener("mousemove",this.onDrag),document.removeEventListener("mouseup",this.stopDrag),document.removeEventListener("touchmove",this.onDrag),document.removeEventListener("touchend",this.stopDrag)}}};var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"relative"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.currentStep,expression:"currentStep"}],ref:"slider",staticClass:"appearance-none w-full h-3 rounded-lg",style:e.sliderBackgroundGradient,attrs:{type:"range",autocomplete:"off",min:"0",step:"1",max:e.stepMax},domProps:{value:e.currentStep},on:{input:e.handleSliderInput,__r:function(s){e.currentStep=s.target.value}}}),t("button",{ref:"handle",class:"flex items-center justify-center absolute border border-grey-20 rounded-full shadow-lg font-medium py-2 px-4 bg-white cursor-grab active:cursor-grabbing active:border-grey-30 z-20",style:e.handleStyleObj,attrs:{type:"button"},on:{mousedown:e.startDrag,touchstart:e.startDrag}},[t("i",{staticClass:"fa-regular fa-grip-lines-vertical text-grey-25"}),t("span",{staticClass:"text-grey-90 ml-2 text-sm",class:{"text-sm":e.selectedCap>=1e3}},[e._v(e._s(e.selectedCap.toLocaleString(e.locale)))])])])},o=[],l=n(a,i,o,!1,null,null);const c=l.exports;export{c as P};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.