!function(t){t.LazyLoad=function(r){"use strict";if(typeof define==="function"&&define.amd)r=window;var s={src:"data-src",srcset:"data-srcset",selector:".lazyload",root:null,rootMargin:"0px",threshold:0},i=function s(){var i={};var o=false;var t=0;var e=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){o=arguments[0];t++}var r=function t(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))if(o&&Object.prototype.toString.call(e[r])==="[object Object]")i[r]=s(true,i[r],e[r]);else i[r]=e[r]};for(;t<e;t++){var a=arguments[t];r(a)}return i};function o(t,e){this.settings=i(s,e||{});this.images=t||document.querySelectorAll(this.settings.selector);this.observer=null;this.init()}if(o.prototype={init:function t(){if(!r.IntersectionObserver){this.loadImages();return}var s=this;var e={root:this.settings.root,rootMargin:this.settings.rootMargin,threshold:[this.settings.threshold]};this.observer=new IntersectionObserver(function(t){Array.prototype.forEach.call(t,function(t){if(t.isIntersecting){s.observer.unobserve(t.target);var e=t.target.getAttribute(s.settings.src);var r=t.target.getAttribute(s.settings.srcset);if("img"===t.target.tagName.toLowerCase()){if(e)t.target.src=e;if(r)t.target.srcset=r}else t.target.style.backgroundImage="url("+e+")";t.target.classList.add("lazy-loaded")}})},e);Array.prototype.forEach.call(this.images,function(t){s.observer.observe(t)})},loadAndDestroy:function t(){if(!this.settings)return;this.loadImages();this.destroy()},loadImages:function t(){if(!this.settings)return;var s=this;Array.prototype.forEach.call(this.images,function(t){var e=t.getAttribute(s.settings.src);var r=t.getAttribute(s.settings.srcset);if("img"===t.tagName.toLowerCase()){if(e)t.src=e;if(r)t.srcset=r}else t.style.backgroundImage="url('"+e+"')";t.classList.add("lazy-loaded")})},destroy:function t(){if(!this.settings)return;this.observer.disconnect();this.settings=null}},r.lazyload=function(t,e){return new o(t,e)},r.jQuery){var e=r.jQuery;e.fn.lazyload=function(t){t=t||{};t.attribute=t.attribute||"data-src";new o(e.makeArray(this),t);return this}}return o}(t)}(window);