{"version":3,"file":"bg-lazy-load-DxVlUoq_.js","sources":["../../../app/frontend/js/bg-lazy-load.js"],"sourcesContent":["// all elements with background images that should be lazy loaded\nconst lazyImages = document.querySelectorAll(\".bg-img.bg-lazy\")\n\n// options for the observer\nconst backgroundOptions = {\n threshold: 0,\n rootMargin: \"0px 0px 50px 0px\",\n}\n\n// the observer\nconst imageObserver = new IntersectionObserver((entries, imageObserver) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n showImageBackground(entry.target)\n imageObserver.unobserve(entry.target)\n }\n })\n}, backgroundOptions)\n\n// observe each image\nlazyImages.forEach((image) => {\n imageObserver.observe(image)\n})\n\n// show background image\nfunction showImageBackground(node) {\n node.classList.remove(\"bg-lazy\")\n}\n"],"names":["lazyImages","backgroundOptions","imageObserver","entries","entry","showImageBackground","image","node"],"mappings":"AACA,MAAMA,EAAa,SAAS,iBAAiB,iBAAiB,EAGxDC,EAAoB,CACxB,UAAW,EACX,WAAY,kBACd,EAGMC,EAAgB,IAAI,qBAAqB,CAACC,EAASD,IAAkB,CACzEC,EAAQ,QAASC,GAAU,CACrBA,EAAM,iBACRC,EAAoBD,EAAM,MAAM,EAChCF,EAAc,UAAUE,EAAM,MAAM,EAE1C,CAAG,CACH,EAAGH,CAAiB,EAGpBD,EAAW,QAASM,GAAU,CAC5BJ,EAAc,QAAQI,CAAK,CAC7B,CAAC,EAGD,SAASD,EAAoBE,EAAM,CACjCA,EAAK,UAAU,OAAO,SAAS,CACjC"}