"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = require("vue");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _context = require("../context");
var _util = require("../util");
var _classNames = _interopRequireDefault(require("../../_util/classNames"));
const markProps = () => ({
  prefixCls: String,
  style: Object,
  value: Number,
  onClick: Function
});
const Mark = (0, _vue.defineComponent)({
  name: 'AMark',
  props: markProps(),
  setup(props, {
    slots
  }) {
    const context = (0, _context.useInjectSlider)();
    return () => {
      var _a;
      const {
        prefixCls,
        style,
        value,
        onClick
      } = props;
      const {
        min,
        max,
        direction,
        includedStart,
        includedEnd,
        included
      } = context.value;
      const textCls = `${prefixCls}-text`;
      const positionStyle = (0, _util.getDirectionStyle)(direction, value, min, max);
      return (0, _vue.createVNode)("span", {
        "class": (0, _classNames.default)(textCls, {
          [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd
        }),
        "style": (0, _extends2.default)((0, _extends2.default)({}, positionStyle), style),
        "onMousedown": e => {
          e.stopPropagation();
        },
        "onClick": () => {
          onClick(value);
        }
      }, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]);
    };
  }
});
var _default = exports.default = Mark;