!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,i){"use strict";function n(){l.lazyLoadCss(),l.lazyLoadScripts()}function a(){window.addEventListener("scroll",function(){if(u)return!1;u=setTimeout(function(){n(),u=null},100)}),l.loadScripts()}var s=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(s),l=new r.default,u=null;window.addEventListener("load",function(){a()})},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(){function t(){n(this,t),this._elementId="ys-main-script",this._scriptOnloadAttribute="data-ys-onload-script",this._scriptLazyAttribute="data-ys-lazy-script",this._cssLazyAttribute="data-ys-lazy-css",this._lazyScripts=null,this._lazyCss=null,this._waitLazyLoad=new Date}return a(t,[{key:"getScripts",value:function(t){var e=document.getElementById(this._elementId);if(null==e)return null;var i=e.getAttribute(t);if(null==i||""===i)return null;try{i=JSON.parse(i)}catch(t){return!1}return i}},{key:"getLazyScripts",value:function(){return null!=this._lazyScripts?this._lazyScripts:(this._lazyScripts=this.getScripts(this._scriptLazyAttribute),this._lazyScripts)}},{key:"getLazyCss",value:function(){return null!=this._lazyCss?this._lazyCss:(this._lazyCss=this.getScripts(this._cssLazyAttribute),this._lazyCss)}},{key:"setWaitingTimeLazyLoad",value:function(){this._waitLazyLoad.setSeconds(this._waitLazyLoad.getSeconds()+5)}},{key:"resetWaitingTimeLazyLoad",value:function(){this._waitLazyLoad=new Date}},{key:"isWaitingLazyLoad",value:function(){return new Date<this._waitLazyLoad}},{key:"loadScripts",value:function(){var e=this.getScripts(this._scriptOnloadAttribute);if(null!==e&&!1!==e)for(var i=0;i<e.length;i=i+1|0)t.loadScript(e[i].id,e[i].url,"")}},{key:"lazyLoadScripts",value:function(){var e=this.getLazyScripts();null!==e&&!1!==e&&e.length>0&&(this.isWaitingLazyLoad()||(this.setWaitingTimeLazyLoad(),t.loadScript(e[0].id,e[0].url,"",this.resetWaitingTimeLazyLoad()),this._lazyScripts.shift()))}},{key:"lazyLoadCss",value:function(){var e=this.getLazyCss();null!==e&&!1!==e&&e.length>0&&(this.isWaitingLazyLoad()||(this.setWaitingTimeLazyLoad(),t.loadCss(e[0].id,e[0].url,"",this.resetWaitingTimeLazyLoad()),this._lazyCss.shift()))}}],[{key:"loadScript",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=document;if(""===i||a.getElementById(i)){var s=void 0;a.getElementById(t)||(s=a.createElement("script"),s.id=t,s.src=e,s.async=!0,null!=n&&(s.onload=n),a.body.appendChild(s))}}},{key:"loadCss",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=document,a=void 0;n.getElementById(t)||(a=n.createElement("link"),a.id=t,a.href=e,a.rel="stylesheet",null!=i&&(a.onload=i),n.getElementsByTagName("head")[0].appendChild(a))}}]),t}();e.default=s}]);