"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),M=require("../_util/classNames.js"),e=require("../_util/type.js"),$=require("../config-provider/hooks/useConfigInject.js"),w=require("../form/FormItemContext.js"),R=require("../vc-slider/src/Handle.js"),z=require("../vc-slider/src/Range.js"),_=require("../vc-slider/src/Slider.js"),D=require("./SliderTooltip.js"),E=require("./style/index.js"),H=o=>typeof o=="number"?o.toString():"",S=()=>({id:String,prefixCls:String,tooltipPrefixCls:String,range:e.someType([Boolean,Object]),reverse:e.booleanType(),min:Number,max:Number,step:e.someType([Object,Number]),marks:e.objectType(),dots:e.booleanType(),value:e.someType([Array,Number]),defaultValue:e.someType([Array,Number]),included:e.booleanType(),disabled:e.booleanType(),vertical:e.booleanType(),tipFormatter:e.someType([Function,Object],()=>H),tooltipOpen:e.booleanType(),tooltipVisible:e.booleanType(),tooltipPlacement:e.stringType(),getTooltipPopupContainer:e.functionType(),autofocus:e.booleanType(),handleStyle:e.someType([Array,Object]),trackStyle:e.someType([Array,Object]),onChange:e.functionType(),onAfterChange:e.functionType(),onFocus:e.functionType(),onBlur:e.functionType(),"onUpdate:value":e.functionType()}),U=n.defineComponent({compatConfig:{MODE:3},name:"ASlider",inheritAttrs:!1,props:S(),slots:Object,setup(o,{attrs:f,slots:T,emit:d,expose:N}){const{prefixCls:a,rootPrefixCls:j,direction:m,getPopupContainer:O,configProvider:k}=$.default("slider",o),[b,q]=E.default(a),g=w.useInjectFormItemContext(),c=n.ref(),v=n.ref({}),C=(r,l)=>{v.value[r]=l},F=n.computed(()=>o.tooltipPlacement?o.tooltipPlacement:o.vertical?m.value==="rtl"?"left":"right":"top"),A=()=>{c.value?.focus()},I=()=>{c.value?.blur()},h=r=>{d("update:value",r),d("change",r),g.onFieldChange()},P=r=>{d("blur",r)};N({focus:A,blur:I});const x=({tooltipPrefixCls:r,info:{value:l,dragging:y,index:t,...p}})=>{const{tipFormatter:i,tooltipOpen:s=o.tooltipVisible,getTooltipPopupContainer:u}=o,V=i?v.value[t]||y:!1,B=s||s===void 0&&V;return n.createVNode(D.default,{prefixCls:r,title:i?i(l):"",open:B,placement:F.value,transitionName:`${j.value}-zoom-down`,key:t,overlayClassName:`${a.value}-tooltip`,getPopupContainer:u||O?.value},{default:()=>[n.createVNode(R.default,{...p,value:l,onMouseenter:()=>C(t,!0),onMouseleave:()=>C(t,!1)},null)]})};return()=>{const{tooltipPrefixCls:r,range:l,id:y=g.id.value,...t}=o,p=k.getPrefixCls("tooltip",r),i=M.default(f.class,{[`${a.value}-rtl`]:m.value==="rtl"},q.value);m.value==="rtl"&&!t.vertical&&(t.reverse=!t.reverse);let s;return typeof l=="object"&&(s=l.draggableTrack),b(l?n.createVNode(z.default,{...f,...t,step:t.step,draggableTrack:s,class:i,ref:c,handle:u=>x({tooltipPrefixCls:p,prefixCls:a.value,info:u}),prefixCls:a.value,onChange:h,onBlur:P},{mark:T.mark}):n.createVNode(_.default,{...f,...t,id:y,step:t.step,class:i,ref:c,handle:u=>x({tooltipPrefixCls:p,prefixCls:a.value,info:u}),prefixCls:a.value,onChange:h,onBlur:P},{mark:T.mark}))}}}),W=e.withInstall(U);exports.default=W;exports.sliderProps=S;
