import { defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import { tokens } from '../Slider.tokens.js';

var getTickStyle = function getTickStyle(_ref) {
  var tick = _ref.tick,
    min = _ref.min,
    max = _ref.max,
    isVertical = _ref.isVertical,
    reversed = _ref.reversed;
  var percent = (tick - min) / (max - min) * 100;
  var tickSizeVar = "var(".concat(tokens.tickSize, ")");
  if (isVertical) {
    var direction = reversed ? 'bottom' : 'top';
    if (tick === min) {
      return _defineProperty({}, direction, "calc(".concat(percent, "% + ").concat(tickSizeVar, " / 2 )"));
    }
    if (tick === max) {
      return _defineProperty({}, direction, "calc(".concat(percent, "% - ").concat(tickSizeVar, " / 2 )"));
    }
    return _defineProperty({}, direction, "".concat(percent, "%"));
  }
  if (tick === min) {
    return {
      left: "calc(".concat(percent, "% + ").concat(tickSizeVar, " / 2 )")
    };
  }
  if (tick === max) {
    return {
      left: "calc(".concat(percent, "% - ").concat(tickSizeVar, " / 2 )")
    };
  }
  return {
    left: "".concat(percent, "%")
  };
};

export { getTickStyle };
