(()=>{"use strict";const e=function(e,t){0<e.length&&Array.prototype.slice.call(e,0).forEach((function(e,n){t(e,n)}))},t=()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>{e=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){e=!1}return e};document.addEventListener("DOMContentLoaded",(()=>{const n=document.querySelectorAll(".js-bg-parallax");if("undefined"==typeof IntersectionObserver)return void e(n,(e=>{e.setAttribute("data-is-loaded","true")}));(()=>{const e=window.navigator.userAgent;return 0<e.indexOf("iPad")||0<e.indexOf("iPhone")||0<e.indexOf("iPod")||0<e.indexOf("Android")&&0<e.indexOf("Mobile")})()?e(n,(e=>{e.setAttribute("data-is-mobile","true"),e.setAttribute("data-is-loaded","true")})):e(n,(e=>{const n=e.querySelector(".js-bg-parallax__bgimage > img");if(!n)return void e.setAttribute("data-is-loaded","true");const i=n.getAttribute("src");if(!i||!i.match(/\.[^\.\/]+?$/))return void e.setAttribute("data-is-loaded","true");e.setAttribute("data-is-loaded","true");const r=()=>{const i=new IntersectionObserver((e=>e.forEach((e=>r(e.isIntersecting)))),{root:null,rootMargin:"0px",threshold:0});i.observe(e);const r=r=>{let o=0,s=e.getBoundingClientRect().top;if(window.matchMedia("(max-width: 1023px)").matches)return i.unobserve(e),void window.removeEventListener("scroll",d,!!t()&&{passive:!0});const d=()=>{const t=e.getBoundingClientRect().top,i=s-t;let r=o+i/5;(30<Math.abs(i)||Math.abs(r)>=(n.offsetHeight-e.offsetHeight)/2)&&(r=o),o=r,s=t,n.style.transform=`translateY(calc(-50% + ${r}px))`};r?(d(),window.addEventListener("scroll",d,!!t()&&{passive:!0})):window.removeEventListener("scroll",d,!!t()&&{passive:!0})}};r(),window.addEventListener("resize",r,!1)}))}),!1)})();