%26%23x26A0%3B︎',e.rObserver.unobserve(t)}))):this.setupFallback(t)},buildImage:function(t){t.dataset.srcset?(t.cld_loaded=!0,t.srcset=t.dataset.srcset):(t.src=this.getSizeURL(t),t.dataset.responsive&&this.rObserver.observe(t))},inInitialView:function(t){var e=t.getBoundingClientRect();return this.aboveFold=e.top=e;)t-=i,this.sizeBands.push(t);"undefined"!=typeof IntersectionObserver&&this._setupObservers(),this.enabled=!0},_setupObservers:function(){var t=this,e={rootMargin:this.lazyThreshold+"px 0px "+this.lazyThreshold+"px 0px"},i=this.minPlaceholderThreshold<2*this.lazyThreshold?2*this.lazyThreshold:this.minPlaceholderThreshold,r={rootMargin:i+"px 0px "+i+"px 0px"};this.rObserver=new ResizeObserver((function(e,i){e.forEach((function(e){e.target.cld_loaded&&e.contentRect.width>=e.target.cld_loaded&&(e.target.src=t.getSizeURL(e.target))}))})),this.iObserver=new IntersectionObserver((function(e,i){e.forEach((function(e){e.isIntersecting&&(t.buildImage(e.target),i.unobserve(e.target),t.pObserver.unobserve(e.target))}))}),e),this.pObserver=new IntersectionObserver((function(e,i){e.forEach((function(e){e.isIntersecting&&(e.target.src=t.getPlaceholderURL(e.target),i.unobserve(e.target))}))}),r)},_calcThreshold:function(){var t=this.config.lazy_threshold.replace(/[^0-9]/g,""),e=0;switch(this.config.lazy_threshold.replace(/[0-9]/g,"").toLowerCase()){case"em":e=parseFloat(getComputedStyle(document.body).fontSize)*t;break;case"rem":e=parseFloat(getComputedStyle(document.documentElement).fontSize)*t;break;case"vh":e=window.innerHeight/t*100;break;default:e=t}this.lazyThreshold=parseInt(e,10)},_getDensity:function(){var t=this.config.dpr?this.config.dpr.replace("X",""):"off";if("off"===t)return this.density=1,1;var e=this.deviceDensity;"max"!==t&&"auto"!==e&&(t=parseFloat(t),e=e>Math.ceil(t)?t:e),this.density=e},scaleWidth:function(t,e,i){var r=parseInt(this.config.max_width),n=Math.round(r/i);if(!e){e=t.width;for(var a=Math.round(e/i);-1===this.sizeBands.indexOf(e)&&ar&&(e=r),t.originalWidth
Skip to content