((t,e)=>{"use strict";t.on("tf_autotiles_init",((i,l)=>{const _=(t,e)=>{let i=0;for(let l=t.length;l>-1;--l){let _=t[l]?.classList;if(_&&(_.contains("post")||_.contains("product"))){++i;let{offsetWidth:f,offsetHeight:o}=t[l];_.add(f-10<=e?f===o||f>o&&f-o<10||o>f&&o-f<10?"tiled-square-small":"tiled-portrait":f>o?"tiled-landscape":"tiled-square-large")}}return i};if(!t.cssLazy.has("tf_grid_auto_tiles"))for(let t=i.length-1;t>-1;--t)i[t].classList.add("tf_lazy");t.loadCss("grids/auto_tiles","tf_grid_auto_tiles").then((()=>{((i,l)=>{void 0===i.length&&(i=[i]);for(let o=i.length-1;o>-1;--o){if(null!==i[o].querySelector(".ptb_loops_wrapper")){i[o].classList.remove("auto_tiles","tf_lazy");continue}let s=i[o].children,r=s.length,a=i[o].classList;a.contains("tf_tiles_more")||a.add(5===r||6===r?"tf_tiles_"+r:"tf_tiles_more");let u=_(s,parseInt(e.getComputedStyle(i[o]).getPropertyValue("grid-auto-rows")));if(u>0){if(r!==u){if(!a.contains("tf_tiles_more")||u<6){for(var f=a.length-1;f>-1;--f)0===a[f].indexOf("tf_tiles_")&&a.remove(a[f]);5===u||6===u?(a.remove("tb_tiles_more"),a.add("tf_tiles_"+u)):a.add("tf_tiles_more")}_()}let e=i[o].previousElementSibling;e?.classList.contains("post-filter")&&t.trigger("themify_isotop_filter",i[o].previousElementSibling),l?.(i[o]),a.remove("tf_lazy")}a.add("tf_auto_tiles_init")}})(i,l)}))}))})(Themify,window);