1class u{static className="ImageLightbox";static MQ_DESKTOP="(min-width: 980px)";static LIGHTBOX_ONLY_MEDIA="(max-width: 0px)";init(o){const r=o.querySelectorAll("picture");r.length&&r.forEach(i=>{const n=i.querySelector('source[data-lightbox="desktop"]'),e=i.querySelector('source[data-lightbox="mobile"]');this.markLightboxSourceAsNonRendering(n),this.markLightboxSourceAsNonRendering(e),!(!n&&!e)&&i.addEventListener("click",()=>{const a=this.getLightboxImageUrl(n,e);a&&this.openLightbox(a,i,n,e)})})}markLightboxSourceAsNonRendering(o){o&&o.setAttribute("media",u.LIGHTBOX_ONLY_MEDIA)}getLightboxImageUrl(o,r){const n=(typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(u.MQ_DESKTOP).matches:!1)?o:r;if(n?.srcset)return n.srcset.trim().split(",")[0]?.trim().split(" ")[0]}openLightbox(o,r,i,n){const e=document.createElement("div"),a=r.querySelector("img");e.className="imageLightbox open";const d=document.createElement("button");d.className="close",d.type="button",d.setAttribute("aria-label","SchlieÃen");const l=document.createElement("div");l.className="imageWrapper",l.appendChild(d);const c=document.createElement("img");c.className="image",c.src=o,c.alt=a?.alt||"",l.appendChild(c),e.appendChild(l);const w=document.body.style.overflow;document.body.style.overflow="hidden",document.body.appendChild(e);const t=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(u.MQ_DESKTOP):null,p=()=>{const s=this.getLightboxImageUrl(i,n);s&&c.getAttribute("src")!==s&&(c.src=s)},f=()=>{p()},m=()=>{p()};window.addEventListener("resize",f),t&&(typeof t.addEventListener=="function"?t.addEventListener("change",m):typeof t.addListener=="function"&&t.addListener(m));const g=()=>{e.remove(),document.body.style.overflow=w,document.removeEventListener("keydown",h),window.removeEventListener("resize",f),t&&(typeof t.removeEventListener=="function"?t.removeEventListener("change",m):typeof t.removeListener=="function"&&t.removeListener(m))},h=s=>{s.key==="Escape"&&g()};e.addEventListener("click",s=>{const L=s.target;(L===e||L.classList.contains("close"))&&g()}),document.addEventListener("keydown",h)}}export{u as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.