"use strict";

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

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

var _ = require("./");

var _examplesList = _interopRequireDefault(require("./examples-list"));

var _index = require("../styles/index");

var _examples$DEFAULT$exa;

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

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

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; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = (_examples$DEFAULT$exa = {}, _defineProperty(_examples$DEFAULT$exa, _examplesList.default.DEFAULT, function Story1() {
  var Example =
  /*#__PURE__*/
  function (_React$Component) {
    _inherits(Example, _React$Component);

    function Example() {
      var _getPrototypeOf2;

      var _this;

      _classCallCheck(this, Example);

      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Example)).call.apply(_getPrototypeOf2, [this].concat(args)));

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", {
        value: 3
      });

      return _this;
    }

    _createClass(Example, [{
      key: "render",
      value: function render() {
        var _this2 = this;

        return _react.default.createElement(_.StarRating, {
          value: this.state.value,
          onChange: function onChange(_ref) {
            var value = _ref.value;
            return _this2.setState({
              value: value
            });
          }
        });
      }
    }]);

    return Example;
  }(_react.default.Component);

  return _react.default.createElement(Example, null);
}), _defineProperty(_examples$DEFAULT$exa, _examplesList.default.CUSTOM_STARS, function Story2() {
  var Example =
  /*#__PURE__*/
  function (_React$Component2) {
    _inherits(Example, _React$Component2);

    function Example() {
      var _getPrototypeOf3;

      var _this3;

      _classCallCheck(this, Example);

      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }

      _this3 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(Example)).call.apply(_getPrototypeOf3, [this].concat(args)));

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this3)), "state", {
        value: 5
      });

      return _this3;
    }

    _createClass(Example, [{
      key: "render",
      value: function render() {
        var _this4 = this;

        return _react.default.createElement(_.StarRating, {
          numItems: 10,
          value: this.state.value,
          onChange: function onChange(_ref2) {
            var value = _ref2.value;
            return _this4.setState({
              value: value
            });
          }
        });
      }
    }]);

    return Example;
  }(_react.default.Component);

  return _react.default.createElement(Example, null);
}), _defineProperty(_examples$DEFAULT$exa, _examplesList.default.EMOTICON, function Story3() {
  var Example =
  /*#__PURE__*/
  function (_React$Component3) {
    _inherits(Example, _React$Component3);

    function Example() {
      var _getPrototypeOf4;

      var _this5;

      _classCallCheck(this, Example);

      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
        args[_key3] = arguments[_key3];
      }

      _this5 = _possibleConstructorReturn(this, (_getPrototypeOf4 = _getPrototypeOf(Example)).call.apply(_getPrototypeOf4, [this].concat(args)));

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this5)), "state", {
        value: 3
      });

      return _this5;
    }

    _createClass(Example, [{
      key: "render",
      value: function render() {
        var _this6 = this;

        return _react.default.createElement(_.EmoticonRating, {
          value: this.state.value,
          onChange: function onChange(_ref3) {
            var value = _ref3.value;
            return _this6.setState({
              value: value
            });
          }
        });
      }
    }]);

    return Example;
  }(_react.default.Component);

  return _react.default.createElement(Example, null);
}), _defineProperty(_examples$DEFAULT$exa, _examplesList.default.OVERRIDES, function Story4() {
  var StyledCustomItem = (0, _index.styled)('li', function (_ref4) {
    var $isSelected = _ref4.$isSelected,
        $isActive = _ref4.$isActive;
    return {
      display: 'inline-block',
      marginRight: 8,
      color: $isSelected ? 'blue' : $isActive ? 'red' : ''
    };
  });

  var CustomRatingItem = function CustomRatingItem(_ref5) {
    var $index = _ref5.$index,
        props = _objectWithoutProperties(_ref5, ["$index"]);

    return _react.default.createElement(StyledCustomItem, props, $index);
  };

  var Example =
  /*#__PURE__*/
  function (_React$Component4) {
    _inherits(Example, _React$Component4);

    function Example() {
      var _getPrototypeOf5;

      var _this7;

      _classCallCheck(this, Example);

      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
        args[_key4] = arguments[_key4];
      }

      _this7 = _possibleConstructorReturn(this, (_getPrototypeOf5 = _getPrototypeOf(Example)).call.apply(_getPrototypeOf5, [this].concat(args)));

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this7)), "state", {});

      return _this7;
    }

    _createClass(Example, [{
      key: "render",
      value: function render() {
        var _this8 = this;

        return _react.default.createElement(_.StarRating, {
          overrides: {
            Item: {
              component: CustomRatingItem
            }
          },
          value: this.state.value,
          onChange: function onChange(_ref6) {
            var value = _ref6.value;
            return _this8.setState({
              value: value
            });
          }
        });
      }
    }]);

    return Example;
  }(_react.default.Component);

  return _react.default.createElement(Example, null);
}), _examples$DEFAULT$exa);

exports.default = _default;