f+F.offset().top+d&&f+s'),g.append(q)),g.css("padding-bottom",q.outerHeight(!0)+i));i=parseInt(V.height(),10);parseInt(F.height(),10)<=i&&(i=parseInt(a.height(),10)+(i-s-parseInt(g.innerHeight(),10)),a.css("height",i)),void 0===F.data("scrolling-events")&&(F.data("scrolling-events",!0),V.on("scroll.header",z).on("mess_in_header",function(){S()}).on("resize.header",function(){clearTimeout(u),u=setTimeout(j,500)}),S())}else M(),T=!0,q.length&&g.find(q).length&&(W("#"+y).after(q).remove(),g.css("padding-bottom","")),void 0!==F.data("scrolling-events")&&(F.removeData("scrolling-events"),V.off("scroll.header mess_in_header resize.header"),clearTimeout(u),F.css("top","").removeClass(m).removeClass(v)),t<=J[0]?R.css("padding-top",""):R.css("padding-top",F.height())},N.layout.add(L),L({},N.layout.size),q.length&&q.imagesLoaded(function(){L({},N.layout.size)}))},headerSearch:function(){var t,e,a,i,n,o,s=w.find("#search-button");s.length&&(e=(t=F.find("div.search-container")).find("form.search-form"),a=e.find('input[name="s"]'),i=e.next(),n=function(e){"opacity"===e.originalEvent.propertyName&&(t.off(G,n),a.focus())},o=function(e){"visibility"===e.originalEvent.propertyName&&(t.off(G,o),t.removeClass("open"))},s.on("click",function(){t.hasClass("open")?i.click():(t.addClass("open"),Y?(t.on(G,n),setTimeout(function(){t.addClass("show")},15)):(t.addClass("show"),a.focus()),s.addClass("active"))}),i.on(j,function(e){e.preventDefault(),Y?t.on(G,o):t.removeClass("open"),t.removeClass("show"),s.removeClass("active")}))},topMessage:function(){var e,t,a,i=W("#top-closable-message");i.length&&(e=i.find("div.button").children(),t=i.find("span.close-sidebar"),a=function(e){"opacity"===e.originalEvent.propertyName&&(i.off(G,a),i.remove())},e.add(t).one(j,function(e){e.stopPropagation(),e.preventDefault(),Y?(i.on(G,a),i.addClass("hide")):(i.addClass("hide"),i.remove()),N.cookieExpire("apollo13framework_top_msg=closed",168)}))},toolsLanguages:function(){var e,t=W("#tools-lang-switcher");t.length&&(e=t.parent(),t.on(j,function(){e.toggleClass("open")}))},toTop:function(){function e(){100t.height()&&t.addClass("big-content"))}),e.on(j,i),parseInt(Q.menu_overlay_on_click,10)&&t.find(".menu-item").find("a").on("click",function(){e.trigger("click")}))},sideMenu:function(){var a,i,n,o,s,t=W("#side-menu-switch");t.length&&(a="-switch".length,i=W("span.close-sidebar"),n=W("#content-overlay"),s=function(e){e.preventDefault();e=W(e.target);!e.is(i)&&e.parents().addBack().hasClass("side-widget-menu")||(t.removeClass("active"),U.removeClass(o+"-open"),n.off(j,s),i.off(j,s))},t.on(j,function(e){e.stopPropagation(),e.preventDefault();var t=W(this),e=t.attr("id");t.hasClass("active")?n.trigger("click"):(n.trigger("click"),t.addClass("active"),o=e.slice(0,e.length-a),U.addClass(o+"-open"),n.on(j,s),i.on(j,s))}))},basketMenu:function(){var i,n,o,s,l,r,a,d,c=W("#basket-menu-switch");c.length&&(i=W("span.close-sidebar"),o=W("#"+(n="basket-menu")),s=F.hasClass("vertical"),l=s&&U.hasClass("header-side-right"),r=function(e){var t=W(e.target),e=N.layout.size;!t.is(i)&&t.parents().addBack().hasClass("basket-sidebar")||(c.removeClass("active"),U.removeClass(n+"-open"),Y?(s&&J[2]V.width()&&(a=V.width()-320)),{display:"block",top:t,left:a})),setTimeout(function(){o.addClass("show")},15),U.on(j,r),i.on(j,r))}))},titleBar:function(){var o=R.find("header.title-bar.has-effect");o.length&&(V.on("scroll resize a13_title_bar_trigger",function(){var e=P.scrollTop||D.pageYOffset||0,t=parseInt(V.height(),10),a=parseInt(o.outerHeight(),10),i=parseInt(o.offset().top,10)+50,n=(e-i)/a;n<0&&(n=0),1\t\t\t
').appendTo(U),o=!0),n=W(i),a=n.children("div.controls"),n.find(".a13-slider").trigger("a13-slider-destroy"),o?(a.find("span.close").on(j,function(){Y?(n.on(G,s),n.removeClass("show")):(n.removeClass("show"),l()),t(),V.off("scroll.a13-lightbox"),h.removeClass("post-lightbox-active"),f(D.location.href.split("#")[0])}).end().find("span.prev").on(j,function(){!c.length||W(this).hasClass("inactive")||n.is(".loading")||r(c)}).end().find("span.next").on(j,function(){!d.length||W(this).hasClass("inactive")||n.is(".loading")||r(d)}),e()):n.is(":visible")?t():(t(),e()),n.addClass("loading")};U.on("click",".open-item-in-lightbox > a",function(e){e.preventDefault();e=W(e.target);e.is("a")&&r(e)}),V.on("popstate",function(){e(D.location.hash)}),D.location.hash.length&&e(D.location.hash)},lazyLoadBricks:function(e){var n,o,s,t,a,i,l,r,d,c,f,h,p,u,g,v,m,y=e.container instanceof jQuery?e.container:W(e.container);y.length&&(n=e.items,o=R.find("nav.navigation"),s=W("#loadingSpace"),t=e.filter instanceof jQuery?e.filter:W(e.filter),a=e.layoutMode,i=parseInt(e.gutter,10),l="lazyload-indicator",r=y.data("lazy-load"),d=y.data("lazy-load-mode"),c=r&&"auto"===d,f=r&&!c,h=function(){W("#"+l).addClass("idle")},p=function(){var e=o.prev(".load-more-button");e.length&&e.fadeOut()},u=function(){V.on("scroll.lazyload resize.lazyload",N.throttle(function(){var e=V.scrollTop()+V.height();y.height()-e<250&&(V.off(".lazyload"),g())},150))},g=function(){if(o.length){var e=o.find("a.next");if(e.length){if(!(y.height()<2*V.height()+V.scrollTop()&&e.length))return u(),void h();(a=W("#"+l)).length||(a=W('').appendTo(void 0===t?U:t)),a.removeClass("idle"),s.load(e.attr("href"),"a13-ajax-get",function(){var e=s.find(".navigation");o.replaceWith(e),o=e;e=s.find("img.jetpack-lazy-image");e.length&&e.removeAttr("srcset"),s.imagesLoaded(function(){var e=s.find(n);void 0!==W.fn.mediaelementplayer&&s.find(".wp-video video").mediaelementplayer("undefined"==typeof mejs?{}:mejs.MediaElementDefaults),e.fitVids(),e.appendTo(y),N.elementsActions.pageSlider(),y.isotope("appended",e),g()})})}else h()}var t,a},s.length||(s=W('').appendTo(U)),a=void 0!==a&&a.length?e.layoutMode:"packery",a=void 0===Isotope.LayoutMode.modes[a]?"masonry":a,y.isotope({itemSelector:n,transitionDuration:"0.6s",isOriginLeft:!E,layoutMode:a,packery:{columnWidth:".grid-master",gutter:i},masonry:{columnWidth:".grid-master",gutter:i},fitRows:{gutter:i}}).addClass("layout-"+a),y.imagesLoaded(function(){y.isotope("layout"),c?g():f&&0===y.data("isotope").filteredItems.length&&W("div.load-more-button").click()}),U.on("webfontsloaded",function(){y.data("isotope")&&y.isotope("layout")}),W(S).on("lazyloaded",function(){y.data("isotope")&&y.isotope("layout")}),U.on("jetpack-lazy-loaded-image",function(){y.data("isotope")&&setTimeout(function(){y.isotope("layout")},100)}),t.length&&((v=t.find("li")).on(j,function(e){e.stopPropagation(),e.preventDefault(),v.removeClass("selected");e="__all"===(e=W(this).addClass("selected").data("filter"))?"*":"[data-category-"+e+"]";y.isotope({filter:e}),c?V.trigger("scroll.lazyload"):f&&0===y.data("isotope").filteredItems.length&&W("div.load-more-button").click()}),v.filter(".selected").click()),f&&(o.prev(".load-more-button").length||(o.before(''+Q.load_more+'
'),(m=W("span.result-count"))&&W("div.load-more-button").append(m)),W("div.load-more-button").on(j,function(){var e,i=W(this);o.length&&((e=o.find("a.next")).length?(i.addClass("loading"),s.load(e.attr("href"),"a13-ajax-get",function(){var e,t,a=s.find(".navigation");o.replaceWith(a),o=a,f&&(e=s.find("span.result-count"),(t=W("div.load-more-button").find("span.result-count"))&&t.replaceWith(e)),a.find("a.next").length||p(),s.imagesLoaded(function(){var e=s.find(n);void 0!==W.fn.mediaelementplayer&&s.find(".wp-video video").mediaelementplayer("undefined"==typeof mejs?{}:mejs.MediaElementDefaults),e.fitVids(),e.appendTo(y),N.elementsActions.pageSlider(),N.elementsActions.parallax(),y.isotope("appended",e),i.removeClass("loading"),0===y.data("isotope").filteredItems.length&&W("div.load-more-button").click()})})):p())})))},singleCptMasonry:function(e){var p=e.container instanceof jQuery?e.container:W(e.container);if(p.length){var n=p.prevAll(".gallery-media-collection"),u=n.children(),s=e.id||1,l=W('').appendTo(U),o=e.filter?e.filter instanceof jQuery?e.filter:W(e.filter):W([]),r=e.proofing_filter?W(e.proofing_filter):W([]),g=W("#done-with-proofing"),d="lazyload-indicator",v=p.data("cover-color"),m=parseInt(p.data("desc"),10),y=parseInt(p.data("proofing"),10),_=parseInt(p.data("socials"),10),b=!!Q.proofing_manual_ids,c=0,f=u.length,k=e.thumbs_video||"",a=e.sticky_sidebar?e.sticky_sidebar_el:"",h=function(){W("#"+d).addClass("idle")},C=function(e){var t,a;1!==parseInt(p.data("lightbox_off"),10)&&(N.layout.size<=J[0]&&1===parseInt(p.data("lightbox_off_mobile"),10)||(a=p.find(".object-item").index(W(this)),t=u.eq(a),(a=W(e.target)).is("a")||0!==a.parents("a").length||(!k&&t.hasClass("type-video")?t.hasClass("link")||(e.stopPropagation(),e.preventDefault()):t.click())))},x=function(e){function a(){i.css("opacity",0),setTimeout(function(){i.remove(),n.removeClass(h).addClass(f)},315)}var i,n=W(this),o=n.parents(".object-item").eq(0),t=n.parent(),s=p.find(".object-item").index(o),l=u.eq(s),r=Q.album_id,d=l.data("id"),c=l.find("div.proofing_comment").text(),f="fa-commenting",h="fa-floppy-o";e.stopPropagation(),e.preventDefault(),n.hasClass("loading")||(t.find("textarea").length?t.find("textarea").blur():(n.removeClass(f).addClass(h),(i=W('').appendTo(t).focus()).val(c),l.hasClass("subtype-videolink")&&(d="external"),i.one("blur",function(){var t=W.trim(i.val());t!==c?(i.prop("readonly",!0),n.addClass("loading"),W.ajax({type:"post",url:Q.ajaxurl,data:{action:"apollo13framework_comment_album_item",security:Q.proofing_nonce,album_id:r,item_id:d,link:"external"===d?l.data("src"):"",comment:t},dataType:"json"}).done(function(e){void 0!==e.comment&&(t=e.comment),t.length?n.addClass("filled"):n.removeClass("filled"),a(),l.find("div.proofing_comment").html(t),o.add(l).attr("data-proofing_comment",t.length?1:0),p.isotope(),g.removeClass("done idle"),z()}).fail(function(e){void 0!==e.status&&403==e.status&&alert("Site version is outdated. Please refresh page to make this function work."),i.prop("readonly",!1)}).always(function(){n.removeClass("loading")})):a()}).on("keydown",function(e){27===e.keyCode&&a()}).on(j,function(e){e.stopPropagation()})))},w=function(e){var t=W(this),a=t.parents(".object-item").eq(0),i=p.find(".object-item").index(a),n=u.eq(i),o=Q.album_id,i=n.data("id");e.stopPropagation(),e.preventDefault(),t.hasClass("loading")||(n.hasClass("subtype-videolink")&&(i="external"),t.addClass("loading"),W.ajax({type:"get",url:Q.ajaxurl,data:{action:"apollo13framework_mark_album_item",security:Q.proofing_nonce,album_id:o,item_id:i,link:"external"===i?n.data("src"):"",approve:t.hasClass("filled")?0:1},dataType:"json"}).done(function(e){e.approve?t.addClass("filled").attr("title",Q.proofing_uncheck_item):t.removeClass("filled").attr("title",Q.proofing_mark_item),a.add(n).attr("data-proofing_checked",e.approve),p.isotope(),g.removeClass("done idle"),z()}).fail(function(e){void 0!==e.status&&403==e.status&&alert("Site version is outdated. Please refresh page to make this function work.")}).always(function(){t.removeClass("loading")}))},I=function(e){e.stopPropagation(),e.preventDefault(),g.hasClass("loading")||g.hasClass("done")||(g.addClass("loading"),g.find("span.counter").text(u.filter("[data-proofing_checked=1]").length+"/"+u.length),W.ajax({type:"get",url:Q.ajaxurl,data:{action:"apollo13framework_album_finished_proofing",security:Q.proofing_nonce,album_id:Q.album_id},dataType:"json"}).done(function(e){e.done&&(g.addClass("done"),setTimeout(function(){g.addClass("idle")},4e3))}).fail(function(e){void 0!==e.status&&403==e.status&&alert("Site version is outdated. Please refresh page to make this function work.")}).always(function(){g.removeClass("loading")}))},T=function(){if(f)if(f<=c)h();else{var e=parseInt(p.css("height"),10);if(e===parseInt(p.css("min-height"),10)&&(e=0),!(e+p.offset().top<2*V.height()+V.scrollTop()))return V.on("scroll.lazyload"+s+" resize.lazyload"+s,N.throttle(function(){var e=V.scrollTop()+V.height();p.height()+p.offset().top-e<250&&o()},150)),V.on("filter.lazyload"+s,o),void h();(e=W("#"+d)).length||(e=W('').appendTo(void 0===n?U:n)),e.removeClass("idle");for(var t="",i=c,a=f<(a=c+2)?f:a;c',e.length&&(a+=''+e+""),a+='',a+='',a+=""),a};if(void 0!==l&&l.length)for(var f=l.split(","),h=0;h").append(n.clone()).html():"",k||"type-video"!=d?(t+='",t+='

',t+='
',t+='
',t+='
',t+='
',m&&(t+='
',t+='
',s.length&&(t+=s),t+="
",t+=a.length?'
'+a.html()+n+"
":"",t+="
"),i.hasClass("link")&&(t+='
"),t+="
",_&&(t+='
')):i.hasClass("subtype-videolink")?(t+='
",t+='
'):(t+='
",t+=W(i.data("html")).html()),t+=e(),t+="
"}(c);l.append(t).fitVids(),c=i,l.find(".archive-item").each(function(){var e,t;_&&(e=W(this).find(".social"),t=u.eq(c).find(".dot-irecommendthis"),"undefined"!=typeof a2a_config&&e.append(u.eq(c).find(".a2a_kit")),t.length&&e.append(t)),c++}),void 0!==W.fn.mediaelementplayer&&l.find(".wp-video video").mediaelementplayer("undefined"==typeof mejs?{}:mejs.MediaElementDefaults),l.imagesLoaded(function(){var e,t,a=l.find(".archive-item").appendTo(p);0===i?(e=parseInt(p.data("margin"),10),t=void 0!==Isotope.LayoutMode.modes.packery?"packery":"masonry",p.isotope({itemSelector:".archive-item",transitionDuration:"0.6s",isOriginLeft:!E,layoutMode:t,packery:{columnWidth:".grid-master",gutter:e},masonry:{columnWidth:".grid-master",gutter:e}}).addClass("layout-"+t),U.on("webfontsloaded",function(){p.data("isotope")&&p.isotope("layout")}),W(S).on("lazyloaded",function(){p.data("isotope")&&p.isotope("layout")}),U.on("jetpack-lazy-loaded-image",function(){p.data("isotope")&&setTimeout(function(){p.isotope("layout")},100)}),p.on("click",".object-item",C).on(j,"i.p-comment",x).on(j,"i.p-check",w).on(j,"span.p-id",function(e){e.stopPropagation(),e.preventDefault()}),W("#done-with-proofing").on(j,I)):p.isotope("appended",a),T()})}var n;function o(){V.off(".lazyload"+s),T()}},t=function(e){e.stopPropagation(),e.preventDefault();var t,a=W(this),i="",e=a.closest("ul.category-filter");o.length&&"__all"!==(t=e.is(o)?(o.find("li").removeClass("selected"),a.addClass("selected").data("filter")):o.find("li.selected").data("filter"))&&(i="[data-category-"+t+"]"),r.length&&"__all"!==(t=e.is(r)?(r.find("li").removeClass("selected"),a.addClass("selected").data("filter")):r.find("li.selected").data("filter"))&&(i+=2===t?"[data-proofing_comment=1]":"[data-proofing_checked="+t+"]"),""===i&&(i="*"),p.isotope({filter:i}),V.trigger("filter.lazyload"+s),V.trigger("a13_gallery_filtered",[i,n])},z=function(){var e,t,a,i;r.length&&(e=u.filter("[data-proofing_checked=1]").length,t=u.length-e,a=u.filter("[data-proofing_comment=1]").length,(i=r.find("li")).filter('[data-filter="1"]').find(".count").text("("+e+")"),i.filter('[data-filter="0"]').find(".count").text("("+t+")"),i.filter('[data-filter="2"]').find(".count").text("("+a+")"))},e=function(e,t){a.length&&J[2]
").append(l.clone()).html():"",f.push({type:n,image:i.data("main-image"),thumb:i.data("thumb"),title:s.text(),alt_attr:i.data("alt_attr"),desc:o+l,autoplay:i.data("autoplay"),video_type:d,video_url:r?i.data("html"):i.data("video_player"),bg_color:i.data("bg_color"),url:!("image"!=n||!i.hasClass("link"))&&s.attr("href"),url_target:i.data("link_target")});if(h.length)for(a=c.children(".item__link"),u=0;un.length?0:i;(a.eq(v).is(t)||a.eq(i).is(t))&&g++,2===g&&l.off("bgLazyLoad.flickity",w).flickity("playPlayer")},I=function(e,t){var a;void 0===f.a13Effect||"off"!==(a=f.a13Effect)&&(J[2]").append(r.clone()).html():"",c.push({image:t.data("main-image"),title:s.text(),desc:o+r,bg_color:t.data("bg_color"),url:!("image"!=a||!t.hasClass("link"))&&s.attr("href"),url_target:"image"==a&&1===parseInt(t.data("link_target"),10)}));for(var z,A,M,S,j=c.length,L=0,D="";L<=j-1;)D+='',D+='
',h&&(D+='
',c[L].title.length&&(D+='
',D+=c[L].title,D+=""),D+=c[L].desc.length?'
'+c[L].desc+"
":"",D+="
"),c[L].url.length&&(D+='
"),D+=p?'
':"",D+="
",L++;E&&(f.rightToLeft=!0),l.append(D).flickity(f).on("staticClick.flickity",function(e,t,a,i){var n=l.data("flickity");i===n.selectedIndex?!1===c[i].url&&(W(n.selectedElement).toggleClass("enlarge"),l.flickity("reposition")):"number"==typeof i&&l.flickity("selectCell",i)}).on("mousewheel",function(e,t){var a,i=l.height(),n=l.offset().top,o=V.height(),s=V.scrollTop();n+i<=o+s&&s<=n&&(a=new Date,e.preventDefault(),200'),t=a.find("span.prev-slide"),a=a.find("span.next-slide"),t.on(j,null,{dir:"prev"},e),a.on(j,null,{dir:"next"},e))})},lightbox:function(){var i,e,n,o,s,t,a;void 0!==W.fn.lightGallery&&(i={hash:!!parseInt(Q.lg_lightbox_share,10),share:!!parseInt(Q.lg_lightbox_share,10),controls:!!parseInt(Q.lg_lightbox_controls,10),download:!!parseInt(Q.lg_lightbox_download,10),counter:!!parseInt(Q.lg_lightbox_counter,10),thumbnail:!!parseInt(Q.lg_lightbox_thumbnail,10),showThumbByDefault:!!parseInt(Q.lg_lightbox_show_thumbs,10),autoplay:!!parseInt(Q.lg_lightbox_autoplay_open,10),autoplayControls:!!parseInt(Q.lg_lightbox_autoplay,10),progressBar:!!parseInt(Q.lg_lightbox_progressbar,10),fullScreen:!!parseInt(Q.lg_lightbox_full_screen,10),zoom:!!parseInt(Q.lg_lightbox_zoom,10),mode:Q.lg_lightbox_mode,pause:parseInt(Q.lg_lightbox_autoplay_pause,10),speed:parseInt(Q.lg_lightbox_speed,10),preload:parseInt(Q.lg_lightbox_preload,10),hideBarsDelay:parseInt(Q.lg_lightbox_hide_delay,10)},e=W(".gallery-media-collection"),n=W("div.vc_media_grid, div.vc_masonry_media_grid"),t=W("div.gallery"),e.length&&(o=e.children(),s=W.extend({selector:o.not(".link"),exThumbImage:"data-thumb"},i),e.parent().is("div.bricks-frame")&&o.filter('[data-video_type="vimeo"]').length&&function(){var e=S.createElement("script");e.src="https://f.vimeocdn.com/js/froogaloop2.min.js";var t=S.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}(),o.each(function(){var e,t=W(this),a=t.children("a.item__link"),i=t.find("div.item-desc"),n=t.find("div.album-video");i.length&&(e=a.text(),t.attr("data-sub-html","#"+i.attr("id")),i.wrapInner(''),i.prepend(""+e+"
"),i.wrapInner(''),t.attr("data-pinterest-text",e),t.attr("data-tweet-text",e)),n.length?t.attr("data-html","#"+n.attr("id")):t.attr("data-src",a.attr("href"))}),e.lightGallery(s),V.on("a13_gallery_filtered",function(e,t,a){t="*"===t?s:W.extend({},s,{selector:o.not(".link").filter(t)});a.data("lightGallery").destroy(!0),a.lightGallery(t)})),n.length&&V.on("grid:items:added",function(e,t){var a=W(t),t=a.find("a.a13-lightbox-added");n.is(a)&&t.length&&(a.lightGallery(W.extend({},i,{selector:t,exThumbImage:"href",subHtmlSelectorRelative:!0,hash:!1})),t.on("click",function(){return!1}))}),t.length&&(a=t.find(".gallery-icon").children("a"),t.lightGallery(W.extend({selector:a,exThumbImage:"href",getCaptionFromTitleOrAlt:!1},i))),Q.lightbox_single_post&&(U.hasClass("single-post")||U.hasClass("single-work")||U.hasClass("page")&&!U.hasClass("elementor-page")||U.hasClass("single-album"))&&(a=(t=U.find(".real-content")).find("a").children("img").parent(),t.lightGallery(W.extend({selector:a,exThumbImage:"href",getCaptionFromTitleOrAlt:!1},i))),V.on("post-load",function(){var e,t=W("#a13-post-lightbox");Q.lightbox_single_post&&t.length&&t.is(":visible")&&(t=(e=t.find(".real-content")).find("a").children("img").parent(),e.lightGallery(W.extend({selector:t,exThumbImage:"href",getCaptionFromTitleOrAlt:!1},i)))}))},demoFlyOut:function(){var e=W("#a13-flyout-box");e.length&&e.find("span.drag-out").on(j,function(){e.toggleClass("open")})}}},N=D.A13FRAMEWORK,W(S).ready(N.onReady)}(jQuery,window,document);