window.isMobile=!1;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){window.isMobile=!0}
function 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)}}}
function t868_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;rec.setAttribute('data-animationappear','off');rec.style.opacity='1';var popup=rec.querySelector('.t-popup');if(!popup)return;var hook=popup.getAttribute('data-tooltip-hook');if(!hook)return;var analitics=popup.getAttribute('data-track-popup');var customCodeHTML=t868__readCustomCode(rec);var recBlocks=document.querySelectorAll('.r');for(var i=0;i<recBlocks.length;i++){recBlocks[i].addEventListener('click',function(event){var target=event.target;var href=target.closest('a[href$="'+hook+'"]')?target:!1;if(!href)return;event.preventDefault();t868_showPopup(rec,customCodeHTML);t_onFuncLoad('t_popup__resizePopup',function(){t_popup__resizePopup(recid)});if(hook.substring(0,7)==='#popup:'&&analitics&&window.Tilda){var virtTitle=hook;virtTitle=virtTitle.substring(7);Tilda.sendEventToStatistics(analitics,virtTitle)}})}
if(!popup.getAttribute('data-popup-inited')&&'MutationObserver' in window){popup.setAttribute('data-popup-inited','yes');var stores=document.querySelectorAll('body .t-store');Array.prototype.forEach.call(stores,function(store){new MutationObserver(function(mutationsList){for(var mutation in mutationsList){var event=mutationsList[mutation];if(event.type==='attributes'){if(event.target.className.indexOf('t-popup_show')!==-1){popup.style.zIndex='99999999';t868_initPopup(recid);}}}}).observe(store,{attributes:!0,attributeFilter:['class'],subtree:!0,})})}}
function t868__readCustomCode(rec){var codeWrap=rec.querySelector('.t868 .t868__code-wrap');if(!codeWrap)return;var customCode=codeWrap.innerHTML;return customCode}
function t868_showPopup(rec){var popup=rec.querySelector('.t-popup');if(!popup)return;var popupContainer=popup.querySelector('.t-popup__container');if(!popupContainer)return;var codeWrap=popup.querySelector('.t868__code-wrap');if(!codeWrap)return;var windowWidth=window.innerWidth;var screenMin=rec.getAttribute('data-screen-min');var screenMax=rec.getAttribute('data-screen-max');if(screenMin&&windowWidth<parseInt(screenMin,10))return;if(screenMax&&windowWidth>parseInt(screenMax,10))return;popup.style.display='block';codeWrap.style.display='block';t868_setHeight(rec);setTimeout(function(){popupContainer.classList.add('t-popup__container-animated');popup.classList.add('t-popup_show')},100);if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed');popup.addEventListener('click',function(event){var container=event.target.closest('.t-popup__container');if(!container)t868_closePopup(rec)});var closeButton=rec.querySelector('.t-popup__close');if(closeButton){closeButton.addEventListener('click',function(){t868_closePopup(rec)})}
var buttons=rec.querySelectorAll('a[href*="#"]');Array.prototype.forEach.call(buttons,function(button){button.addEventListener('click',function(){var url=button.getAttribute('href');if(url.indexOf('#order')!==-1){var popupContainer=rec.querySelector('.t-popup__container');setTimeout(function(){while(popupContainer.firstChild){popupContainer.removeChild(popupContainer.firstChild)}},600)}
if(!url||url.substring(0,7)!=='#price:'){t868_closePopup(rec);if(!url||url.substring(0,7)==='#popup:'){setTimeout(function(){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed')},300)}}})});document.addEventListener('keydown',function(event){if(event.keyCode===27){t868_closePopup(rec)}})}
function t868_closePopup(rec){var popup=rec.querySelector('.t-popup');var codeWrap=rec.querySelector('.t868 .t868__code-wrap');if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t-body_popupshowed');popup.classList.remove('t-popup_show');setTimeout(function(){if(!popup.classList.contains('.t-popup_show')){popup.style.display='none';if(codeWrap){codeWrap.style.display='none'}}},300)}
function t868_setHeight(rec){var videoCarier=rec.querySelector('.t868__video-carier');if(!videoCarier)return;var paddingLeft=parseInt(videoCarier.style.paddingLeft,10)||0;var paddingRight=parseInt(videoCarier.style.paddingRight,10)||0;var height=(videoCarier.clientWidth-(paddingLeft+paddingRight))/(16/9);videoCarier.style.height=height;Array.prototype.forEach.call(videoCarier.closest,function(parent){parent.style.height=height})}
if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector}
if(!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}
el=el.parentElement||el.parentNode}
return null}}
function t858_init(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var wrapper=rec.querySelector('.t858');if(!wrapper)return;t_onFuncLoad('t_card__moveClickOnCard',function(){t_card__moveClickOnCard(recId)});t_onFuncLoad('t_card__addFocusOnTab',function(){t_card__addFocusOnTab(recId)});t858_unifyHeights(recId);window.addEventListener('resize',t_throttle(function(){if(window.noAdaptive&&window.noAdaptive===!0&&window.isMobile)return;t858_unifyHeights(recId)}));window.addEventListener('load',function(){t858_unifyHeights(recId)});if(typeof jQuery!=='undefined'){$(wrapper).on('displayChanged',function(){t858_unifyHeights(recId)})}else{wrapper.addEventListener('displayChanged',function(){t858_unifyHeights(recId)})}
if(wrapper.classList.contains('t858__previewmode')){setInterval(function(){t858_unifyHeights(recId)},5000)}}
function t858_unifyHeights(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var wrapper=rec.querySelector('.t858');if(!wrapper)return;var container=rec.querySelector('.t858__container');var columnsInRow=Number(container.getAttribute('data-columns-in-row'));if(columnsInRow===0||columnsInRow===''){columnsInRow=1}
var allCols=Array.prototype.slice.call(rec.querySelectorAll('.t858__col'));var rowsArray=[];for(var i=0;i<allCols.length;i+=columnsInRow){rowsArray.push(allCols.slice(i,i+columnsInRow))}
if(window.innerWidth>=960){for(var i=0;i<rowsArray.length;i++){var row=rowsArray[i];var maxHeight=0;var innerCols=[];for(var j=0;j<row.length;j++){innerCols.push(row[j].querySelector('.t858__inner-col'))}
for(var j=0;j<innerCols.length;j++){var col=innerCols[j];var colWrap=col.querySelector('.t858__wrap');var colHeight=colWrap.offsetHeight;if(colHeight>maxHeight)maxHeight=colHeight}
for(var j=0;j<innerCols.length;j++){if(innerCols[j])innerCols[j].style.height=maxHeight+'px'}}}else{var innerCols=rec.querySelectorAll('.t858__inner-col');for(var i=0;i<innerCols.length;i++){if(innerCols[i])innerCols[i].style.height='auto'}}}
function t698_onSuccess(form){t_onFuncLoad('t_forms__onSuccess',function(){t_forms__onSuccess(form)})}
function t698_fixcontentheight(recId){var rec=document.getElementById('rec'+recId);var cover=rec.querySelector('.t-cover');var coverFilter=rec.querySelector('.t-cover__filter');var coverCarrier=rec.querySelector('.t-cover__carrier');var coverWrapper=rec.querySelector('.t-cover__wrapper');var coverContainer=rec.querySelector('.t-cover__container');var coverStyle=getComputedStyle(cover,null);var coverPaddingTop=parseInt(coverStyle.paddingTop)||0;var coverPaddingBottom=parseInt(coverStyle.paddingBottom)||0;var coverHeight=cover.clientHeight-(coverPaddingTop+coverPaddingBottom);var hookContent=rec.querySelector('div[data-hook-content]');var hookContentHeight=hookContent.offsetHeight;if(hookContentHeight>300&&coverHeight<hookContentHeight){var newHookContentHeight=hookContentHeight+120;if(newHookContentHeight>1000)newHookContentHeight+=100;console.log('auto correct cover height: '+newHookContentHeight);cover.style.height=newHookContentHeight+'px';if(coverFilter)coverFilter.style.height=newHookContentHeight+'px';if(coverCarrier)coverCarrier.style.height=newHookContentHeight+'px';if(coverWrapper)coverWrapper.style.height=newHookContentHeight+'px';if(coverContainer)coverContainer.style.height=newHookContentHeight+'px';if(window.isMobile===!1){setTimeout(function(){if(coverCarrier.querySelector('iframe')){console.log('correct video from cover_fixcontentheight');setWidthHeightYoutubeVideo(coverCarrier,newHookContentHeight+'px')}},2000)}}}