(app={utils:{}}).utils.getDirection={direction:1,lastScrollTop:0,init:function(){var e=this;app.dom.$window.scroll(function(){var t=app.dom.$window.scrollTop();e.lastScrollTop!==t&&(e.lastScrollTop{var t=document.createElement("div"),e=(t.classList.add("regions-map__accordion-wrapper"),p.appendChild(t),document.createElement("button"));e.classList.add("accordion-title"),t.appendChild(e),(e=document.createElement("div")).classList.add("accordion-block"),t.appendChild(e)})(),(()=>{var t=document.querySelector(".accordion-title"),e=document.querySelector(".accordion-block");t.addEventListener("click",function(){t.classList.toggle("active"),e.classList.toggle("active"),e.classList.contains("active")?e.style.maxHeight=e.scrollHeight+"px":e.style.maxHeight=""}),window.matchMedia("(min-width: 1023px)").matches&&(t.classList.add("active"),e.classList.add("active"))})());function n(t){var e=p.dataset.type;"interaction"!==e&&"static"!==e||l(t,e)}function l(a,e){Object.keys(i).length?(r=[],i.Data.forEach(function(e){e.OKATO===a&&i.Indicators.forEach(function(t){t.id===e.Pok_id&&(e.title=t.Title,r.push(e))})}),i.RegionsLinks.forEach(function(t){t.OKATO===a&&(t.url=t.url.replace("http://","https://"),r.push(t))}),"interaction"===e?s(a):d()):$.getJSON(""+p.getAttribute("data-url"),function(t){t.Data.forEach(function(e){e.OKATO===a&&t.Indicators.forEach(function(t){t.id===e.Pok_id&&(e.title=t.Title,r.push(e))})}),t.RegionsLinks.forEach(function(t){t.OKATO===a&&(t.url=t.url.replace("http://","https://"),r.push(t))}),"interaction"===e?s(a):d(),i=t})}function s(a){var i=document.querySelector(".accordion-title"),n=document.querySelector(".accordion-block"),e=(n.innerHTML="",o.forEach(function(t,e){t.OKATO===a&&(i.innerText=t.NM),0===e&&(n.innerHTML="")}),r.forEach(function(t){var e,a,i;t.val&&((i=document.createElement("div")).classList.add("accordion-block__item"),a=document.createElement("p"),e=document.createElement("span"),i.appendChild(a),i.appendChild(e),n.appendChild(i),a.innerHTML=t&&t.title,""!==t.Trend&&e.classList.add(""+t&&t.Trend),i=t&&t.val,a=t&&t.dim,i=i.toFixed(t.prec),"ru"===f&&(i=new String(i).replace(/\./g,",")),e.innerHTML="%"===a?i+a:i+" "+a)}),document.createElement("a"));e.classList.add("accordion-block__item-link"),e.innerHTML="Ссылка на регион",r.forEach(function(t){t.url&&(e.href=t.url)}),n.appendChild(e)}function d(){var t=document.querySelector(".regions-map__block-details"),o=(t&&p.removeChild(t),document.createElement("div"));o.classList.add("regions-map__block-details"),p.appendChild(o),r.forEach(function(t){var e,a,i,n;t.val&&((e=document.createElement("div")).classList.add("regions-map__item-details"),(a=document.createElement("p")).classList.add("regions-map__item-details_title"),a.innerHTML=t.title,i=document.createElement("span"),""!==t.Trend?i.classList.add("regions-map__item-details_info",t&&t.Trend):i.classList.add("regions-map__item-details_info"),n=t.val.toFixed(t.prec),"ru"===f&&(n=new String(n).replace(/\./g,",")),"%"===t.dim?i.innerHTML=n+t.dim:i.innerHTML=n+" "+t.dim,e.appendChild(a),e.appendChild(i),o.appendChild(e))})}(t=>{var e;t&&(e=document.querySelector("body"),t.addEventListener("touchmove",function(t){t.preventDefault(),e.classList.add("no-scroll")}),t.addEventListener("touchend",function(){e.classList.remove("no-scroll")}))})(u)})}},app.votingMainPage=function(t){var i,n,o,r,l,s,d,e,a;app.findWithRoot(t,".landing-voting").length&&(i=document.querySelector(".update-time"),app.pollIdentityData().then(function(a){var e=a;e.displayName||o.forEach(function(t){t.classList.remove("voting-hide")}),e.displayName&&(n.forEach(function(t){t.classList.remove("voting-hide"),s.innerText=e.displayName}),e.options.length||r.forEach(function(t){t.classList.remove("voting-hide")}),e.options.length)&&l.forEach(function(t){t.classList.remove("voting-hide")}),setTimeout(function(){var t;document.querySelector(".voting-main__slider-section")&&(t=new Swiper(".votingMainSwiperThumbs",{loop:!1,spaceBetween:10,slidesPerView:4,watchSlidesVisibility:!0,freeMode:!0,watchSlidesProgress:!0,lazy:{loadOnTransitionStart:!0,loadPrevNext:!1},preloadImages:!1}),new Swiper(".votingMainSwiper",{loop:!1,on:{init:function(){$(".image-slider__total").text(d),$(".image-slider__current").text(this.realIndex+1),$(".votingMainSwiperThumbs .swiper-slide").eq(0).addClass("active")},slideChange:function(){$(".image-slider__current").text(this.realIndex+1);var t=this.activeIndex;t=t,$(".votingMainSwiperThumbs .swiper-slide").removeClass("active"),$(".votingMainSwiperThumbs .swiper-slide").eq(t).addClass("active")}},spaceBetween:10,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},thumbs:{swiper:t},lazy:{loadOnTransitionStart:!1,loadPrevNext:!1},preloadImages:!1}).update())},0),app.allVotingCharts.forEach(function(t){var e=t.series[0].data.map(function(t){return{color:a.displayName&&a.options.includes(t.options.id)?"#2AA65E":"#0088CC"}});t.update({series:[{data:e}]})}),app.updateAllChartsData(app.initialChartsData.url,app.allVotingCharts,a,i),setInterval(function(){0{app.openFullscreenModal(e),tippy.hideAll()})}}),t.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),app.openFullscreenModal(e),tippy.hideAll()})}),document.querySelector(".voting-info-modal"))&&(a=document.querySelector(".voting-info-modal").children[0],document.querySelectorAll(".landing-voting__hint").forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),app.openFullscreenModal(a),a.querySelector(".login-modal__step-title").scrollIntoView()})}))},app.votingPage=function(t){if(app.findWithRoot(t,".voting-page").length){var e=document.querySelector(".voting-page"),i=Array.from(e.querySelectorAll('[data-voting-auth="false"]')),n=Array.from(document.querySelectorAll('[data-voting-auth="true"]')),o=Array.from(e.querySelectorAll('[data-voting-poll="false"]')),r=Array.from(e.querySelectorAll('[data-voting-poll="true"]')),l=document.querySelector(".update-time"),s=(app.pollIdentityData().then(function(a){var e=a;e.displayName||(i.forEach(function(t){t.classList.remove("voting-hide")}),e.options.length&&o.forEach(function(t){t.classList.add("voting-hide")})),e.displayName&&(n.forEach(function(t){t.classList.remove("voting-hide")}),e.options.length||o.forEach(function(t){t.classList.remove("voting-hide")}),e.options.length&&r.forEach(function(t){e.options.includes(t.dataset.pollOptionId)&&t.classList.remove("voting-hide")}),i.forEach(function(t){t.classList.add("voting-hide")})),app.allVotingCharts.forEach(function(t){var e=t.series[0].data.map(function(t){return{color:a.displayName&&a.options.includes(t.options.id)?"#2AA65E":"#0088CC"}});t.update({series:[{data:e}]})}),app.updateAllChartsData(app.initialChartsData.url,app.allVotingCharts,a,l),setInterval(function(){0t.name))).every(e=>m.some(t=>t.name===e&&t.checked))?(_.disabled=!1,b.classList.add("hide"),y.classList.remove("hide")):(_.disabled=!0,b.classList.remove("hide"),y.classList.add("hide")),v.style.display="flex"})});let a=Array.from(document.querySelectorAll(".tabs.home-tabs .tab")),i=document.querySelector(".voting-page__submit-popup-text .voting-page__submit-links-text");a.forEach(t=>{var e=document.createElement("a");e.textContent=t.textContent.trim(),e.setAttribute("data-tabs-tab",t.getAttribute("data-tabs-tab")),e.classList.add("pseudo"),i.appendChild(e)});d=document.querySelectorAll(".voting-page__submit-links-text .pseudo");app.homeTabs(t),d.forEach(e=>{e.addEventListener("click",()=>{var t=Array.from(a).find(t=>t.getAttribute("data-tabs-tab")===e.getAttribute("data-tabs-tab"));t&&(a.forEach(t=>t.classList.remove("_active")),t.classList.add("_active"),t.scrollIntoView({block:"center",behavior:"smooth"}))})})}C(),h.forEach(function(t){t.addEventListener("click",function(t){var e=t.target.dataset.votingName,a=t.target.dataset.variantId;g.forEach(function(t){t.dataset.votingName===e&&t.dataset.variantId!==a&&t.classList.add("hide")}),h.forEach(function(t){t.dataset.votingName===e&&t.dataset.variantId===a&&t.classList.add("hide")}),g.forEach(function(t){t.dataset.votingName===e&&t.dataset.variantId===a&&t.classList.remove("hide")}),h.forEach(function(t){t.dataset.votingName===e&&t.dataset.variantId!==a&&t.classList.contains("hide")&&t.classList.remove("hide")})})}),m.forEach(function(t){var e,a;t.checked&&(e=t.name,a=t.value,g.forEach(function(t){t.dataset.votingName===e&&t.dataset.variantId!==a&&t.classList.add("hide")}),(t=g.find(function(t){return t.dataset.votingName===e&&t.dataset.variantId===a}))&&t.classList.remove("hide"),t=h.find(function(t){return t.dataset.votingName===e&&t.dataset.variantId===a}))&&t.classList.add("hide")})}function w(t){t.forEach(function(t){t.classList.add("calendar-card-slide-full")}),s.update()}function k(t){t.forEach(function(t){t.classList.remove("calendar-card-slide-full")}),s.update()}function C(){let a=(()=>{var t=document.querySelectorAll(".voting-page__grid-cards");let a=[];return t.forEach(t=>{var e=t.querySelectorAll('input[type="radio"]');Array.from(e).some(t=>t.checked)||a.push(t.closest("[data-tabs-content]").getAttribute("data-tabs-content"))}),a})();document.querySelectorAll(".voting-page__submit-popup-text .pseudo").forEach(t=>{var e=t.getAttribute("data-tabs-tab");a.includes(e)?t.style.display="inline-block":t.style.display="none"})}},app.chatButton=function(t){t=app.findWithRoot(t,".chat-button");if(t.length){let a=t[0],i=document.querySelector(".question");t=window.innerWidth<=768;let n=!1;t||(a.addEventListener("mouseenter",()=>{a.classList.contains("chat-button--active")||a.classList.add("chat-button--hover")}),a.addEventListener("mouseleave",()=>{a.classList.remove("chat-button--hover")})),a.addEventListener("click",()=>{a.classList.toggle("chat-button--active"),a.classList.remove("chat-button--hover")}),t&&window.addEventListener("scroll",()=>{var t,e;n||(t=i.getBoundingClientRect(),e=window.innerHeight,0<=t.top&&t.bottom<=e&&(a.classList.add("chat-button--hover"),setTimeout(()=>{a.classList.remove("chat-button--hover")},3e3),n=!0))})}},app.materialsGall=function(){var t=document.querySelectorAll(".materials");function d(t){if(t.length){let e=0;t.forEach(t=>{t.style.minHeight="0";t=t.offsetHeight;t>e&&(e=t)}),t.forEach(t=>{t.style.minHeight=e+"px"})}}t.length&&t.forEach(i=>{let n=i.querySelector(".materials_gall");var o=i.querySelector(".materials_nav"),r=o?.querySelector("._next"),l=o?.querySelector("._prev"),s=i.querySelectorAll(".swiper-slide");if(s.length){s.length<5&&o&&(o.style.display="none");let t=s[0],e=i.dataset.spaceBetween||50,a=new Swiper(n,{on:{init:function(){var t,e,a;d(i.querySelectorAll(".material-external")),t=this,e=n,(a=(a=new URL(window.location.href)).hash)&&(a=document.querySelector(a))&&e.contains(a)&&0<=(e=Array.from(e.querySelectorAll(".swiper-slide a")).indexOf(a))&&t.slideTo(e,0,!1)}},slidesPerView:4,spaceBetween:e,navigation:{nextEl:r,prevEl:l},breakpoints:{1023:{slidesPerView:"auto",spaceBetween:16}}});window.addEventListener("resize",()=>{e=1023
'+(a?"":'
'+e.series.name+":
")+'
'+e.y+(e.series.options.units||"")+"
"},'
'+this.x+"
")}},app.chartAutoHeight=function(t,e,a,i){a=a||30,i=i||400;var n,o=$("#"+t),r=!1;function l(){if(!e.options.legend.floating)return r?(e.update({legend:{y:null}}),void o.css("height","")):void 0;var t=e.legend.legendHeight+a;e.update({legend:{y:t}}),o.css("height",t+e.chartHeight+"px"),r=!0}setTimeout(l,i),$(window).on("resize",function(){clearTimeout(n),n=setTimeout(l,i)})},app.charts=function(){"undefined"!=typeof Highcharts&&Highcharts.setOptions({title:{text:""},subtitle:{text:""},chart:{height:400,spacingBottom:0,animation:!1},xAxis:{gridLineWidth:0,labels:{style:{color:"#2b2e33"}}},yAxis:{gridLineWidth:1,lineColor:"#E8E9EB",labels:{style:{color:"#2b2e33"}},title:{x:-17,margin:0,style:{color:"#2b2e33"}}},responsive:{rules:[{condition:{maxWidth:927}}]},tooltip:{useHTML:!0,headerFormat:'
{point.key}
',pointFormat:'
{series.name}:
{point.y}
',style:{color:"#ffffff"},padding:0,shadow:!1,backgroundColor:"#36383d",borderRadius:4,borderColor:"#36383d"},legend:{useHTML:!0,labelFormatter:function(){var t={circle:"●",diamond:"◆",square:"◼",triangle:"▲","triangle-down":"▼"}[this.symbol||"circle"];return void 0===t&&-1!==this.symbol.indexOf("url")&&(t=``),''+t+''+this.name+""},itemDistance:16,itemMarginBottom:8,itemMarginTop:0,padding:0,squareSymbol:!1,symbolWidth:0,symbolPadding:0,symbolRadius:0,align:"left",maxHeight:1/0,width:"100%",x:-7},credits:{enabled:!1},plotOptions:{series:{point:{events:{legendItemClick:function(){return!1}}},events:{legendItemClick:function(){return!1}}},column:{borderWidth:0,pointPadding:0,groupPadding:.12},columnrange:{stacking:"normal",pointPadding:0,groupPadding:.1,borderWidth:0}}})},app.charts(),app.chartsPrint=function(a){window.addEventListener("beforeprint",function(){var t=document.querySelector(".highcharts-tooltip-box"),e=document.querySelector('div.highcharts-tooltip[style*="opacity: 1"]');t&&e&&(e.style.opacity=0,t.style.opacity=0),a.chartWidth=800,a.containerWidth=800,a.legend.chart.chartWidth=800,a.renderer.width=800,a.xAxis[0].update(["redraw"]),a.xAxis[0].render(),a.legend.update(["redraw"]),a.legend.render(),a.redraw(),a.render()}),window.addEventListener("afterprint",function(){var t=document.querySelector(".highcharts-tooltip-box"),e=document.querySelector('div.highcharts-tooltip[style*="opacity: 0"]');t&&e&&(e.style.opacity=1,t.style.opacity=1),a.legend.update(["redraw"]),a.xAxis[0].update(["redraw"]),a.xAxis[0].render()})},app.chartsPrintLandscape=function(a){window.addEventListener("beforeprint",function(){var t=document.querySelector(".highcharts-tooltip-box"),e=document.querySelector('div.highcharts-tooltip[style*="opacity: 1"]');t&&e&&(e.style.opacity=0,t.style.opacity=0),a.chartWidth=1700,a.containerWidth=1700,a.legend.chart.chartWidth=1700,a.renderer.width=1700,a.xAxis[0].update(["redraw"]),a.xAxis[0].render(),a.legend.update(["redraw"]),a.legend.render(),a.redraw(),a.render()}),window.addEventListener("afterprint",function(){var t=document.querySelector(".highcharts-tooltip-box"),e=document.querySelector('div.highcharts-tooltip[style*="opacity: 0"]');t&&e&&(e.style.opacity=1,t.style.opacity=1),a.legend.update(["redraw"]),a.xAxis[0].update(["redraw"]),a.xAxis[0].render()})},app.chartLegendDataHighlighter=function(t,e){var i,n=$("#"+t),o="pie"===e.options.chart.type,a=n.find(".chart-legend").length;function r(t){return(o?e.series[0].data:e.series)[t]}for(var l=0;l{var t=(o?r(l).series:r(l)).options;if(!t.dataLabels||!t.dataLabels.enabled){var a=(o?".highcharts-color-":".highcharts-series-")+e+" .chart-legend";try{n.get(0).addEventListener("mouseover",function(t){t=$(t.target);i!==e&&t.is($(a))&&(null!=i&&r(i).update({dataLabels:{enabled:!1}},!1),r(e).update({dataLabels:{enabled:!0}}),i=e)},!1)}catch(t){console.error(t)}}})(l);function s(){null!=i&&(r(i).update({dataLabels:{enabled:!1}}),i=null)}n.add(n.find(".highcharts-legend")).on("mouseleave",s),n.find(".highcharts-root").on("mouseleave",s)},app.menuSticky=function(t){var a=app.findWithRoot(t,".menu-sticky"),t=app.findWithRoot(t,".menu-sticky__close"),i=[],n=document.querySelectorAll(".menu-sticky__link");n.forEach(function(t){var t=t.getAttribute("href");t&&"#"==t[0]&&(t=document.querySelector(t))&&i.push(t)}),a&&(window.addEventListener("scroll",function(){var e,t=i.filter(function(t){return 0<=(t=(t=t).getBoundingClientRect()).top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)});t.length&&(e=t[t.length-1],n.forEach(function(t){t.classList.remove("active"),t.parentElement.classList.remove("active"),t.getAttribute("href")==="#"+e.id&&(t.classList.add("active"),t.parentElement.classList.add("active"))})),450"),$("body").append(e),e.val(t).select(),document.execCommand("copy"),e.remove()})},app.statistics=function(t){t=app.findWithRoot(t,"[data-statistics-filter]");t.length&&t.each(function(){var t=$(this),e=t.find("[data-statistics-filter-inner]"),a=t.find("[data-statistics-filter-search]"),n=t.find("[data-statistics-filter-search-empty]"),o=t.find("[data-statistics-filter-theme]").parent(),r=o.children("[data-statistics-filter-theme-text]"),l=t.find("[data-statistics-filter-theme-group]").parent(),s=l.children("[data-statistics-filter-theme-text]"),i=t.find("[data-filter-close]"),t=t.find("input[type=radio]"),d=l.add(o);function c(){var i=$(this).val().toLowerCase();d.removeClass("_hidden _found"),i?("auto"===e.css("min-height")&&e.css("min-height",e.height()+"px"),r.each(function(){var t=$(this),e=-1!==t.text().toLowerCase().indexOf(i);t.parent().addClass(e?"_found":"_hidden")}),s.each(function(){var t=$(this),e=t.parent(),t=-1!==t.text().toLowerCase().indexOf(i);function a(){var t=e.children("[data-toggle-btn]");t.hasClass("_active")||t.click()}e.parents(l).add(e.find(o)).hasClass("_found")?a():t?(e.addClass("_found").find(d).removeClass("_hidden"),a()):e.addClass("_hidden")}),n.toggle(!d.hasClass("_found"))):(e.css("min-height",""),n.hide())}i.on("click",function(){a.val()&&a.val("")}),t.on("change",function(){a.val()&&a.val("")}),a.on("input",c),a.on("input-hook",c)})},app.subscribe=function(t){t=app.findWithRoot(t,"[data-subscribe]");t.length&&t.each(function(){var t=$(this),a=t.find("input[type=checkbox]"),i=t.find("[data-subscribe-selected]"),e=t.find("[data-subscribe-popup-open]"),n=$('[data-subscribe-popup="'+t.data("subscribe")+'"]'),o=n.find("[data-subscribe-popup-inner]"),t=n.find("[data-subscribe-popup-close]"),r=n.find("[data-subscribe-popup-clear]"),l=n.find("[data-subscribe-popup-search]"),s=n.find("[data-subscribe-popup-search-empty]"),d=n.find("[data-subscribe-popup-theme]"),c=d.parent(),p=c.children("[data-subscribe-popup-theme-text]"),u=n.find("[data-subscribe-popup-theme-group]"),f=u.parent(),h=f.children("[data-subscribe-popup-theme-text]"),g=(a.on("change",function(){d.prop("checked",a.is(":checked"))}),a.is(":checked")&&0===d.filter(":checked").length&&d.prop("checked",!0),e.on("click",function(){n.addClass("_open"),n.focus()}),t.on("click",function(){n.removeClass("_open"),l.val("")}),r.on("click",function(){d.prop("checked",!1)}),f.add(c));function m(){var a=$(this).val().toLowerCase();g.removeClass("_hidden _found"),a?("auto"===o.css("min-height")&&o.css("min-height",o.height()+"px"),p.each(function(){var t=$(this),e=-1!==t.text().toLowerCase().indexOf(a);t.parent().addClass(e?"_found":"_hidden")}),h.each(function(){var t=$(this),e=t.parent(),t=-1!==t.text().toLowerCase().indexOf(a);e.parents(f).add(e.find(c)).hasClass("_found")||(t?e.addClass("_found").find(g).removeClass("_hidden"):e.addClass("_hidden"))}),s.toggle(!g.hasClass("_found"))):(o.css("min-height",""),s.hide())}l.on("input",m),l.on("input-hook",m),u.each(function(){var a=$(this),i=a.parent(),e=(a.is(":checked")&&i.find(d).filter(":not(:checked)").prop("checked",!0),a.on("change",function(t){i.find(d).prop("checked",a.is(":checked"))}),app.createRunOnceTimeout());function t(t){t&&a.is(t.target)||e(function(){var t=i.find(d),e=t.filter(":checked");i.removeClass("_indeterminate"),t.length===e.length?a.prop("checked",!0):0!==e.length?(a.prop("checked",!1),i.addClass("_indeterminate")):a.prop("checked",!1)})}t(),i.on("change",t),i.on("input-hook",t)});var v=app.createRunOnceTimeout();function _(){v(function(){var t=d.add(u),e=t.filter(":checked");e.length===t.length?(a.prop("checked",!0),i.removeClass("_active").text("")):0'),t=this.childNodes[this.childNodes.length-1])&&3===t.nodeType&&t.data&&0'),(t=this.childNodes[this.childNodes.length-1])&&3===t.nodeType&&t.data&&0=this.scrollHeight))for(var a=e.split(" ");a.pop();)if(t.text(a.join(" ")+"…"),Math.round(t.height())+1>=this.scrollHeight)return})}r.length&&(a=s.find(".excursion-calendar_col"),i=a.children(),(n=l.children()).filter("._active").length||(l=n.filter(":not(._disabled)").eq(0).index(),n.add(a).removeClass("_active"),n.eq(l).add(a.eq(l)).addClass("_active")),n.each(function(t){var e=$(this);e.hasClass("_disabled")||e.on("click",function(){n.add(a).removeClass("_active"),e.add(a.eq(t)).addClass("_active"),e.closest(".excursion-calendar_table_empty").find("#text").toggle()})}),r.on("click",function(t){var t=$(t.target),e=t.attr(o),t=(r.removeClass("_active"),t.addClass("_active"),s.removeClass("_group _personal"),e&&s.addClass("_"+e),i.filter("._"+e));e&&!t.length?(c.addClass("_active _with-filter"),p.text("По вашему запросу ничего не найдено.")):(e||i.length?c.removeClass("_active _with-filter"):(c.addClass("_active"),c.removeClass("_with-filter")),p.text("К сожалению, на этой неделе экскурсий пока не запланировано."))}),t.on("click",function(t){r.first().trigger("click")}),u(),e=Date.now(),app.dom.$window.on("resize",function(){Date.now()-e<=200||(setTimeout(u,200),e=Date.now())}))},app.homeHeaderIEFix=function(t){var e,a=app.findWithRoot(t,".home-header_bottom"),t=!!window.MSInputMethodContext&&!!document.documentMode;function i(){setTimeout(function(){e.css("height",a.height()+"px")})}a.length&&t&&(e=$('
').appendTo(a.parent()),a.addClass("_ie-fix"),i(),app.dom.$window.on("resize",i))},app.homeMainAsideSticky=function(t){var u,f,h,g,m,v=app.findWithRoot(t,"[data-home-main-aside-sticky]");function _(){f.css("min-height",v.outerHeight()+"px")}function e(t){var e,a,i,n,o,r,l,s,d,c,p=u.scrollTop();p===h&&t&&"scroll"===t.type||Math.round(v.outerHeight())>=Math.round(f.height())||(e=p+(t=f.get(0).getBoundingClientRect()).top,t=p+t.bottom,a=v.height(),i=p+(n=v.get(0).getBoundingClientRect()).top,n=p+n.bottom,r=(o=p)+u.height(),s=(l=p-h)<0,d=0i.height()||t.bottom{var e=$('
').hide(),a=$("
").appendTo(e);return $('
').on("click",function(){e.hide(),a.html("")}).appendTo(e),function(t){e.appendTo(app.dom.$body),app.findWithRoot(t,"[data-mobile-tooltip-content]").on("click",function(){a.html($(this).data("mobile-tooltip-content")),e.show()})}})(),app.lineCutter=function(t){app.findWithRoot(t,"[data-line-cutter]").each(function(){var t=$(this),e=+t.data("line-cutter");function a(){setTimeout(function(){t.line(e,"...")})}e&&(setTimeout(a),setTimeout(a,500),app.dom.$window.on("resize",a))})},app.brandbook=function(t){var e,a=app.findWithRoot(t,"[data-brandbook]");function i(){var t=e.filter("._active").map(function(){return"brandbook-"+$(this).data("brandbook-variant")}).get().join(" ");a.attr("class","brandbook").addClass(t)}a.length&&((e=app.findWithRoot(t,"[data-brandbook-variant]")).on("click",function(){var t=$(this);t.siblings().removeClass("_active"),t.addClass("_active"),i()}),i())},app.banknotesPoints=function(t){app.findWithRoot(t,"[data-point-container]").each(function(){var a=$(this).find("[data-point]"),d=a.length,i=null,o=null;function c(t){a.eq(t).removeClass("_active"),app.dom.$document.off("click",o),i=null}function p(e){var n;i!==e&&(null!==i&&c(i),n=a.eq(e),i=e,n.addClass("_active"),o=function(t){$(t.target).closest(n).length||c(e)},app.dom.$document.on("click",o),setTimeout(function(){var t=n.find("[data-point-info]"),e=app.dom.$window.scrollTop(),a=app.dom.$window.height(),i=t.offset().top-e,t=i+t.outerHeight();i<0?$("html, body").stop().animate({scrollTop:e+i-a/2},300,"swing"):a/).map(function(t){return t?t.split(" "):[]});if(r.html(".").css({display:"block",visibality:"hidden"}),o.height()>t)r.html(n),r.css({display:"block",height:"0",margin:"0"});else{r.html(n);t:for(var a=e.length-1;0<=a;a--){for(var i=!1;e[a].length;){if(o.height()<=t)break t;r.html(e.map(function(t){return t.join(" ")}).join("
")+(i?"...":"")),i=!0,e[a].pop()}e.pop()}r.css({visibality:""})}}function i(){return("undefined"!=typeof performance&&performance.now?performance:Date).now()}o.length&&r.length&&(n=r.html(),a(),e=i(),app.dom.$window.on("resize",function(){i()-e<=200||(setTimeout(a,200),e=i())}))},app.inputHiddenField=function(t){app.findWithRoot(t,"[data-input-hidden-id]").each(function(){var e=$(this),t=e.data("input-hidden-id"),a=$("#"+t),i=e.is("option");function n(t){a.toggle(i?e.closest("select").val()===e.attr("value"):e.is(":checked"))}t=i?e.closest("select"):e.closest("form").find('input[type="'+e.attr("type")+'"][name="'+e.attr("name")+'"]');t.on("change",n),t.on("input-hook",n),n()})},app.popupCookies=function(t){var e=app.findWithRoot(t,"[data-popup-cookies]"),t=e.find("[data-popup-cookies-btn]");!e.length||document.cookie.match(new RegExp("(?:^|; )accept=([^;]*)"))||(e.addClass("_open"),t.on("click",function(){document.cookie="accept=1; path=/; max-age=31536000",e.removeClass("_open")}))},app.popup=function(t){var e=app.findWithRoot(t,"[data-popup-open]"),t=app.findWithRoot(t,"[data-popup-close]");e.on("click",function(t){var e=$(this).attr("data-popup-open"),e=$('[data-popup="'+e+'"]'),a=(e.data("body-overflow",document.body.style.overflow),document.body.style.overflow="hidden",e.addClass("_open"),e.find("input"));(a.length?a.first():e.attr("tabindex","-1")).focus(),t.preventDefault()}),t.on("click",function(t){var e=$(this).closest("[data-popup]");document.body.style.overflow=e.data("body-overflow")||"",e.removeClass("_open"),t.preventDefault()})},app.accessibility=function(t){app.findWithRoot(t,".footer_menu_item._visually-impaired a").on("click",function(){return $("html").toggleClass("vision-impaired"),app.dom.$window.trigger("resize"),window.localStorage&&localStorage.setItem("vision-impaired",!!$("html").hasClass("vision-impaired")||""),!1})},app.trAsLink=function(t){app.findWithRoot(t,"tr[data-tr-link]").on("click",function(t){var e=$(this).attr("data-tr-link");e&&(window.location=e)})},app.videoStub=function(t){$('meta[name="cbr:intranet"][content="true"]').length&&((t=app.findWithRoot(t,".media > .video-scale")).children().remove(),$('
Данное видео доступно
только в сети интернет
').appendTo(t))},app.scrollToContentBtn=function(t){app.findWithRoot(t,"[data-scroll-to-content]").on("click",function(){$("html, body").stop().animate({scrollTop:app.dom.$window.height()},300,"swing")})},app.fileInput=function(t){var m=0;Array.prototype.forEach.call(t.querySelectorAll("[data-file-input], [data-file-input-simple]"),function(i){var o=i.querySelector(".file-input_files"),n=i.querySelector('input[type="file"]'),r=i.querySelector(".file-input_input"),t=i.querySelector(".file-input_delete-all"),l=i.hasAttribute("data-file-input-simple"),h=n.dataset.fileextensions,g=+n.dataset.maxfilenamesize,s=+n.dataset.maxfilescount,d=+n.dataset.maxfilesize;function e(){var t,e=0,a=0;Array.prototype.forEach.call(i.querySelectorAll(".file-input_file"),function(t){t=t.dataset.file;e+=JSON.parse(t).size,a++}),i.classList.toggle("_delete-all",l?1<=a:2<=a),l||(t="",dg&&(n=app.l10n.file.nameSizeErr.replace("$value$",g))}catch(t){}var d=document.createElement("div");d.className="file-input_file"+(n?" _error":""),d.innerHTML=`
${a}${e}
${n?`
${n}: 
`:`
Тип документа
`}
${i} ${l?"":''}
Выберите один из предложенных вариантов ниже. Указание типа файлов необходимо для оперативного рассмотрения Вашего обращения
${(a=>{let i=[{id:"radio-group_1",value:"Текст обращения",label:"Текст обращения"},{id:"radio-group_2",value:"Паспорт",label:"Паспорт"},{id:"radio-group_4",value:"СНИЛС",label:"СНИЛС"},{id:"radio-group_3",value:"Водительское удостоверение",label:"Водительское удостоверение"},{id:"radio-group_6",value:"Договор",label:"Договор"},{id:"radio-group_5",value:"Полис",label:"Полис"},{id:"radio-group_7",value:"Акт",label:"Акт"},{id:"radio-group_8",value:"Ответ финансовой организации",label:"Ответ финансовой организации"},{id:"radio-group_9",value:"Другое",label:"Другое"}];return i.map((t,e)=>`
`).join("")})(a)}
до 30 символов
до 30 символов
`,d.dataset.file=JSON.stringify(t),o.appendChild(d);let c=null,p="";if(!n){let e=d.querySelector(".file-input_type"),a=d.querySelector(".file-input_type-select"),i=d.querySelector(".other-input"),n=i.querySelector("input"),o=d.querySelector(".file-input_type-buttons");s=d.querySelector(".btn._outline");let r=d.querySelector(".btn._blue");function u(){a.classList.contains("d-block")?(d.classList.remove("file-input_type-active"),d.classList.remove("file-input_file-active"),a.classList.remove("d-block"),a.classList.add("d-none")):(d.classList.add("file-input_file-active"),d.classList.add("file-input_type-active"),r.disabled=!1,l.classList.add("field-validation-valid"),l.classList.remove("field-validation-error"),a.classList.remove("d-none"),a.classList.add("d-block"))}e.addEventListener("click",function(){var t;d.querySelector(".text-input_clear")||app.textInput(d),d.querySelector(".text-input_clear").addEventListener("click",()=>{r.disabled=!0}),c&&((t=a.querySelector(`input[value="${c}"]`))&&(t.checked=!0),"Другое"===c?(i.classList.remove("d-none"),d.querySelector(".text-input").classList.add("_focus","_value")):i.classList.add("d-none"),n.value=p),u()});var f=null;Array.prototype.forEach.call(a.querySelectorAll('input[type="radio"]'),function(t){t.addEventListener("change",function(t){o.style.display="flex",o.scrollIntoView({block:"center",behavior:"smooth"}),r.disabled=!1,"Другое"===t.target.value?i.classList.remove("d-none"):i.classList.add("d-none"),f=t.target.value})}),s.addEventListener("click",function(t){t.preventDefault(),c?("Другое"===(f=c)?(i.classList.remove("d-none"),n.value=p):i.classList.add("d-none"),a.querySelector(`input[value="${f}"]`).checked=!0):(o.style.display="none",f=null,Array.prototype.forEach.call(a.querySelectorAll('input[type="radio"]'),function(t){t.checked=!1}),i.classList.add("d-none"),n.value=""),u()});let l=i.querySelector("[data-valmsg-for]");r.addEventListener("click",function(t){t.preventDefault();t=n.value.trim();"Другое"!==f||t?(l.classList.add("field-validation-valid"),l.classList.remove("field-validation-error"),r.disabled=!1,"Другое"===(c=f)?(p=t,e.textContent=t):e.textContent=f,e.classList.add("file-input_type-selected"),u()):(l.classList.remove("field-validation-valid"),l.classList.add("field-validation-error"),r.disabled=!0)}),n.addEventListener("input",function(){0').appendTo(t);if(e.is("._filter")){var i=e.find(".input_label"),n=e.find(".input_placeholder"),o=e.find(".datepicker-filter"),r=e.find(".datepicker-filter_button"),l=e.find(".datepicker-filter_datepicker, .datepicker-filter_datepicker-from, .datepicker-filter_datepicker-to"),s=e.find(":input");function d(){var t=!0;a.each(function(){t=t&&!!$(this).val()}),e.toggleClass("_value",t)}function c(){e.toggleClass("_focus",o.is("._open"))}function p(){e.toggleClass("_disabled",!!s.attr("disabled")),e.toggleClass("_readonly",!!s.attr("readonly"))}i.on("click",function(t){r.attr("disabled")||((i.is(t.target)||n.is(t.target))&&setTimeout(function(){r.trigger("click")}),t.preventDefault())}),o.on("click",function(){setTimeout(c)});try{l.each(function(){this.addEventListener("click",function(){setTimeout(c),setTimeout(d)},!0)})}catch(t){console.error(t),l.on("click",function(){d(),c()})}t.on("click",function(){o.trigger("filter-clear"),d(),c()}),app.dom.$document.on("click",function(){setTimeout(c)}),setTimeout(function(){p(),d()}),e.on("input-hook",function(t,e){d(),p(),c()})}else{function u(){e.toggleClass("_value",!!a.val()),e.toggleClass("_disabled",!!a.attr("disabled")),e.toggleClass("_readonly",!!a.attr("readonly"))}a.on("focus blur",function(t){e.toggleClass("_focus","focus"===t.type)}),a.on("input",function(){e.toggleClass("_value",!!a.val())}),a.on("change",function(){a.trigger("filter-select")}),a.on("input-hook",u),t.on("click",function(){a.val(""),a.trigger("input"),a.trigger("change"),a.trigger("focus")}),u()}})},app.select=function(t){app.findWithRoot(t,"[data-select]").each(function(){var e=$(this),t=e.find("select");function a(){e.toggleClass("_value",!!t.val()),e.toggleClass("_disabled",t.is(":disabled"))}t.on("focus blur",function(t){e.toggleClass("_focus","focus"===t.type)}),e.toggleClass("_value",!!t.val()),t.on("change",function(){e.toggleClass("_value",!!t.val()),t.trigger("filter-select")}),t.on("input-hook",a),a()})},app.radioCheckbox=function(t){app.findWithRoot(t,'.radio input[type="radio"], .checkbox input[type="checkbox"]').on("change",function(){$(this).trigger("filter-select")})},app.sorting=function(t){var a=app.findWithRoot(t,"[data-sorting]");a.length&&(a.each(function(){var t=$(this),e=t.find("[data-sorting-title]"),a=t.find("[data-sorting-close"),i=t.find("[data-sorting-direction]"),n=i.find("input"),o=t.find("[data-sorting-items]"),r=o.find("input"),l="";function s(){l=r.filter(":checked").siblings("label").text(),e.text(l),o.hide()}function d(){var t=n.val();"down"===t&&"up"===t||n.prop("value","down"),"up"!==t?i.removeClass("_active"):i.addClass("_active")}e.on("click",function(){o.toggle()}),r.filter(":checked").length||r.first().prop("checked",!0),r.on("change",s),r.on("input-hook",function(t,e){"set-attr"===e.type&&"checked"===e.attr&&s()}),s(),a.on("click",function(){o.hide()}),d(),n.on("input-hook",function(t,e){"set-value"===e.type&&d()}),i.on("click",function(){var t=$(this),e=t.hasClass("_active")?"down":"up";n.prop("value",e),t.toggleClass("_active")})}),app.dom.$document.click(function(e){a.each(function(){var t=$(this);$(e.target).closest(t).length||t.find("[data-sorting-items]").hide()})}))},app.event=function(t){var e=app.findWithRoot(t,".event_application"),a=e.parent().parent().parent();e.length&&$(window).on("scroll",function(){var t;e.is(":visible")&&(t=e.hasClass("_fixed"),a.get(0).getBoundingClientRect().bottom+e.height()*tapp.dom.$window.width()/2?o.addClass("_right"):o.removeClass("_right")):s.val()||o.trigger("clear-datepicker")})})},app.monthpickerPeriod=function(t){app.findWithRoot(t,"[data-monthpicker-period-filter], [data-quarterpicker-period-filter]").each(function(){var l,s,d,c,p=$(this),u=p.find(".datepicker-filter_button"),f=p.find(".datepicker-filter_close"),h=p.find(".datepicker-filter_apply-btn"),t=p.find(".datepicker-filter_clear-btn"),e=p.find(".datepicker-filter_modal"),i=p.find(".datepicker-filter_tab-from"),n=p.find(".datepicker-filter_tab-to"),g=p.find(".datepicker-filter_input-from"),m=p.find(".datepicker-filter_input-to"),a=p.find(".datepicker-filter_datepicker-from"),o=p.find(".datepicker-filter_datepicker-to"),r=p.is("[data-quarterpicker-period-filter]"),v=r?"QuarterPicker":"MonthPicker",_=app.l10n[v].plugin[r?"quarters":"months"],b=p.data("date-text"),y=function(t){return t};function w(t){$.contains(p.get(0),t.target)||(p.removeClass("_open"),app.dom.$document.off("click",w),l&&s?p.hasClass("_changed")&&p.trigger("filter-select"):L())}b&&(y=function(t){return b.replace("$$date$$",t)});var k=function(t){var e;if(t)return 6===(t=String(t)).length&&(t="0"+t),/^\d\d(.|\/)\d\d\d\d$/.test(t)?(t=String(t),(e=new Date).setFullYear(+t.slice(-4),+t.slice(0,2)-1,1),e):void 0},C=function(t){return t?_[t.getMonth()]+" "+t.getFullYear():""+app.l10n[v].emptyValue+""};function x(t){t=t.getMonth()+1+app.l10n[v].separator+t.getFullYear();return t=6!==t.length||r?t:"0"+t}function S(){var t=C(l),e=C(s),a=l||s?" - ":" - ";i.html(t),n.html(e),u.html(y(t+a+e))}function L(t){l=s=void 0,g.add(m).prop("value",""),S(),p.removeClass("_changed _modified _open"),a.add(o).addClass("_empty"),a[v]("option","MaxMonth",o[v]("option","MaxMonth")),o[v]("option","MinMonth",a[v]("option","MinMonth")),a.add(o)[v]("Update"),app.dom.$document.off("click",w),p.trigger("clear-datepicker"),t&&setTimeout(function(){p.trigger("filter-select")})}function W(){p.hasClass("_open")&&(p.offset().left+2*p.outerWidth()/3>2*app.dom.$window.width()/3?"left"!==e.data("pos")&&(e.data("pos","left"),e.css("transform","translateX("+(-e.outerWidth()+u.outerWidth())+"px)")):p.offset().left+p.outerWidth()/3>app.dom.$window.width()/3?"center"!==e.data("pos")&&(e.data("pos","center"),e.css("transform","translateX("+(-e.outerWidth()+u.outerWidth())/2+"px)")):"right"!==e.data("pos")&&(e.data("pos","right"),e.css("transform","")))}function T(n,o,e,r){p.data("date-text");var t,a=k(e.val());a?(t=e.val(),r?d=p.data("default-value-from")||t:c=p.data("default-value-to")||t,r?l=a:s=a,o[v]("option",r?"MinMonth":"MaxMonth",a)):h.attr("disabled",!0),n[v]("option",{i18n:app.l10n[v].plugin,Animation:"none",MinMonth:k(p.data("min-date"))||null,MaxMonth:k(p.data("max-date"))||null,SelectedMonth:a,MonthFormat:"mm"+app.l10n[v].separator+"yy",OnAfterChooseMonth:function(t){t=x(t);e.val()!==t&&(e.prop("value",t),e.trigger("input-hook",[{type:"set-value",value:t},!0]))}}),e.off("input-hook").on("input-hook",function(t,e,a){var i;"set-value"===e.type?(x(i=k(e.value)),r?l=i:s=i,S(),W(),p.addClass("_tab-to _changed").toggleClass("_modified",d!==g.val()||c!==m.val()),n.removeClass("_empty"),o[v]("option",r?"MinMonth":"MaxMonth",i),a||n[v]("option",{SelectedMonth:i}),o[v]("Update"),l&&s&&h.removeAttr("disabled")):"set-attr"!==e.type||"disabled"!==e.attr&&"readonly"!==e.attr||(p.hasClass("_open")&&f.trigger("click"),u.attr("disabled",g.is(":disabled")||m.is(":disabled")))}),e.data("datepickerElement",n),n.off("click").on("click",function(t){return t.stopPropagation(),!1})}a.add(o)[v](),T(o,a,m,!1),T(a,o,g,!0),S(),"number"==typeof d&&(d=String(d)),"number"==typeof c&&(c=String(c)),(d||c)&&p.toggleClass("_modified",d!==g.val()||c!==m.val()),u.attr("disabled",!!g.add(m).is(":disabled")),i.on("click",function(){p.removeClass("_tab-to")}),n.on("click",function(){p.addClass("_tab-to")}),t.on("click",L),p.on("filter-clear",L),u.add(f).add(h).off("click").on("click",function(){p.toggleClass("_open"),p.hasClass("_open")?(p.removeClass("_tab-to"),app.dom.$document.off("click",w),app.dom.$document.on("click",w),W()):(e.data("pos",""),l&&s?p.hasClass("_changed")&&p.trigger("filter-select"):L())})})},app.datepicker=function(t){var m=["I","II","III"];app.findWithRoot(t,"[data-datepicker-filter], [data-decadepicker-filter]").each(function(){var n=$(this),o=n.find(".datepicker-filter_button"),r=n.find(".datepicker-filter_close"),t=n.find(".datepicker-filter_clear-btn"),l=n.find(".datepicker-filter_input"),s=n.find(".datepicker-filter_datepicker"),e=n.is("[data-decadepicker-filter]"),d=e?"decadepicker":"datepicker",a=n.data("date-text");function c(t){return e&&(t=m[t[0]-1]+t.slice(1)),t=a?a.replace("$$date$$",t):t}function i(t){$.contains(n.get(0),t.target)||(n.removeClass("_open"),app.dom.$document.off("click",i),l.val())||n.trigger("clear-datepicker")}var p=app.l10n[d].plugin.dateFormat;s[d]({yearRange:"-99:+99",changeMonth:!0,changeYear:!0,minDate:n.data("min-date"),maxDate:n.data("max-date"),dateFormat:p}),s[d]("option",app.l10n[d].plugin);try{var u=$[d].parseDate(p,l.val()),f=$[d].formatDate(p,u)}catch(t){}u?(o.html(c(f)),s[d]("setDate",u),l.prop("value",f)):(o.html(app.l10n[d].emptyValue),n.addClass("_empty"),s.addClass("_empty"));var h=n.data("default-value")||f;function g(){l.prop("value",""),s.addClass("_empty"),n.addClass("_empty").removeClass("_changed _modified _open"),o.html(app.l10n[d].emptyValue),app.dom.$document.off("click",i),n.trigger("clear-datepicker"),setTimeout(function(){n.trigger("filter-select")})}h&&n.toggleClass("_modified",f!==h),s[d]("option",{onSelect:function(t){l.prop("value",t),l.trigger("input-hook",[{type:"set-value",value:t},!0])}}),l.off("input-hook").on("input-hook",function(t,e,a){var i;"set-value"===e.type?(i=e.value,o.html(c(i)),n.removeClass("_empty _open").toggleClass("_modified",i!==h),s.removeClass("_empty"),l.trigger("filter-select"),a||s[d]("setDate",u)):"set-attr"!==e.type||"disabled"!==e.attr&&"readonly"!==e.attr||(n.hasClass("_open")&&r.trigger("click"),o.attr("disabled",e.value))}),s.off("click").on("click",function(t){return t.stopPropagation(),!1}),l.data("datepickerElement",s),t.on("click",g),n.on("filter-clear",g),o.attr("disabled",!!l.is(":disabled")),o.add(r).off("click").on("click",function(){n.toggleClass("_open"),n.hasClass("_open")?(app.dom.$document.off("click",i),app.dom.$document.on("click",i),n.offset().left+n.width()/2>app.dom.$window.width()/2?n.addClass("_right"):n.removeClass("_right")):l.val()||n.trigger("clear-datepicker")})})},app.datepickerPeriod=function(t){var L=["I","II","III"];app.findWithRoot(t,"[data-datepicker-period-filter], [data-decadepicker-period-filter]").each(function(){var l,s,d,c,p=$(this),u=p.find(".datepicker-filter_button"),f=p.find(".datepicker-filter_close"),h=p.find(".datepicker-filter_apply-btn"),t=p.find(".datepicker-filter_clear-btn"),e=p.find(".datepicker-filter_modal"),i=p.find(".datepicker-filter_tab-from"),n=p.find(".datepicker-filter_tab-to"),g=p.find(".datepicker-filter_input-from"),m=p.find(".datepicker-filter_input-to"),a=p.find(".datepicker-filter_datepicker-from"),o=p.find(".datepicker-filter_datepicker-to"),r=p.is("[data-decadepicker-period-filter]"),v=r?"decadepicker":"datepicker",_=p.data("date-text");function b(t){$.contains(p.get(0),t.target)||(p.removeClass("_open"),app.dom.$document.off("click",b),l&&s?p.hasClass("_changed")&&p.trigger("filter-select"):k())}function y(t){return(t=t&&r?L[t[0]-1]+t.slice(1):t)||""+app.l10n[v].emptyValue+""}function w(){var t=y(l),e=y(s),a=l||s?" - ":" - ";i.html(t),n.html(e),u.html((t=t+a+e,t=_?_.replace("$$date$$",t):t))}function k(t){l=s=void 0,g.add(m).prop("value",""),w(),p.removeClass("_changed _modified _open"),a.add(o).addClass("_empty"),a[v]("option","maxDate",o[v]("option","maxDate")),o[v]("option","minDate",a[v]("option","minDate")),app.dom.$document.off("click",b),p.trigger("clear-datepicker"),t&&p.hasClass("_changed")&&setTimeout(function(){p.trigger("filter-select")})}function C(){p.hasClass("_open")&&(p.offset().left+2*p.outerWidth()/3>2*app.dom.$window.width()/3?"left"!==e.data("pos")&&(e.data("pos","left"),e.css("transform","translateX("+(-e.outerWidth()+u.outerWidth())+"px)")):p.offset().left+p.outerWidth()/3>app.dom.$window.width()/3?"center"!==e.data("pos")&&(e.data("pos","center"),e.css("transform","translateX("+(-e.outerWidth()+u.outerWidth())/2+"px)")):"right"!==e.data("pos")&&(e.data("pos","right"),e.css("transform","")))}var x=app.l10n[v].plugin.dateFormat;function S(n,o,e,r){n[v]("option",{yearRange:"-99:+99",changeMonth:!0,changeYear:!0,minDate:p.data("min-date"),maxDate:p.data("max-date"),onSelect:function(t){t!==e.val()&&(e.prop("value",t),e.trigger("input-hook",[{type:"set-value",value:t},!0]))}}),e.off("input-hook").on("input-hook",function(t,e,a){var i;"set-value"===e.type?(i=e.value,r?l=i:s=i,w(),C(),p.addClass("_tab-to _changed").toggleClass("_modified",d!==l||c!==s),n.removeClass("_empty"),o[v]("option",r?"minDate":"maxDate",i),l&&s&&h.removeAttr("disabled"),a||n[v]("setDate",$[v].parseDate(x,i))):"set-attr"!==e.type||"disabled"!==e.attr&&"readonly"!==e.attr||(p.hasClass("_open")&&f.trigger("click"),u.attr("disabled",g.is(":disabled")||m.is(":disabled")))});try{var t=$[v].parseDate(x,e.val()),a=$[v].formatDate(x,t)}catch(t){}t?(r?l=a:s=a,r?d=p.data("default-value-from")||a:c=p.data("default-value-to")||a,o[v]("option",r?"minDate":"maxDate",t),n[v]("setDate",t)):(h.attr("disabled",!0),n.addClass("_empty"),r&&((a=new Date).setMonth(a.getMonth()-1),n[v]("setDate",a))),e.data("datepickerElement",n),n.off("click").on("click",function(t){return t.stopPropagation(),!1})}a.add(o)[v](app.l10n[v].plugin),S(o,a,m,!1),S(a,o,g,!0),w(),(d||c)&&p.toggleClass("_modified",d!==l||c!==s),u.attr("disabled",!!g.add(m).is(":disabled")),i.off("click").on("click",function(){p.removeClass("_tab-to")}),n.off("click").on("click",function(){p.addClass("_tab-to")}),t.on("click",k),p.on("filter-clear",k),u.add(f).add(h).off("click").on("click",function(){p.toggleClass("_open"),p.hasClass("_open")?(p.removeClass("_tab-to"),app.dom.$document.off("click",b),app.dom.$document.on("click",b),C()):(e.data("pos",""),l&&s?p.hasClass("_changed")&&p.trigger("filter-select"):k())})})},app.yearpickerPeriod=function(t){app.findWithRoot(t,"[data-yearpicker-period-filter]").each(function(){var e,a,n,o,r,l,s=$(this),d=s.find(".datepicker-filter_button"),c=s.find(".datepicker-filter_close"),p=s.find(".datepicker-filter_apply-btn"),t=s.find(".datepicker-filter_clear-btn"),i=s.find(".datepicker-filter_modal"),u=s.find(".datepicker-filter_tab-from"),f=s.find(".datepicker-filter_tab-to"),h=s.find(".datepicker-filter_input-from"),g=s.find(".datepicker-filter_input-to"),m=s.find(".datepicker-filter_datepicker-from"),v=s.find(".datepicker-filter_datepicker-to"),_=(m.find(".ui-yearpicker").remove(),v.find(".ui-yearpicker").remove(),$('
').appendTo(m)),b=$('
').appendTo(v),y=+s.data("min-date")||1970,w=+s.data("max-date")||(new Date).getFullYear();function k(t){$.contains(s.get(0),t.target)||(s.removeClass("_open"),app.dom.$document.off("click",k),r&&l?s.hasClass("_changed")&&s.trigger("filter-select"):L(),e&&h.trigger("input-hook",[{type:"set-value",value:e},!0]),a&&g.trigger("input-hook",[{type:"set-value",value:a},!0]))}function C(t){return t?t+" "+app.l10n.yearpicker.emptyValue.toLocaleLowerCase():""+app.l10n.yearpicker.emptyValue+""}function x(){var t=C(r),e=C(l),a=r||l?" - ":" - ";u.html(t),f.html(e),d.html(t+a+e)}function S(){[_,b].forEach(function(t,e){var a=!e;t.children().each(function(){var t=+$(this).text();$(this).attr("disabled",a?l2*app.dom.$window.width()/3?"left"!==i.data("pos")&&(i.data("pos","left"),i.css("transform","translateX("+(-i.outerWidth()+d.outerWidth())+"px)")):s.offset().left+s.outerWidth()/3>app.dom.$window.width()/3?"center"!==i.data("pos")&&(i.data("pos","center"),i.css("transform","translateX("+(-i.outerWidth()+d.outerWidth())/2+"px)")):"right"!==i.data("pos")&&(i.data("pos","right"),i.css("transform","")))}function T(){_.add(b).find("button._active").each(function(){var t=$(this),e=t.parent(),t=t.position(),a=e.scrollTop(),i=e.height();e.scrollTop(a+t.top-i/2)})}function E(t,e){t.empty();for(var a=y;a<=w;a++)$('
").appendTo(a)}),a.trigger("new-html"),t.isLast&&e.remove()}).always(function(){e.attr("disabled",!1).removeClass("_loading")})})},app.ajaxPreviews=function(n){var o=1;app.findWithRoot(n,"[data-previews-ajax-url]").click(function(){var e=$(this),a=app.findWithRoot(n,"#previews-ajax-container"),t=e.data("previews-ajax-url"),i=0<=t.indexOf("?")?"&":"?";t+=i+"page="+o++,e.attr("disabled",!0).addClass("_loading"),$.ajax({url:t,dataType:"json"}).done(function(t){t.items.forEach(function(t){$('
\t
'+t.date+"
"+t.elements.map(function(t){return'
'+t.time+'
"+(t.important?'
':"")+'
'+t.source+"
"}).join("")+"
").appendTo(a)}),t.isLast&&e.remove()}).always(function(){e.attr("disabled",!1).removeClass("_loading")})})},app.ajaxAbout=function(t){var i=1;app.findWithRoot(t,"[data-about-ajax-url]").click(function(){var e=$(this),t=e.data("about-ajax-url"),a=0<=t.indexOf("?")?"&":"?";t+=a+"page="+i++,e.attr("disabled",!0).addClass("_loading"),$.ajax({url:t,dataType:"json"}).done(function(t){t.items.forEach(function(t){$('
'+t.date+'
').insertBefore(e)}),t.isLast&&e.remove()}).always(function(){e.attr("disabled",!1).removeClass("_loading")})})},app.ajaxCross=function(t){$(t).find("[data-cross-ajax-url]").click(function(){var a=$(this),i=a.prev(),t=a.data("cross-ajax-url");a.attr("disabled",!0).addClass("_loading"),$.ajax({url:t,dataType:"html"}).done(function(t){var t=$(t),e=(t.appendTo(i),t.data("cross-ajax-url"));e?a.data("cross-ajax-url",e):a.remove(),t.trigger("new-html")}).always(function(){a.attr("disabled",!1).removeClass("_loading")})})},app.shareBtn=function(t){app.findWithRoot(t,"[data-share-btn]").on("click",function(e){var a,i=$(this),n=i.next();n.toggleClass("_hide"),n.hasClass("_hide")||(a=function(t){$.contains(i.parent().get(0),t.target)||e===t||(n.addClass("_hide"),$(document).off("click",a))},$(document).on("click",a))})},app.tables=function(e){app.findWithRoot(e,"[data-table-fixed] table:first").floatThead({responsiveContainer:function(t){return t.closest("[data-table-fixed]")},debug:!0,zIndex:10,position:"fixed"});var t=$("[data-table-fixed] > table.data_dobn");!0==(-1 table").css({"padding-top":"160px"}),app.findWithRoot(e,"table.data, table.CBRTBL").each(function(){var n=[];$(this).find("tr").each(function(){for(var i=[],t=n.length-1;0<=t;t--)n[t].span--;$(this).find("td").each(function(){var t=$(this),e=t.attr("rowspan");t.data("linked_td",$.merge([],i));for(var a=i.length-1;0<=a;a--)i[a].data("linked_td").push(t);for(a=n.length-1;0<=a;a--)0app.dom.$header.height()&&-1===app.utils.getDirection.direction&&!a.some(function(t){return app.isScrolledIntoView(t)})?(e.addClass("_show"),$("body").addClass("header-fixed")):(e.removeClass("_show"),$("body").removeClass("header-fixed"))})},app.homeMenuButton=function(t){var e=app.findWithRoot(t,".header_menu, .banner-header"),a=app.findWithRoot(t,".home-header_content, .banner-header");function i(){app.dom.$window.scrollTop()parseInt(a)?(n.show(),t.addClass("_hidden")):(n.hide(),t.removeClass("_hidden"))}t.length&&t.offset().top-1>t.parent().offset().top&&(n.toggleClass("_active"),o.filter("._active").toggleClass("_hidden"))})},app.imageSlider=function(t){var e=app.findWithRoot(t,".image-slider_base"),t=app.findWithRoot(t,".image-slider_popup"),d=($("[data-popup-open]"),!1);function a(t,e){var a=t.find(".swiper-container"),i=t.find(".image-slider_pagination"),n=t.find(".image-slider_caption"),o=t.find(".image-slider_slide img"),r=t.find("._next"),t=t.find("._prev"),l=$("[data-popup-close]"),s=new Swiper(a,{on:{init:function(){e?n.text(o.eq(e).attr("alt")||""):n.text(o.first().attr("alt"))},slideChange:function(){n.text(o.eq(s.realIndex).attr("alt")||"")}},observer:!0,observeParents:!0,observeSlideChildren:!0,slidesPerView:1,spaceBetween:40,loop:!0,effect:"fade",preloadImages:!1,initialSlide:e||0,lazy:{loadOnTransitionStart:!0},pagination:{el:i,type:"custom",renderCustom:function(t,e,a){return e+" / "+a}},navigation:{nextEl:r,prevEl:t}});d&&l.on("click",function(){s.destroy(),d=!1})}e.each(function(){a($(this))}),t.each(function(){var e=$(this);$(document).on("click","[data-popup-open]",function(){var t=$(this).data("swiper-slide-index");d=!0,a(e,t)})})},app.homeBannersGall=function(t){t=app.findWithRoot(t,"[data-home-banners-gall]");new Swiper(t[0],{slidesPerView:"auto",spaceBetween:16})},app.bannersGall=function(t){app.findWithRoot(t,"[data-banners-gall]").each(function(){var t=$(this);t.find(".swiper-slide"),new Swiper(t[0],{slidesPerView:"auto",spaceBetween:16})})},app.homeContentAnimation=function(t){var a=app.findWithRoot(t,".home-content");if(!a.length)return!1;var e,i=app.findWithRoot(t,".home-header_shadow");function n(){var t=$(document).scrollTop();t<=2400&&o(t)}function o(t){var e=150*Math.min(t/400,1)-150;a.css({transform:e?"translate(0,"+e+"px)":""}),i.css({"box-shadow":"0px 400px 0px 400px rgba(0,0,0,"+(1-Math.min(t/400,1))+")"})}setTimeout(function(){o($(document).scrollTop())}),app.dom.$window.scroll(function(){n(),clearTimeout(e),e=setTimeout(n,500)})},app.homeHeaderGall=function(t){var e,a,i,n,o,r,l,s,d,c,p,u,f,h,g=app.findWithRoot(t,".home-header"),m=app.findWithRoot(t,".home-header_gall");return!!m.length&&(e=(a=app.findWithRoot(t,".home-header_nav_btns")).find("._next"),a=a.find("._prev"),i=app.findWithRoot(t,".home-header_nav_progress_bar"),n=app.findWithRoot(t,"[data-home-search]"),o=app.findWithRoot(t,".home-header_search_inp"),r=null,l=0,s=!5e3,d=m.hasClass("_no-autoplay"),c=app.findWithRoot(t,".home-header_main._desktop .swiper-slide"),p="",d&&i.parent().addClass("hidden-content"),c.each(function(){p=p+'
\n
\n
'}),$('
\n
\n
\n'+p+"
\n
\n
").prependTo(".home-header"),c.length<2?(g.addClass("_one-slide"),!1):(u=new Swiper(app.findWithRoot(t,".home-header_photo_gall")[0],{slidesPerView:1,initialSlide:0,loop:!0}),n.css("opacity",0),f=!0,h=new Swiper(m[0],{slidesPerView:1,loop:!0,effect:"fade",initialSlide:0,simulateTouch:!1,autoplay:!d&&{delay:5e3,disableOnInteraction:!1},on:{progress:v,slideChange:function(){var t;h&&((t=0===h.realIndex)!==f&&(t||n.removeClass("_hide"),n.animate({opacity:t?0:1},150,function(){t&&n.addClass("_hide")}),f=t),u.slideTo(h.realIndex+1))}},navigation:{nextEl:e,prevEl:a},pagination:{el:".home-header_nav_pag",type:"custom",renderCustom:function(t,e,a){return e+" / "+a}}}),m.on("mouseover",".home-header_nav_btns",_),m.on("mouseout",".home-header_nav_btns",_),m.on("focus",".home-header_search_inp",_),void m.on("blur",".home-header_search_inp",function(){o.val()||(s=!1,h.autoplay.start(),v())})));function v(){if(s)return!1;clearInterval(r),l=0,r=setInterval(function(){l=Math.min(l+1,100),i.css({width:l+"%"})},50)}function _(){s=!0,h.autoplay.stop(),clearInterval(r),i.css({width:0})}},app.homeHeaderGallMobile=function(t){var e=app.findWithRoot(t,".home-header"),a=app.findWithRoot(t,".home-header_gall_mobile"),i=null,n=0,o=a.hasClass("_no-autoplay"),r=null,l=a.find(".swiper-pagination"),s=app.findWithRoot(t,".home-header_main._mobile .swiper-slide"),d="";if(0===s.length)return e.addClass("_no-mobile-slider"),!1;s.each(function(){d=d+'
\n
\n
'});var c=$('
\n
\n
\n'+d+"
\n
\n
");if(1===s.length)return e.addClass("_one-slide-mobile"),!1;c.prependTo(".home-header");var p=new Swiper(app.findWithRoot(t,".home-header_photo_gall._mobile")[0],{slidesPerView:1,loop:!0}),u=new Swiper(a[0],{slidesPerView:1,loop:!0,effect:"fade",autoplay:!o&&{delay:5e3,disableOnInteraction:!1},on:{slideChange:function(){u&&(p.slideTo(u.realIndex+1),r)&&a.find(".swiper-pagination-bullet-active").append(r)},progress:f,init:function(){setTimeout(function(){r=$(''),a.find(".swiper-pagination-bullet-active").append(r),f(),o&&l.addClass("_noProgress")},200)}},pagination:{el:l}});function f(){if(!r)return!1;clearInterval(i),n=0,i=setInterval(function(){n=Math.min(n+1,100),r.css({width:n+"%"})},50)}},app.openAnchor=function(t){var e;app.findWithRoot(t,'a[href *= "#"]').not('[href $= "#"]').on("click",function(t){var e=$(this).attr("href").replace(/^[^#]*/,""),e=$(e);e.length&&e.trigger("open-anchor",[!0])}),app.dom.$document.on("open-anchor",function(t,e){e&&(e=$(t.target),$("html, body").animate({scrollTop:e.offset().top-app.dom.$window.height()/2},500))}),location.hash&&location.hash.match(/^#[a-z][0-9-_:\.a-z]*$/gim)&&(e=$(location.hash)).length&&setTimeout(function(){e.trigger("open-anchor",[!0])},500)},app.rouble=function(t){app.findWithRoot(t,".ruble_download_buffer_link").on("click",function(t){var e;t.preventDefault(),t=".ruble_symbol",e=$(""),$("body").append(e),e.val($(t).text()).select(),document.execCommand("copy"),e.remove()})},app.searchForm=function(e){var t,a=app.findWithRoot(e,"[data-search-form]"),i=a.find("[data-search-form-input]"),n=a.find("[data-search-form-btn]"),o=app.findWithRoot(e,"[data-search-form-show]");$.trim(i.val())||n.prop("disabled",!0),i.keyup(function(){t=!$.trim(i.val()),n.prop("disabled",t)}),o.on("click",function(t){t.preventDefault(),app.dom.$body.addClass("blackout"),app.findWithRoot(e,"[data-menu-close]").trigger("click"),a.show(),i.focus()}),app.dom.$document.click(function(t){!a.is(":visible")||$(t.target).closest(a).length||$(t.target).closest(o).length||(app.dom.$body.removeClass("blackout"),a.hide())})},app.textareaCounter=function(t){app.findWithRoot(t,"textarea[maxlength], textarea[data-maxlength], textarea[data-val-maxlength-max]").each(function(){var e=$(this),a=parseInt(e.attr("maxlength")||e.data("maxlength")||e.data("val-maxlength-max"),10),i=e.val().replace(/\n/g,"\r\n").length,t=(e.removeAttr("maxlength"),a-i),n=$('
'+app.l10n.textarea.charsLeft+" "+t.toLocaleString(app.l10n.locales)+"
");function o(){var t=0;(i=e.val().replace(/\n/g,"\r\n").length)<=a?(t=a-i,n.text(app.l10n.textarea.charsLeft+" "+t.toLocaleString(app.l10n.locales))):(t=i-a,n.text(app.l10n.textarea.extraChars+" "+t.toLocaleString(app.l10n.locales)))}n.insertAfter(e),o(),e.on("input",o),e.on("input-hook",o),e.on("change",function(){e.trigger("filter-select")})})},app.addField=function(t){var i=app.findWithRoot(t,"[data-add-field]");i.each(function(){var t=$(this),e=t.find("[data-add-field-items]"),a=t.find("[data-add-field-template]");t.find("[data-add-field-btn]").on("click",function(t){t.preventDefault(),a.clone().attr("data-text-input","").appendTo(e).removeAttr("data-add-field-template").trigger("new-html")}),i.on("click","[data-add-field-delete]",function(){$(this).closest(".add-field_template").remove()})})},app.export=function(t){var e=app.findWithRoot(t,".b-export");app.findWithRoot(t,"button.b-export_button").on("click",function(t){t.preventDefault();t=$(this).closest(e);t.toggleClass("_open"),t.hasClass("_open")&&(t.offset().left+t.width()/2>app.dom.$window.width()/2?t.addClass("_right"):t.removeClass("_right"))}),$(document).click(function(t){e.each(function(){0===$(this).has(t.target).length&&$(this).removeClass("_open")})})},app.imageZoom=function(t){OpenSeadragon($.extend({id:"imageZoom",prefixUrl:"/common/images/openseadragon/",autoHideControls:!1,showFullPageControl:!1,minZoomImageRatio:.1},t))},app.AddItemInMenu=function(t){var t=app.findWithRoot(t,".dropdownBtnBlock"),e=t.find(".dropdownBtn"),t=t.find(".dropdown-close");e.on("click",function(){$(this).siblings(".dropdown-content").toggle("show")}),t.on("click",function(){$(this).parent(".dropdown-content").toggle("show")})},app.tabsWidthCheckingUnit=function(t){function e(){var t=r.getBoundingClientRect().left+d.getBoundingClientRect().left,e=r.getBoundingClientRect().right+d.getBoundingClientRect().right,a=r.getBoundingClientRect().left+c.getBoundingClientRect().left,i=r.getBoundingClientRect().right+c.getBoundingClientRect().right,n=(window.pageYOffset,window.pageXOffset+document.documentElement.clientWidth),o=window.pageXOffset+document.documentElement.clientWidth;document.documentElement.clientHeight,n
'},positioner:function(t,e,a){var i=this.chart,n=i.plotTop,o=window.innerWidth&&window.innerWidth<=768?50:200,r=a.plotY+n,l=window.innerWidth&&window.innerWidth<=768?120:160,s="tooltip-arrow-down",i=(n+i.plotHeight span")));return i&&i.forEach(function(t){t.classList.remove("tooltip-arrow-up","tooltip-arrow-down"),t.classList.add(s)}),{x:o,y:r}},borderWidth:0,shadow:!1,shape:"square"},legend:{enabled:!1},xAxis:{categories:i,labels:{useHTML:!0,align:"left",reserveSpace:!0,formatter:function(){var t=this.axis.series[0].processedYData[this.pos].toLocaleString("en-US").replaceAll(","," ");return'
'+this.value+''+t+"
"}},gridLineWidth:1,tickWidth:1,tickPixelInterval:10,tickLength:window&&768<=window.innerWidth?365:275,tickColor:"#E8E9EB",lineColor:"#E8E9EB"},yAxis:{title:{enabled:!1},labels:{enabled:!1},gridLineWidth:0},plotOptions:{bar:{dataLabels:{enabled:!0,format:"{point.info}",style:{fontSize:"18px"}},pointWidth:20}},series:[{name:"Значение",data:e.series.map(function(t){return{id:t.id,imagePath:t.imagePath,y:t.y,category:t.category,color:"#0088CC"}}),enableMouseTracking:!0},{name:"Fake Series",data:t,grouping:!1,stacking:!1,showInLegend:!1,enableMouseTracking:!1,zIndex:-1,color:"#F5F5F5",states:{hover:{enabled:!1},inactive:{opacity:1}}}]},t=Highcharts.chart(e.blockId,i);app.allVotingCharts.push(t)})},document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".swiper-container").forEach(t=>{new Swiper(t.querySelector(".swiper"),{navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},on:{init:function(){handleAnchorNavigation(this,t.dataset.sliderId)}}})})}),window.trigger=function(){app.dom.$window.trigger("new-html")};