import './_commonjsHelpers-0c4b6f40.js';
import './_to-object-a4107da3.js';
import './es6.string.iterator-c990c18c.js';
import './_library-528f1934.js';
import './_iter-detect-5d49a330.js';
import './toConsumableArray-43aa614d.js';
import './core.get-iterator-method-e1de7503.js';
import './_object-pie-33c40e79.js';
import './extends-6f2fcc99.js';
import './_object-sap-964b6feb.js';
import './inherits-75d45541.js';
import './define-property-8af5f002.js';
import './web.dom.iterable-4439f05a.js';
import './typeof-af9c50d8.js';
import './_is-array-58e95429.js';
import React from 'react';
import './index-acfb8079.js';
import 'prop-types';
import 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import 'react-bootstrap/Card';
import './moment-b6f49411.js';
import 'next/router';
import './isSymbol-1981418f.js';
import './debounce-9207d8ee.js';
import './toNumber-2f7a84cd.js';
import './index.es-c6222053.js';
import 'react-dom';
import './visibility-sensor-f40c2564.js';
import { i as imageUrlBuilder } from './index-51a80699.js';
import { L as LazyLoad } from './index-6c12bdd5.js';
import './main-747e7d25.js';
import './entities-7cc3bf45.js';
import './slicedToArray-641f241f.js';
import './stringify-4330ccdc.js';
import './asyncToGenerator-fc1c2e29.js';
export { default as Segment } from './Segment.js';
export { default as Beam } from './Beam.js';
export { default as AdSlot } from './AdSlot.js';
import './ADInfeed-783bb61d.js';
export { default as DeckContent } from './DeckContent.js';
import './lodash-ec8c6b48.js';
import './ADlgInfeed-45032e42.js';
import './getContentCategory-15dcc413.js';
import './get-1e515072.js';
import './eq-b470f743.js';
export { default as AD } from './AD.js';
import './AuthorComponent-8ffd4679.js';
export { default as GridContent } from './GridContent.js';
export { default as DeckQueue } from './DeckQueue.js';
import 'react-bootstrap/Media';
export { default as ThumbnailCard } from './ThumbnailCard.js';
import './BlockContent-d05b5b23.js';
import './react-social-icons-3822f1ce.js';
export { default as TaxonomyCard } from './TaxonomyCard.js';
export { default as RolesDeck } from './RolesDeck.js';
import './index-c7e2ac95.js';
import './smoothscroll-0cd4c7a6.js';
export { default as GroupDeck } from './GroupDeck.js';
export { default as YoutubeGroup } from './YoutubeGroup.js';
import 'react-bootstrap';
import './timeDifferenceCalc.js';
export { default as QueueDeckExpanded } from './QueueDeckExpanded.js';
import './iconBase-602d52fe.js';
import './index.esm-3fdda599.js';
export { default as VideoSeriesListing } from './VideoSeriesListing.js';
export { default as ArticleSeriesListing } from './ArticleSeriesListing.js';
export { default as ArticleCarousel } from './ArticleCarousel.js';
export { g as getSerializers } from './index-52068e2b.js';
import './util-7700fc59.js';
import './brightcove-react-player-loader.es-4abff0b1.js';
import 'next/head';
import 'react-share';
export { default as SocialShare } from './SocialShare.js';
import './_object-to-array-7e804fce.js';
import 'react-bootstrap/Pagination';
import 'react-bootstrap/Button';
import 'react-bootstrap/Figure';
export { default as HorizontalArticleListing } from './HorizontalArticleListing.js';
export { default as MasterDeck } from './MasterDeck.js';
export { default as PublicationDeck } from './PublicationDeck.js';
export { default as IssueDeck } from './IssueDeck.js';
import 'react-bootstrap/Badge';
export { default as IssueContentDeck } from './IssueContentDeck.js';
import './defineProperty-94fd8bfc.js';
export { default as EventsDeck } from './EventsDeck.js';
import 'react-bootstrap/Spinner';
import 'react-bootstrap/Form';
import './index-c00b0bbb.js';
import './js.cookie-6874175c.js';
export { default as CMEDeck } from './CMEDeck.js';
export { default as ExternalResources } from './ExternalResources.js';
export { Column1 } from './Column1.js';
export { default as SideFooter } from './SideFooter.js';
import './ConferenceBanner-9162d0ca.js';
export { Column2 } from './Column2.js';
export { default as ADSponsoredResources } from './ADSponsoredResources.js';
import 'react-bootstrap/ListGroup';
export { default as ADWebcast } from './ADWebcast.js';
export { default as LeftNav } from './LeftNav.js';
export { default as PageFilter } from './PageFilter.js';
export { Column3 } from './Column3.js';
export { default as Header } from './Header.js';
import 'react-bootstrap/Accordion';
import 'react-bootstrap/AccordionToggle';
export { default as AccordionPanel } from './AccordionPanel.js';
export { default as VideoSeriesFilter } from './VideoSeriesFilter.js';
import 'react-bootstrap/Nav';
import 'react-bootstrap/Navbar';
import 'react-bootstrap/NavDropdown';
import './index.esm-d6f88d94.js';
import './NavFooter-c29526b7.js';
import './index.esm-8ee5ff72.js';
export { default as SocialIcons } from './SocialIcons.js';
import 'react-bootstrap/FormControl';
import './SocialSearchComponent-9da8e6ae.js';
export { default as NavMagazine } from './NavMagazine.js';
export { NavNative } from './NavNative.js';
export { default as Search } from './Search.js';
export { NavNormal } from './NavNormal.js';
export { NavDvm } from './NavDvm.js';
export { HamMagazine } from './HamMagazine.js';
export { default as ADGutter } from './ADGutter.js';
export { default as AD728x90 } from './AD728x90.js';
export { default as TemplateNormal } from './TemplateNormal.js';
export { default as AD300x250 } from './AD300x250.js';
export { default as AD300x250x600 } from './AD300x250x600.js';
export { default as ADFooter } from './ADFooter.js';
export { default as AdSlotsProvider } from './AdSlotsProvider.js';
export { default as ADFloatingFooter } from './ADFloatingFooter.js';
export { default as ADWelcome } from './ADWelcome.js';
export { default as ADSkyscraper } from './ADSkyscraper.js';
import 'react-bootstrap/Carousel';
export { default as Feature } from './Feature.js';
import 'react-bootstrap/Breadcrumb';
export { default as Breadcrumbs } from './Breadcrumbs.js';
export { default as Hero } from './Hero.js';
import './keys-8eda7a5c.js';
export { default as AlphabeticList } from './AlphabeticList.js';
export { default as PdfDownload } from './PdfDownload.js';
import 'react-bootstrap/DropdownButton';
import 'react-bootstrap/Dropdown';
export { default as RelatedTopicsDropdown } from './RelatedTopicsDropdown.js';
import './index.esm-a8ff922c.js';
export { default as Ustream } from './Ustream.js';
export { default as HighlightenVideo } from './HighlightenVideo.js';
export { default as PublicationLanding } from './PublicationLanding.js';
export { default as IssueLanding } from './IssueLanding.js';
import 'react-bootstrap/Modal';
export { default as PopUpModal } from './PopUpModal.js';
export { default as RelatedContent } from './RelatedContent.js';
export { default as TaxonomyDescription } from './TaxonomyDescription.js';
export { default as PubToc } from './PubToc.js';
export { default as PubSection } from './PubSection.js';
export { default as ForbesHero } from './ForbesHero.js';
export { default as HorizontalHero } from './HorizontalHero.js';
export { default as OncliveHero } from './OncliveHero.js';
export { default as OncliveLargeHero } from './OncliveLargeHero.js';
export { default as VerticalHero } from './VerticalHero.js';
export { default as YahooHero } from './YahooHero.js';
export { default as GridHero } from './GridHero.js';
export { default as ConferenceArticleCard } from './ConferenceArticleCard.js';
export { default as KMTracker } from './KMTracker.js';
export { default as getSeriesDetail } from './getSeriesDetail.js';
export { default as SetCookie } from './SetCookie.js';
import './index-db3bb315.js';
export { default as getRelatedArticle } from './getRelatedArticle.js';
export { default as getQuery } from './getQuery.js';
export { default as Auth } from './Auth.js';
import 'swr';
import 'passport-local';
import 'mysql';
import './SeriesSlider-3f5374bc.js';
export { g as getTargeting } from './getTargeting-ed6ebf43.js';
export { default as View } from './View.js';
export { default as getKeywords } from './getKeywords.js';
export { default as urlFor } from './urlFor.js';
import './style-inject.es-1f59c1d0.js';
import 'disqus-react';
import 'react-twitter-embed';
export { default as PartnerDetailListing } from './PartnerDetailListing.js';
export { default as VideoProgramLandingPage } from './VideoProgramLandingPage.js';
import './VideoSeriesCard.js';
export { default as VideoSeriesLandingPage } from './VideoSeriesLandingPage.js';
export { default as ArticleProgramLandingPage } from './ArticleProgramLandingPage.js';
export { default as ArticleSeriesLandingPage } from './ArticleSeriesLandingPage.js';

