(function(){window.WPD=window.WPD||{};WPD.lazy=function(){"undefined"==typeof WPD.lazy.fn&&(WPD.lazy.fn={initialized:!1,elAttached:!1,n:[],init:function(){this.initialized||(this.events(),this.initialized=!0);document.removeEventListener("wpd-dom-viewport-loaded",WPD.lazy.fn.init);this.handler()},events:function(){document.addEventListener("scroll",this.handler.bind(WPD.lazy.fn),{passive:!0});document.addEventListener("resize",this.handler.bind(WPD.lazy.fn),{passive:!0});document.addEventListener("wpd-lazy-trigger",
this.handler.bind(WPD.lazy.fn),{passive:!0})},handler:function(){let b=WPD.dom;b(this.n.join(",")).each(function(a){"undefined"==typeof a._wpd_lazy_loaded&&b(a).inViewPort(-50)&&("img"==a.tagName.toLowerCase()?a.src=b(a).attr("data-src"):a.style.backgroundImage="url('"+b(a).attr("data-src")+"')",a._wpd_lazy_loaded=!0)})}});1==arguments.length&&-1===WPD.lazy.fn.n.indexOf(arguments[0])&&WPD.lazy.fn.n.push(arguments[0]);"undefined"==typeof WPD.dom||"undefined"==typeof WPD.dom.fn.inViewPort?WPD.lazy.fn.elAttached||
(console.log("WPD Lazy: waiting for dependency to load."),document.addEventListener("wpd-dom-viewport-loaded",WPD.lazy.fn.init.bind(WPD.lazy.fn)),WPD.lazy.fn.elAttached=!0):WPD.lazy.fn.init()};document.dispatchEvent(new Event("wpd-lazy-loaded"))})();
