'use strict';

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

var React = require('react');
var ADSponsoredResources = require('./ADSponsoredResources.js');
var Row = require('react-bootstrap/Row');
var Col = require('react-bootstrap/Col');
var LeftNav = require('./LeftNav.js');
var SideFooter = require('./SideFooter.js');
var ConferenceBanner = require('./ConferenceBanner-6c9e718a.js');
var PageFilter = require('./PageFilter.js');
var main = require('./main-f1c77adb.js');
require('./slicedToArray-067dd3bc.js');
require('./_commonjsHelpers-06173234.js');
require('./web.dom.iterable-d98303e0.js');
require('./core.get-iterator-method-5643aa10.js');
require('./AdSlot.js');
require('./extends-7c86182f.js');
require('./_object-pie-083f2dd6.js');
require('prop-types');
require('./index-fc2f1ca2.js');
require('./events-1b438fe7.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('./_iter-detect-b1df62f0.js');
require('./Segment.js');
require('react-bootstrap/ListGroup');
require('./ADWebcast.js');
require('./checkSisterSite-b29833b2.js');
require('./react-social-icons-af932527.js');
require('./get-5839e5b5.js');
require('./eq-5fc26c07.js');
require('react-bootstrap');

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_43 && 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_43 || 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;
