!function(){"use strict";window.jnews=window.jnews||{},window.jnews.hero=window.jnews.hero||{};var e="object"==typeof jnews&&"object"==typeof jnews.library,t="function"==typeof jnews.tns,n=!1;window.jnews.hero={action:function(){var e=this;n&&e.jnewsLibrary.cancelAnimationFrame.call(e.jnewsLibrary.win,n),n=e.jnewsLibrary.requestAnimationFrame.call(e.jnewsLibrary.win,(function(){e.dispatch(),e.heroSlider(e.container)}))},init:function(t){var n=this;if(n.jnewsLibrary=!!e&&jnews.library,n.jnewsLibrary){n.container=void 0===t?n.jnewsLibrary.globalBody:t;var r={resize:n.action.bind(this)};n.jnewsLibrary.winLoad(n.action.bind(this)),n.jnewsLibrary.docReady(n.action.bind(this)),n.jnewsLibrary.addEvents(n.jnewsLibrary.win,r)}},dispatch:function(){var e=this;e.jnewsLibrary.forEach(e.container.getElementsByClassName("jeg_heroblock"),(function(t,n){var r=t,a=r.getElementsByClassName("jeg_heroblock_wrapper"),s=r.getElementsByClassName("jeg_heroblock_scroller"),i=r.getElementsByClassName("jeg_post"),o=r.dataset.margin;e.jnewsLibrary.windowWidth()>667?(a.length>0&&e.jnewsLibrary.forEach(a,(function(e,t){e.style.marginLeft="-"+o+"px",e.style.marginBottom="-"+o+"px",e.style.marginRight=0,e.style.marginTop=0})),i.length>0&&e.jnewsLibrary.forEach(i,(function(e,t){e.style.padding="0 0 "+o+"px "+o+"px "}))):s.length>0&&(o>5&&(o=5),e.jnewsLibrary.hasClass(r,"tiny-slider")||e.jnewsLibrary.forEach(s,(function(e,t){e.style.marginLeft="-"+o+"px"})),a.length>0&&e.jnewsLibrary.forEach(a,(function(e,t){e.style.marginLeft=0,e.style.marginBottom=0,e.style.marginRight=0})),i.length>0&&e.jnewsLibrary.forEach(i,(function(t,n){e.jnewsLibrary.getParents(t,".jeg_heroblock_scroller").length>0?e.jnewsLibrary.hasClass(r,"tiny-slider")?e.jnewsLibrary.hasClass(r,"jeg_heroblock_1")&&e.jnewsLibrary.hasClass(t,"jeg_hero_item_4")||e.jnewsLibrary.hasClass(r,"jeg_heroblock_2")&&(e.jnewsLibrary.hasClass(t,"jeg_hero_item_3")||e.jnewsLibrary.hasClass(t,"jeg_hero_item_5"))||e.jnewsLibrary.hasClass(r,"jeg_heroblock_3")&&(e.jnewsLibrary.hasClass(t,"jeg_hero_item_3")||e.jnewsLibrary.hasClass(t,"jeg_hero_item_4"))||e.jnewsLibrary.hasClass(r,"jeg_heroblock_4")&&e.jnewsLibrary.hasClass(t,"jeg_hero_item_3")?(t.style.paddingLeft=o+"px",t.style.paddingBottom=o+"px"):(t.style.paddingLeft=0,t.style.paddingBottom=o+"px"):(t.style.paddingLeft=o+"px",t.style.paddingBottom=0):(t.style.paddingLeft=0,t.style.paddingBottom=o+"px")})))}))},heroSlider:function(e){if(t){var n=this,r=e.querySelectorAll(".jeg_heroblock.tiny-slider");r.length>0&&n.jnewsLibrary.forEach(r,(function(e,t){var r=e,a=r.dataset.autoplay,s=r.dataset.delay,i=!1;i="undefined"!=typeof jnewsoption?1==jnewsoption.rtl:"undefined"!=typeof jnewsgutenbergoption&&1==jnewsgutenbergoption.rtl,r=r.querySelectorAll(".jeg_hero_wrapper:not(.jeg_tns_active)"),n.jnewsLibrary.forEach(r,(function(e,t){if(!n.jnewsLibrary.hasClass(e,"jeg_tns_active")){var r=jnews.tns({container:e,textDirection:i?"rtl":"ltr",items:1,controlsText:["",""],controls:!0,nav:!1,loop:!0,autoplay:a,autoplayTimeout:s,mouseDrag:!0,onInit:function(e){void 0!==e.nextButton&&(e.nextButton.setAttribute("aria-label","Next button"),n.jnewsLibrary.addClass(e.nextButton,"tns-next")),void 0!==e.prevButton&&(e.prevButton.setAttribute("aria-label","Previous button"),n.jnewsLibrary.addClass(e.prevButton,"tns-prev"))}});void 0!==r&&(r.events.on("dragStart",(function(e){e.event.preventDefault(),e.event.stopPropagation()})),n.jnewsLibrary.addClass(e,"jeg_tns_active"),n.jnewsLibrary.dataStorage.put(e,"tiny-slider",r))}}))}))}}}}();