function t_autoscale__init(){var t=t_autoscale__getAutoscaleData(),e=t.scaledRecordSelector,a=t.allRecords,n;document.querySelector(e)&&(t_autoscale__appendTextStylesForSafari(),t_autoscale__setGeneralStyles(),t_autoscale__setZoomValue(),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||t_autoscale__processDynamicHeight(),t_autoscale__processMapsAndVideos(),t_autoscale__updateCoverHeight(),t_autoscale__triggerSliderUpdate(),null==a||a.addEventListener("allRecPaddingInit",t_autoscale__setZoomValue),window.addEventListener("load",t_autoscale__setZoomValue),t_autoscale__updateOnResize())}function t_autoscale__appendTextStylesForSafari(){var t,e="tilda-autoscale-text-style";if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!document.getElementById(e)){var a,n=t_autoscale__getAutoscaleData().scaledRecordSelector,o=document.createElement("style");o.id=e,o.textContent="\n\t\t"+n+" .t-card__descr,\n\t\t"+n+" .t-card__title,\n\t\t"+n+" .t-title,\n\t\t"+n+" .t-descr,\n\t\t"+n+" .t-uptitle,\n\t\t"+n+" .t-btntext {\n\t\t\t-webkit-text-size-adjust: auto;\n\t\t}\n\t",document.head.appendChild(o)}}function t_autoscale__updateOnResize(){var t=document.documentElement.clientWidth,e;new ResizeObserver((function(){var e=document.documentElement.clientWidth;e!==t&&(t=e,requestAnimationFrame((function(){return t_autoscale__setZoomValue()})))})).observe(document.documentElement)}function t_autoscale__getAutoscaleData(){return{scaledRecordSelector:".t-record_scaled",dynamicHeightAttribute:"data-height-in-vh",allRecords:document.getElementById("allrecords"),breakpoints:[1200,960,640,480,360],variableName:"--t-zoom",isWindowsOS:navigator.userAgent.toLowerCase().includes("win")}}function t_autoscale__setZoomValue(){var t="tilda-autoscale-style",e=document.getElementById(t),a=t_autoscale__getAutoscaleData(),n=a.scaledRecordSelector,o=a.variableName,c=a.breakpoints,l=a.allRecords,i=a.isWindowsOS,r=e||document.createElement("style");function s(t){var e=l&&parseInt(getComputedStyle(l).paddingLeft,10)||0,a=d(),n=e+a,o=Math.abs(window.innerWidth-document.documentElement.clientWidth)>1||a>0,i=window.innerWidth-n,r=document.documentElement.clientWidth-n,s=c.find((function(t){return i>t}));if(!s)return 1;var _=Math.round(r/s*1e5)/1e5,m,h;return u((o?_:Math.max(_,1))||1,t?2:5)}function d(){return document.body.classList.contains("t-body_popupshowed")&&parseInt(getComputedStyle(document.body).paddingRight,10)||0}function u(t,e){return t?Math.floor(t*Math.pow(10,e))/Math.pow(10,e):1}e||(r.id=t),r.textContent="\n\t\t"+n+" {\n\t\t\t"+o+": "+s(i)+";\n\t\t}",e||document.head.appendChild(r)}function t_autoscale__setGeneralStyles(){var t="tilda-autoscale-main-style";if(!document.getElementById(t)){var e=t_autoscale__getAutoscaleData(),a=e.scaledRecordSelector,n=e.variableName,o=e.breakpoints,c=document.createElement("style");c.textContent=o.slice().reverse().map((function(t){return"@media (min-width: "+t+"px) {\n\t\t\t"+a+" {\n\t\t\t\tmax-width: "+t+"px;\n\t\t\t}\n\t\t}"})).join(" "),c.textContent+="@media (min-width: "+Math.min.apply(Math,o)+"px) {\n\t\t\t"+a+" {\n\t\t\t\tzoom: var("+n+", 1);\n\t\t\t}\n\t\t}",c.id=t,document.head.appendChild(c)}}function t_autoscale__processDynamicHeight(){var t=t_autoscale__getAutoscaleData(),e=t.scaledRecordSelector,a=t.dynamicHeightAttribute,n=t.variableName,o;function c(t){return t.style.getPropertyValue("--height")&&t.style.getPropertyValue("--height").includes("vh")?"--height":t.style.minHeight&&t.style.minHeight.includes("vh")?"min-height":t.style.maxHeight&&t.style.maxHeight.includes("vh")?"max-height":"height"}document.querySelectorAll(e+" ["+a+"]").forEach((function(t){if(!t.classList.contains("t-map")){var e=t.getAttribute(a);if(e){var o=c(t);t.style.setProperty(o,"calc("+e+"vh / var("+n+", 1))")}}}))}function t_autoscale__processMapsAndVideos(){var t=t_autoscale__getAutoscaleData(),e=t.scaledRecordSelector,a=t.variableName,n=e+" .t-video-lazyload, "+e+" .t-map",o;document.querySelectorAll(n).forEach((function(t){t.style.zoom="calc(1 / var("+a+", 1))",t_autoscale__setElementHeight(t,a)}))}function t_autoscale__setElementHeight(t,e){var a=t_autoscale__getElementHeight(t,e);a&&(t.style.height=a)}function t_autoscale__getElementHeight(t,e){var a=t.style.height;if(!a)return"";var n=a.includes("vh"),o=a.includes("calc(")&&a.includes("var("+e+", 1)");if(n&&!o)return"";if(o&&n){var c=/\d+(?=px|vh)/,l=a.match(c);return l&&l[0]?l[0]+"vh":""}return!n&&parseFloat(a)?"calc("+parseFloat(a)+"px * var("+e+", 1))":""}function t_autoscale__updateCoverHeight(){var t,e=t_autoscale__getAutoscaleData().scaledRecordSelector,a;document.querySelectorAll(e+" .t-cover__carrier").forEach((function(t){t.dispatchEvent(new Event("displayChanged"))}))}function t_autoscale__triggerSliderUpdate(){var t,e=t_autoscale__getAutoscaleData().scaledRecordSelector,a;document.querySelectorAll(e+" .t-slds__container").forEach((function(t){t.dispatchEvent(new Event("displayChanged",{bubbles:!0}))}))}t_onReady(t_autoscale__init);