'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

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('./core.get-iterator-method-f62321d4.js');
require('./_object-pie-68c5bcbc.js');
require('./extends-0a918631.js');
require('./define-property-f4d12f4e.js');
require('./web.dom.iterable-a0e279c1.js');
var React = require('react');
require('./index-e08f00ce.js');
require('prop-types');
var Row = require('react-bootstrap/Row');
var Col = require('react-bootstrap/Col');
require('./isSymbol-04666465.js');
require('./debounce-529c8d06.js');
require('./toNumber-36d1e7e5.js');
var main = require('./main-7b5e57b0.js');
require('./slicedToArray-8f385299.js');
require('./stringify-7c5aff47.js');
require('./asyncToGenerator-140e5f89.js');
require('./Segment.js');
require('./Beam.js');
require('./AdSlot.js');
require('./get-adbb11e3.js');
require('./eq-bb2843ed.js');
require('./react-social-icons-07939b41.js');
require('react-bootstrap');
require('./defineProperty-55548b25.js');
var SideFooter = require('./SideFooter.js');
var ConferenceBanner = require('./ConferenceBanner-6c9e718a.js');
var ADSponsoredResources = require('./ADSponsoredResources.js');
require('react-bootstrap/ListGroup');
require('./ADWebcast.js');
var LeftNav = require('./LeftNav.js');
var PageFilter = require('./PageFilter.js');

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

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var Row__default = /*#__PURE__*/_interopDefaultLegacy(Row);
var Col__default = /*#__PURE__*/_interopDefaultLegacy(Col);

var Column3 = function Column3(props) {
  var leftItems = props.leftItems,
      rightItems = props.rightItems,
      title = props.title,
      website = props.website,
      showFilter = props.showFilter,
      getParams = props.getParams,
      filters = props.filters,
      defaultFilter = props.defaultFilter,
      showRightAd = props.showRightAd,
      logo = props.logo;

  var adRef = React.useRef(null);

  React.useEffect(function () {
    if (!main.main_40 && window.innerWidth >= 768) {
      var navbar = document.querySelector('.navbar');
      var AdOffsetTop = adRef.current.getBoundingClientRect().top;
      window.addEventListener('scroll', function () {
        if (window.pageYOffset + (AdOffsetTop - navbar.offsetHeight) > AdOffsetTop) {
          if (adRef.current && adRef.current.style) {
            adRef.current.style.position = 'fixed';
            adRef.current.style.top = '60px';
          }
        } else {
          if (adRef.current && adRef.current.style) {
            adRef.current.style.position = 'relative';
            adRef.current.style.top = '';
          }
        }
      });
    }
  }, []);

  return React__default['default'].createElement(
    'section',
    null,
    React__default['default'].createElement(
      Row__default['default'],
      { className: 'justify-content-md-center' },
      React__default['default'].createElement(
        Col__default['default'],
        { md: true, className: 'leftCol', style: { width: '200px' } },
        React__default['default'].createElement(LeftNav['default'], { leftItems: leftItems }),
        website && website.sponsoredAd && React__default['default'].createElement(ADSponsoredResources, { sponsoredAd: website.sponsoredAd }),
        website && website.sideFooterContent && website.sideFooterContent.length && website.showFooterOnLeftSide && React__default['default'].createElement(SideFooter, { website: website, cache: website.cache, logo: logo })
      ),
      React__default['default'].createElement(
        Col__default['default'],
        { md: true, className: 'middleCol', style: { maxWidth: '640px', marginTop: !title && '10px' } },
        showFilter ? React__default['default'].createElement(
          'div',
          { className: 'title-wrap' },
          React__default['default'].createElement(
            'h1',
            { className: 'title' },
            title
          ),
          React__default['default'].createElement(
            'div',
            { className: 'filter-box' },
            React__default['default'].createElement(PageFilter, { getParams: getParams, filters: filters, defaultFilter: defaultFilter })
          )
        ) : title && React__default['default'].createElement(
          'h1',
          { className: 'title' },
          title
        ),
        props.children
      ),
      React__default['default'].createElement(
        'style',
        { jsx: 'true' },
        '\n            .filter-box {\n              float: right;\n              padding-top: 6px;\n              padding-right: 18px;\n            }\n            @media only screen and (min-width: 768px) {\n              .title-wrap {\n                display: flex;\n                justify-content: space-between;\n              }\n            }\n            @media only screen and (max-width: 767px) {\n              /* .filter-box {\n                float: right;\n                display: flex;\n                justify-content: flex-end;\n              } */\n              .title-wrap {\n                display: flex;\n                flex-direction: column;\n                margin-bottom: 10px;\n              }\n            }\n          '
      ),
      (!main.main_40 || showRightAd) && React__default['default'].createElement(
        Col__default['default'],
        { xs: 12, className: 'rightCol' },
        website && website.conferenceBannerContent && React__default['default'].createElement(ConferenceBanner.ConferenceBanner, { website: website }),
        React__default['default'].createElement(
          'div',
          { ref: adRef },
          rightItems && rightItems.map(function (row, index) {
            return React__default['default'].createElement(
              'div',
              { key: index },
              row.component
            );
          }),
          website && website.sideFooterContent && website.sideFooterContent.length && !website.showFooterOnLeftSide && React__default['default'].createElement(SideFooter, { website: website, cache: website.cache, logo: logo })
        )
      )
    )
  );
};

exports.Column3 = Column3;
exports.default = Column3;
