!function(i){"use strict";i(window).on("load fusion-element-render-fusion_woo_product_grid",function(n,o){i(".fusion-products-container-infinite").each(function(n){var o,e,s=i(this),t=1;o="",s.closest(".fusion-woo-product-grid").length&&(o="."+s.parents(".fusion-woo-product-grid").attr("class").replace(/\ /g,".")+" "),i(s).infinitescroll({navSelector:o+".woocommerce-pagination",nextSelector:o+".woocommerce-pagination .next",itemSelector:o+"li.product",loading:{finishedMsg:fusionProductGridVars.infinite_finished_msg,msg:i('<div class="fusion-loading-container fusion-clearfix"><div class="fusion-loading-spinner"><div class="fusion-spinner-1"></div><div class="fusion-spinner-2"></div><div class="fusion-spinner-3"></div></div><div class="fusion-loading-msg">'+fusionProductGridVars.infinite_blog_text+"</div>")},maxPage:s.data("pages")?s.data("pages"):void 0,infid:"pcg"+n,errorCallback:function(){s.find(".fusion-post-grid").css("height","")}},function(n){(e=s).data("pages")==t&&(e.parent().find(".fusion-loading-container").hide(),e.parent().find(".fusion-load-more-button").hide()),setTimeout(function(){i(window).trigger("resize",[!1])},500),i.isFunction(i.fn.initElementAnimations)&&i(window).initElementAnimations(i(this)),t++}),(i(s).hasClass("fusion-product-archive")&&"load_more_button"===fusionProductGridVars.pagination_type||i(s).hasClass("fusion-products-container-load-more"))&&(i(s).infinitescroll("unbind"),(i(s).hasClass("fusion-product-archive")?i(s).parent().find(".fusion-load-more-button"):i(s).parents(".fusion-product-archive").find(".fusion-load-more-button")).on("click",function(n){n.preventDefault(),i(s).infinitescroll("retrieve")})),e=s,1===parseInt(e.data("pages"),10)&&(e.parent().find(".fusion-loading-container").hide(),e.parent().find(".fusion-load-more-button").hide())})})}(jQuery);