function t_lazyload__init(){t_lazyload__detectwebp();var elAllRecs=document.querySelector("#allrecords");elAllRecs&&"yes"===elAllRecs.getAttribute("data-tilda-imgoptimoff")?window.lazy_imgoptimoff="yes":window.lazy_imgoptimoff="";for(var elstoSkip=document.querySelectorAll(".t156 .t-img"),i=0;i-1&&(round=1*a[i].split(":")[1]),a[i].indexOf("comm:")>-1&&"resize"!=(comm=a[i].split(":")[1])&&"cover"!=comm&&"contain"!=comm&&(doo=!1),a[i].indexOf("skip")>-1&&(skip=!0),a[i].indexOf("optimoff")>-1&&(doo=!1)}if(round>1)width=(foo=t_lazyload__round(comm,width,height,round))[0],height=foo[1];if("cover"==comm&&width>0&&height>0&&width<=1e3)if(width===5*Math.ceil(width/5)&&height===5*Math.ceil(height/5));else if(_popularResolutions.indexOf(width+"x"+height)>-1);else if(_popularResolutionsOther.indexOf(width+"x"+height)>-1);else if(_hasClass(source,"tn-atom")||_hasClass(source,"tn-atom__img"));else{var foo;_hasClass(source,"t-cover__carrier")||(comm="resize"),width=(foo=t_lazyload__round(comm,width,height,100))[0],height=foo[1]}if("resize"==comm&&width<30&&(skip=!0),!0===doo&&(src=!0===skip||width>1e3||height>1e3||0==width||"IMG"!=source.tagName&&0==height?t_lazyload__getWebPUrl(src):t_lazyload__getResizeUrl(source.tagName,comm,src,width,height,x,y,bgsize)),"y"===window.lazy_err_static&&_isStaticUrl(src)&&(src=src.replace(_staticUrlRegex,"/static3.tildacdn.com/")),src){if("IMG"===target.tagName)target.setAttribute("src",src);else if("IFRAME"===target.tagName)target.setAttribute("src",src);else if("OBJECT"===target.tagName)target.setAttribute("data",src);else{var gradient,split;if(-1!==target.style.backgroundImage.indexOf("-gradient("))gradient=target.style.backgroundImage.split("), ")[1];gradient?target.style.backgroundImage="url("+src+"), "+gradient:(target.style.backgroundImage="url("+src+")",t_lazyload__checkParentBackground(target,src))}source.lazy_loading_src=src}}else _removeClass(source,"loading")}function t_lazyload__checkParentBackground(el,imageUrl){var coverId=el.getAttribute("data-content-cover-id");if(coverId){var srcType=imageUrl.split(".");srcType=srcType[srcType.length-1];var parentEl=document.getElementById("recorddiv"+coverId);"svg"===srcType&&(parentEl.style.backgroundImage="")}}function t_lazyload__round(comm,width,height,round){if("cover"==comm&&width>0&&height>0){var rr=width/height,ratio=1;rr<=1?(rr<=.8&&(ratio=.8),rr<=.751&&(ratio=.75),rr<=.667&&(ratio=.667),rr<=.563&&(ratio=.562),rr<=.501&&(ratio=.5),height=Math.ceil(height/round)*round,width=Math.ceil(height*ratio),width=10*Math.ceil(width/10)):(rr>=1.25&&(ratio=1.25),rr>=1.332&&(ratio=1.333),rr>=1.5&&(ratio=1.5),rr>=1.777&&(ratio=1.777),rr>=2&&(ratio=2),width=Math.ceil(width/round)*round,height=Math.ceil(width/ratio),height=10*Math.ceil(height/10))}else width>0&&(width=Math.ceil(width/round)*round),height>0&&(height=Math.ceil(height/round)*round);return[width,height]}function t_lazyload__getResizeUrl(tagName,comm,str,width,height,x,y){if("undefined"==str||null==str)return str;if(str.indexOf(".svg")>0||str.indexOf(".gif")>0||str.indexOf(".ico")>0||-1===str.indexOf("static.tildacdn.")||str.indexOf("-/empty/")>0||str.indexOf("-/resizeb/")>0)return str;if(str.indexOf("/-/")>-1)return str;if(0==width&&0==height)return str;if("y"==window.lazy_err_thumb)return str;if(str.indexOf("lib")>-1)return str;if("IMG"!==tagName&&"DIV"!==tagName&&"TD"!==tagName&&"A"!==tagName)return str;var k=1,newstr;if(1===window.devicePixelRatio&&Math.max(width,height)<=400&&(k=1.2),window.devicePixelRatio>1&&(k=2),width>0&&(width=parseInt(k*width)),height>0&&(height=parseInt(k*height)),width>1e3||height>1800)return newstr=t_lazyload__getWebPUrl(str);if("resize"==comm){var arrr;(arrr=str.split("/")).splice(str.split("/").length-1,0,"-/resize/"+width+"x"+("DIV"==tagName&&height>0?height:"")+"/"+("y"==window.lazy_webp?"-/format/webp":""));var newstr=_getThumbUrl(arrr.join("/"))}else{if(width<=0&&height<=0)return str;var arrr;"left"!==x&&"right"!==x&&(x="center"),"top"!==y&&"bottom"!==y&&(y="center"),(arrr=str.split("/")).splice(str.split("/").length-1,0,"-/"+comm+"/"+width+"x"+height+"/"+x+"/"+y+"/"+("y"==window.lazy_webp?"-/format/webp":""));var newstr=_getThumbUrl(arrr.join("/"))}return newstr}function t_lazyload__getWebPUrl(str){if("undefined"==str||null==str)return str;if(str.indexOf(".svg")>0||str.indexOf(".gif")>0||str.indexOf(".ico")>0||-1===str.indexOf("static.tildacdn.")||str.indexOf("-/empty/")>0||str.indexOf("-/resizeb/")>0)return str;if(str.indexOf("/-/")>-1)return str;if(str.indexOf("lib")>-1)return str;if("y"!==window.lazy_webp)return str;if("y"===window.lazy_err_thumb)return str;var arrr=str.split("/"),newstr;return arrr.splice(str.split("/").length-1,0,"-/format/webp"),_getThumbUrl(arrr.join("/"))}function t_lazyload__reloadonError(element,src,startTime){if("string"==typeof src&&null!=src&&""!=src){var newsrc;if(console.log("lazy loading err"),_isStaticUrl(src))return window.lazy_err_static="y",void t_lazyload__reloadonError__reload(element,newsrc=src.replace(_staticUrlRegex,"/static3.tildacdn.com/"));if(-1!==src.indexOf(t_lazyload__getThumbDomainName())&&-1!==src.indexOf("/-/")){window.lazy_err_thumb="y";var arrr=src.split("/"),uid="",name="",newsrc;if(arrr.length>3)for(var i=0;i1?_now()-startTime:"";"object"!=typeof window.t_cdnerrors&&(window.t_cdnerrors=[]),window.t_cdnerrors.push({url:src,time:qTime,debug:{domloaded:window.t_lazyload_domloaded}})}}}function t_lazyload__reloadonError__reload(element,src){console.log("try reload: "+src),"IMG"===element.tagName?src&&element.setAttribute("src",src):src&&(element.style.backgroundImage="url("+src+")")}function LazyLoad(instanceSettings){_init(),this._settings=_merge_objects(_defaultSettings,instanceSettings),this._queryOriginNode=this._settings.container===window?document:this._settings.container,this._previousLoopTime=0,this._loopTimeout=null,_supportsObserver&&this._initializeObserver(),this.update(),this.loadAnimatedImages()}return LazyLoad.prototype._showOnLoad=function(element){var fakeImg,settings=this._settings,startTime;function loadCallback(){null!==settings&&(t_lazyLoad__appendImgStatToArr(fakeImg,startTime),settings.callback_load&&settings.callback_load(element),_setSources(element,element,settings.data_srcset,settings.data_src),settings.callback_set&&settings.callback_set(element),_removeClass(element,settings.class_loading),_addClass(element,settings.class_loaded),fakeImg.removeEventListener("load",loadCallback))}!element.getAttribute("src")&&settings.placeholder&&element.setAttribute("src",settings.placeholder),(fakeImg=document.createElement("img")).addEventListener("load",loadCallback),fakeImg.addEventListener("error",(function(ev){_removeClass(element,settings.class_loading),settings.callback_error&&settings.callback_error(element),void 0!==ev.path?t_lazyload__reloadonError(element,ev.path[0].currentSrc,startTime):void 0!==ev.target&&t_lazyload__reloadonError(element,ev.target.currentSrc,startTime)})),_addClass(element,settings.class_loading),startTime=_now(),_setSources(fakeImg,element,settings.data_srcset,settings.data_src)},LazyLoad.prototype._showOnAppear=function(element){var settings=this._settings,startTime;function loadCallback(){null!==settings&&(t_lazyLoad__appendImgStatToArr(element,startTime),settings.callback_load&&settings.callback_load(element),_removeClass(element,settings.class_loading),_addClass(element,settings.class_loaded),element.removeEventListener("load",loadCallback))}"IMG"!==element.tagName&&"IFRAME"!==element.tagName||(element.addEventListener("load",loadCallback),element.addEventListener("error",(function(ev){element.removeEventListener("load",loadCallback),_removeClass(element,settings.class_loading),settings.callback_error&&settings.callback_error(element),void 0!==ev.path?t_lazyload__reloadonError(element,ev.path[0].currentSrc,startTime):void 0!==ev.target&&t_lazyload__reloadonError(element,ev.target.currentSrc,startTime)})),_addClass(element,settings.class_loading)),startTime=_now(),_setSources(element,element,settings.data_srcset,settings.data_src),settings.callback_set&&settings.callback_set(element)},LazyLoad.prototype._show=function(element){this._settings.show_while_loading?this._showOnAppear(element):this._showOnLoad(element)},LazyLoad.prototype._initializeObserver=function(){var self=this;this._intersectionObserver=new IntersectionObserver((function(entries){var scrollY=window.scrollY;entries.forEach((function(entry){var element=entry.target;if(!(self._settings.skip_invisible&&element.isSkipByPosition&&element.isNotUnderScreenRange)){var isAboveViewport=entry.boundingClientRect.top+scrollY<0,parentZeroElem=element.closest(".t396__elem"),isAboveInnerViewport=parentZeroElem&&0===parentZeroElem.style.top.indexOf("-");if(element.wasProcessed)return self._intersectionObserver.unobserve(element),void(self._settings.callback_processed&&self._settings.callback_processed(self._elements.length));(entry.isIntersecting||isAboveViewport||isAboveInnerViewport)&&(self._show(element),element.wasProcessed=!0)}}))}),{rootMargin:this._settings.threshold+"px",threshold:[0]})},LazyLoad.prototype.loadAnimatedImages=function(){var i,element,settings=this._settings,elements=this._elements,elementsLength=elements?elements.length:0;function getTriggerElementOffset(element,type){var trgEl;if("trigger"===type){var trgId=element.getAttribute("data-animate-sbs-trgels");trgId&&(trgEl=document.querySelector('[data-elem-id="'+trgId+'"]'))}else"viewport"===type&&(trgEl=_getParent(element,"t396"));return _isExist(trgEl)?_getOffset(trgEl):null}function isFarAway(element,type){var trgOffset=getTriggerElementOffset(element,type);if(!trgOffset)return!1;var elemOffset=_getOffset(element),distanceTopBottomBetween=Math.abs(trgOffset.top-elemOffset.top),distanceRightLeftBetween=Math.abs(trgOffset.left-elemOffset.left);return distanceTopBottomBetween>settings.threshold||distanceRightLeftBetween>settings.threshold}for(i=0;i0||str.indexOf(".gif")>0||str.indexOf(".ico")>0||-1===str.indexOf(t_lazyload__getThumbDomainName())||str.indexOf("-/empty/")>0&&str.indexOf("-/resizeb/")>0)){var pos=str.indexOf(prefix)+prefix.length,pos2=str.indexOf("/",pos);if(pos>0&&pos2>0){var modWH=str.slice(pos,pos2).split("x"),width=elem.clientWidth,height=elem.clientHeight;if(width>0&&height>0&&(modWH[0]>0||modWH[1]>0)&&(modWH[0]>0&&width>modWH[0]||modWH[1]>0&&height>modWH[1])&&(modWH[0]>0&&width-modWH[0]>100||modWH[1]>0&&height-modWH[1]>100)){var newstr=str.slice(0,pos)+(modWH[0]>0?width:"")+"x"+(modWH[1]>0?height:"")+str.substring(pos2);"IMG"==tagName?elem.setAttribute("src",newstr):elem.style.backgroundImage="url('"+newstr+"')"}}}}},window.t_loadImgStats=[];