function fusionInitGallery(e){var n;e.data("isotope")||e.parents('.fusion-builder-live-element[data-type="fusion_gallery"]').length||(n=e.find(".fusion-gallery-column"),e.css("min-height","500px"),n.hide(),e.hasClass("fusion-gallery-layout-masonry")&&!e.hasClass("fusion-masonry-has-vertical")&&0<e.find(".fusion-grid-column:not(.fusion-grid-sizer)").not(".fusion-element-landscape").length&&e.addClass("fusion-masonry-has-vertical"),e.closest(".awb-gallery-wrapper").find(".awb-gallery-infinite-scroll-handle").removeClass("is-active"),imagesLoaded(n,(function(){e.css("min-height",""),n.fadeIn(),e.isotope({layoutMode:"packery",itemSelector:".fusion-gallery-column",isOriginLeft:!jQuery("body.rtl").length,resizable:!0,initLayout:!1}),e.on("layoutComplete",(function(e){var n=jQuery(e.target);n.parents(".fusion-blog-layout-grid").length&&!n.parents(".fusion-blog-layout-grid").hasClass("fusion-blog-equal-heights")&&setTimeout((function(){n.parents(".fusion-blog-layout-grid").isotope()}),50),n.parents(".fusion-portfolio-wrapper").length&&setTimeout((function(){n.parents(".fusion-portfolio-wrapper").isotope()}),50)})),e.isotope(),setTimeout((function(){window.dispatchEvent(new Event("fusion-resize-horizontal",{bubbles:!0,cancelable:!0})),jQuery(document.body).trigger("sticky_kit:recalc")}),100),jQuery('[data-spy="scroll"]').each((function(){jQuery(this).scrollspy("refresh")}))})))}jQuery(window).on("load",(function(){jQuery(".fusion-gallery-layout-grid, .fusion-gallery-layout-masonry").each((function(){fusionInitGallery(jQuery(this))}))})),jQuery(window).on("fusion-dynamic-content-render",(function(e,n){var i=jQuery(n).find(".fusion-gallery");0<i.length&&i.each((function(){jQuery(this).removeData(),fusionInitGallery(jQuery(this))}))})),jQuery(document).ready((function(){function e(e){const i=jQuery(e).parents(".awb-gallery-wrapper"),o=i.find(".awb-gallery-posts-loading-container"),t=parseInt(i.attr("data-limit")),a=parseInt(i.attr("data-page")),s=i.find(".fusion-gallery-column").length;var r=a*t;const l=r+t,u=r<s,f=!!jQuery(e).parents(".fusion-builder-live-element").length;u?(o.show(),i.find(".fusion-gallery-column").slice(r,l).hide().removeClass("awb-gallery-item-hidden").delay(300).fadeIn(100,(function(){f?window.parent.jQuery("#fb-preview").contents().find(i).find(".fusion-gallery-container").isotope("reveal",this).isotope("layout"):i.find(".fusion-gallery-container").isotope("reveal",this).isotope("layout"),o.slideUp()})),i.attr("data-page",a+1),i.find(".awb-gallery-infinite-scroll-handle").removeClass("is-active"),(r=(a+1)*t)>=s&&n(o,e)):n(o,e)}function n(e,n){e.show(),setTimeout(()=>{e.find(".fusion-loading-spinner").hide(),e.find(".fusion-loading-msg").html(window.fusionGalleryVars.no_more_items_msg)},500),setTimeout(()=>{e.slideUp(),jQuery(n).hide()},1e3)}jQuery("body").on("click",".awb-gallery-load-more-btn",(function(){event.preventDefault(),e(this)}));const i=new IntersectionObserver(n=>{n.forEach(n=>{n.isIntersecting&&!jQuery(n.target).hasClass("is-active")&&(jQuery(n.target).addClass("is-active"),e(n.target))})});document.querySelectorAll(".awb-gallery-infinite-scroll-handle").forEach(e=>{i.observe(e)}),jQuery(document).on("fusion-element-render-fusion_gallery",(function(e,n){var o=jQuery('div[data-cid="'+n+'"]').find(".awb-gallery-infinite-scroll-handle");o.length&&o.hasClass("is-active")&&(o.removeClass("is-active"),i.observe(o[0]))}))})),jQuery(document).on("fusion-element-render-fusion_tab fusion-element-render-fusion_tabs fusion-element-render-fusion_toggle fusion-element-render-fusion_tagline_box fusion-element-render-fusion_text",(function(e,n){jQuery('div[data-cid="'+n+'"]').find(".fusion-gallery").each((function(){jQuery(this).removeData(),fusionInitGallery(jQuery(this))}))}));