wp_back/wp-content/plugins/ewww-image-optimizer/includes/lazysizes.min.js

1 line
15 KiB
JavaScript
Raw Normal View History

2024-05-20 15:37:46 +03:00
var ewww_webp_supported;void 0===ewww_webp_supported&&(ewww_webp_supported=!1),window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.expand=500<document.documentElement.clientHeight&&500<document.documentElement.clientWidth?1e3:740,"undefined"==typeof eio_lazy_vars&&(eio_lazy_vars={exactdn_domain:".exactdn.com",threshold:0,skip_autoscale:0}),50<eio_lazy_vars.threshold&&(window.lazySizesConfig.expand=eio_lazy_vars.threshold),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,n,o){"use strict";var s,l,d={};function c(e,t,a){var i,r;d[e]||(i=n.createElement(t?"link":"script"),r=n.getElementsByTagName("script")[0],t?(i.rel="stylesheet",i.href=e):(i.onload=function(){i.onerror=null,i.onload=null,a()},i.onerror=i.onload,i.src=e),d[e]=!0,d[i.src||i.href]=!0,r.parentNode.insertBefore(i,r))}n.addEventListener&&(l=/\(|\)|\s|'/,s=function(e,t){var a=n.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,i;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&c(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,c(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):c(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,s(a,function(){r.style.backgroundImage="url("+(l.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(i=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,s(i,function(){r.poster=i,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!1))}),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(u,f,g){"use strict";var n;f.addEventListener&&(n=/\(|\)|\s|'/,addEventListener("lazybeforeunveil",function(e){var t,a,i,r;e.detail.instance==g&&(e.defaultPrevented||("none"==e.target.preload&&(e.target.preload="auto"),(i=e.target.getAttribute("data-back"))&&(ewww_webp_supported&&(r=e.target.getAttribute("data-back-webp"))&&(i=r),t=u.devicePixelRatio||1,a=Math.round(e.target.offsetWidth*t),r=Math.round(e.target.offsetHeight*t),0===i.search(/\[/)||o(e.target)&&o(e.target.parentNode)&&(i=g.hC(e.target,"wp-block-cover")?(g.hC(e.target,"has-parallax")?(a=Math.round(u.screen.width*t),r=Math.round(u.screen.height*t)):r<300&&(r=430),s(i,a,r,"bg-cover")):g.hC(e.target,"cover-image")||g.hC(e.target,"elementor-bg")||g.hC(e.target,"et_parallax_bg")||g.hC(e.target,"bg-image-crop")?s(i,a,r,"bg-cover"):s(i,a,r,"bg")),e.target.style.backgroundImage&&-1===e.target.style.backgroundImage.search(/^initial/)?0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',r=e.target.style.backgroundImage+", "+i,e.target.style.backgroundImage=r):e.target.style.backgroundImage=e.target.style.backgroundImage+', url("'+(n.test(i)?JSON.stringify(i):i)+'")':0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',e.target.style.backgroundImage=i):e.target.style.backgroundImage="url("+(n.test(i)?JSON.stringify(i):i)+")")))},!1));function h(e){var t=e.getAttribute("data-eio-r