text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _propTypes = require('prop-types');
  
  var _propTypes2 = _interopRequireDefault(_propTypes);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-unknown-property: 0 */
  
  /**
   * Spotify player iframe widget
   *
   * @author Alexander Wallin <office@alexanderwallin.com>
   * @see https://developer.spotify.com/technologies/widgets/spotify-play-button/
   */
  
  // Dimension prop type
  var dimensionPropType = _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]);
  
  // Size presets, defined by Spotify
  var sizePresets = {
    large: {
      width: 300,
      height: 380
    },
    compact: {
      width: 300,
      height: 80
    }
  };
  
  /**
   * SpotifyPlayer class
   */
  
  var SpotifyPlayer = function (_Component) {
    _inherits(SpotifyPlayer, _Component);
  
    function SpotifyPlayer() {
      _classCallCheck(this, SpotifyPlayer);
  
      return _possibleConstructorReturn(this, (SpotifyPlayer.__proto__ || Object.getPrototypeOf(SpotifyPlayer)).apply(this, arguments));
    }
  
    _createClass(SpotifyPlayer, [{
      key: 'render',
  
  
      // ------------------------------------------------------
      // Render
      // ------------------------------------------------------
  
      value: function render() {
        var _props = this.props,
            uri = _props.uri,
            view = _props.view,
            theme = _props.theme;
        var size = this.props.size;
  
  
        if (typeof size === 'string') {
          size = sizePresets[size];
        }
  
        return _react2.default.createElement('iframe', {
          title: 'Spotify',
          className: 'SpotifyPlayer',
          src: 'https://embed.spotify.com/?uri=' + uri + '&view=' + view + '&theme=' + theme,
          width: size.width,
          height: size.height,
          frameBorder: '0',
          allowtransparency: 'true'
        });
      }
    }]);
  
    return SpotifyPlayer;
  }(_react.Component);
  
  SpotifyPlayer.propTypes = {
  
    // Spotify URI
    uri: _propTypes2.default.string.isRequired,
  
    // Size as either a preset or as custom dimensions
    size: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['large', 'compact']), _propTypes2.default.shape({
      width: dimensionPropType,
      height: dimensionPropType
    })]),
  
    // View
    view: _propTypes2.default.oneOf(['list', 'coverart']),
  
    // Theme
    theme: _propTypes2.default.oneOf(['black', 'white'])
  };
  
  SpotifyPlayer.defaultProps = {
    size: 'large',
    view: 'list',
    theme: 'black'
  };
  
  exports.default = SpotifyPlayer;