!function(f){"use strict";f.epNewsTicker=function(t,e){var i={effect:"fade",direction:"ltr",autoPlay:!1,interval:4e3,scrollSpeed:2,pauseOnHover:!1,position:"auto",zIndex:99999},n=this;n.settings={},n._element=f(t),n._label=n._element.children(".bdt-news-ticker-label"),n._news=n._element.children(".bdt-news-ticker-content"),n._ul=n._news.children("ul"),n._li=n._ul.children("li"),n._controls=n._element.children(".bdt-news-ticker-controls"),n._prev=n._controls.find(".bdt-news-ticker-prev").parent(),n._action=n._controls.find(".bdt-news-ticker-action").parent(),n._next=n._controls.find(".bdt-news-ticker-next").parent(),n._pause=!1,n._controlsIsActive=!0,n._totalNews=n._ul.children("li").length,n._activeNews=0,n._interval=!1,n._frameId=null;var s=function(){var t=parseFloat(n._ul.css("marginLeft"));t-=n.settings.scrollSpeed/2,n._ul.css({marginLeft:t}),t<=-n._ul.find("li:first-child").outerWidth()&&(n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginLeft:0})),!1===n._pause&&(n._frameId=requestAnimationFrame(s),window.requestAnimationFrame&&n._frameId||setTimeout(s,16))},l=function(){var t=parseFloat(n._ul.css("marginRight"));t-=n.settings.scrollSpeed/2,n._ul.css({marginRight:t}),t<=-n._ul.find("li:first-child").outerWidth()&&(n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginRight:0})),!1===n._pause&&(n._frameId=requestAnimationFrame(l)),window.requestAnimationFrame&&n._frameId||setTimeout(l,16)},a=function(){"rtl"===n.settings.direction?n._ul.stop().animate({marginRight:-n._ul.find("li:first-child").outerWidth()},300,function(){n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginRight:0}),n._controlsIsActive=!0}):n._ul.stop().animate({marginLeft:-n._ul.find("li:first-child").outerWidth()},300,function(){n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginLeft:0}),n._controlsIsActive=!0})},c=function(){"rtl"===n.settings.direction?(0<=parseInt(n._ul.css("marginRight"),10)&&(n._ul.css({"margin-right":-n._ul.find("li:last-child").outerWidth()}),n._ul.find("li:last-child").insertBefore(n._ul.find("li:first-child"))),n._ul.stop().animate({marginRight:0},300,function(){n._controlsIsActive=!0})):(0<=parseInt(n._ul.css("marginLeft"),10)&&(n._ul.css({"margin-left":-n._ul.find("li:last-child").outerWidth()}),n._ul.find("li:last-child").insertBefore(n._ul.find("li:first-child"))),n._ul.stop().animate({marginLeft:0},300,function(){n._controlsIsActive=!0}))},o=function(){switch(n._controlsIsActive=!0,n.settings.effect){case"typography":n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).width(30).show(),n._ul.find("li").eq(n._activeNews).animate({width:"100%",opacity:1},1500);break;case"fade":n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).fadeIn();break;case"slide-down":n._totalNews<=1?n._ul.find("li").animate({top:30,opacity:0},300,function(){f(this).css({top:-30,opacity:0,display:"block"}),f(this).animate({top:0,opacity:1},300)}):(n._ul.find("li:visible").animate({top:30,opacity:0},300,function(){f(this).hide()}),n._ul.find("li").eq(n._activeNews).css({top:-30,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({top:0,opacity:1},300));break;case"slide-up":n._totalNews<=1?n._ul.find("li").animate({top:-30,opacity:0},300,function(){f(this).css({top:30,opacity:0,display:"block"}),f(this).animate({top:0,opacity:1},300)}):(n._ul.find("li:visible").animate({top:-30,opacity:0},300,function(){f(this).hide()}),n._ul.find("li").eq(n._activeNews).css({top:30,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({top:0,opacity:1},300));break;case"slide-right":n._totalNews<=1?n._ul.find("li").animate({left:"50%",opacity:0},300,function(){f(this).css({left:-50,opacity:0,display:"block"}),f(this).animate({left:0,opacity:1},300)}):(n._ul.find("li:visible").animate({left:"50%",opacity:0},300,function(){f(this).hide()}),n._ul.find("li").eq(n._activeNews).css({left:-50,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({left:0,opacity:1},300));break;case"slide-left":n._totalNews<=1?n._ul.find("li").animate({left:"-50%",opacity:0},300,function(){f(this).css({left:"50%",opacity:0,display:"block"}),f(this).animate({left:0,opacity:1},300)}):(n._ul.find("li:visible").animate({left:"-50%",opacity:0},300,function(){f(this).hide()}),n._ul.find("li").eq(n._activeNews).css({left:"50%",opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({left:0,opacity:1},300));break;default:n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).show()}},r=function(){if(n._pause=!1,n.settings.autoPlay)switch(n.settings.effect){case"scroll":"rtl"===n.settings.direction?n._ul.width()>n._news.width()?l():n._ul.css({marginRight:0}):n._ul.width()>n._news.width()?s():n._ul.css({marginLeft:0});break;default:n.pause(),n._interval=setInterval(function(){n.next()},n.settings.interval)}},d=function(){n._element.width()<480?(n._label.hide(),"rtl"==n.settings.direction?n._news.css({right:0}):n._news.css({left:0})):(n._label.show(),"rtl"==n.settings.direction?n._news.css({right:n._label.outerWidth()}):n._news.css({left:n._label.outerWidth()}))};n.init=function(){n.settings=f.extend({},i,e),n._element.addClass("bdt-effect-"+n.settings.effect+" bdt-direction-"+n.settings.direction),function(){if(0<n._label.length&&("rtl"==n.settings.direction?n._news.css({right:n._label.outerWidth()}):n._news.css({left:n._label.outerWidth()})),0<n._controls.length){var t=n._controls.outerWidth();"rtl"==n.settings.direction?n._news.css({left:t}):n._news.css({right:t})}if("scroll"===n.settings.effect){var e=0;n._li.each(function(){e+=f(this).outerWidth()}),e+=50,n._ul.css({width:e})}}(),"scroll"!=n.settings.effect&&o(),r(),n.settings.autoPlay?n._action.find("span").removeClass("bdt-news-ticker-play").addClass("bdt-news-ticker-pause"):n._action.find("span").removeClass("bdt-news-ticker-pause").addClass("bdt-news-ticker-play"),n._element.on("mouseleave",function(t){var e=f(document.elementFromPoint(t.clientX,t.clientY)).parents(".bdt-breaking-news")[0];f(this)[0]!==e&&(!0===n.settings.pauseOnHover?!0===n.settings.autoPlay&&n.play():!0===n.settings.autoPlay&&!0===n._pause&&n.play())}),n._element.on("mouseenter",function(){!0===n.settings.pauseOnHover&&n.pause()}),n._next.on("click",function(){n._controlsIsActive&&(n._controlsIsActive=!1,n.pause(),n.next())}),n._prev.on("click",function(){n._controlsIsActive&&(n._controlsIsActive=!1,n.pause(),n.prev())}),n._action.on("click",function(){n._controlsIsActive&&(n._action.find("span").hasClass("bdt-news-ticker-pause")?(n._action.find("span").removeClass("bdt-news-ticker-pause").addClass("bdt-news-ticker-play"),n.stop()):(n.settings.autoPlay=!0,n._action.find("span").removeClass("bdt-news-ticker-play").addClass("bdt-news-ticker-pause")))}),d(),f(window).on("resize",function(){d(),n.pause(),n.play()})},n.pause=function(){n._pause=!0,clearInterval(n._interval),cancelAnimationFrame(n._frameId)},n.stop=function(){n._pause=!0,n.settings.autoPlay=!1},n.play=function(){r()},n.next=function(){!function(){switch(n.settings.effect){case"scroll":a();break;default:n._activeNews++,n._activeNews>=n._totalNews&&(n._activeNews=0),o()}}()},n.prev=function(){!function(){switch(n.settings.effect){case"scroll":c();break;default:n._activeNews--,n._activeNews<0&&(n._activeNews=n._totalNews-1),o()}}()},n.init()},f.fn.epNewsTicker=function(e){return this.each(function(){if(null==f(this).data("epNewsTicker")){var t=new f.epNewsTicker(this,e);f(this).data("epNewsTicker",t)}})}}(jQuery),function(t,e){"use strict";var i=function(t,e){var i=t.find(".bdt-news-ticker"),n=i.data("settings");i.length&&e(i).epNewsTicker(n)};jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/bdt-news-ticker.default",i)})}(jQuery,window.elementorFrontend);