let loadStatus=!0;function uagb_carousel_height(e){e=document.querySelector("#wpwrap .is-carousel.uagb-block-"+e);e&&window.UAGBPostCarousel._setHeight(e)}function uagb_carousel_unset_height(e){e=document.querySelector("#wpwrap .is-carousel.uagb-block-"+e);e&&window.UAGBPostCarousel._unSetHeight(e)}window.UAGBPostCarousel={_setHeight(e){if(0{var t=l[e].offsetHeight,e=l[e].querySelector(".uagb-post__inner-wrap")?.offsetHeight;a{const t=l[e].querySelector(".uagb-post__inner-wrap");t&&(t.style.height=a+"px")}),e[0].querySelector(".slick-list"));r&&(r.style.height=n+"px"),a=-1,o=-1,Object.keys(s).forEach(e=>{const t=s[e];if(t.classList.contains("slick-active"))return!0;e=(r=t.querySelector(".uagb-post__inner-wrap"))?.offsetHeight;e&&(r.style.height=e+"px")})}},_unSetHeight(e){if(0{const t=a[e].querySelector(".uagb-post__inner-wrap");t.style.height="auto"}),Object.keys(a).forEach(e=>{const t=o[e];if(t.classList.contains("slick-active"))return!0;const a=t.querySelector(".uagb-post__inner-wrap");a.style.height="auto"})}}},window.UAGBPostMasonry={_init(o,e){let n=2;const r=window.innerHeight/1.25;let s=document.querySelector(e);const l=s?.querySelectorAll(".uagb-post-inf-loader");"none"!==o.paginationType&&"scroll"===o.paginationEventType&&window.addEventListener("scroll",function(){let e=s.querySelector(".uagb-post__items");var t,a=(e=e||s).lastElementChild.getBoundingClientRect().top+window.scrollY;window.pageYOffset+r>=a&&(a={page_number:n},t=s.getAttribute("data-total"),!0===loadStatus&&n<=t&&(0e.json()).then(function(r){let s=l.querySelector(".is-masonry");s=s||l,setTimeout(function(){const e=new Isotope(s,{itemSelector:"article"});e.insert(window.UAGBPostMasonry.createElementFromHTML(r.data)),loadStatus=!0,0e.json()).then(function(e){const t=document.querySelector(".uagb-block-"+s);if(t){const o=e.data.replace(/\n|\t/g,"");e=(t.outerHTML=o).match(/uagb-block-([\w-]+)/)?.[1]||"";{var a=e;const n=document.querySelectorAll(`.uagb-post-grid.uagb-block-${a} .uagb-post-pagination-wrap a`);n.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault();const t=e.target.getAttribute("href").match(/admin-ajax.*/)?.[0]||"";e=t.match(/\d+/)?.[0]||1;window.UAGBPostGrid._callAjax(r,parseInt(e),a)})})}}else;})}};