'use strict';

var React = require('react');
var brightcoveReactPlayerLoader_es = require('./brightcove-react-player-loader.es-a195642e.js');
require('./_commonjsHelpers-06173234.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var HighlightenVideo = function HighlightenVideo(_ref) {
  var highlightVideoOptions = _ref.highlightVideoOptions;
  var accountId = highlightVideoOptions.accountId,
      experienceId = highlightVideoOptions.experienceId,
      playerId = highlightVideoOptions.playerId,
      playlistId = highlightVideoOptions.playlistId,
      videoId = highlightVideoOptions.videoId;

  if (accountId && experienceId) {
    return React__default['default'].createElement(
      React__default['default'].Fragment,
      null,
      React__default['default'].createElement(
        'div',
        { className: 'brightcove-experience-player' },
        React__default['default'].createElement(
          'p',
          { style: { width: '100%' } },
          'Highlighted Videos'
        ),
        React__default['default'].createElement(
          'div',
          { className: 'playlist-player', style: { position: 'relative', display: 'block', margin: '0px auto' } },
          React__default['default'].createElement(
            'div',
            { style: { paddingTop: '56.25%' } },
            React__default['default'].createElement('iframe', {
              src: 'https://players.brightcove.net/' + accountId + '/' + experienceId + '/index.html',
              allowFullScreen: true,
              allow: 'encrypted-media',
              style: { border: 'none', position: 'absolute', top: '0px', right: '0px', bottom: '0px', left: '0px', width: '100%', height: '100%' }
            })
          )
        )
      ),
      React__default['default'].createElement(
        'style',
        { jsx: 'true' },
        '\n          @media (min-width: 320px) {\n            .playlist-player {\n              height: 290px;\n            }\n          }\n          @media (min-width: 360px) {\n            .playlist-player {\n              height: 340px;\n            }\n          }\n          @media (min-width: 480px) {\n            .playlist-player {\n              height: 400px;\n            }\n          }\n          @media (min-width: 560px) {\n            .playlist-player {\n              height: 300px;\n            }\n          }\n          @media (min-width: 768px) {\n            .playlist-player {\n              height: 400px;\n            }\n          }\n          @media (min-width: 968px) {\n            .playlist-player {\n              height: 300px;\n            }\n          }\n          @media (min-width: 992px) {\n            .playlist-player {\n              height: 350px;\n            }\n          }\n          @media (min-width: 1192px) {\n            .playlist-player {\n              height: 300px;\n            }\n          }\n          @media (min-width: 1400px) {\n            .playlist-player {\n              height: 400px;\n            }\n          }\n          .brightcove-experience-player {\n            margin-bottom: 10px;\n            width: 100%;\n          }\n          .brightcove-experience-player p {\n            padding: 10px;\n            margin: 0;\n            color: #fff;\n            text-transform: uppercase;\n            text-align: center;\n            font-size: 1.5em;\n            font-weight: 400;\n            margin-bottom: 10px;\n          }\n        '
      )
    );
  } else if (accountId && playerId && playlistId) {
    return React__default['default'].createElement(
      'div',
      { className: 'brightcove-playlist-player' },
      React__default['default'].createElement(brightcoveReactPlayerLoader_es.ReactPlayerLoader, { accountId: accountId, playerId: playerId, playlistId: playlistId, attrs: { className: 'brightcove' } })
    );
  } else if (accountId && playerId && videoId) {
    return React__default['default'].createElement(
      'div',
      { className: 'brightcove-video-player' },
      React__default['default'].createElement(brightcoveReactPlayerLoader_es.ReactPlayerLoader, { accountId: accountId, playerId: playerId, videoId: videoId, attrs: { className: 'brightcove' } })
    );
  } else {
    return null;
  }
};

module.exports = HighlightenVideo;
