'use strict';

var _extends = require('./extends-7c86182f.js');
var React = require('react');
var QueueDeckExpanded = require('./QueueDeckExpanded.js');
var Breadcrumbs = require('./Breadcrumbs.js');
var BlockContent = require('./BlockContent-9ebd251f.js');
var getSerializers = require('./index-2a3d37a1.js');
require('./_commonjsHelpers-06173234.js');
require('./core.get-iterator-method-5643aa10.js');
require('./_object-pie-083f2dd6.js');
require('./slicedToArray-067dd3bc.js');
require('./web.dom.iterable-d98303e0.js');
require('./toConsumableArray-d7797c2b.js');
require('./_iter-detect-b1df62f0.js');
require('react-bootstrap');
require('./urlFor.js');
require('./index-d48b231c.js');
require('./index.es-f3e47207.js');
require('./moment-aca40de1.js');
require('./visibility-sensor-eb2c5b69.js');
require('react-dom');
require('./index-fc2f1ca2.js');
require('./events-1b438fe7.js');
require('prop-types');
require('next/router');
require('./index-eadd5035.js');
require('./main-f1c77adb.js');
require('./entities-df1aed86.js');
require('./ADInfeed-bce0ba07.js');
require('react-bootstrap/Card');
require('./AdSlot.js');
require('./debounce-d4a2369b.js');
require('./isSymbol-03abbdf0.js');
require('./toNumber-5e1fac58.js');
require('./Beam.js');
require('./stringify-f7a37a8d.js');
require('./asyncToGenerator-77821af0.js');
require('./_library-dd23b178.js');
require('./Segment.js');
require('./AuthorComponent-39b37d84.js');
require('./lodash-f0783643.js');
require('./ADlgInfeed-950b414b.js');
require('./getContentCategory-f38a4c00.js');
require('./timeDifferenceCalc.js');
require('react-bootstrap/Breadcrumb');
require('./index-187c967e.js');
require('./util-93a37fd0.js');
require('./typeof-567e31ff.js');
require('./_is-array-54228b29.js');
require('./brightcove-react-player-loader.es-a195642e.js');
require('./GroupDeck.js');
require('./smoothscroll-99df7f93.js');
require('./SocialShare.js');
require('next/head');
require('react-share');
require('./_object-to-array-ce86cae7.js');
require('react-bootstrap/Pagination');
require('react-bootstrap/Button');
require('react-bootstrap/Row');
require('react-bootstrap/Col');
require('./inherits-de66ea16.js');
require('./_object-sap-d1978572.js');
require('./define-property-e8404b64.js');
require('./index.esm-d81454e7.js');
require('./iconBase-be4097c0.js');
require('react-bootstrap/Figure');
require('react-bootstrap/OverlayTrigger');
require('react-bootstrap/Tooltip');
require('react-bootstrap/Popover');

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

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

/* usage
import Settings, { Ads } from '../../../../settings'
import { IssueLanding, getQuery } from '@mjhls/mjh-framework'
import client from '../../../../client'
import moment from 'moment'
import Shell from '../../../../components/2.0/Shell'
import { pageview } from '../../../../utilities/gtag'

const Issue = (props) => {
  const { pubIssue, cache } = props
  const targeting = {
    content_placement: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
    document_url: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
  }
  return (
    <Shell cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3' title={pubIssue.issue.name}>
      <IssueLanding pubIssue={pubIssue} client={client} settings={Settings} pageview={pageview} rightItems={Ads.getMobileAds(targeting)} />
    </Shell>
  )
}

Issue.getInitialProps = async (ctx) => {
  const { query } = ctx
  const pubIssue = await client.fetch(getQuery('issue'), { ...query, currentDate: moment().utc().format() }
  )
  return { pubIssue }
}

export default Issue
*/

var IssueLanding = function IssueLanding(props) {
  var pubIssue = props.pubIssue,
      client = props.client,
      settings = props.settings,
      pageview = props.pageview,
      rightItems = props.rightItems,
      _props$showCategory = props.showCategory,
      showCategory = _props$showCategory === undefined ? true : _props$showCategory,
      _props$showPublished = props.showPublished,
      showPublished = _props$showPublished === undefined ? true : _props$showPublished,
      _props$seoPaginate = props.seoPaginate,
      seoPaginate = _props$seoPaginate === undefined ? true : _props$seoPaginate,
      _props$autoScroll = props.autoScroll,
      autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
      _props$showAuthor = props.showAuthor,
      showAuthor = _props$showAuthor === undefined ? false : _props$showAuthor,
      _props$showPubInfo = props.showPubInfo,
      showPubInfo = _props$showPubInfo === undefined ? false : _props$showPubInfo,
      _props$imageHeight = props.imageHeight,
      imageHeight = _props$imageHeight === undefined ? 270 : _props$imageHeight,
      _props$imageWidth = props.imageWidth,
      imageWidth = _props$imageWidth === undefined ? 480 : _props$imageWidth;

  return React__default['default'].createElement(
    'div',
    { id: 'issueLanding' },
    React__default['default'].createElement(Breadcrumbs, null),
    pubIssue.issue.source && React__default['default'].createElement(
      'p',
      { className: 'badge badge-primary' },
      pubIssue.issue.source
    ),
    pubIssue.issue.description && React__default['default'].createElement(
      React__default['default'].Fragment,
      null,
      React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers.getSerializers(client), blocks: pubIssue.issue.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
      React__default['default'].createElement('div', { style: { clear: 'both' } })
    ),
    React__default['default'].createElement(QueueDeckExpanded, {
      client: client,
      mapping: settings.mapping,
      dataRecord: pubIssue.issue.articles,
      seoPaginate: seoPaginate,
      pageview: pageview,
      showAuthor: showAuthor,
      autoScroll: autoScroll,
      defaultImage: settings.logo,
      showPublished: showPublished,
      showCategory: showCategory,
      imageHeight: imageHeight,
      imageWidth: imageWidth,
      rightItems: rightItems,
      showPubInfo: showPubInfo,
      columns: 'rotate',
      variant: 'top',
      contentCategoryMapping: settings.contentCategoryMapping ? settings.contentCategoryMapping : []
    })
  );
};

module.exports = IssueLanding;
