import{slicedToArray as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import n from"classnames";import{COMPONENT_ID as t,BEM_PREFIX as o}from"./SliderConstants.js";function i(r,n,t){var o=Math.round(100*(t-n)/(r-n));return[o,o]}function a(r,n,t){return r||(void 0!==n?"function"!=typeof t?""+n:t(n):void 0)}var u=function(r){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!r||""===r)return function(){return""};var i=t?r:"".concat(o,"-").concat(r);return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=""!==r?"".concat(i,"__").concat(r):i,u=n(t).split(" ").map((function(r){return""===r?"":"".concat(a,"--").concat(r)}));return n(a,u,o)}}(t);function e(n,t,o,a){if(!o){var u=i(n,t,a),e=r(u,2);return{dimension:e[0],offset:0,positions:[e[1]],thumbKeys:["start"]}}var c=r(a,2),s=c[1],f=i(n,t,c[0]),v=r(f,2),d=v[0],l=v[1],m=i(n,t,s),h=r(m,2);return{dimension:h[0],offset:d,positions:[l,h[1]],thumbKeys:["start","end"]}}function c(r,n,t){var o=(r-n)/10;if(t>o)return t;var i=function(r,n){var t=r%n;return 0===t?r:r-t}(Math.round(o),t);return(r-n)/i>10?2*i:i}function s(r,n,t,o){return o&&!Array.isArray(r)?[n,t]:n>r?n:r>t?t:r}function f(r,n,t){return Array.isArray(n)?n.map((function(n,o){return a(Array.isArray(r)?r[o]:void 0,n,t)})):a(r,n,t)}function v(r,n,t){return n&&Math.abs(t[0]-r)>Math.abs(t[1]-r)?1:0}function d(r,n,t,o,i){var a=Math.round((Math.round(r/(o.width/(t-n)))+n)/i)*i;return n>a?n:a>t?t:a}export{i as _calcDimension,u as bem,e as calcDimensions,c as calculatePageStep,s as ensureDefaultValue,f as ensureValueText,v as getNearest,d as moveToPx};
