"use strict";

exports.__esModule = true;
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _clsx = _interopRequireDefault(require("clsx"));

var _ConfigProviderContext = _interopRequireDefault(require("../config-provider/ConfigProviderContext"));

var _excluded = ["vertical"];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var SwiperPagIndicator = /*#__PURE__*/_react.default.memo(function (_ref) {
  var vertical = _ref.vertical,
      props = _objectWithoutPropertiesLoose(_ref, _excluded);

  var _React$useContext = _react.default.useContext(_ConfigProviderContext.default),
      prefixCls = _React$useContext.prefixCls,
      createNamespace = _React$useContext.createNamespace;

  var _createNamespace = createNamespace('indicator', prefixCls),
      bem = _createNamespace[0];

  var dots = [];

  for (var i = 0; i < props.total; i++) {
    dots.push( /*#__PURE__*/_react.default.createElement("div", {
      key: i,
      className: (0, _clsx.default)(bem('dot', {
        active: props.current === i
      }))
    }));
  }

  return /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _clsx.default)(props.className, bem({
      vertical: vertical
    })),
    style: props.style
  }, dots);
});

var _default = SwiperPagIndicator;
exports.default = _default;