Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-blocks-page189679009.min.js

Код файла
Версия от 31.08.2026, 07:09:39 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1window.isMobile=!1;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){window.isMobile=!0}2function t_throttle(fn,threshhold,scope){var last;var deferTimer;threshhold||(threshhold=250);return function(){var context=scope||this;var now=+new Date();var args=arguments;if(last&&now<last+threshhold){clearTimeout(deferTimer);deferTimer=setTimeout(function(){last=now;fn.apply(context,args)},threshhold)}else{last=now;fn.apply(context,args)}}}3function t670_init(recid,isEditMode){var rec=document.getElementById('rec'+recid);if(!rec)return;var image=rec.querySelector('.t-img');if(image){if(image.complete){t670_addImageEvents(recid,isEditMode)}else{image.addEventListener('load',function(){t670_addImageEvents(recid,isEditMode)});image.addEventListener('error',function(){t670_addImageEvents(recid,isEditMode)})}}else{t670_addImageEvents(recid,isEditMode)}}4const t670_postMessages={youtube:{pause:'{"event":"command","func":"pauseVideo","args":""}',play:'{"event":"command","func":"playVideo","args":""}',},rutube:{pause:'{"type":"player:pause","data":"{}"}',play:'{"type":"player:play","data":"{}"}',},vimeo:{pause:'{"method":"pause","value":"true"}',play:'{"method":"play","value":"true"}',},};function t670_addImageEvents(recid,isEditMode){var rec=document.getElementById('rec'+recid);t670_imageHeight(rec);t670_show(rec);t670_hide(rec);t670_addArrowHandlers(rec);t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid)});if(isEditMode){t_onFuncLoad('t_slds_UpdateSliderHeight',function(){t_slds_UpdateSliderHeight(recid)});t_onFuncLoad('t_slds_UpdateSliderArrowsHeight',function(){t_slds_UpdateSliderArrowsHeight(recid)})}5var wrapper=rec.querySelector('.t670');if(wrapper){wrapper.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)});t_onFuncLoad('t_slds_positionArrows',function(){t_slds_positionArrows(recid)})})}}
История файла и сравнение версий
  • 31.08.2026, 07:09:39 · 56c3b845
