wp_back/wp-content/plugins/wp-smushit/app/assets/js/smush-lazy-load-native.min.js

2 lines
9.3 KiB
JavaScript
Raw Normal View History

2024-05-20 15:37:46 +03:00
!function(){var e={7090:function(e){!function(t,n){var i=function(e,t,n){"use strict";var i,a;if(function(){var t,n={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(t in a=e.lazySizesConfig||e.lazysizesConfig||{},n)t in a||(a[t]=n[t])}(),!t||!t.getElementsByClassName)return{init:function(){},cfg:a,noSupport:!0};var o=t.documentElement,r=e.HTMLPictureElement,s="addEventListener",l="getAttribute",d=e[s].bind(e),c=e.setTimeout,u=e.requestAnimationFrame||c,f=e.requestIdleCallback,v=/^picture$/i,g=["load","error","lazyincluded","_lazyloaded"],m={},y=Array.prototype.forEach,p=function(e,t){return m[t]||(m[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),m[t].test(e[l]("class")||"")&&m[t]},z=function(e,t){p(e,t)||e.setAttribute("class",(e[l]("class")||"").trim()+" "+t)},h=function(e,t){var n;(n=p(e,t))&&e.setAttribute("class",(e[l]("class")||"").replace(n," "))},b=function(e,t,n){var i=n?s:"removeEventListener";n&&b(e,t),g.forEach((function(n){e[i](n,t)}))},L=function(e,n,a,o,r){var s=t.createEvent("Event");return a||(a={}),a.instance=i,s.initEvent(n,!o,!r),s.detail=a,e.dispatchEvent(s),s},C=function(t,n){var i;!r&&(i=e.picturefill||a.pf)?(n&&n.src&&!t[l]("srcset")&&t.setAttribute("srcset",n.src),i({reevaluate:!0,elements:[t]})):n&&n.src&&(t.src=n.src)},E=function(e,t){return(getComputedStyle(e,null)||{})[t]},A=function(e,t,n){for(n=n||e.offsetWidth;n<a.minSize&&t&&!e._lazysizesWidth;)n=t.offsetWidth,t=t.parentNode;return n},_=(ze=[],he=[],be=ze,Le=function(){var e=be;for(be=ze.length?he:ze,ye=!0,pe=!1;e.length;)e.shift()();ye=!1},Ce=function(e,n){ye&&!n?e.apply(this,arguments):(be.push(e),pe||(pe=!0,(t.hidden?c:u)(Le)))},Ce._lsFlush=Le,Ce),M=function(e,t){return t?function(){_(e)}:function(){var t=this,n=arguments;_((function(){e.apply(t,n)}))}},w=function(e){var t,i=0,o=a.throttleDelay,r=a.ricTimeout,s=function(){t=!1,i=n.now(),e()},l=f&&r>49?function(){f(s,{timeout:r}),r!==a.ricTimeout&&(r=a.ricTimeout)}:M((function(){c(s)}),!0);return function(e){var a;(e=!0===e)&&(r=33),t||(t=!0,(a=o-(n.now()-i))<0&&(a=0),e||a<9?l():c(l,a))}},x=function(e){var t,i,a=99,o=function(){t=null,e()},r=function(){var e=n.now()-i;e<a?c(r,a-e):(f||o)(o)};return function(){i=n.now(),t||(t=c(r,a))}},N=(K=/^img$/i,Q=/^iframe$/i,V="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),X=0,Y=0,Z=0,ee=-1,te=function(e){Z--,(!e||Z<0||!e.target)&&(Z=0)},ne=function(e){return null==J&&(J="hidden"==E(t.body,"visibility")),J||!("hidden"==E(e.parentNode,"visibility")&&"hidden"==E(e,"visibility"))},ie=function(e,n){var i,a=e,r=ne(e);for(j-=n,G+=n,U-=n,q+=n;r&&(a=a.offsetParent)&&a!=t.body&&a!=o;)(r=(E(a,"opacity")||1)>0)&&"visible"!=E(a,"overflow")&&(i=a.getBoundingClientRect(),r=q>i.left&&U<i.right&&G>i.top-1&&j<i.bottom+1);return r},ae=function(){var e,n,r,s,d,c,u,f,v,g,m,y,p=i.elements;if((P=a.loadMode)&&Z<8&&(e=p.length)){for(n=0,ee++;n<e;n++)if(p[n]&&!p[n]._lazyRace)if(!V||i.prematureUnveil&&i.prematureUnveil(p[n]))fe(p[n]);else if((f=p[n][l]("data-expand"))&&(c=1*f)||(c=Y),g||(g=!a.expand||a.expand<1?o.clientHeight>500&&o.clientWidth>500?500:370:a.expand,i._defEx=g,m=g*a.expFactor,y=a.hFac,J=null,Y<m&&Z<1&&ee>2&&P>2&&!t.hidden?(Y=m,ee=0):Y=P>1&&ee>1&&Z<6?g:X),v!==c&&(I=innerWidth+c*y,$=innerHeight+c,u=-1*c,v=c),r=p[n].getBoundingClientRect(),(G=r.bottom)>=u&&(j=r.top)<=$&&(q=r.right)>=u*y&&(U=r.left)<=I&&(G||q||U||j)&&(a.loadHidden||ne(p[n]))&&(R&&Z<3&&!f&&(P<3||ee<4)||ie(p[n],c))){if(fe(p[n]),d=!0,Z>9)break}else!d&&R&&!s&&Z<4&&ee<4&&P>2&&(k[0]||a.preloadAfterLoad)&&(k[0]||!f&&(G||q||U||j||"auto"!=p[n][l](a.sizesAttr)))&&(s=k[0]||p[n]);s&&!d&&fe(s)}},oe=w(ae),re=function(e){var t=e.target;t._lazyCache?delete t._lazyCache:(te(e),z(t,a.loadedClass),h(t,a.loadingClass),b(t,le),L(t,"lazyloaded"))},se=M(re),le=function(e){se({target:e.
//# sourceMappingURL=smush-lazy-load-native.min.js.map