((t,$,i)=>{"use strict";t.body.addEventListener("ptb_gallery_init",(async e=>{const r=e.detail.contex,_=$(".ptb_extra_showcase",r),a=$(".ptb_extra_gallery_masonry .ptb_extra_gallery",r),s=t.body.classList.contains("rtl");_.each((function(){$(this).on("click","img",(function(t){t.preventDefault();let i=$(this).closest(".ptb_extra_showcase").find(".ptb_extra_main_image"),e=$(this).clone(),r=e.data("ptb-image-link");i.html(e),r&&e.wrap('<a href="'+r+'" />')})).find("img:first").trigger("click")})),a.length>0&&(await i.loadJs(ptb.include+"masonry.min.js",void 0!==$.fn.masonry,"4.2.2"),a.each((function(){this.insertAdjacentHTML("afterbegin",'<div class="ptb_gallery_gutter_sizer"></div><div class="ptb_gallery_item_sizer"></div>'),i.imagesLoad(this).then((t=>{$(t).masonry({columnWidth:".ptb_gallery_item_sizer",itemSelector:".ptb_extra_gallery_item",isOriginLeft:!s,gutter:".ptb_gallery_gutter_sizer"})}))})))}))})(document,jQuery,PTB);