((t,i,e)=>{"use strict";let s=t.w,r=".grid-stack div.grid-stack-item{position:absolute;left:0;top:0;padding:0}.grid-stack.grid-stack-1{width:auto;margin-left:0;height:auto!important}.grid-stack.grid-stack-1 .builder_mosaic_item.grid-stack-item{position:relative;top:0;left:0;width:auto;margin-bottom:20px}";const a=!0===t.is_builder_active,[d,o]=i.currentScript.src.replace("scripts.js","").split("?ver="),l=i.createElement("style"),c={},n=8.333,g=".grid-stack .grid-stack-item",f=d+"modules/",m={float:!0,verticalMargin:0,disableDrag:!0,disableWindowResize:!0,disableResize:!0,ddPlugin:!1,animate:!1,inHead:!0,rtl:t.isRTL},h=(t,i)=>{if(c["l"+t]===e){c["l"+t]=!0;let i=t*n;t%3==0&&(i=Math.round(i)),l.textContent+=g+'[data-gs-x="'+t+'"]{left:'+i+"%}"}if(c["w"+i]===e){c["w"+i]=!0;let t=0==i?n:i*n;i%3==0&&(t=Math.round(t)),l.textContent+=g+'[data-gs-width="'+i+'"]{width:'+t+"%}"}},k=i=>{const e=t.selectWithParent("tpgs-wrap",i);for(let i=e.length-1;i>-1;--i){let r=e[i];if(!r.classList.contains("grid-stack-done")){m.cellHeight=parseFloat(r.dataset.cellHeight),m.minWidth=parseFloat(r.dataset.minWidth);let i=GridStack.init(m,r),e=t.convert(r.tfClass("builder_mosaic_item")).reverse();m.minWidth>=s&&r.classList.add("grid-stack-1");for(let r=e.length-1;r>-1;--r){let d=e[r],l=d.dataset,{gsX:n,gsWidth:g,hover:k}=l;k&&!0!==c["ef"+k]&&(c["ef"+k]=!0,t.loadCss(f+"effects/"+k,null,o)),m.minWidth<s&&h(n,g),i.addWidget(d,{x:n,y:l.gsY,width:g,height:l.gsHeight}),!1===a&&(d.style.visibility="visible",d.style.animationDelay=200*r+"ms",d.classList.add("animated",l.effect))}r.classList.add("grid-stack-done"),u(r)}}},p=e=>{const s=e.tfClass("tbm_wrap_more")[0];if(s){t.loadCss(f+"infinite","tbm_infinity",o);const e=s.previousElementSibling,r=e.parentNode.classList.contains("pagination-load-more");e.tfOn("infiniteloaded",(function(t){let e=this;while(1){if(!e.nextElementSibling?.classList.contains("tpgs-wrap"))break;e=e.nextElementSibling}const s=this.cloneNode(!1),r=i.createDocumentFragment(),a=t.detail.items;s.classList.remove(this.gridstack.opts._class,"grid-stack-done"),s.removeAttribute("data-gs-current-row");for(let t=0;t<a.length;++t)r.appendChild(a[t]);s.appendChild(r),k(s),e.after(s)}),{passive:!0}),r&&s.classList.remove("tf_hidden"),t.infinity(e,{scrollThreshold:!r,history:!1})}},u=i=>{const e=i.closest(".tf_swiper-container");e&&!e.classList.contains("tf_swiper-container-initialized")&&t.carousel(e)};l.id="tb_mosaic_css",t.isRTL&&(r+=".grid-stack-rtl{direction:ltr}.grid-stack-rtl .grid-stack-item{direction:rtr}"),!0===a&&(r+=".themify_builder_active .builder_mosaic_item{visibility:visible}"),l.textContent=r,i.head.appendChild(l),r=null,t.on("builder_load_module_partial",((e,s)=>{if(!0===s&&!e.classList.contains("module-mosaic"))return;const r=[t.animateCss(),t.loadJs(d+"gridstack",!!window.GridStack,o)];(e||i).tfClass("product")[0]&&r.push(t.loadCss(f+"product","tbm_products",o)),Promise.all(r).then((()=>{k(e),!1===a&&t.requestIdleCallback((()=>{p(e)}),100)}))})).on("tfsmartresize",(t=>{if(t){s=t.w;for(let t=i.tfClass("grid-stack-done"),e=t.length-1;e>-1;--e){let i=t[e];if(i.gridstack)if(i.dataset.minWidth>=s)i.classList.add("grid-stack-1");else{for(let t=i.tfClass("grid-stack-item"),e=t.length-1;e>-1;--e){let i=t[e].dataset;h(i.gsX,i.gsWidth)}i.classList.remove("grid-stack-1")}}}}))})(Themify,document,void 0);