"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

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

var _i18n = require("../i18n");

var _SvgIcon = _interopRequireDefault(require("./SvgIcon"));

var _classnames = _interopRequireDefault(require("classnames"));

var _excluded = ["isFilled"];

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

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 defaultProps = {
  className: '',
  viewBox: '0 0 18 16'
};

function StarIcon(props) {
  // don't want to pass isFilled through to SvgIcon
  var isFilled = props.isFilled,
      otherProps = _objectWithoutProperties(props, _excluded);

  var iconCssClasses = (0, _classnames.default)('ds-c-icon--star', {
    'ds-c-icon--star-filled': isFilled
  }, props.className);
  var title = isFilled ? (0, _i18n.t)('icons.starFilled') : (0, _i18n.t)('icons.star');
  return /*#__PURE__*/_react.default.createElement(_SvgIcon.default, _extends({
    title: title
  }, defaultProps, otherProps, {
    className: iconCssClasses
  }), isFilled ? /*#__PURE__*/_react.default.createElement("path", {
    d: "M8.533 13.063l-5.274 2.69 1.008-5.699L0 6.017l5.896-.831L8.533 0l2.637 5.186 5.897.831-4.267 4.037 1.007 5.7z",
    fillRule: "nonzero"
  }) : /*#__PURE__*/_react.default.createElement("path", {
    className: "ds-c-icon--star__outline",
    d: "M13.14 14.852l-.88-4.976 3.709-3.508-5.126-.723-2.31-4.542-2.309 4.542-5.126.723 3.708 3.508-.88 4.976 4.607-2.35 4.607 2.35z",
    fillRule: "nonzero",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1"
  }));
}

StarIcon.propTypes = {
  isFilled: _propTypes.default.bool
};
var _default = StarIcon;
exports.default = _default;