6function t670_handleRutube(videoWrap,videoLazy){var videoId=videoLazy.getAttribute('data-videolazy-id');if(videoId)videoId=videoId.replace(/[^\w-]/g,'');if(!videoId)return;var videoHash=videoLazy.getAttribute('data-videolazy-hash');if(videoHash)videoHash=videoHash.replace(/[^\w-]/g,'');var existingIframe=videoWrap.querySelector('iframe.t670__rutube-iframe');if(!existingIframe){var src='https://rutube.ru/play/embed/'+videoId+'/?autoplay=1&muted=1&playsinline=1';if(videoHash)src+='&p='+videoHash;videoWrap.innerHTML='';var iframe=document.createElement('iframe');iframe.className='t670__rutube-iframe';iframe.setAttribute('allow','autoplay; fullscreen');iframe.setAttribute('allowfullscreen','');iframe.setAttribute('frameborder','0');iframe.style.width='100%';iframe.style.height='100%';iframe.style.display='block';iframe.src=src;videoWrap.appendChild(iframe)}else{try{existingIframe.contentWindow.postMessage(t670_postMessages.rutube.play,'*')}catch(e){console.warn('Failed to send play message to Rutube iframe:',e)}}}
7function t670_show(rec){var playBtns=rec.querySelectorAll('.t670__play');Array.prototype.forEach.call(playBtns,function(play){var itemWrap=play.closest('.t670__imgwrapper');var image=itemWrap.querySelector('.t-slds__bgimg');var videoWrap=itemWrap.querySelector('.t670__wrap-video');var videoLazy=videoWrap.querySelector('.t-video-lazyload');play.addEventListener('click',function(event){event.preventDefault();videoWrap.style.display='block';image.style.opacity=0;var type=videoLazy.getAttribute('data-videolazy-type');if(type==='rutube'){t670_handleRutube(videoWrap,videoLazy)}else{t_onFuncLoad('t_video_lazyload__addVideo',function(){t_video_lazyload__addVideo(videoLazy)})}})})}
8function t670_pauseVideo(videoWrap){if(!videoWrap)return;var iframe=videoWrap.querySelector('iframe');if(iframe&&iframe.contentWindow&&iframe.src){var videoSRC=iframe.src;if(videoSRC.indexOf('&enablejsapi=1')!==-1){iframe.contentWindow.postMessage(t670_postMessages.youtube.pause,'*')}
9if(videoSRC.indexOf('rutube')!==-1){iframe.contentWindow.postMessage(t670_postMessages.rutube.pause,'*')}
10if(videoSRC.indexOf('vimeo')!==-1&&videoSRC.indexOf('&api=1')!==-1){iframe.contentWindow.postMessage(t670_postMessages.vimeo.pause,'*')}}
11var videoEl=videoWrap.querySelector('video');if(videoEl&&typeof videoEl.pause==='function'){try{videoEl.pause()}catch(e){console.warn('t670: Failed to pause video element:',e)}}}
12function t670_hide(rec){var videoWraps=rec.querySelectorAll('.t670__wrap-video');rec.addEventListener('updateSlider',function(){Array.prototype.forEach.call(videoWraps,function(videoWrap){t670_pauseVideo(videoWrap);var hasIframe=videoWrap.querySelector('iframe');if(!hasIframe){videoWrap.style.display='none'}})})}
13function t670_addArrowHandlers(rec){if(!rec)return;if(rec.t670ArrowsInitialized){return}
14rec.t670ArrowsInitialized='true';rec.addEventListener('click',function(event){var arrow=event.target.closest('.t-slds__arrow_wrapper');if(!arrow)return;t670_pauseAllVideos(rec)})}
15function t670_pauseAllVideos(rec){if(!rec)return;var videoWraps=rec.querySelectorAll('.t670__wrap-video');Array.prototype.forEach.call(videoWraps,function(videoWrap){t670_pauseVideo(videoWrap);var hasIframe=videoWrap.querySelector('iframe');if(!hasIframe){videoWrap.style.display='none';var imgWrapper=videoWrap.closest('.t670__imgwrapper');if(imgWrapper){var bgImg=imgWrapper.querySelector('.t-slds__bgimg');if(bgImg){bgImg.style.opacity=1}}}})}
16function t670_imageHeight(rec){var images=rec.querySelectorAll('.t670__separator');Array.prototype.forEach.call(images,function(img){var width=parseInt(img.getAttribute('data-slider-image-width'))||0;var height=parseInt(img.getAttribute('data-slider-image-height'))||0;var ratio=height/width;var padding=ratio*100;img.style.paddingBottom=padding+'%'})}
17function t214__updateLazyLoad(recid){var scrollContainer=document.querySelector('#rec'+recid+' .t214__container_mobile-flex');var currentMode=document.querySelector('.t-records').getAttribute('data-tilda-mode');if(scrollContainer&&currentMode!=='edit'&&currentMode!=='preview'){scrollContainer.addEventListener('scroll',t_throttle(function(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}}))}}
18function t746_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return!1;var popup=rec.querySelector('.t-popup');var videoWraps=rec.querySelectorAll('.t746__wrap-video');var hook=popup?popup.getAttribute('data-tooltip-hook'):'';var analitics=popup?popup.getAttribute('data-track-popup'):'';rec.setAttribute('data-animationappear','off');rec.style.opacity='1';t746_imageHeight(rec);t746_arrowWidth(rec);t746_show(rec);rec.addEventListener('updateSlider',function(){t746_hide(videoWraps)});window.addEventListener('resize',t_throttle(function(){t746_arrowWidth(rec)},200));window.addEventListener('orientationchange',function(){setTimeout(function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)})},500)});if(hook){t_onFuncLoad('t_popup__addAttributesForAccessibility',function(){t_popup__addAttributesForAccessibility(hook)});if(popup){popup.addEventListener('click',function(e){if(e.target===popup){t746_hide(videoWraps);t746_closePopup(rec)}})}
19var popupClose=rec.querySelector('.t-popup__close');if(popupClose){popupClose.addEventListener('click',function(){t746_hide(videoWraps);t746_closePopup(rec)})}
20document.addEventListener('keydown',function(e){if(e.keyCode===27){t746_hide(videoWraps);t746_closePopup(rec)}});var allRec=document.getElementById('allrecords');var lazyMode=allRec?allRec.getAttribute('data-tilda-lazy'):'';var isInitSlds=!1;document.addEventListener('click',function(e){var href=e.target.closest('a[href="'+hook+'"]');if(href){e.preventDefault();t746_showPopup(recid);if(isInitSlds){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)})}else{t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid);isInitSlds=!0})}
21t746_arrowWidth(rec);t_onFuncLoad('t_popup__resizePopup',function(){t_popup__resizePopup(recid)});if(window.lazy==='y'||lazyMode==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}
22if(analitics&&window.Tilda){var virtTitle=hook;if(virtTitle.substring(0,7)==='#popup:'){virtTitle=virtTitle.substring(7)}
23Tilda.sendEventToStatistics(analitics,virtTitle)}}});t_onFuncLoad('t_popup__addClassOnTriggerButton',function(){t_popup__addClassOnTriggerButton(document,hook)})}}
24function t746_showPopup(recid){var rec=document.getElementById('rec'+recid);var popup=rec?rec.querySelector('.t-popup'):null;t_onFuncLoad('t_popup__showPopup',function(){t_popup__showPopup(popup)});if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed')}
25function t746_closePopup(rec){var popup=rec.querySelector('.t-popup');var popupHook=popup?popup.getAttribute('data-tooltip-hook'):'';var popupHookLink=document.querySelectorAll('[data-tooltip-hook="'+popupHook+'"]');if(popup&&!popup.classList.contains('t-popup_show')){return}else if(popup){Array.prototype.forEach.call(popupHookLink,function(popup){popup.classList.remove('t-popup_show')})}
26if(!document.querySelector('.t-popup_show')){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t-body_popupshowed')}
27var allCovers=rec.querySelectorAll('.t-bgimg');Array.prototype.forEach.call(allCovers,function(cover){if(cover.style.opacity==='0'){cover.style.opacity=''}});t_onFuncLoad('t_popup__addFocusOnTriggerButton',function(){t_popup__addFocusOnTriggerButton()});setTimeout(function(){if(popup)popup.style.display='none'},300)}
28function t746_sendPopupEventToStatistics(popupname){var virtPage='/tilda/popup/';var virtTitle='Popup: ';if(popupname.substring(0,7)==='#popup:'){popupname=popupname.substring(7)}
29virtPage+=popupname;virtTitle+=popupname;if(ga){if(window.mainTracker!=='tilda'){ga('send',{hitType:'pageview',page:virtPage,title:virtTitle,})}}
30if(window.mainMetrika>''&&window[window.mainMetrika]){window[window.mainMetrika].hit(virtPage,{title:virtTitle,referer:window.location.href,})}}
31function t746_show(rec){var playBtns=rec.querySelectorAll('.t746__play');Array.prototype.forEach.call(playBtns,function(play){var itemWrap=play.closest('.t746__imgwrapper');var image=itemWrap.querySelector('.t-slds__bgimg');var videoWrap=itemWrap.querySelector('.t746__wrap-video');var videoLazy=videoWrap.querySelector('.t-video-lazyload');play.addEventListener('click',function(event){event.preventDefault();event.stopPropagation();t_onFuncLoad('t_video_lazyload__addVideo',function(){videoWrap.style.display='block';image.style.opacity=0;t_video_lazyload__addVideo(videoLazy)})})})}
32function t746_hide(videoWraps){t_onFuncLoad('t_video__getPlayer',function(){Array.prototype.forEach.call(videoWraps,function(videoWrap){videoWrap.style.display='none';var videoLazy=videoWrap.querySelector('.t-video-lazyload');var videoLoad=videoLazy.getAttribute('data-videolazy-load');if(videoLoad==='false')return;var slide=videoWrap.closest('.t-slds__item:not(.t-slds__item_dummy)');if(!slide)return;var player=t_video__getPlayer(slide);if(player){player.pause()}else{t746_proccessVideo(slide).then(player=>player.pause()).catch(error=>error)}
33if(player)player.pause()})})}
34function t746_imageHeight(rec){var images=rec.querySelectorAll('.t746__separator');Array.prototype.forEach.call(images,function(img){var width=parseInt(img.getAttribute('data-slider-image-width'))||0;var height=parseInt(img.getAttribute('data-slider-image-height'))||0;var ratio=height/width;var padding=ratio*100;img.style.paddingBottom=padding+'%'})}
35function t746_arrowWidth(rec){var arrows=rec.querySelectorAll('.t-slds__arrow_wrapper');var slide=rec.querySelector('.t-slds__item_active .t-slds__wrapper');var slideWidth=slide?slide.offsetWidth:0;var arrowWidth=window.innerWidth-slideWidth;Array.prototype.forEach.call(arrows,function(arrow){var arrowContainer=arrow.closest('.t-slds__arrow_container');var isArrowNearPic=arrowContainer?arrowContainer.classList.contains('t-slds__arrow-nearpic'):!1;if(window.innerWidth>960&&isArrowNearPic){arrow.style.width=arrowWidth/2+'px'}else{arrow.style.width=''}})}
36function t746_proccessVideo(videoContainer){return new Promise((resolve,reject)=>{t_onFuncLoad('t_video__createPlayer',()=>{t_video__createPlayer(videoContainer).then(player=>resolve(player)).catch(reason=>reject(reason))})})}
37if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector}
38if(!Element.prototype.closest){Element.prototype.closest=function(s){var el=this;while(el&&el.nodeType===1){if(Element.prototype.matches.call(el,s)){return el}
39el=el.parentElement||el.parentNode}
40return null}}
41function t410_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var wrapper=rec?rec.querySelector('.t410__wrapper'):null;if(!wrapper)return!1;var sliderOrientation=wrapper.getAttribute('data-beforeafter-orientation');var sliderStartPosition=wrapper.getAttribute('data-beforeafter-start');var firstImgURL=wrapper.getAttribute('data-beforeafter-imgurl-first');var firstImgDescr=wrapper.getAttribute('data-beforeafter-imgdescr-first');var firstImgAlt=wrapper.getAttribute('data-beforeafter-imgalt-first');var secondImgURL=wrapper.getAttribute('data-beforeafter-imgurl-second');var secondImgDescr=wrapper.getAttribute('data-beforeafter-imgdescr-second');var secondImgAlt=wrapper.getAttribute('data-beforeafter-imgalt-second');t410_onObjLoad('beforeafter',function(){new beforeafter.BASlider('#t410-beforeafter__'+recid,[{src:firstImgURL,label:firstImgDescr,alt:firstImgAlt,},{src:secondImgURL,label:secondImgDescr,alt:secondImgAlt,},],{mode:sliderOrientation?sliderOrientation:'horizontal',startingPosition:sliderStartPosition?sliderStartPosition+'%':'50%',})});var block=rec.querySelector('.t410');if(typeof jQuery!=='undefined'){$(block).on('displayChanged',function(){window.beforeafter.sliders.forEach(function(obj){if(obj.options.wrapper.getAttribute('id')==='t410-beforeafter__'+recid){obj.options.setWrapperDimensions()}})})}else if(block){block.addEventListener('displayChanged',function(){window.beforeafter.sliders.forEach(function(obj){if(obj.options.wrapper.getAttribute('id')==='t410-beforeafter__'+recid){obj.options.setWrapperDimensions()}})})}}
42function t410_onObjLoad(objName,okFunc,time){if(typeof window[objName]==='object'){okFunc()}else{var timerId=setTimeout(function checkFuncExist(){if(typeof window[objName]==='object'){okFunc();return}
43timerId=setTimeout(checkFuncExist,time||100)})}}
44function t552_init(recid,ratio){var rec=document.getElementById('rec'+recid);if(!rec)return;var recordBlock=rec?rec.querySelector('.t552'):null;t552__setHeight(recid,ratio);window.addEventListener('resize',t_throttle(function(){t552__setHeight(recid,ratio)}));if(typeof jQuery!=='undefined'){$(recordBlock).on('displayChanged',function(){t552__setHeight(recid,ratio)})}else{if(recordBlock){recordBlock.addEventListener('displayChanged',function(){t552__setHeight(recid,ratio)})}}}
45function t552__setHeight(recid,ratio){var rec=document.getElementById('rec'+recid);if(!rec)return;var firstIMG=rec.querySelector('.t552__blockimg');var images=rec.querySelectorAll('.t552__blockimg');Array.prototype.forEach.call(images,function(img){var calculatedHeight=Math.floor(firstIMG.offsetWidth*ratio);img.style.height=calculatedHeight+'px'})}
46function t675_init(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t675');if(!container)return;var textWrapper=rec.querySelectorAll('.t675__textwrapper');if(typeof jQuery!=='undefined'){$(container).bind('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t675__calcHeight(rec,textWrapper)})})}else{container.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t675__calcHeight(rec,textWrapper)})})}
47t675__calcHeight(rec,textWrapper)}
48function t675__calcHeight(rec,textWrapper){setTimeout(function(){var dot=rec.querySelector('.t-slds__bullet_wrapper');var dotsHeight=dot?dot.offsetHeight:0;Array.prototype.forEach.call(textWrapper,function(wrapper){wrapper.style.marginBottom=dotsHeight+7+'px'})},100)}
49function t604_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;t604_imageHeight(rec);t604_arrowWidth(rec);t604_show(rec);t604_hide(rec);window.addEventListener('resize',t_throttle(function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)});t604_arrowWidth(rec)}));var currentBlock=rec.querySelector('.t604');if(currentBlock){currentBlock.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)});t604_arrowWidth(rec)})}}
50function t604_show(rec){var playBtns=rec.querySelectorAll('.t604__play');Array.prototype.forEach.call(playBtns,function(play){var itemWrap=play.closest('.t604__imgwrapper');var image=itemWrap.querySelector('.t-slds__bgimg');var videoWrap=itemWrap.querySelector('.t604__wrap-video');var videoLazy=videoWrap.querySelector('.t-video-lazyload');play.addEventListener('click',function(event){event.preventDefault();event.stopPropagation();t_onFuncLoad('t_video_lazyload__addVideo',function(){videoWrap.style.display='block';image.style.opacity=0;t_video_lazyload__addVideo(videoLazy)})})})}
51function t604_hide(rec){var videoWraps=rec.querySelectorAll('.t604__wrap-video');var videos=rec.querySelectorAll('.t604__wrap-video .t-video-lazyload');rec.addEventListener('updateSlider',function(){Array.prototype.forEach.call(videoWraps,function(videoWrap){videoWrap.display.style='none'});Array.prototype.forEach.call(videos,function(video){video.innerHTML=''})})}
52function t604_imageHeight(rec){var images=rec.querySelectorAll('.t604__separator');Array.prototype.forEach.call(images,function(image){var imgHeight=parseInt(image.getAttribute('data-slider-image-height'));var imgWidth=parseInt(image.getAttribute('data-slider-image-width'));var imgRatio=imgHeight/imgWidth;var imgPadding=imgRatio*100;image.style.paddingBottom=imgPadding+'%'})}
53function t604_arrowWidth(rec){var arrows=rec.querySelectorAll('.t-slds__arrow_wrapper');var slide=rec.querySelector('.t-slds__item_active .t-slds__wrapper');var slideWidth=slide?slide.offsetWidth:0;if(slide&&slideWidth===0){t_onFuncLoad('t_slds_SliderWidth',function(){setTimeout(function(){slideWidth=slide.offsetWidth;t604__updateArrowWidth(slideWidth,arrows)},300)})}else{t604__updateArrowWidth(slideWidth,arrows)}}
54function t604__updateArrowWidth(slideWidth,arrows){var calcArrowWidth=window.innerWidth-slideWidth;var arrowWidth=window.innerWidth>960?calcArrowWidth/2+'px':'';if(arrowWidth!=='0px'&&arrowWidth!==''){Array.prototype.forEach.call(arrows,function(arrow){arrow.style.width=arrowWidth})}}
55function t604__UpdateSliderArrowsHeight(recid){var sliderRec=document.getElementById('rec'+recid);if(!sliderRec)return;var activeItem=sliderRec.querySelector('.t-slds__item_active');if(activeItem){var separator=activeItem.querySelector('.t604__separator');var isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var offsetForVideoBtns=0;var isVideo=activeItem.querySelector('[data-slider-video-type]');if(isVideo&&isMobile)offsetForVideoBtns=40;var itemPaddingTop=parseInt(getComputedStyle(activeItem).paddingTop)||0;var itemPaddingBottom=parseInt(getComputedStyle(activeItem).paddingBottom)||0;var height=itemPaddingTop+itemPaddingBottom-offsetForVideoBtns;if(separator&&separator.hasAttribute('data-slider-image-height')&&activeItem.clientHeight===0){height=parseInt(separator.getAttribute('data-slider-image-height'))-height}else{height=activeItem.clientHeight-height}}
56var arrowWrappers=sliderRec.querySelectorAll('.t-slds__arrow_wrapper');if(height&&arrowWrappers.length>0){Array.prototype.forEach.call(arrowWrappers,function(arrowWrapper){arrowWrapper.style.height=height+'px';var arrow=arrowWrapper.querySelector('.t-slds__arrow');if(arrow)arrow.style.marginTop=offsetForVideoBtns/2+'px'})}}
57function t764_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid)});t_onFuncLoad('t_slds_SliderWidth',function(){t_slds_SliderWidth(recid)});var sliderWrapper=rec.querySelector('.t-slds__items-wrapper');var sliderContainer=rec.querySelector('.t-slds__container');var sliderWidth=sliderContainer?sliderContainer.offsetWidth:0;var sliderPos=sliderWrapper?sliderWrapper.getAttribute('data-slider-pos'):'0';var pos=parseFloat(sliderPos);if(sliderWrapper)sliderWrapper.style.transform='translate3d(-'+sliderWidth*pos+'px, 0, 0)';t_onFuncLoad('t_slds_UpdateSliderHeight',function(){t_slds_UpdateSliderHeight(recid)});t_onFuncLoad('t_slds_UpdateSliderArrowsHeight',function(){t_slds_UpdateSliderArrowsHeight(recid)});var currentBlock=rec.querySelector('.t764');if(currentBlock){currentBlock.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)})})}}
58function t827_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var wrapper=rec.querySelector('.t827');if(!wrapper)return;var grid=rec.querySelector('.t827__grid');var sizer=rec.querySelector('.t827__grid-sizer');var items=rec.querySelectorAll('.t827__grid-item');var images=rec.querySelectorAll('.t827__grid img');var overlayList=rec.querySelectorAll('.t827__overlay');var sizerWidth=sizer?sizer.offsetWidth||parseInt(window.getComputedStyle(sizer).width,10):0;if(window.getComputedStyle(rec).display==='none'){grid.setAttribute('data-hidden-tab','y')}
59t827_reverse(grid);Array.prototype.forEach.call(images,function(img){img.addEventListener('load',function(){t827_initMasonry(rec,recid,grid);setTimeout(function(){t827_showOverlay(overlayList,items)},500)})});Array.prototype.forEach.call(overlayList,function(overlay){if(overlay.classList.contains('t827__overlay_preview')){setTimeout(function(){t827_showOverlay([overlay],items)},1000)}});t827_initMasonry(rec,recid,grid);setTimeout(function(){t827_calcColumnWidth(rec,sizerWidth,grid,sizer,items)});window.addEventListener('resize',t_throttle(function(){if(typeof window.noAdaptive!=='undefined'&&window.noAdaptive===!0&&window.isMobile){return}
60t827_initMasonry(rec,recid,grid);t827_calcColumnWidth(rec,sizerWidth,grid,sizer,items)}));window.addEventListener('load',function(event){t827_initMasonry(rec,recid,grid);t827_calcColumnWidth(rec,sizerWidth,grid,sizer,items)});wrapper.addEventListener('displayChanged',function(e){t827_initMasonry(rec,recid,grid,e.type);t827_calcColumnWidth(rec,sizerWidth,grid,sizer,items)})}
61function t827_reverse(grid){if(grid&&grid.classList.contains('t827__grid_reverse')){for(var i=grid.childElementCount-2;i>=0;i--){grid.appendChild(grid.children[i])}}}
62function t827_initMasonry(rec,recid,grid,eventType){var gutterElement=rec.querySelector('.t827__gutter-sizer');var gutterWidth;grid.classList.add('t827__grid_load');if(gutterElement&&(gutterElement.offsetWidth===40||window.getComputedStyle(gutterElement).width==='40px')){gutterWidth=39}else{gutterWidth='#rec'+recid+' .t827__gutter-sizer'}
63t_onFuncLoad('imagesLoaded',function(){if(eventType==='displayChanged'&&grid.getAttribute('data-hidden-tab')==='y'){grid.style.opacity='0';imagesLoaded(grid,function(){if(grid.style.opacity==='0'){grid.style.opacity=''}
64grid.removeAttribute('data-hidden-tab')});setTimeout(function(){if(grid.style.opacity==='0'){grid.style.opacity=''}
65grid.removeAttribute('data-hidden-tab')},3000);new Masonry(grid,{columnWidth:'#rec'+recid+' .t827__grid-sizer',itemSelector:'#rec'+recid+' .t827__grid-item',gutter:gutterWidth,isFitWidth:!0,transitionDuration:0,})}else{imagesLoaded(grid,function(){new Masonry(grid,{columnWidth:'#rec'+recid+' .t827__grid-sizer',itemSelector:'#rec'+recid+' .t827__grid-item',gutter:gutterWidth,isFitWidth:!0,transitionDuration:0,})})}
66grid.classList.remove('t827__grid_load')})}
67function t827_showOverlay(overlayList,items){if(window.innerWidth>=1024){Array.prototype.forEach.call(overlayList,function(overlay){overlay.style.display='block'})}else{Array.prototype.forEach.call(items,function(item){item.addEventListener('click',function(){var currentOverlay=item.querySelector('.t827__overlay');if(currentOverlay){if(currentOverlay.style.opacity==='0'){Array.prototype.forEach.call(overlayList,function(overlay){if(overlay===currentOverlay){overlay.style.opacity='1'}else{overlay.style.opacity='0'}})}else{currentOverlay.style.opacity='0'}}})})}}
68function t827_calcColumnWidth(rec,sizerWidth,grid,sizer,items){var isRecHidden=window.getComputedStyle(rec).display==='none';if(isRecHidden){rec.style.setProperty('display','block','important')}
69var container=rec.querySelector('.t827__container');var firstItem=rec.querySelector('.t827__grid-item');var gutterElement=rec.querySelector('.t827__gutter-sizer');var containerWidthViaPadding=container?container.offsetWidth||parseInt(window.getComputedStyle(container).width,10):0;var containerPaddingLeft=container?window.getComputedStyle(container).getPropertyValue('padding-left'):'0';var containerPaddingLeftValue=parseInt(containerPaddingLeft,10)||0;var containerPaddingRight=container?window.getComputedStyle(container).getPropertyValue('padding-right'):'0';var containerPaddingRightValue=parseInt(containerPaddingRight,10)||0;var containerWidth=containerWidthViaPadding-(containerPaddingLeftValue+containerPaddingRightValue);var itemWidth=firstItem?firstItem.offsetWidth||parseInt(window.getComputedStyle(firstItem).width,10):0;var gutterSizerWidth=gutterElement?gutterElement.offsetWidth||parseInt(window.getComputedStyle(gutterElement).width,10):0;if(gutterElement&&gutterSizerWidth===40)gutterSizerWidth=39;if(isRecHidden)rec.style.display='';var columnAmount=Math.round(containerWidth/sizerWidth);if(columnAmount===1&&containerWidth>320&&containerWidth<=480){columnAmount=2}
70var newSizerWidth=(containerWidth-gutterSizerWidth*(columnAmount-1))/columnAmount;if(containerWidth>=itemWidth){if(sizer)sizer.style.width=newSizerWidth+'px';Array.prototype.forEach.call(items,function(item){item.style.width=newSizerWidth+'px'})}else{if(grid)grid.style.width='100%';if(sizer)sizer.style.width='100%';Array.prototype.forEach.call(items,function(item){item.style.width=newSizerWidth+'px'})}}
71function t979_init(recid,rowheight,guttersizer){var rec=document.getElementById('rec'+recid);if(!rec)return;var grid=rec.querySelector('.t979__grid');if(!grid)return;var items=rec.querySelectorAll('.t979__grid-item');var images=rec.querySelectorAll('.t979__image');var overlayList=rec.querySelectorAll('.t979__overlay');if(guttersizer==='')guttersizer=0;t979_reverse(grid);t979_initMasonry(rec,recid,grid,rowheight,guttersizer,images);if(typeof jQuery!=='undefined'){$(rec).find('.t979').bind('displayChanged',t_throttle(function(){var gutterSizer=parseInt(guttersizer,10);var heightSizer=parseInt(rowheight,10);var containerWidth=grid?grid.offsetWidth:0;var imageWidths=t979_getImageWidths(grid,heightSizer);var rows=t979_divideRows(imageWidths,containerWidth);var heights=[];t979_fitItemsByWidth(rows,heights,containerWidth,heightSizer,gutterSizer);t979_updateItems(grid,rows,heights,gutterSizer);t979_updateGridHeight(grid,heights,gutterSizer)}))}else{var currentBlock=rec.querySelector('.t979');currentBlock.addEventListener('displayChanged',t_throttle(function(){var gutterSizer=parseInt(guttersizer,10);var heightSizer=parseInt(rowheight,10);var containerWidth=grid?grid.offsetWidth:0;var imageWidths=t979_getImageWidths(grid,heightSizer);var rows=t979_divideRows(imageWidths,containerWidth);var heights=[];t979_fitItemsByWidth(rows,heights,containerWidth,heightSizer,gutterSizer);t979_updateItems(grid,rows,heights,gutterSizer);t979_updateGridHeight(grid,heights,gutterSizer)}))}
72window.addEventListener('resize',t_throttle(function(){var gutterSizer=parseInt(guttersizer,10);var heightSizer=parseInt(rowheight,10);var containerWidth=grid?grid.offsetWidth:0;var imageWidths=t979_getImageWidths(grid,heightSizer);var rows=t979_divideRows(imageWidths,containerWidth);var heights=[];t979_fitItemsByWidth(rows,heights,containerWidth,heightSizer,gutterSizer);t979_updateItems(grid,rows,heights,gutterSizer);t979_updateGridHeight(grid,heights,gutterSizer)}));t_onFuncLoad('imagesLoaded',function(){imagesLoaded(grid,function(){t979_initMasonry(rec,recid,grid,rowheight,guttersizer,images);Array.prototype.forEach.call(images,function(img){img.style.display='block'})})})}
73function t979_reverse(grid){if(grid&&grid.classList.contains('t979__grid_reverse')){for(var i=grid.childElementCount-2;i>=0;i--){grid.appendChild(grid.children[i])}}}
74function t979_initMasonry(rec,recid,grid,rowheight,guttersizer,images){var gutterSizer=parseInt(guttersizer,10);var heightSizer=parseInt(rowheight,10);Array.prototype.forEach.call(images,function(img){if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&window.lazy==='y'){t979__waitLazyLoadIMG(img,function(){t979_eventOnLoadImg(grid,heightSizer,gutterSizer)})}else{if(img.complete&&img.naturalHeight&&img.naturalWidth){t979_eventOnLoadImg(grid,heightSizer,gutterSizer)}else{img.addEventListener('load',function(){t979_eventOnLoadImg(grid,heightSizer,gutterSizer)})}}})}
75function t979__waitLazyLoadIMG(img,cb){if(img.complete&&img.naturalHeight&&img.naturalWidth){cb()}else{setTimeout(function(){t979__waitLazyLoadIMG(img,cb)},500)}}
76function t979_eventOnLoadImg(grid,heightSizer,gutterSizer){var containerWidth=grid?grid.offsetWidth:0;var imageWidths=t979_getImageWidths(grid,heightSizer);var rows=t979_divideRows(imageWidths,containerWidth);var heights=[];t979_fitItemsByWidth(rows,heights,containerWidth,heightSizer,gutterSizer);t979_updateItems(grid,rows,heights,gutterSizer);t979_updateGridHeight(grid,heights,gutterSizer)}
77function t979_getImageWidths(grid,heightSizer){var imageWidths=[];if(!grid)return!1;var images=grid.querySelectorAll('.t979__image');Array.prototype.forEach.call(images,function(img){imageWidths.push((img.naturalWidth*heightSizer)/img.naturalHeight)});return imageWidths}
78function t979_divideRows(imageWidths,containerWidth){var rows=[];var curRow=0;var rowWidth=0;Array.prototype.forEach.call(imageWidths,function(item){rowWidth+=item;if(typeof rows[curRow]=='undefined'){rows[curRow]=[]}
79rows[curRow].push(item);if(rowWidth>=containerWidth){curRow+=1;rowWidth=0}});return rows}
80function t979_fitItemsByWidth(rows,heights,containerWidth,heightSizer,gutterSizer){rows.forEach(function(row){var sumWidth=0;var thresholdRatio=1.5;var rowWidth=containerWidth-gutterSizer*(row.length-1);row.forEach(function(width){sumWidth+=width});var ratio=rowWidth/sumWidth;if(ratio<thresholdRatio){row.forEach(function(width,curRow){width*=ratio;row[curRow]=width});heights.push(heightSizer*ratio)}else{heights.push(heightSizer)}
81sumWidth=0;row.forEach(function(width){sumWidth+=width})})}
82function t979_updateItems(grid,rows,heights,gutterSizer){if(!grid)return!1;var curRow=0;var curCol=0;var top=0;var left=0;var width=0;var height=0;var items=grid.querySelectorAll('.t979__grid-item');Array.prototype.forEach.call(items,function(item){if(curCol>=rows[curRow].length){top+=heights[curRow];curRow++;curCol=0;if(curRow!==0){top+=gutterSizer}
83left=0}
84left+=rows[curRow][curCol-1]?rows[curRow][curCol-1]+gutterSizer:0;width=rows[curRow][curCol];height=heights[curRow];item.style.top=top+'px';item.style.left=left+'px';item.style.width=width+'px';item.style.height=height+'px';curCol++})}
85function t979_updateGridHeight(grid,heights,gutterSizer){var sumHeight=heights.reduce(function(cur,acc){return cur+acc+gutterSizer},0);sumHeight-=gutterSizer;if(grid)grid.style.height=sumHeight+'px'}
86function t989_init(recid){var allRec=document.getElementById('allrecords');var lazyMode=allRec?allRec.getAttribute('data-tilda-lazy'):'';var rec=document.getElementById('rec'+recid);var bulletsWrapper=rec.querySelector('.t-slds__thumbsbullet-wrapper');var slides=rec.querySelectorAll('.t-slds__item');var bullets=rec.querySelectorAll('.t-slds__thumbsbullet');var currentBlock=rec.querySelector('.t989');var activePos=bulletsWrapper?bulletsWrapper.getAttribute('data-thumbs-active'):'0';Array.prototype.forEach.call(slides,function(slide,i){if(i===parseInt(activePos,10))slide.classList.add('t-slds__item_active')});Array.prototype.forEach.call(bullets,function(bullet,i){if(i===parseInt(activePos,10))bullet.classList.add('t-slds__item_active')});t_onFuncLoad('t_sldsInit',function(){t_sldsInit(recid);t989_checkArrowsDisplay(rec)});var thumbsTimeout=bulletsWrapper?bulletsWrapper.getAttribute('data-thumbs-timeout'):'';if(thumbsTimeout>0){t989_thumbs_initAutoPlay(rec)}
87window.addEventListener('resize',t_throttle(function(){t989_checkArrowsDisplay(rec);t_slds_updateSlider(recid);if(window.lazy==='y'||lazyMode==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},300));if(currentBlock){currentBlock.addEventListener('displayChanged',function(){t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recid)});if(window.lazy==='y'||lazyMode==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}})}
88t989_addEvents(rec)}
89function t989_addEvents(rec){var bulletsWrapper=rec.querySelector('.t-slds__thumbsbullet-wrapper');var bullets=rec.querySelectorAll('.t-slds__thumbsbullet');var arrowRight=rec.querySelector('.t989__arrow-right');var arrowLeft=rec.querySelector('.t989__arrow-left');var mobileWrapperRight=rec.querySelector('.t989__mobile-arrows .t-slds__arrow_wrapper-right');var mobileWrapperLeft=rec.querySelector('.t989__mobile-arrows .t-slds__arrow_wrapper-left');var thumbsTimeout=bulletsWrapper?bulletsWrapper.getAttribute('data-thumbs-timeout'):'';if(arrowRight){arrowRight.addEventListener('click',function(){t989_next(rec);if(thumbsTimeout>0)t989_thumbs_initAutoPlay(rec)})}
90if(arrowLeft){arrowLeft.addEventListener('click',function(){t989_prev(rec);if(thumbsTimeout>0)t989_thumbs_initAutoPlay(rec)})}
91if(mobileWrapperRight){mobileWrapperRight.addEventListener('click',function(){t989_next(rec);if(thumbsTimeout>0)t989_thumbs_initAutoPlay(rec)})}
92if(mobileWrapperLeft){mobileWrapperLeft.addEventListener('click',function(){t989_prev(rec);if(thumbsTimeout>0)t989_thumbs_initAutoPlay(rec)})}
93Array.prototype.forEach.call(bullets,function(bullet){bullet.addEventListener('click',function(){t989_slideIntoView(rec,bullet);if(thumbsTimeout>0)t989_thumbs_initAutoPlay(rec)})})}
94function t989_checkArrowsDisplay(rec){var bullets=rec.querySelectorAll('.t-slds__thumbsbullet');var arrowRight=rec.querySelector('.t989__arrow-right');var arrowLeft=rec.querySelector('.t989__arrow-left');var thumbsWrapper=rec.querySelector('.t-slds__thumbsbullet-wrapper');var thumbsCycle=thumbsWrapper?thumbsWrapper.getAttribute('data-thumbs-cycle'):null;var activeThumb=thumbsWrapper?thumbsWrapper.getAttribute('data-thumbs-active'):'0';if(thumbsCycle==='yes'){if(arrowLeft)arrowLeft.style.display='block';if(arrowLeft)arrowRight.style.display='block'}else{if(arrowLeft)arrowLeft.style.display=parseInt(activeThumb,10)>0?'block':'none';if(arrowLeft)arrowRight.style.display=parseInt(activeThumb,10)<bullets.length-1?'block':'none'}}
95function t989_slideIntoView(rec,bullet){var container=rec.querySelector('.t989__thumbsbullets-container');var thumbsWrapper=rec.querySelector('.t-slds__thumbsbullet-wrapper');var containerWidth=container?container.offsetWidth:0;var containerLeftPos=container?container.getBoundingClientRect().left+window.pageXOffset:0;var containerRightPos=containerLeftPos+containerWidth;var thumbsCycle=thumbsWrapper?thumbsWrapper.getAttribute('data-thumbs-cycle'):null;var bulletFor=bullet.getAttribute('data-slide-bullet-for');var bulletRightPos=bullet.offsetWidth+bullet.getBoundingClientRect().left+window.pageXOffset;var hiddenPart;var direction;if(bulletRightPos>containerRightPos){hiddenPart=bulletRightPos-containerRightPos;direction='right'}
96if(container&&container.getBoundingClientRect().left>bullet.getBoundingClientRect().left){hiddenPart=container.getBoundingClientRect().left-bullet.getBoundingClientRect().left+12;direction='left'}
97if(parseInt(bulletFor,10)){var slideID=(parseInt(bulletFor,10)-1).toString();if(thumbsWrapper)thumbsWrapper.setAttribute('data-thumbs-active',slideID)}
98if(hiddenPart){t989_slide(rec,direction,hiddenPart)}
99if(thumbsCycle!=='yes'){setTimeout(function(){t989_checkArrowsDisplay(rec)},300)}}
100function t989_next(rec){var bullets=rec.querySelectorAll('.t-slds__thumbsbullet');var thumbsWrapper=rec.querySelector('.t-slds__thumbsbullet-wrapper');var thumbsCycle=thumbsWrapper?thumbsWrapper.getAttribute('data-thumbs-cycle'):null;var activeThumb=thumbsWrapper?thumbsWrapper.getAttribute('data-thumbs-active'):'0';var activeThumbValue=parseInt(activeThumb,10);if(activeThumbValue<bullets.length){activeThumbValue++}
Следующие 100 строк