").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.dotsData||(this._templates=[t("
").addClass(i.dotClass).append(t("
")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",t.proxy(function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(s,i.dotsSpeed)},this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s;for(t in this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),a=this._core.settings,o=a.center||a.autoWidth||a.dotsData?1:a.dotsEach||a.items;if("page"!==a.slideBy&&(a.slideBy=Math.min(a.slideBy,a.items)),a.dots||"page"==a.slideBy)for(this._pages=[],t=i,e=0,0;t
=o||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+o-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),a=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!a&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!a&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.sbyOwlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,function(t,e){return t===s?e:null}).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);void 0!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)},this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.sbyOwlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){function n(e,i){var n=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+r.join(a+" ")+a).split(" "),function(t,e){if(o[e]!==s)return n=!i||e,!1}),n}function a(t){return n(t,!0)}var o=t("").get(0).style,r="Webkit Moz O ms".split(" "),l={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},d=function(){return!!n("transform")},h=function(){return!!n("perspective")},c=function(){return!!n("animation")};(function(){return!!n("transition")})()&&(t.support.transition=new String(a("transition")),t.support.transition.end=l.transition.end[t.support.transition]),c()&&(t.support.animation=new String(a("animation")),t.support.animation.end=l.animation.end[t.support.animation]),d()&&(t.support.transform=new String(a("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){Owl2row=function(e){this.owl=e,this.owl.options=t.extend({},Owl2row.Defaults,this.owl.options),this.handlers={"initialize.owl.carousel":t.proxy(function(t){this.owl.settings.owl2row&&this.build2row(this)},this)},this.owl.$element.on(this.handlers)},Owl2row.Defaults={owl2row:!1,owl2rowTarget:"sby_item",owl2rowContainer:"sby_owl2row-item",owl2rowDirection:"utd"},Owl2row.prototype.build2row=function(e){var i=t(e.owl.$element),s=i.find("."+e.owl.options.owl2rowTarget),n=[],a=[];switch(t.each(s,function(t,e){t%2==0?n.push(e):a.push(e)}),e.owl.options.owl2rowDirection){case"ltr":e.leftToright(e,i,s);break;default:e.upTodown(e,n,a,i)}},Owl2row.prototype.leftToright=function(e,i,s){var n=e.owl.options.owl2rowContainer,a=e.owl.options.margin,o=s.length,r=[],l=[];o%2==1?o=(o-1)/2+1:o/=2,t.each(s,function(t,e){t '),d=r[e];d.style.marginBottom=a+"px",o.append(d).append(l[e]),i.append(o)})},Owl2row.prototype.upTodown=function(e,i,s,n){var a=e.owl.options.owl2rowContainer,o=e.owl.options.margin;t.each(i,function(e,r){var l=t('
'),d=i[e];d.style.marginBottom=o+"px",l.append(d).append(s[e]),n.append(l)})},Owl2row.prototype.destroy=function(){},t.fn.sbyOwlCarousel.Constructor.Plugins.owl2row=Owl2row}(window.Zepto||window.jQuery,window,document),function(t){function e(){this.feeds={},this.ctas={},this.options=sbyOptions,this.isTouch=function(){if("ontouchstart"in document.documentElement)return!0;return!1}()}function i(t,e,i){this.el=t,this.index=e,this.settings=i,this.placeholderURL=window.sby.options.placeholder,i.narrowPlayer&&(this.placeholderURL=window.sby.options.placeholderNarrow),this.playerAPIReady=!1,this.consentGiven=i.consentGiven,this.players={},this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1,this.mostRecentlyLoadedPosts=[]}function s(e,s,n){i.call(this,e,s,n),this.CTA={},this.initLayout=function(){this.initGalleryLayout(),this.initGrid(),this.initCarousels();var t=jQuery.Event("sbyafterlayoutinit");t.feed=this,jQuery(window).trigger(t)},this.initGrid=function(){if(window.sbySemiEagerLoading&&jQuery("#sby_lightbox").length){var e=this;playerID="sby_lb-player",jQuery("#sby_lightbox").addClass("sby_video_lightbox");var i=t(this.el).find("sby_item").first().attr("data-video-id"),s=sbyOptions.autoplay;if(void 0===window.sbyLightboxPlayer){var n={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:i,playerVars:{modestbranding:1,rel:0,autoplay:s},events:{onStateChange:function(i){var s=i.target.getVideoData().video_id;e.afterStateChange(playerID,s,i,t("#"+playerID).closest(".sby_video_thumbnail_wrap"))}}};e.maybeAddCTA(playerID),window.sbyLightboxPlayer=new window.YT.Player(playerID,n)}}},this.initCarousels=function(){var e=this,i=t(this.el);if(void 0!==this.settings.general.carousel){var s=this.settings.cols,n=this.settings.colsmobile;i.find(".sby_items_wrap").addClass("sby_carousel"),i.find(".sby_load_btn").remove(),i.find(".sby_item").css({"padding-top":i.find(".sby_items_wrap").css("padding-top"),"padding-right":i.find(".sby_items_wrap").css("padding-top"),"padding-bottom":i.find(".sby_items_wrap").css("padding-top"),"padding-left":i.find(".sby_items_wrap").css("padding-top")}),i.find(".sby_item").each(function(){t(this).attr("style",t(this).attr("style").replace("padding: "+i.find(".sby_items_wrap").css("padding-top"),"padding: "+i.find(".sby_items_wrap").css("padding-top")+" !important"))});var a=e.settings.general.carousel[0],o=e.settings.general.carousel[1],r=e.settings.general.carousel[2],l=e.settings.general.carousel[3],d=e.settings.general.carousel[4],h=e.settings.general.carousel[5];r||(l=!1);var c=s,u=s,y=(a=a?"onhover":"hide",r=!1!==l,2==h);d=!d;i.hasClass("sby_mob_col_auto")?(c=2,2!=parseInt(s)&&(u=1),2==parseInt(s)&&(u=2)):u=n,this.carouselArgs={items:s,loop:d,rewind:!d,autoplay:r,autoplayTimeout:Math.max(l,2e3),autoplayHoverPause:!0,nav:!0,navText:[' ',' '],dots:o,owl2row:y,responsive:{0:{items:u},480:{items:c},640:{items:s}},onChange:function(){setTimeout(function(){e.afterResize()},250)},onInitialize:function(){var t=jQuery(e.el);t.find(".sby_items_wrap.sby_carousel").fadeIn(),setTimeout(function(){t.find(".sby_items_wrap.sby_carousel .sby_info, .sby_owl2row-item,.sby_items_wrap.sby_carousel").fadeIn()},50),setTimeout(function(){var e=t.find(".sby-owl-nav");if("onhover"===a);else if("below"===a){var i=t.find(".sby-owl-dots"),s=t.find(".sby-owl-prev"),n=t.find(".sby-owl-next"),o=t.find(".sby-owl-nav"),r=t.find(".sby-owl-dot"),l=r.length*r.innerWidth();t.innerWidth(),s.after(i),o.css("position","relative"),n.css("position","absolute").css("top","-6px").css("right",Math.max(.5*o.innerWidth()-.5*l-n.innerWidth()-6,0)),s.css("position","absolute").css("top","-6px").css("left",Math.max(.5*o.innerWidth()-.5*l-s.innerWidth()-6,0))}else"hide"===a&&e.addClass("hide").hide()},100)}}}},this.stripEmojihtml=function(e){return e.find(".emoji").each(function(){t(this).replaceWith(t(this).attr("alt"))}),e.html()},this.afterItemRevealed=function(t){var e=this;if(t.find(".sby_caption").length&&!t.find(".sby_caption").hasClass("sby_full_caption")){var i=t.find(".sby_item_caption_wrap .sby_caption"),s=t.find(".sby_item_video_thumbnail .sby_caption"),n=void 0!==e.settings.general.descriptionlength?parseInt(e.settings.general.descriptionlength):150;n<1&&(n=99999);var a=this.stripEmojihtml(t.find(".sby_caption").first()),o=(a.match(/ /g)||[]).length;if((void 0===sbyOptions.brAdjust||"1"===sbyOptions.brAdjust||!0===sbyOptions.brAdjust)&&o>0&&a.indexOf(" ")20?r.width():t.width(),fontSize=r.css("font-size"),charactersPerLine=captionWidth/parseInt(fontSize)*1.85,maxCharsPerLine=Math.floor(charactersPerLine),projectedMaxLines=Math.ceil(n/charactersPerLine);var l=a.split(" "),d=0,h=0;jQuery.each(l,function(){var t=projectedMaxLines-d;if(t>0){var e=Math.max(1,Math.ceil(this.length/charactersPerLine));h+=Math.min(this.length+4,t*maxCharsPerLine),d+=e}}),n=h}var c=a.substring(0,n);if(c=c.substr(0,Math.min(c.length,c.lastIndexOf(" "))),i.length&&(i.html(sbyLinkify(c)),c===a&&i.next(".sby_expand").remove()),s.length){var u=c;c!==a&&(u+='... '),s.html(u)}a.length>n&&t.find(".sby_expand").show(),t.find(".sby_expand a").off("click").on("click",function(s){s.preventDefault();jQuery(this);i=void 0!==i?i:t.find(".sby_info .sby_caption"),a="undefined"!=typeof captiontext?a:t.find(".sby_item_video_thumbnail").attr("data-title"),t.hasClass("sby_caption_full")&&void 0!==c?(i.html(c),t.removeClass("sby_caption_full")):(i.html(sbyLinkify(a)),t.addClass("sby_caption_full")),e.afterResize()})}this.setUpCTA(t);var y=void 0!==e.settings.general.disablelightbox&&e.settings.general.disablelightbox,g=void 0!==e.settings.general.captionlinks&&e.settings.general.captionlinks;if(y||g){if(g){var p="";void 0!==t.find("img").attr("alt")?p=t.find("img").attr("alt"):void 0!==t.find("video").attr("alt")&&(p=t.find("video").attr("alt"));var b=p.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g);b&&t.find("a").attr("href",b)}t.find(".sby_link").addClass("sby_disable_lightbox")}else{var f=t.find(".sby_photo_wrap"),m=f.find(".sby_link");feedOptions={hovereffect:"true"},"none"==feedOptions.hovereffect?(m.css("background","none").show(),m.find("*").hide().end().find(".sby_link_area").show()):f.on("mouseenter mouseleave",function(e){switch(e.type){case"mouseenter":t.addClass("sby_animate");break;case"mouseleave":t.removeClass("sby_animate")}})}var _=void 0!==t.attr("data-video-id")?t.attr("data-video-id"):t.find(".sby_video_thumbnail").attr("data-video-id");this.mostRecentlyLoadedPosts.push(_)},this.afterFeedSet=function(){void 0!==this.carouselArgs&&(t(this.el).find(".sby_carousel").sbyOwlCarousel(this.carouselArgs),2===parseInt(this.settings.general.carousel[5])&&t(this.el).addClass("sby_carousel_2_row"))},this.setUpCTA=function(t,e){e=void 0!==e?e:t.find(".sby_item_video_thumbnail").attr("data-video-id");var i=void 0!==t.find(".sby_item_video_thumbnail").attr("data-title")?t.find(".sby_item_video_thumbnail").attr("data-title"):"",s=window.sby.ctaDetect(i);window.sby.ctas[e]=s||this.getDefaultCTA()},this.getDefaultCTA=function(){return void 0!==this.settings.general.cta&&"default"!==this.settings.general.cta.type&&("link"===this.settings.general.cta.type?{callback:"link",url:this.settings.general.cta.defaultLink,text:this.settings.general.cta.defaultText}:{callback:"related",related:this.settings.general.cta.defaultPosts})},this.afterResize=function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass(),this.setAllCTADimensions(),this.sizePlayer(),this.sizeItems()},this.setAllCTADimensions=function(){t.each(this.CTA,function(t,e){e.isInitialized&&e.setCTAStyles()})},this.afterSendCheckWPPostsToServer=function(e){var i=t(this.el);i.find(".sby_item").each(function(){if(void 0!==e[t(this).attr("data-video-id")]){var i=e[t(this).attr("data-video-id")];t(this).find(".sby_view_count").text(i.sby_view_count),t(this).find(".sby_comment_count").text(i.sby_comment_count),t(this).find(".sby_like_count").text(i.sby_like_count),"none"!==i.sby_live_broadcast.broadcast_type&&(t(this).find(".sby_ls_message").text(i.sby_live_broadcast.live_streaming_string),t(this).find(".sby_date").html(i.sby_live_broadcast.live_streaming_date)),void 0!==i.sby_live_broadcast.live_streaming_timestamp&&t(this).attr("data-live-date",i.sby_live_broadcast.live_streaming_timestamp),void 0!==i.sby_description&&t(this).find(".sby_item_video_thumbnail").attr("data-title",i.sby_description)}}),i.find(".sby_player_item").each(function(){if(void 0!==e[t(this).find(".sby_video_thumbnail").attr("data-video-id")]){var i=e[t(this).find(".sby_video_thumbnail").attr("data-video-id")];t(this).find(".sby_view_count").text(i.sby_view_count),t(this).find(".sby_comment_count").text(i.sby_comment_count),t(this).find(".sby_like_count").text(i.sby_like_count),"none"!==i.sby_live_broadcast.broadcast_type&&(t(this).find(".sby_ls_message").text(i.sby_live_broadcast.live_streaming_string),t(this).find(".sby_date").html(i.sby_live_broadcast.live_streaming_date)),void 0!==i.sby_live_broadcast.live_streaming_timestamp&&t(this).attr("data-live-date",i.sby_live_broadcast.live_streaming_timestamp)}});var n=jQuery.Event("sbyaftercheckposts");n.feed=window.sby.feeds[s],n.response=e,jQuery(window).trigger(n)},this.afterStateChange=function(t,e,i,s){this.CTA[t].toggleCTA(e,i.data,s)},this.changePlayerInfo=function(e){t(this.el).find(".sby_player_item").find(".sby_info").replaceWith(e.find(".sby_info").clone(!0,!0))},this.maybeAddCTA=function(t,e){void 0===this.CTA[t]&&(this.CTA[t]=new o(t,this))}}function n(){}function a(){n.call(this),this.getData=function(t){return{feedIndex:parseInt(t.closest(".sb_youtube").attr("data-sby-index")-1),link:t.attr("href"),video:t.attr("data-video-id"),title:t.attr("data-title"),videoTitle:void 0!==t.attr("data-video-title")?t.attr("data-video-title"):"YouTube Video",avatar:t.attr("data-avatar"),user:t.attr("data-user"),channelURL:t.attr("data-url")}},this.template=function(){return"
"},this.beforePlayerSetup=function(e,i,s,n,a){e.find(".sby_cta_items_wraps").length?e.find(".sby_cta_items_wraps").replaceWith(t(a.el).find(".sby_cta_items_wraps").clone()):e.find(".sby_lb_video_thumbnail_wrap").append(t(a.el).find(".sby_cta_items_wraps").clone())},this.afterPlayerSetup=function(t,e,i,s){this.availableAvatarUrls={};var n=e.title;void 0!==n&&""!==n&&(n=n.replace(/(>#)/g,"> #")),n=n?sbyLinkify(n):"","function"==typeof sbyLightboxAction&&setTimeout(function(){sbyLightboxAction()},100);var a="",o="";void 0!==e.avatar&&""!==e.avatar&&void 0!==e.user?(a="undefined"!==e.avatar?' ':"",o=''+a+"@"+e.user+"
"):void 0!==e.user&&jQuery.each(window.sby.feeds,function(){void 0!==this.availableAvatarUrls&&void 0!==this.availableAvatarUrls[e.user]&&"undefined"!==this.availableAvatarUrls[e.user]&&(a=' ')}),t.find(".sby_lb-caption").html(o+''+n+" ").fadeIn("fast")}}function o(t,e){this.isInitialized=!1,this.videoID=t,this.callback=this.related,this.callbackArgs={},this.feedObjInContext=e,this.state=1,this.numItems=4,this.numItemColumns=2,this.$player=!1}function r(e,i){t.ajax({url:sbyOptions.adminAjaxUrl,type:"post",data:e,success:i})}e.prototype={createPage:function(e,i){void 0!==window.sbyajaxurl&&-1!==window.sbyajaxurl.indexOf(window.location.hostname)||(window.sbyajaxurl=window.location.hostname+"/wp-admin/admin-ajax.php"),t(".sby_no_js_error_message").remove(),t(".sby_no_js").removeClass("sby_no_js"),e(i)},maybeAddYTAPI:function(){if(null===document.getElementById("sby-youtube-api")){var t=document.createElement("script"),e=document.getElementsByTagName("script")[0];t.src="https://www.youtube.com/iframe_api",t.id="sby-youtube-api",e.parentNode.insertBefore(t,e)}},createLightbox:function(){var e,i=new a,s=(e=0,function(t,i){clearTimeout(e),e=setTimeout(t,i)});jQuery(window).on("resize",function(){s(function(){i.afterResize()},200)}),function(){var e=jQuery,s=function(){function t(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return t.prototype.albumLabel=function(t,e){return t+" / "+e},t}(),n=function(){function s(t){this.options=t,this.album=[],this.currentImageIndex=void 0,this.init()}return s.prototype.init=function(){this.enable(),this.build()},s.prototype.enable=function(){var t=this;e("body").on("click","a[data-sby-lightbox]",function(i){return t.start(e(i.currentTarget)),!1})},s.prototype.build=function(){var t=this;e(""+i.template()).appendTo(e("body")),this.$lightbox=e("#sby_lightbox"),this.$overlay=e("#sby_lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".sby_lb-outerContainer"),this.$container=this.$lightbox.find(".sby_lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return t.end(),!1}),jQuery(document).on("click",function(t,e,s){jQuery(t.target).closest(".sby_lb-outerContainer").length||jQuery(t.target).closest(".sby_lb-dataContainer").length||(i.pausePlayer(),jQuery("#sby_lightboxOverlay, #sby_lightbox").fadeOut())}),this.$lightbox.hide(),jQuery("#sby_lightboxOverlay").on("click",function(s){return i.pausePlayer(),"sby_lightbox"===e(s.target).attr("id")&&t.end(),!1}),this.$lightbox.find(".sby_lb-prev").on("click",function(){return i.pausePlayer(),t.changeImage(0===t.currentImageIndex?t.album.length-1:t.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-container").on("swiperight",function(){return i.pausePlayer(),t.changeImage(0===t.currentImageIndex?t.album.length-1:t.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-next").on("click",function(){return i.pausePlayer(),t.changeImage(t.currentImageIndex===t.album.length-1?0:t.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-container").on("swipeleft",function(){return i.pausePlayer(),t.changeImage(t.currentImageIndex===t.album.length-1?0:t.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-loader, .sby_lb-close").on("click",function(){return i.pausePlayer(),t.end(),!1})},s.prototype.start=function(t){function s(t){n.album.push(i.getData(t))}var n=this,a=e(window);a.on("resize",e.proxy(this.sizeOverlay,this)),e("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var o,r=0,l=t.attr("data-sby-lightbox");if(l){o=e(t.prop("tagName")+'[data-sby-lightbox="'+l+'"]');for(var d=0;dl||n.height>r)&&(n.width/l>n.height/r?(o=l,a=parseInt(n.height/(n.width/o),10),s.width(o),s.height(a)):(a=r,o=parseInt(n.width/(n.height/a),10),s.width(o),s.height(a)))),i.sizeContainer(s.width(),s.height())},n.src=this.album[t].link,this.currentImageIndex=t},s.prototype.sizeOverlay=function(){this.$overlay.width(e(window).width()).height(e(document).height())},s.prototype.sizeContainer=function(t,e){function i(){s.$lightbox.find(".sby_lb-dataContainer").width(o),s.$lightbox.find(".sby_lb-prevLink").height(r),s.$lightbox.find(".sby_lb-nextLink").height(r),s.showImage()}var s=this,n=this.$outerContainer.outerWidth(),a=this.$outerContainer.outerHeight(),o=t+this.containerLeftPadding+this.containerRightPadding,r=e+this.containerTopPadding+this.containerBottomPadding;n!==o||a!==r?this.$outerContainer.animate({width:o,height:r},this.options.resizeDuration,"swing",function(){i()}):i()},s.prototype.showImage=function(){this.$lightbox.find(".sby_lb-loader").hide(),this.$lightbox.find(".sby_lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},s.prototype.updateNav=function(){var t=!1;try{document.createEvent("TouchEvent"),t=!!this.options.alwaysShowNavOnTouchDevices}catch(t){}this.$lightbox.find(".sby_lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(t&&this.$lightbox.find(".sby_lb-prev, .sby_lb-next").css("opacity","1"),this.$lightbox.find(".sby_lb-prev, .sby_lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".sby_lb-prev").show(),t&&this.$lightbox.find(".sby_lb-prev").css("opacity","1")),this.currentImageIndex ')}i.afterPlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album),this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".sby_lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".sby_lb-number").hide()}},s.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&((new Image).src=this.album[this.currentImageIndex-1].link)},s.prototype.enableKeyboardNav=function(){e(document).on("keyup.keyboard",e.proxy(this.keyboardAction,this))},s.prototype.disableKeyboardNav=function(){e(document).off(".keyboard")},s.prototype.keyboardAction=function(e){var s=event.keyCode,n=String.fromCharCode(s).toLowerCase();27===s||n.match(/x|o|c/)?(sby_supports_video()&&t("#sby_lightbox video.sby_video")[0].pause(),t("#sby_lightbox iframe").attr("src",""),this.end()):"p"===n||37===s?(0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1),sby_supports_video()&&t("#sby_lightbox video.sby_video")[0].pause(),t("#sby_lightbox iframe").attr("src","")):"n"!==n&&39!==s||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0),i.pausePlayer())},s.prototype.end=function(){this.disableKeyboardNav(),e(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),e("select, object, embed").css({visibility:"visible"})},s}();e(function(){var e=new s;new n(e),t(".sby_lightbox_action a").off().on("click",function(){t(this).parent().find(".sby_lightbox_tooltip").toggle()})})}.call(this)},createFeeds:function(e){window.sby.createLightbox(),e.whenFeedsCreated(t(".sb_youtube").each(function(e){t(this).attr("data-sby-index",e+1),t(this).find(".sby_player").replaceWith('
');var i=t(this),n=void 0!==i.attr("data-sby-flags")?i.attr("data-sby-flags").split(","):[],a=void 0!==i.attr("data-options")?JSON.parse(i.attr("data-options")):{};if(n.indexOf("testAjax")>-1){window.sby.triggeredTest=!0;r({action:"sby_on_ajax_test_trigger"},function(t){console.log("did test")})}var o={cols:i.attr("data-cols"),colsmobile:"same"!==i.attr("data-colsmobile")?i.attr("data-colsmobile"):i.attr("data-cols"),num:i.attr("data-num"),imgRes:i.attr("data-res"),feedID:i.attr("data-feedid"),postID:"undefind"!=typeof i.attr("data-postid")?i.attr("data-postid"):"unknown",shortCodeAtts:i.attr("data-shortcode-atts"),resizingEnabled:-1===n.indexOf("resizeDisable"),imageLoadEnabled:-1===n.indexOf("imageLoadDisable"),debugEnabled:n.indexOf("debug")>-1,favorLocal:n.indexOf("favorLocal")>-1,ajaxPostLoad:n.indexOf("ajaxPostLoad")>-1,checkWPPosts:n.indexOf("checkWPPosts")>-1,singleCheckPosts:n.indexOf("singleCheckPosts")>-1,narrowPlayer:n.indexOf("narrowPlayer")>-1,gdpr:n.indexOf("gdpr")>-1,consentGiven:-1===n.indexOf("gdpr"),noCDN:n.indexOf("disablecdn")>-1,lightboxEnabled:void 0!==i.attr("data-sby-supports-lightbox"),locator:n.indexOf("locator")>-1,autoMinRes:1,general:a};window.sby.feeds[e]=function(t,e,i){return new s(t,e,i)}(this,e,o),void 0!==window.sbyAPIReady&&(window.sby.feeds[e].playerAPIReady=!0),window.sby.feeds[e].setResizedImages(),window.sby.feeds[e].init();var l=jQuery.Event("sbyafterfeedcreate");l.feed=window.sby.feeds[e],jQuery(window).trigger(l)}))},afterFeedsCreated:function(){if(t(".sb_youtube_header").each(function(){var e=t(this);e.find(".sby_header_link").on("mouseenter mouseleave",function(t){switch(t.type){case"mouseenter":e.find(".sby_header_img_hover").addClass("sby_fade_in");break;case"mouseleave":e.find(".sby_header_img_hover").removeClass("sby_fade_in")}})}),window.sbyAPIReady){var e=jQuery.Event("sbyfeedandytready");jQuery(window).trigger(e)}},encodeHTML:function(t){return void 0===t?"":t.replace(/(>)/g,">").replace(/(<)/g,"<").replace(/(<br\/>)/g," ").replace(/(<br>)/g," ")},urlDetect:function(t){return t.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)},ctaDetect:function(t){var e=t.match(/{Link:(.*)}/g),i=!1;if(null!==e){var s=window.sby.urlDetect(e[0]);if(null!==s){var n=s[0].trim();i={callback:"link",url:n,text:e[0].replace("{Link:","").replace("}","").replace(n,"").replace(" "," ").trim()}}else console.log("CTA found but no URL")}return i},shuffle:function(t){for(var e,i,s=t.length;0!==s;)i=Math.floor(Math.random()*s),e=t[s-=1],t[s]=t[i],t[i]=e;return t}},i.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),e.settings.consentGiven&&window.sby.maybeAddYTAPI(),e.settings.noCDN&&!e.settings.consentGiven&&(t(this.el).find(".sb_youtube_header").length?t(this.el).find(".sb_youtube_header").addClass("sby_no_consent"):t(this.el).prev(".sb_youtube_header").length&&t(this.el).prev(".sb_youtube_header").addClass("sby_no_consent")),t(this.el).find("#sby_mod_error").length&&t(this.el).prepend(t(this.el).find("#sby_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var i,s=(i=0,function(t,e){clearTimeout(i),i=setTimeout(t,e)});jQuery(window).on("resize",function(){s(function(){e.afterResize()},500)})},initLayout:function(){this.initGalleryLayout()},initGalleryLayout:function(){var e=t(this.el),i=this;e.hasClass("sby_layout_gallery")&&e.find(".sby_player_outer_wrap").length&&(this.maybeRaiseSingleImageResolution(e.find(".sby_player_outer_wrap"),0,!0),e.find(".sby_player_outer_wrap .sby_video_thumbnail").off().on("click",function(e){if((!i.settings.lightboxEnabled||i.settings.lightboxEnabled&&i.settings.noCDN)&&(i.settings.noCDN||!i.settings.consentGiven))return t(this).closest(".sby_item").length,void(void 0!==t(this).closest(".sby_item").attr("data-video-id")&&t(this).attr("href","https://www.youtube.com/watch?v="+t(this).closest(".sby_item").attr("data-video-id")));e.preventDefault(),i.onThumbnailClick(t(this),!0)}),e.find(".sby_item").first().addClass("sby_current"),e.on("mouseenter",function(){i.canCreatePlayer()&&(e.find(".sby_player_outer_wrap iframe").length?void 0===i.player&&i.playerEagerLoaded()&&i.createPlayer("sby_player"+i.index):(e.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),e.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),i.createPlayer("sby_player"+i.index)))}),window.sbySemiEagerLoading&&i.createPlayer("sby_player"+i.index),i.settings.noCDN&&e.find(".sby_player_outer_wrap").append(''))},createPlayer:function(e,i,s,n){var a=t(this.el),o=this;if(i=void 0!==i?i:this.getVideoID(a.find(".sby_item").first()),s=void 0!==s?s:0,void 0===n&&(n={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:i,playerVars:{modestbranding:1,rel:0,autoplay:s}}),void 0===n.events&&(n.events={onReady:function(){a.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden"),t("#"+e).length&&t("#"+e).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").length&&t("#"+e).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").fadeTo(0,"slow",function(){t(this).css("z-index",-1),t(this).find(".sby_loader").hide().addClass("sby_hidden"),t(this).closest(".sby_item").removeClass("sby_player_loading")});var i=jQuery.Event("sbyafterplayerready");i.feed=o,i.player=this,jQuery(window).trigger(i)},onStateChange:function(s){a.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden"),o.afterStateChange(e,i,s,t("#"+e).closest(".sby_video_thumbnail_wrap")),1===s.data&&void 0!==o.players&&a.find(".sby_item").each(function(){var e=o.getVideoID(t(this));t(this).find("iframe").length&&e!==i&&void 0!==o.players[e]&&"function"==typeof o.players[e].pauseVideo&&o.players[e].pauseVideo()})}}),window.sbyEagerLoading)var r=YT.get(e);else r=new window.YT.Player(e,n);this.maybeAddCTA(e),a.hasClass("sby_layout_list")&&void 0===this.players[i]?this.players[i]=r:void 0===this.player&&(this.player=r);var l=jQuery.Event("sbyafterplayercreated");return l.feed=this,jQuery(window).trigger(l),r},afterStateChange:function(t,e,i,s){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraItemsForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),this.afterFeedSet(),this.sizePlayer(),this.sizeItems(),this.settings.consentGiven?this.applyFullFeatures():this.removeFeatures()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(t){t.find(".sby_loader").removeClass("sby_hidden"),t.find(".sby_btn_text").addClass("sby_hidden"),t.closest(".sb_youtube").find(".sby_num_diff_hide").addClass("sby_transition").removeClass("sby_num_diff_hide")},afterNewImagesLoaded:function(){var e=t(this.el),i=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),this.sizePlayer(),this.sizeItems(),setTimeout(function(){e.find(".sby_loader").addClass("sby_hidden"),e.find(".sby_btn_text").removeClass("sby_hidden"),i.maybeRaiseImageResolution()},500),this.settings.consentGiven?this.applyFullFeatures():this.removeFeatures()},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},afterFeedSet:function(){},sizePlayer:function(){var e=t(this.el),i=this;if(e.hasClass("sby_layout_gallery")){$playerThumbnail=e.find(".sby_player_item").find(".sby_player_video_thumbnail");var s=$playerThumbnail.innerWidth(),n=Math.floor(9*s/16);i.settings.narrowPlayer&&(n=Math.floor(3*s/4)),$playerThumbnail.css("height",n+"px").css("overflow","hidden")}else e.hasClass("sby_layout_list")&&e.find(".sby_item").each(function(){$playerThumbnail=t(this).find(".sby_item_video_thumbnail");var e=$playerThumbnail.innerWidth(),s=Math.floor(9*e/16);i.settings.narrowPlayer&&(s=Math.floor(3*e/4)),$playerThumbnail.css("height",s+"px").css("overflow","hidden")})},sizeItems:function(){var e=t(this.el);e.hasClass("sby_layout_list")||e.find(".sby_item").find(".sby_item_video_thumbnail").each(function(){if(t(this).hasClass("sby_imgLiquid_ready")){var e=t(this).innerWidth(),i=Math.floor(9*e/16);t(this).css("height",i+"px").css("overflow","hidden")}})},revealNewImages:function(){var e=t(this.el),i=this;this.applyImageLiquid(),"function"==typeof sbyCustomJS&&setTimeout(function(){sbyCustomJS()},100),e.find(".sby-screenreader").find("img").remove(),e.find(".sby_item.sby_new").each(function(e){var s=jQuery(this);videoID=s.attr("data-video-id"),window.sbyEagerLoading&&i.canCreatePlayer()&&t("#sby_player_"+videoID).length&&(player=new YT.Player("sby_player_"+videoID,{height:"100",width:"100",videoId:videoID,playerVars:{modestbranding:1,rel:0,autoplay:0},events:{onStateChange:function(t){t.target.getVideoData().video_id;1===t.data&&s.find(".sby_item").each(function(){var e=jQuery(this).attr("data-video-id");jQuery(this).find("iframe").length&&jQuery(t.target.a).attr("id")!==jQuery(this).find("iframe").attr("id")&&YT.get("sby_player_"+e).pauseVideo()})}}})),s.find(".sby_video_thumbnail").on("mouseenter",function(){i.onThumbnailEnter(t(this),!1)}),s.find(".sby_player_wrap").on("mouseleave",function(){i.onThumbnailLeave(t(this),!1)}),s.find(".sby_video_thumbnail").on("click",function(e){if((!i.settings.lightboxEnabled||i.settings.lightboxEnabled&&i.settings.noCDN)&&(i.settings.noCDN||!i.settings.consentGiven))return t(this).closest(".sby_item").length,void(void 0!==t(this).closest(".sby_item").attr("data-video-id")&&t(this).attr("href","https://www.youtube.com/watch?v="+t(this).closest(".sby_item").attr("data-video-id")));e.preventDefault(),i.onThumbnailClick(t(this),!1)}),i.settings.lightboxEnabled&&(s.find(".sby_video_thumbnail").attr("data-sby-lightbox",i.index),"undefined"!=typeof sbyOptions&&void 0!==sbyOptions.lightboxPlaceholder&&(i.settings.narrowPlayer?s.find(".sby_video_thumbnail").attr("href",sbyOptions.lightboxPlaceholderNarrow):s.find(".sby_video_thumbnail").attr("href",sbyOptions.lightboxPlaceholder))),i.afterItemRevealed(s),""===s.find(".sby_info_item").text().trim()&&s.find(".sby_info_item").addClass("sby_no_space")}),e.find(".sby_player_item").each(function(t){var e=jQuery(this);i.afterItemRevealed(e)}),setTimeout(function(){e.find(".sby_item.sby_new").removeClass("sby_new");var t=10;e.find(".sby_transition").length;e.find(".sby_transition").each(function(e){var i=jQuery(this);setTimeout(function(){i.removeClass("sby_transition")},t),t+=10})},500)},afterItemRevealed:function(){},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.sendCheckWPPostsToServer(),this.settings.imageLoadEnabled||t(".sby_no_resraise").removeClass("sby_no_resraise");var e=t.Event("sbyafterimagesloaded");e.el=t(this.el),t(window).trigger(e)},setResizedImages:function(){t(this.el).find(".sby_resized_image_data").length&&void 0!==t(this.el).find(".sby_resized_image_data").attr("data-resized")&&0===t(this.el).find(".sby_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(t(this.el).find(".sby_resized_image_data").attr("data-resized")),t(this.el).find(".sby_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var i=t(this.el).find(".sby_item").length;r({action:"sby_resized_images_submit",needs_resizing:e.needsResizing,offset:i,feed_id:e.settings.feedID,location:e.locationGuess(),post_id:e.settings.postID,atts:e.settings.shortCodeAtts},function(t){if(0===t.trim().indexOf("{")){var i=JSON.parse(t);e.settings.debugEnabled&&console.log(i)}})}},sendCheckWPPostsToServer:function(){var e=this;if(e.settings.checkWPPosts||e.settings.singleCheckPosts){var i=void 0!==e.settings.feedID?e.settings.feedID:"sby_single",s=e.mostRecentlyLoadedPosts;e.mostRecentlyLoadedPosts=[];r({action:"sby_check_wp_submit",feed_id:i,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID,offset:t(this.el).hasClass("sby_layout_carousel")?Math.floor(t(this.el).find(".sby_item").length/2-1):t(this.el).find(".sby_item").length,posts:s},function(t){if(0===t.trim().indexOf("{")){var i=JSON.parse(t);e.settings.debugEnabled&&console.log(i),e.afterSendCheckWPPostsToServer(i)}})}},afterSendCheckWPPostsToServer:function(t){},loadMoreButtonInit:function(){var e=t(this.el),i=this;e.find(".sby_footer .sby_load_btn").off().on("click",function(){i.afterLoadMoreClicked(jQuery(this)),i.getNewPostSet()})},getNewPostSet:function(){var e=t(this.el),i=this;r({action:"sby_load_more_clicked",offset:e.find(".sby_item").length,feed_id:i.settings.feedID,atts:i.settings.shortCodeAtts,location:i.locationGuess(),post_id:i.settings.postID,current_resolution:i.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s),a=void 0!==n.feedStatus.checkWPPosts&&n.feedStatus.checkWPPosts;i.settings.debugEnabled&&console.log(n),i.settings.checkWPPosts=!!a,i.appendNewPosts(n.html),i.addResizedImages(n.resizedImages),i.settings.ajaxPostLoad?(i.settings.ajaxPostLoad=!1,i.afterInitialImagesLoaded()):i.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?i.outOfPages=!1:(i.outOfPages=!0,e.find(".sby_load_btn").hide()),t(".sby_no_js").removeClass("sby_no_js")}})},appendNewPosts:function(e){var i=t(this.el);i.find(".sby_items_wrap .sby_item").length?i.find(".sby_items_wrap .sby_item").last().after(e):i.find(".sby_items_wrap").append(e)},addResizedImages:function(t){for(var e in t)this.resizedImages[e]=t[e]},setImageHeight:function(){},maybeRaiseSingleImageResolution:function(e,i,s){var n=this,a=n.getImageUrls(e),o=e.find(".sby_video_thumbnail > img").attr("src"),r=150;s=void 0!==s&&s;if(!(e.hasClass("sby_no_resraise")||!n.settings.consentGiven&&n.settings.noCDN)){t.each(a,function(t,e){e===o&&(r=parseInt(t),s=!1)});var l=640;switch(n.settings.imgRes){case"thumb":l=120;break;case"medium":l=320;break;case"large":l=480;break;case"full":l=640;break;default:var d=Math.max(n.settings.autoMinRes,e.find(".sby_video_thumbnail").innerWidth());switch(n.getBestResolutionForAuto(d,1,t(this.el).find("sby_item").first())){case 480:l=480;break;case 320:l=320;break;case 120:l=120}}if(l>r||o===n.placeholderURL||s){if(n.settings.debugEnabled){var h=o===n.placeholderURL?"was placeholder":"too small";console.log("rais res for "+o,h)}var c=a[l];e.find(".sby_video_thumbnail > img").attr("src",c),e.find(".sby_video_thumbnail").hasClass("sby_imgLiquid_ready")&&e.find(".sby_video_thumbnail").css("background-image",'url("'+c+'")')}e.find("img").on("error",function(){if(t(this).hasClass("sby_img_error"))console.log("unfixed error "+t(this).attr("src"));else{if(t(this).addClass("sby_img_error"),t(this).attr("src").indexOf("i.ytimg.com")>-1)n.settings.favorLocal=!0,n.getImageUrls(t(this).closest(".sby_item"))[640];else void 0!==t(this).closest(".sby_video_thumbnail").attr("data-full-res")||t(this).closest(".sby_video_thumbnail").attr("href");setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var i=this,s=void 0!==e&&!0===e?".sby_item.sby_new":".sby_item",n=!i.isInitialized;t(i.el).find(s).each(function(e){!t(this).hasClass("sby_num_diff_hide")&&t(this).find(".sby_video_thumbnail").length&&void 0!==t(this).find(".sby_video_thumbnail").attr("data-img-src-set")&&i.maybeRaiseSingleImageResolution(t(this),e,n)}),i.isInitialized=!0},getBestResolutionForAuto:function(e,i,s){(isNaN(i)||i<1)&&(i=1);var n=e*i,a=10*Math.ceil(n/10),o=[120,320,480,640];if(s.hasClass("sby_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var r=!1;t.each(o,function(t,e){e>parseInt(a)&&!r&&(a=e,r=!0)})}return a},hideExtraItemsForWidth:function(){if("carousel"!==this.layout){var e=t(this.el),i=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):i;e.hasClass(".sby_layout_carousel")||(t(window).width()<480?s140&&a<240?e.addClass("sby_medium"):a<=140&&e.addClass("sby_small")},setMinImageWidth:function(){t(this.el).find(".sby_item .sby_video_thumbnail").first().length?this.minImageWidth=t(this.el).find(".sby_item .sby_video_thumbnail").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(t){var e=JSON.parse(t.find(".sby_video_thumbnail").attr("data-img-src-set").replace(/\\\//g,"/")),i=t.attr("id").replace("sby_","").replace("player_","");if(void 0!==this.resizedImages[i]&&"video"!==this.resizedImages[i]&&"pending"!==this.resizedImages[i]&&"error"!==this.resizedImages[i].id&&"video"!==this.resizedImages[i].id&&"pending"!==this.resizedImages[i].id){if(void 0!==this.resizedImages[i].sizes){var s=[];void 0!==this.resizedImages[i].sizes.full&&(s.push(640),e[640]=sbyOptions.resized_url+this.resizedImages[i].id+"full.jpg",t.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[i].id+"full.jpg"),t.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[i].id+"full.jpg")),void 0!==this.resizedImages[i].sizes.low&&(s.push(320),e[320]=sbyOptions.resized_url+this.resizedImages[i].id+"low.jpg",this.settings.favorLocal&&void 0===this.resizedImages[i].sizes.full&&(t.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[i].id+"low.jpg"),t.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[i].id+"low.jpg"))),void 0!==this.resizedImages[i].sizes.thumb&&(s.push(150),e[150]=sbyOptions.resized_url+this.resizedImages[i].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sbyOptions.resized_url+this.resizedImages[i].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sbyOptions.resized_url+this.resizedImages[i].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sbyOptions.resized_url+this.resizedImages[i].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sbyOptions.resized_url+this.resizedImages[i].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sbyOptions.resized_url+this.resizedImages[i].id+"full.jpg")))}}else(void 0===this.resizedImages[i]||void 0!==this.resizedImages[i].id&&"pending"!==this.resizedImages[i].id&&"error"!==this.resizedImages[i].id)&&this.addToNeedsResizing(i);return e},getVideoID:function(e){if(e.hasClass("sby_item")||e.hasClass("sby_player_item")){if(void 0!==e.find(".sby_video_thumbnail").attr("data-video-id"))return e.find(".sby_video_thumbnail").attr("data-video-id")}else if(e.closest("sby_item").length||e.closest("sby_player_item").length){var i=e.closest("sby_item").length?e.closest("sby_item"):e.closest("sby_player_item");if(void 0!==i.find(".sby_video_thumbnail").attr("data-video-id"))return i.find(".sby_video_thumbnail").attr("data-video-id")}else{if(e.hasClass("sb_youtube"))return e.find(".sby_item").first().find(".sby_video_thumbnail").attr("data-video-id");if(t(this.el).find(".sby_video_thumbnail").first().length&&void 0!==t(this.el).find(".sby_video_thumbnail").first().attr("data-video-id"))return t(this.el).find(".sby_video_thumbnail").first().attr("data-video-id")}return""},getAvatarUrl:function(t,e){if(""===t)return"";var i=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==i["LCL"+t]&&1===parseInt(i["LCL"+t])?sbyOptions.resized_url+t+".jpg":void 0!==i[t]?i[t]:"":void 0!==i[t]?i[t]:void 0!==i["LCL"+t]&&1===parseInt(i["LCL"+t])?sbyOptions.resized_url+t+".jpg":""},addToNeedsResizing:function(t){-1===this.needsResizing.indexOf(t)&&this.needsResizing.push(t)},applyImageLiquid:function(){var e=t(this.el);sbyAddImgLiquid(),"function"==typeof e.find(".sby_player_item").sby_imgLiquid&&(e.find(".sby_player_item").length&&e.find(".sby_player_item .sby_player_video_thumbnail").sby_imgLiquid({fill:!0}),e.find(".sby_item .sby_item_video_thumbnail").sby_imgLiquid({fill:!0}))},listenForVisibilityChange:function(){var e,i,s,n=this;e=jQuery,i={callback:function(){},runOnLoad:!0,frequency:100,sbyPreviousVisibility:null},s={sbyCheckVisibility:function(t,e){if(jQuery.contains(document,t[0])){var i=e.sbyPreviousVisibility,n=t.is(":visible");e.sbyPreviousVisibility=n,null==i?e.runOnLoad&&e.callback(t,n):i!==n&&e.callback(t,n),setTimeout(function(){s.sbyCheckVisibility(t,e)},e.frequency)}}},e.fn.sbyVisibilityChanged=function(t){var n=e.extend({},i,t);return this.each(function(){s.sbyCheckVisibility(e(this),n)})},"function"==typeof t(this.el).filter(":hidden").sbyVisibilityChanged&&t(this.el).filter(":hidden").sbyVisibilityChanged({callback:function(t,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=t(this.el),i=this.settings.cols,s=this.settings.colsmobile,n=i;return sbyWindowWidth=window.innerWidth,e.hasClass("sby_mob_col_auto")?(sbyWindowWidth<640&&parseInt(i)>2&&parseInt(i)<7&&(n=2),sbyWindowWidth<640&&parseInt(i)>6&&parseInt(i)<11&&(n=4),sbyWindowWidth<=480&&parseInt(i)>2&&(n=1)):sbyWindowWidth<=480&&(n=s),parseInt(n)},onThumbnailClick:function(e,i,s){if(this.canCreatePlayer()){var n=t(this.el);if(n.hasClass("sby_layout_gallery"))if(n.find(".sby_current").removeClass("sby_current"),e.closest(".sby_item").addClass("sby_current"),e.closest(".sby_item").addClass("sby_current"),n.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),n.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),n.find(".sby_player_outer_wrap iframe").length)if(i){s=void 0===s?this.getVideoID(n.find(".sby_item").first()):s;this.playVideoInPlayer(s)}else{s=void 0===s?this.getVideoID(e.closest(".sby_item")):s;this.changePlayerInfo(e.closest(".sby_item")),this.playVideoInPlayer(s),this.afterVideoChanged()}else if(i)this.createPlayer("sby_player"+this.index);else{var s=void 0===s?this.getVideoID(e.closest(".sby_item")):s;this.createPlayer("sby_player"+this.index,s)}else if(t(this.el).hasClass("sby_layout_grid")||t(this.el).hasClass("sby_layout_carousel")){var a=e.closest(".sby_item");s=void 0===s?this.getVideoID(a):s;this.playVideoInPlayer(s),this.afterVideoChanged()}else if(t(this.el).hasClass("sby_layout_list")){a=e.closest(".sby_item"),s=void 0===s?this.getVideoID(a):s;a.length&&!a.find("iframe").length?(a.find(".sby_loader").show().removeClass("sby_hidden"),a.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s)):(this.playVideoInPlayer(s,a.attr("data-video-id")),this.afterVideoChanged())}}},onThumbnailEnter:function(e){if(this.canCreatePlayer()&&t(this.el).hasClass("sby_layout_list")){var i=e.closest(".sby_item"),s=this.getVideoID(i);i.find("iframe").length||(i.find(".sby_loader").show().removeClass("sby_hidden"),i.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s,0))}},onThumbnailLeave:function(t){},changePlayerInfo:function(t){},playerEagerLoaded:function(){if(void 0!==this.player||t(this.el).hasClass("sby_player_loaded"))return!0},canCreatePlayer:function(){return!t(this.el).find("#sby_blank").length&&(this.playerEagerLoaded()||this.playerAPIReady&&this.settings.consentGiven||window.sbyAPIReady&&this.settings.consentGiven)},playVideoInPlayer:function(t,e){void 0!==this.player&&void 0!==this.player.loadVideoById?this.player.loadVideoById(t):void 0!==window.sbyLightboxPlayer&&void 0!==window.sbyLightboxPlayer.loadVideoById?window.sbyLightboxPlayer.loadVideoById(t):void 0!==e&&void 0!==this.players&&void 0!==this.players[e]&&void 0!==this.players[e].loadVideoById&&this.players[e].loadVideoById(t)},afterVideoChanged:function(){t(this.el).hasClass("sby_layout_gallery")&&(t(this.el).find(".sby_player_outer_wrap").removeClass("sby_player_loading"),t(this.el).find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").hide().addClass("sby_hidden"),t(window).width()<480&&t("html, body").animate({scrollTop:t(this.el).find(".sby_player_outer_wrap").offset().top},300))},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return this.settings.noCDN=!1,!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var t=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===t.length){var e=t.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(t){for(var e=t+"=",i=window.document.cookie.split(";"),s=0;s "},beforePlayerSetup:function(t,e,i,s,n){},afterPlayerSetup:function(t,e,i,s){},afterResize:function(){var e=t("#sby_lightbox .sby_lb-player").height();if(e>100){var i=t("#sby_lightbox .sby_lb-outerContainer").height()-e;i>10&&t("#sby_lightbox .sby_lb-player").css("top",i/2)}},pausePlayer:function(){void 0===window.sbyLightboxPlayer&&"undefined"==typeof YT||(void 0!==YT.get("sby_lb-player")&&"function"==typeof YT.get("sby_lb-player").pauseVideo?YT.get("sby_lb-player").pauseVideo():void 0!==window.sbyLightboxPlayer&&"function"==typeof window.sbyLightboxPlayer.pauseVideo&&window.sbyLightboxPlayer.pauseVideo())}},a.prototype=Object.create(n.prototype),o.prototype={toggleCTA:function(e,i,s){this.$player=s.length?s:t(".sby_lb-container"),this.state=i,this.videoID=e,this.isInitialized=!0,this.resetCTA(),void 0!==window.sby.ctas[e]&&(this.callbackArgs=window.sby.ctas[e]);var n=this.callbackArgs.callback;if("link"===n)this.callback=this.link;else{if("related"!==n)return;this.callback=this.related}2===i||0===i?(this.$player.find(".sby_cta_items_wraps").addClass("sby_cta_is_open"),2===i?this.$player.find(".sby_cta_items_wraps").addClass("sby_cta_state_paused"):this.$player.find(".sby_cta_items_wraps").addClass("sby_cta_state_ended"),this.$player.find(".sby_cta_items_wraps").show(),this.callback(),this.setCTAStyles()):(this.$player.find(".sby_cta_items_wraps").removeClass("sby_cta_is_open"),this.$player.find(".sby_cta_items_wraps").hide().removeClass("sby_cta_state_paused").removeClass("sby_cta_state_ended").removeClass("sby_cta_is_open"))},related:function(e){var i=this,s=this.feedObjInContext,n=window.sby.shuffle(this.getRelated(s)),a=0,o=this.videoID,r=this.$player;this.$player.find(".sby_cta_items_wraps").removeClass("sby_cta_cols_"+this.numItemColumns),this.numItems=4,this.numItemColumns=2,r.width()<480&&(this.numItems=1,this.numItemColumns=1);var l=this.numItems;t.each(n,function(t,e){e.videoID!==o&&a '),a++)}),r.find(".sby_cta_items_wraps .sby_video_thumbnail").each(function(){t(this).off().on("click",function(e){e.preventDefault();var n=t(this).attr("data-video-id");s.onThumbnailClick(t(this),!0,n),i.videoID=n})})},getRelated:function(e){if(void 0===e.settings.general.cta.defaultPosts[0]){var i=t(e.el),s=[];return i.find(".sby_item").each(function(){if(void 0!==t(this).find(".sby_item_video_thumbnail").attr("data-full-res")){var e={videoID:t(this).attr("data-video-id"),title:t(this).attr("data-video-title"),thumbnail:t(this).find(".sby_item_video_thumbnail").attr("data-full-res")};s.push(e)}}),s}return e.settings.general.ctaPosts},link:function(t){var e=this.$player,i=this.feedObjInContext;this.$player.find(".sby_cta_items_wraps").removeClass("sby_cta_cols_"+this.numItemColumns),this.numItems=1,this.numItemColumns=1;var s="",n="";""===i.settings.general.cta.color&&""===i.settings.general.cta.textColor||(s=' style="',n=" sby_custom",""!==i.settings.general.cta.color&&(s+="background: rgb("+i.settings.general.cta.color+");"),""!==i.settings.general.cta.textColor&&(s+="color: rgb("+i.settings.general.cta.textColor+");"),s+='"');var a="";"newwindow"===i.settings.general.cta.openType&&(a=' target="_blank" rel="noopener"'),e.find(".sby_cta_items_wraps .sby_cta_inner_wrap").append('
")},setCTAStyles:function(){var t=Math.max(90,this.$player.height()-60-49);this.$player.find(".sby_cta_items_wraps").css("height",t+"px").css("width",this.$player.find("iframe").width()-20+"px").addClass("sby_cta_cols_"+this.numItemColumns);var e=Math.max(1,this.numItems/this.numItemColumns),i=2*parseInt(this.$player.find(".sby_cta_items_wraps").css("padding-top").replace("px","")),s=Math.max(90,(t-i)/e);this.$player.find(".sby_cta_item").css("max-height",s+"px").find("img").css({"max-height":s+"px",width:"auto",margin:"auto"}),this.$player.find(".sby_btn_wrap").css("height",s+"px")},resetCTA:function(){this.$player.find(".sby_cta_items_wraps .sby_cta_inner_wrap").empty()}},window.sby_init=function(){window.sby=new e,window.sby.createPage(window.sby.createFeeds,{whenFeedsCreated:window.sby.afterFeedsCreated})}}(jQuery),void 0===window.sbyEagerLoading&&(window.sbyEagerLoading=void 0!==window.sbyOptions&&window.sbyOptions.eagerload,jQuery("div[data-vc-video-bg]").length&&(window.sbyEagerLoading=!0)),void 0===window.sbySemiEagerLoading&&(window.sbySemiEagerLoading=void 0!==window.sbyOptions&&window.sbyOptions.semiEagerload,(jQuery("div[data-vc-video-bg]").length||window.sbyEagerLoading)&&(window.sbySemiEagerLoading=!1)),jQuery(document).ready(function(t){window.sbySemiEagerLoading||sby_init(),t("#cookie-notice a").on("click",function(){setTimeout(function(){t.each(window.sby.feeds,function(t){window.sby.feeds[t].afterConsentToggled()})},1e3)}),t("#cookie-law-info-bar a").on("click",function(){setTimeout(function(){t.each(window.sby.feeds,function(t){window.sby.feeds[t].afterConsentToggled()})},1e3)}),t(".cli-user-preference-checkbox").on("click",function(){setTimeout(function(){t.each(window.sby.feeds,function(t){window.sby.feeds[t].settings.consentGiven=!1,window.sby.feeds[t].afterConsentToggled()})},1e3)}),t(window).on("CookiebotOnAccept",function(e){t.each(window.sby.feeds,function(t){window.sby.feeds[t].settings.consentGiven=!0,window.sby.feeds[t].afterConsentToggled()})}),t(document).on("cmplzAcceptAll",function(e){t.each(window.sby.feeds,function(t){window.sby.feeds[t].settings.consentGiven=!0,window.sby.feeds[t].afterConsentToggled()})}),t(document).on("cmplzRevoke",function(e){t.each(window.sby.feeds,function(t){window.sby.feeds[t].settings.consentGiven=!1,window.sby.feeds[t].afterConsentToggled()})}),t(document).on("borlabs-cookie-consent-saved",function(e){t.each(window.sby.feeds,function(t){window.sby.feeds[t].settings.consentGiven=!1,window.sby.feeds[t].afterConsentToggled()})})})}if(window.sbySemiEagerLoading){var sbyYScriptId="sby-youtube-api",sbyYScript=document.getElementById(sbyYScriptId);if(null===sbyYScript){var tag=document.createElement("script"),firstScript=document.getElementsByTagName("script")[0];tag.src="https://www.youtube.com/iframe_api",tag.id=sbyYScriptId,firstScript.parentNode.insertBefore(tag,firstScript)}}window.onYouTubeIframeAPIReady=function(){var t=document.getElementsByClassName("sb_youtube").length;if(t>0){if(window.sbySemiEagerLoading){if(void 0!==window.sby)for(var e=0;e
'),player=new YT.Player("sby_lb-player",{height:"100",width:"100",videoId:jQuery(this).find(".sby_item").first().attr("data-video-id"),playerVars:{modestbranding:1,rel:0,autoplay:s}}),window.sbyLightboxPlayer=player)}if(void 0!==window.sby){var n=jQuery.Event("sbyfeedandytready");jQuery(window).trigger(n)}};