import { _ as _typeof } from './typeof-657f25da.js';
import React__default from 'react';
import { L as LazyLoad } from './index-755f2cc2.js';
import urlFor from './urlFor.js';
import { m as moment } from './moment-bc12cb97.js';
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
import 'prop-types';
import './_commonjsHelpers-0c4b6f40.js';
import './core.get-iterator-method-ea258bb1.js';
import './web.dom.iterable-ab4dea5c.js';
import './_is-array-8d21b9e3.js';
import './extends-1559c147.js';
import './_library-528f1934.js';
import 'react-dom';
import './slicedToArray-6ebcbfea.js';
import './index-3f5c03b2.js';

var css = ".VideoSeriesCard-module_article__Hlc3e {\n  width: 100%;\n  margin: 0 0 1rem 0;\n}\n.VideoSeriesCard-module_article__Hlc3e a {\n  display: flex;\n  width: 100%;\n  color: #000000;\n}\n.VideoSeriesCard-module_thumb__3hGyJ {\n  width: 25%;\n}\n.VideoSeriesCard-module_thumb__3hGyJ img {\n  width: 100%;\n  height: auto;\n}\n.VideoSeriesCard-module_info__2_i1N {\n  width: 75%;\n  font-size: 1rem;\n}\n.VideoSeriesCard-module_info__2_i1N h2 {\n  font-weight: bold;\n  font-size: 1.25rem;\n  margin: 0;\n}\n.VideoSeriesCard-module_published__1fI0q {\n  color: #6d6d6d;\n  margin: 0;\n}\n.VideoSeriesCard-module_summary__3hWJT {\n  margin: 0.5rem 0 0 0;\n}\n.VideoSeriesCard-module_author__aU35o {\n  margin: 0;\n}\n.VideoSeriesCard-module_author__aU35o span {\n  color: #6d6d6d;\n}\n@media only screen and (max-width: 568px) {\n  .VideoSeriesCard-module_article__Hlc3e {\n    margin: 1rem 0;\n    box-shadow: 2px 4px 8px rgba(0,0,0,.2);\n  }\n  .VideoSeriesCard-module_article__Hlc3e a {\n    flex-direction: column;\n    align-items: center;\n  }\n  .VideoSeriesCard-module_thumb__3hGyJ {\n    overflow: hidden;\n    width: 100%;\n    margin-bottom: 1rem;\n  }\n  .VideoSeriesCard-module_thumb__3hGyJ img{\n    border-radius: 10px 10px 0 0;    \n  }\n  .VideoSeriesCard-module_thumb__3hGyJ figure {\n    margin: 0;\n  }\n  .VideoSeriesCard-module_info__2_i1N {\n    width: 90%;\n    padding: 1rem !important;\n  }\n  .VideoSeriesCard-module_info__2_i1N h2 {\n    font-size: 1rem;\n  }\n}\n";
var styles = { "article": "VideoSeriesCard-module_article__Hlc3e", "thumb": "VideoSeriesCard-module_thumb__3hGyJ", "info": "VideoSeriesCard-module_info__2_i1N", "published": "VideoSeriesCard-module_published__1fI0q", "summary": "VideoSeriesCard-module_summary__3hWJT", "author": "VideoSeriesCard-module_author__aU35o" };
styleInject(css);

var VideoSeriesCard = function VideoSeriesCard(props) {
  var data = props.data,
      variant = props.variant,
      defaultImage = props.defaultImage,
      client = props.client,
      index = props.index;

  var episode = parseInt(index) + 1;

  return React__default.createElement(
    'div',
    { className: styles.article },
    React__default.createElement(
      'a',
      { href: '/view/' + data.url.current, style: variant === 'right' ? { flexDirection: 'row-reverse' } : {} },
      React__default.createElement(
        'div',
        { className: styles.thumb },
        React__default.createElement(
          'figure',
          null,
          React__default.createElement(
            LazyLoad,
            null,
            React__default.createElement('img', {
              src: data.thumbnail && data.thumbnail.asset ? urlFor({ client: client, source: data.thumbnail }) : data.thumbnail && _typeof(data.thumbnail == 'string') ? data.thumbnail : defaultImage
            })
          )
        )
      ),
      React__default.createElement(
        'div',
        { className: styles.info, style: variant === 'right' ? { padding: '0 1rem 0 0' } : { padding: ' 0 0 0 1rem' } },
        React__default.createElement(
          'div',
          { style: { fontSize: '1.3rem', fontWeight: 'bold' } },
          episode && 'EP ' + episode + ': ',
          data.title
        ),
        data.published && React__default.createElement(
          'p',
          { className: styles.published },
          moment(data.published).format('MMMM Do YYYY')
        ),
        data.authorMapping && data.authorMapping.displayName && React__default.createElement(
          'p',
          { className: styles.author },
          'By ',
          React__default.createElement(
            'span',
            null,
            data.authorMapping.displayName
          )
        ),
        data.intro && React__default.createElement('p', { dangerouslySetInnerHTML: { __html: data.intro }, className: styles.summary })
      )
    )
  );
};

export { VideoSeriesCard as default };