//Feature query to be used
// const featureQuery = `*[_type == 'feature' && is_active == true && feature_url == "/"] | order(_updatedAt asc)[0..5]{
//     ...,
//      feature_img { asset-> {url} }
//    }`

//Update*  Added control toggle for features.  Will default to off -
//<Feature controls dataset={props.features} /></div>

var FeatureArticles = function FeatureArticles(props) {
  var data = props.dataset;

  var client = props.client,
      _props$imageWidth = props.imageWidth,
      imageWidth = _props$imageWidth === undefined ? 200 : _props$imageWidth,
      imageHeight = props.imageHeight,
      defaultImage = props.defaultImage,
      _props$styles = props.styles,
      styles = _props$styles === undefined ? null : _props$styles;


  var urlFor = function urlFor(source) {
    var builder = imageUrlBuilder(client);
    return builder.image(source).auto('format');
  };

  var renderImage = function renderImage(thumbnail, imageWidth, imageHeight) {
    var url = urlFor(thumbnail);
    if (imageHeight) url = url.height(imageHeight);
    if (imageWidth) url = url.width(imageWidth);
    return url.url();
  };

  //image width updated.

  return React.createElement(
    'div',
    { className: 'featured-articles-wrapper' },
    data.map(function (article, index) {
      return React.createElement(
        React.Fragment,
        null,
        React.createElement(
          Row,
          { className: 'article-wrap' },
          React.createElement(
            Col,
            { className: 'mb-4 m-fl-center deck', xs: 12, sm: 4, md: 4, lg: 3, xl: 3 },
            React.createElement(
              'a',
              { href: '' + article.feature_link },
              React.createElement(
                'figure',
                { style: { marginTop: '1rem' } },
                React.createElement(
                  LazyLoad,
                  { height: imageHeight },
                  React.createElement('img', { style: { width: '100%', borderRadius: '10px' }, src: article.feature_img ? renderImage(article.feature_img, imageWidth, imageHeight) : defaultImage })
                )
              )
            )
          ),
          React.createElement(
            Col,
            { className: 'article-wrap-body', xs: 12, sm: 8, md: 8, lg: 9, xl: 9, style: { paddingTop: '10px' } },
            React.createElement(
              'a',
              { href: '' + article.feature_link },
              React.createElement(
                'h4',
                { className: 'mb-1', style: { fontWeight: '600', fontSize: '22px' } },
                article.feature_title
              ),
              React.createElement(
                'p',
                { style: { fontSize: '1.1em' } },
                article.feature_body
              )
            )
          ),
          index !== data.length - 1 && React.createElement('hr', null)
        ),
        React.createElement(
          'style',
          { jsx: 'true' },
          '\n              .featured-articles-wrapper {\n                background: ' + props.backgroundColor + ';\n                padding: 1rem;\n                border-radius: 10px;\n                box-shadow: #0000002b 1px 3px 3px 3px;\n              }\n              hr {\n                width: 100%;\n                height: 1px;\n                margin-left: 15px;\n                margin-right: 15px;\n              }\n              ' + styles + '\n            '
        )
      );
    })
  );
};

export { FeatureArticles };
