'use strict';

require('./_commonjsHelpers-06173234.js');
require('./_to-object-329a650b.js');
require('./es6.string.iterator-cc0bbaa4.js');
require('./_library-dd23b178.js');
require('./_iter-detect-60b2f026.js');
require('./toConsumableArray-9a3476fe.js');
require('./core.get-iterator-method-f62321d4.js');
require('./_object-pie-68c5bcbc.js');
var _extends = require('./extends-0a918631.js');
require('./_object-sap-5e74ba08.js');
require('./inherits-0c7830c5.js');
require('./define-property-f4d12f4e.js');
require('./web.dom.iterable-a0e279c1.js');
require('./typeof-9d7f610f.js');
require('./_is-array-754e012d.js');
var React = require('react');
require('./index-e08f00ce.js');
require('prop-types');
require('react-bootstrap/Row');
require('react-bootstrap/Col');
require('./moment-ca3bd9fb.js');
require('next/router');
require('./isSymbol-04666465.js');
require('./debounce-529c8d06.js');
require('./toNumber-36d1e7e5.js');
require('react-dom');
require('./index-b5eb3ff8.js');
require('./index-9d365128.js');
require('./main-7b5e57b0.js');
require('./entities-310b46ee.js');
require('./slicedToArray-8f385299.js');
require('./stringify-7c5aff47.js');
require('./asyncToGenerator-140e5f89.js');
require('./Segment.js');
require('./Beam.js');
require('./AdSlot.js');
var BlockContent = require('./BlockContent-8b494587.js');
require('./index-187c967e.js');
require('./smoothscroll-5054361f.js');
require('./GroupDeck.js');
require('./YoutubeGroup.js');
require('react-bootstrap');
require('./iconBase-68959171.js');
var index_esm = require('./index.esm-974f47d9.js');
var ArticleCarousel = require('./ArticleCarousel.js');
var getSerializers = require('./index-e5ee306e.js');
require('./util-f2c1b65b.js');
require('./brightcove-react-player-loader.es-5c98aec7.js');
require('next/head');
require('react-share');
require('./SocialShare.js');
require('./_object-to-array-5762f850.js');
require('react-bootstrap/Pagination');
require('react-bootstrap/Button');
require('react-bootstrap/Figure');

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

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

function HorizontalArticleListing(_ref) {
  var _ref$data = _ref.data,
      data = _ref$data === undefined ? null : _ref$data,
      _ref$client = _ref.client,
      client = _ref$client === undefined ? null : _ref$client,
      _ref$color = _ref.color,
      color = _ref$color === undefined ? '#FFFFFF' : _ref$color;

  // Look at AJMC for query setup
  // Data format = Array of Objects based on Taxonomies with videos and latest videos
  // {
  // name: ...,
  // identifier: ...,
  // data: Array of latest articles with videos
  // }
  return React__default['default'].createElement(
    'div',
    null,
    data.length > 0 ? data.map(function (taxonomy, index) {
      return React__default['default'].createElement(
        React__default['default'].Fragment,
        null,
        React__default['default'].createElement(
          'div',
          { key: 'articleCarousel_' + taxonomy.identifier + '_' + index, className: 'mb-3 horizontal-article' },
          React__default['default'].createElement(
            'div',
            { className: 'horizontal-article-header', style: { borderBottom: '2px solid ' + color } },
            React__default['default'].createElement(
              'div',
              { className: 'horizontal-article-title-wrapper' },
              React__default['default'].createElement(
                'a',
                { href: '/' + taxonomy.identifier },
                React__default['default'].createElement(
                  'h4',
                  { className: 'article-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', margin: '0' } },
                  taxonomy.name
                )
              ),
              taxonomy.identifier && React__default['default'].createElement(
                'div',
                { style: { width: 'fit-content', whiteSpace: 'nowrap' } },
                React__default['default'].createElement(
                  'a',
                  { href: '/' + taxonomy.identifier },
                  'View All ',
                  React__default['default'].createElement(index_esm.IoIosArrowForward, null)
                )
              )
            ),
            taxonomy.summary && React__default['default'].createElement(
              'div',
              { className: 'horizontal-article-summary' },
              React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers.getSerializers(client), blocks: taxonomy.summary, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
            )
          ),
          taxonomy.data.length > 0 ? React__default['default'].createElement(
            'div',
            { className: 'article-carousel' },
            React__default['default'].createElement(ArticleCarousel, { articles: taxonomy.data, client: client })
          ) : React__default['default'].createElement(
            'div',
            null,
            React__default['default'].createElement(
              'h5',
              { className: 'mt-2' },
              React__default['default'].createElement(
                'em',
                { className: 'pl-3' },
                'New content coming soon, please check back later.'
              )
            )
          )
        ),
        React__default['default'].createElement(
          'style',
          { jsx: 'true' },
          '\n                .article-carousel {\n                  display: flex;\n                  align-items: center;\n                  justify-content: center;\n                }\n                .horizontal-article-title-wrapper {\n                  display: flex;\n                  flex-wrap: no-wrap;\n                  align-items: center;\n                  justify-content: space-between;\n                }\n              '
        )
      );
    }) : React__default['default'].createElement(
      'div',
      null,
      React__default['default'].createElement(
        'h5',
        null,
        React__default['default'].createElement(
          'em',
          { className: 'pl-3' },
          'New content coming soon, please check back later.'
        )
      )
    )
  );
}

module.exports = HorizontalArticleListing;
