(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40383,e=>{"use strict";var n=e.i(71645);let t=(e,n)=>{e&&(n?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},i=(e,n)=>{n.style.removeProperty("overflow-y"),e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},l=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},o=()=>document.querySelectorAll("[data-portal]").length>1;e.s(["u",0,e=>{let a=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(s.current===e)return;s.current=e;let n=a.current,r=document.body,c=document.documentElement,u=window.innerWidth-c.clientWidth;if(e&&u>0)r.style.top||(window.prevScrollPosition=window.scrollY),c.style.setProperty("overflow-y","scroll"),r.classList.toggle("scroll-disable-windows",!0),r.style.setProperty("width",`calc(100vw - ${u}px)`),r.style.setProperty("top",`-${window.prevScrollPosition}px`),t(n,!0);else if(e)r.style.setProperty("overflow","hidden"),r.style.setProperty("height","100vh"),t(n,!0);else{let e=!o();e&&i(r,c),e&&l(),t(n,!1)}return()=>{let e=!o();e&&i(r,c),e&&l()}},[e]),a}])},99974,20841,83657,e=>{"use strict";var n=e.i(71645);let t={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},i={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},l=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M19.03 10.28l-6.5 6.5a.75.75 0 01-1.06 0l-6.5-6.5a.75.75 0 111.06-1.06L12 15.19l5.97-5.97a.75.75 0 111.06 1.06z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function o({className:e,style:a,boxSize:s,size:r,onClick:c}){return n.default.createElement("span",{className:e,style:{...t,...c&&{cursor:"pointer"},...r&&{fontSize:`${r}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...a},...c?{role:"button",tabIndex:"0",onClick:c}:{}},n.default.createElement(l,{viewBox:"0 0 24 24",style:i}))}o.displayName="IconFdsChevronDownO",e.s(["m",0,o],99974);let a={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},s={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},r=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M6.999 7a5 5 0 1110 0 5 5 0 01-10 0zm5-3.5a3.5 3.5 0 100 7 3.5 3.5 0 000-7zM10.012 14h3.974c1.52 0 2.497 0 3.345.337a4.75 4.75 0 011.916 1.402c.579.705.875 1.636 1.335 3.085l.05.159.332 1.04a.75.75 0 11-1.43.455l-.33-1.04c-.53-1.664-.744-2.293-1.117-2.748a3.249 3.249 0 00-1.31-.959c-.547-.217-1.212-.23-2.958-.23h-3.64c-1.746 0-2.41.013-2.957.23a3.249 3.249 0 00-1.311.959c-.373.454-.587 1.084-1.116 2.748l-.331 1.04a.75.75 0 11-1.43-.455l.331-1.04.05-.159c.461-1.449.757-2.38 1.336-3.086a4.752 4.752 0 011.916-1.4C7.515 14 8.492 14 10.012 14z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function c({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...a,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(r,{viewBox:"0 0 24 24",style:s}))}c.displayName="IconFdsUserO",e.s(["e",0,c],20841);var u=e.i(24359),d=e.i(63687),p=e.i(34650);let f={userRegion:p.U,userTown:p.c,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},g={userRegion:p.U,userTown:p.c,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},h=(e=!1)=>e?g:f,m=(e,n=!1)=>{if(n){window.allRegionsNewApi=e;return}window.allRegions=e},w=e=>Array.isArray(e.towns)?e.towns:[],v=function(e){if(typeof window>"u"||!window.localStorage)return null;let n=window.localStorage.getItem(e);if(!n||"undefined"===n)return null;try{return JSON.parse(n)}catch(n){console.warn(`Invalid object in localStorage for key "${e}": ${n}`)}return null},x=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),b=(e,n)=>`${e.replace(/\/+$/,"")}${n}`,C=(e,n)=>b(e||"https://finuslugi.ru",n),_=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},y=(e,n=!1)=>{if(e.length<1)return;let t=h(n);m(e,n),window.localStorage.setItem(t.allRegions,JSON.stringify(e)),window.localStorage.setItem(t.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},k=async e=>{let n=await _(C(e,"/money_data/Root.json?short=1")),t=Array.isArray(null==n?void 0:n.regions)?n.regions:[];return y(t),t},I=async e=>{let n,t,[i,l]=await Promise.all([_(b(e,"/sc/api/v1/cities?all=true&isActive=true")),_(b(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==i?void 0:i.content)||!Array.isArray(null==l?void 0:l.content))return[];let o=i.content,a=(t=(n=l.content.filter(e=>e.isActive).map(e=>({id:e.geoRegionId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,region_id:e.geoRegionId,enabled:+!!e.isActive,fiasId:e.fiasId,towns:[]}))).reduce((e,n)=>(e[n.id]=n,e),{}),o.forEach(e=>{let n=t[e.geoRegionId];n&&n.towns.push({id:e.legacyId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,main:+!!e.isRegionalCenter,newId:e.id,fiasId:e.fiasId})}),n);return x(a)?(y(a,!0),a):[]},S=async({showcaseUrl:e="",useNewCitiesApi:n=!1}={})=>n?I(e):k(e),O=async e=>{let n=null;try{n=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return n||null};e.s(["a",0,e=>{let n={};return e.map(({id:e,name:t,towns:i})=>(i.forEach(i=>{i.parentId=e,n[i.name]=n[i.name]||{},n[i.name][i.id]=t}),i)).reduce((e,t)=>(t.forEach(e=>{Object.keys(n[e.name]).length>1&&(e.parentName=n[e.name][e.id])}),[...e,...t]),[])},"b",0,(e,n,t)=>{let i=null,l=null;return t&&e.some(e=>{let n=e.towns.find(e=>e.id===t.id)??null;return!!n&&(i=e,l=n,!0)}),{region:i??(n?e.find(e=>e.url===n.url)??e.find(e=>e.region_id===n.region_id)??null:null)??n,town:l??t}},"c",0,(e,n)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=n&&n.newId||null!=n&&n.fiasId),"d",0,C,"e",0,h,"f",0,e=>{if(typeof document>"u")return null;let n=u.a.getItem(e)??void 0;if(!n||"undefined"===n)return null;try{return JSON.parse(decodeURIComponent(n))}catch{return null}},"g",0,(e=!1)=>{if(typeof window>"u")return[];let n=((e=!1)=>e?window.allRegionsNewApi:window.allRegions)(e);if(Array.isArray(n)&&n.length>0)return n;let t=v(h(e).allRegions)||[];return m(t,e),t},"h",0,(e,n,t)=>{(0,d.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:n,eventLabel:t})},"i",0,(e,n=!1)=>!(e.length<1)&&(!n||x(e)),"j",0,(e,n)=>(!!e||!!n)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=n&&n.newId)&&!(null!=n&&n.fiasId),"k",0,(e,n)=>{if(!e||!n)return!1;if(e.url!==n.url)return!0;let t=w(e);return t.length>1||t.some(({main:e})=>!e)},"l",0,S,"m",0,O,"p",0,v,"s",0,(e,n,t=!1)=>{if(typeof document>"u")return;let i=h(t);if(!e&&!n){u.a.removeItem(i.userRegion),u.a.removeItem(i.userTown);return}u.a.setItem(i.userRegion,JSON.stringify((e=>{if(!e)return null;let n=w(e).find(({main:e})=>!!e);return{...e,towns:n?[n]:[]}})(e))||"",{"max-age":31536e3}),u.a.setItem(i.userTown,JSON.stringify(n)||"",{"max-age":31536e3})}],83657)},3366,e=>{"use strict";var n=e.i(71645);let t={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},i={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},l=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M11.28 17.03l4.5-4.5a.75.75 0 000-1.06l-4.5-4.5a.75.75 0 10-1.06 1.06L14.19 12l-3.97 3.97a.75.75 0 101.06 1.06z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function o({className:e,style:a,boxSize:s,size:r,onClick:c}){return n.default.createElement("span",{className:e,style:{...t,...c&&{cursor:"pointer"},...r&&{fontSize:`${r}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...a},...c?{role:"button",tabIndex:"0",onClick:c}:{}},n.default.createElement(l,{viewBox:"0 0 24 24",style:i}))}o.displayName="IconFdsChevronRightSmallO",e.s(["_",0,o])},89867,e=>{"use strict";var n=e.i(43476),t=e.i(71645),i=e.i(70703),l=e.i(86473),o=e.i(99974),a=e.i(30382),s=e.i(20841);e.i(34348);var r=e.i(47611),c=e.i(60822),u=e.i(7670),d=e.i(85900),p=e.i(63687),f=e.i(22468),g=e.i(83657),h=e.i(40383),m=e.i(44437),w=e.i(34650);e.i(46401);var v=e.i(34986),x=e.i(3366),b=e.i(71121),C=e.i(65019),_=e.i(93562),y=e.i(1668);let k={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},I={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},S=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("defs",null,t.createElement("clipPath",{id:"fds-chat-dots-square-add-o_svg__a"},t.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h24v24.001H0z"}))),t.createElement("g",{clipPath:"url(#fds-chat-dots-square-add-o_svg__a)"},t.createElement("path",{d:"M18.25 5.75V8c0 .42.33.75.75.75s.75-.33.75-.75V5.75H22c.42 0 .75-.33.75-.75s-.33-.75-.75-.75h-2.25V2c0-.42-.33-.75-.75-.75s-.75.33-.75.75v2.25H16c-.42 0-.75.33-.75.75s.33.75.75.75h2.25zm-4.546-2.23c-.259-.014-.827-.02-1.704-.02-.676 0-1.129.002-1.358.007a7.963 7.963 0 00-.779.047 7.246 7.246 0 00-2.328.689 7.204 7.204 0 00-4.028 6.4c-.005.228-.007.68-.007 1.357 0 .671.002 1.121.007 1.349.007.324.023.584.047.778.057.474.158.933.303 1.378v.001a7.17 7.17 0 001.76 2.867 7.169 7.169 0 002.92 1.777 7.436 7.436 0 002.108.341c.228.006.68.009 1.355.009.67 0 1.12-.003 1.346-.009a7.12 7.12 0 00.794-.057c.476-.05.96-.162 1.455-.333a.71.71 0 01.685.102c.662.48 1.32.829 1.976 1.047a4.85 4.85 0 001.482.264c.142.002.278-.004.41-.016a10.758 10.758 0 01-.222-.535c-.45-1.164-.676-2.305-.676-3.423a.74.74 0 01.116-.401 7.211 7.211 0 001.08-3.01c.024-.196.04-.456.047-.78.005-.228.007-.678.007-1.349 0-.214.002-.488.006-.822.003-.22.004-.376.004-.468 0-.42.33-.75.75-.75s.75.33.75.75c0 .098-.001.26-.004.486A70.38 70.38 0 0022 12c0 .682-.003 1.142-.008 1.381a9.337 9.337 0 01-.058.93 8.752 8.752 0 01-.393 1.737 8.757 8.757 0 01-.788 1.7c.026.866.217 1.757.571 2.674a8.847 8.847 0 00.6 1.249c.11.224.136.42.078.587-.057.168-.198.306-.423.416-.139.068-.32.13-.543.189a5 5 0 01-1.316.15 6.336 6.336 0 01-1.94-.34 8.598 8.598 0 01-2.064-1.035c-.471.14-.939.236-1.402.286a8.23 8.23 0 01-.93.067c-.24.006-.701.009-1.384.009-.688 0-1.152-.003-1.392-.009a8.222 8.222 0 01-.937-.067 8.672 8.672 0 01-3.989-1.538 8.707 8.707 0 01-2.077-2.078 8.705 8.705 0 01-1.597-4.927A78.972 78.972 0 012 12c0-.687.003-1.15.008-1.39.008-.376.027-.686.057-.93a8.737 8.737 0 01.832-2.806 8.69 8.69 0 013.977-3.977 8.7 8.7 0 012.803-.831c.246-.03.557-.05.933-.058C10.85 2.003 11.313 2 12 2c.902 0 1.495.007 1.779.021.42.021.732.367.712.787a.743.743 0 01-.787.711zm-5.91 9.19a1 1 0 111.412-1.414 1 1 0 01-1.413 1.415zm3.497-1.412a1 1 0 101.418 1.41 1 1 0 00-1.418-1.41zm3.502 1.413a1 1 0 111.414-1.415 1 1 0 01-1.414 1.415z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"})));function O({className:e,style:n,boxSize:i,size:l,onClick:o}){return t.default.createElement("span",{className:e,style:{...k,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...n},...o?{role:"button",tabIndex:"0",onClick:o}:{}},t.default.createElement(S,{viewBox:"0 0 24 24",style:I}))}O.displayName="IconFdsChatDotsSquareAddO";let j={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},N={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},R=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("defs",null,t.createElement("clipPath",{id:"fds-menu-skewed-o_svg__a"},t.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h24v24.001H0z"}))),t.createElement("g",{clipPath:"url(#fds-menu-skewed-o_svg__a)"},t.createElement("path",{d:"M7.75 5a.75.75 0 100 1.5h13.5a.75.75 0 100-1.5H7.75zM22 12a.75.75 0 00-.75-.75H2.75a.75.75 0 100 1.5h18.5A.75.75 0 0022 12zm-5.75 5.5a.75.75 0 110 1.5H2.75a.75.75 0 110-1.5h13.5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"})));function $({className:e,style:n,boxSize:i,size:l,onClick:o}){return t.default.createElement("span",{className:e,style:{...j,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...n},...o?{role:"button",tabIndex:"0",onClick:o}:{}},t.default.createElement(R,{viewBox:"0 0 24 24",style:N}))}$.displayName="IconFdsMenuSkewedO";let A=e=>{let[n,i]=(0,t.useState)(e);return(0,t.useEffect)(()=>{e&&i(!0)},[e]),e||n},T=()=>{let e=(0,t.useRef)(null),n=(0,t.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),i=(0,t.useCallback)((n,t)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,n()},t)},[]);return(0,t.useEffect)(()=>n,[n]),{start:i,clear:n,pending:!!e.current}},E=(0,f.g)("certificates-warning-banner","sc"),B=(0,f.g)("certificates-warning-popup","sc"),P=Object.freeze({wrapper:`${E}`,container:`${E}__container`,content:`${E}__content`,info:`${E}__info`,image:`${E}__image`,text:`${E}__text`,title:`${E}__title`,description:`${E}__description`,details:`${E}__details`,buttons:`${E}__buttons`,button:`${E}__button`,closeButton:`${E}__close-button`,mobileActivator:`${E}__mobile-activator`}),z=Object.freeze({modal:`${B}__modal`,desktopCloseButton:`${B}__desktop-close-button`,mobilePopup:`${B}__mobile-popup`,mobileContentContainer:`${B}__mobile-content-container`,mobileCloseButton:`${B}__mobile-close-button`,mobileDialog:`${B}__mobile-dialog`,content:`${B}__content`,image:`${B}__image`,text:`${B}__text`,title:`${B}__title`,description:`${B}__description`,actions:`${B}__actions`,primaryActions:`${B}__primary-actions`,divider:`${B}__divider`,explanation:`${B}__explanation`,button:`${B}__button`,gosuslugiButton:`${B}__gosuslugi-button`,gosuslugiIcon:`${B}__gosuslugi-icon`}),M="fu_certificates_access_confirmed",F="fu_certificates_banner_dismissed",L="fu_external_link_warning_shown",U=new Map,W=e=>{if(typeof window>"u")return"1"===U.get(e);try{return"1"===window.localStorage.getItem(e)||"1"===U.get(e)}catch{return"1"===U.get(e)}},H=e=>{if(U.set(e,"1"),!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},D=(e,n)=>{if(!e)return null;try{let t,i,l=new URL(e.toString(),n.href);return"http:"!==l.protocol&&"https:"!==l.protocol||(t=l.hostname,i=n.hostname,t===i||"finuslugi.ru"===t||t.endsWith(".finuslugi.ru"))?null:l}catch{return null}},V={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},G={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},J=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M3 9.998a9 9 0 0118 0c0 2.08-.89 4.273-2.029 6.249-1.148 1.991-2.6 3.844-3.826 5.262a4.123 4.123 0 01-6.29 0c-1.227-1.418-2.678-3.271-3.826-5.262C3.889 14.27 3 12.077 3 9.998zm9-7.5a7.5 7.5 0 00-7.5 7.5c0 1.688.737 3.607 1.828 5.5 1.083 1.877 2.468 3.65 3.661 5.029 1.084 1.251 2.938 1.251 4.022 0 1.193-1.379 2.578-3.152 3.66-5.03 1.092-1.893 1.829-3.81 1.829-5.499a7.5 7.5 0 00-7.5-7.5zm-4 7.5a4 4 0 118 0 4 4 0 01-8 0zm4-2.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function q({className:e,style:n,boxSize:i,size:l,onClick:o}){return t.default.createElement("span",{className:e,style:{...V,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...n},...o?{role:"button",tabIndex:"0",onClick:o}:{}},t.default.createElement(J,{viewBox:"0 0 24 24",style:G}))}q.displayName="IconFdsLocationO";let Y=(0,g.g)(),K=(0,g.a)(Y),Q={regions:Y,towns:K,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},X=(0,t.createContext)(Q);function Z(){return(0,t.useContext)(X)}let ee={"uat-mp.beta.moex.com":"//chat-marketplace.beta.moex.com","finuslugi.ru":"//chat.finuslugi.ru","dev-rc.beta.moex.com":"//dev-opbot.tech.finuslugi.ru"},en=(0,t.createContext)({isAuth:!1,isHeaderHidden:!1,isHeaderTransparent:!1,openedBlock:null,setOpenedBlock:()=>null,openedSection:null,setOpenedSection:()=>null,isNavigationOpen:!1,isNavigationMounted:!1,navMenuItemsRef:{current:null},navigationRef:{current:null},ignoreClicks:!1,setIgnoreClicks:()=>null,isChatModalOpen:!1,setIsChatModalOpen:()=>null,isChatLoading:!1,fixedContainerRef:{current:null},headerRef:{current:null}});function et(){return(0,t.useContext)(en)}let ei=e=>{let[i,l]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),[s,r]=(0,t.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d}=(()=>{let[e,n]=(0,t.useState)(!1),[i,l]=(0,t.useState)(!1),o=(0,t.useRef)(!1),a=e=>{o.current=e,l(e)};return(0,t.useEffect)(()=>{if(typeof window>"u")return;let e=(()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(ee,e)?ee[e]:ee["finuslugi.ru"]})(),t="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:n=>{if(n.host&&(e=n.host),n.channel&&(t=n.channel),n.user){let e="function"==typeof n.user?n.user:()=>({...n.user});window.__WebchatUserCallback=e}},open:()=>new Promise(e=>{e()}),close:()=>null,toggle:()=>null}};let i=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((l,s)=>{var r,c;let u,d;o.current?s(Error("chat is already opened")):i?(i.openWidget(),n(!1),l()):(a(!0),window.getWebChatCraftTalkExternalControl=e=>{var t;i=e;let o=document.querySelector(".webchat");o&&new MutationObserver(e=>{e.forEach(e=>{if("style"===e.attributeName){let e=document.querySelector(".webchat"),n=!!e&&"none"!==e.style.display;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.isOpened=n)}})}).observe(o,{attributes:!0,attributeFilter:["style"]}),null!=(t=window.supportWidget)&&t.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),a(!1),n(!1),l()},r=e,c=t,(u=document.createElement("link")).rel="stylesheet",u.type="text/css",u.href=`${r}/assets/css/${c}`,document.head.appendChild(u),(d=document.createElement("script")).src=`${r}/get-bootstrap/${c}`,d.defer=!0,document.body.appendChild(d))}),window.supportWidget.craftTalk.toggle=()=>{var e,n,t,i;null!=(n=null==(e=window.supportWidget)?void 0:e.craftTalk)&&n.isOpened?window.supportWidget.craftTalk.close():null==(i=null==(t=window.supportWidget)?void 0:t.craftTalk)||i.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:n,isChatLoading:i}})(),[p,f]=(0,t.useState)(null),[g,w]=(0,t.useState)(null),[v,x]=(0,t.useState)(!1),[b,C]=(0,t.useState)(!1),[_,y]=(0,t.useState)(!1),k=(0,t.useRef)(null),I=(0,h.u)(v),S=(0,t.useRef)(null),O=(0,t.useRef)(null),j=(0,t.useRef)(null),N=(0,t.useRef)(null),R=(0,t.useCallback)(()=>{I.current&&I.current.scrollTo({top:0})},[I]),$=(0,t.useCallback)(e=>{w(e),R()},[R]),A=(0,t.useCallback)(e=>{S.current&&clearTimeout(S.current),e&&C(!0),e||(S.current=setTimeout(()=>{C(!1),$(null)},300))},[$]),T=(0,t.useCallback)((e,n,t)=>{if(n&&$(n),!t&&e===p||!e){A(!v),x(!v);return}f(e),A(!0),x(!0)},[p,$,v,A]),E=(0,t.useCallback)(()=>{O.current&&clearTimeout(O.current),y(!0),O.current=setTimeout(()=>{y(!1)},650)},[]);return(0,t.useEffect)(()=>{l(!!document.cookie.includes("auth.gtm_customer_id"));let n=(0,m.s)(a,r,e.isMainBannerPage);return(0,m.i)(),n},[]),(0,n.jsx)("header",{children:(0,n.jsx)(en.Provider,{value:{isAuth:i,isHeaderHidden:o,isHeaderTransparent:s,openedBlock:p,setOpenedBlock:T,openedSection:g,setOpenedSection:$,isNavigationOpen:v,isNavigationMounted:b,navMenuItemsRef:k,navigationRef:I,ignoreClicks:_,setIgnoreClicks:E,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d,fixedContainerRef:j,headerRef:N},children:e.children})})},el=(0,f.g)("city-select","sc"),eo=Object.freeze({button:`${el}__button`,minimal:`${el}__minimal`,full:`${el}__full`}),ea=(0,i.default)(()=>e.A(67474).then(e=>e.CitySelectModal),{ssr:!1}),es=(0,i.default)(()=>e.A(59495).then(e=>e.StartChoicePopup),{ssr:!1}),er=({initialTown:e})=>{var i;let l=Z(),o=(null==(i=l.town)?void 0:i.name)||e||"Вся Россия",{setIsChatModalOpen:a,isChatModalOpen:s}=et(),{startPopupVisible:c,setStartPopupVisible:d,popupVisible:p}=l,f=A(p),g=A(c),h=(0,t.useRef)();(0,t.useEffect)(()=>{p&&(h.current="popup")},[p]),(0,t.useEffect)(()=>{s&&(h.current="chat")},[s]),(0,t.useEffect)(()=>{c&&(h.current="startPopup")},[c]),(0,t.useEffect)(()=>{h.current&&("chat"===h.current&&c?d(!1):["startPopup","popup"].includes(h.current)&&s&&a(!1))},[p,s,c,d,a]);let m={appearance:"ghost",size:"xs",onClick:()=>l.handleButtonClick(!1),iconLeft:(0,n.jsx)(q,{size:24})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Button,{...m,className:(0,u.default)(eo.button,eo.full),label:o}),(0,n.jsx)(r.Button,{...m,className:(0,u.default)(eo.button,eo.minimal),shape:"icon"}),f&&(0,n.jsx)(ea,{}),g&&(0,n.jsx)(es,{})]})},ec=({label:e,onClick:t,eventActionText:i,eventLabel:l,...o})=>(0,n.jsx)(r.Button,{label:e,onClick:e=>{null==t||t(e),(0,p.h)({eventCategory:w.H,eventActionType:p.D.button,eventActionText:i||"",eventLabel:l||""})},...o}),eu=({onClick:e,eventActionType:t,eventActionText:i,eventLabel:l,...o})=>(0,n.jsx)(v.Link,{onClick:n=>{null==e||e(n),(0,p.h)({eventCategory:w.H,eventActionType:t||p.D.link,eventActionText:i||"",eventLabel:l||""})},...o}),ed={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},ep={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},ef=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M7.22 12.53a.75.75 0 010-1.06l6.5-6.5a.75.75 0 111.06 1.06L8.81 12l5.97 5.97a.75.75 0 11-1.06 1.06l-6.5-6.5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function eg({className:e,style:n,boxSize:i,size:l,onClick:o}){return t.default.createElement("span",{className:e,style:{...ed,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...n},...o?{role:"button",tabIndex:"0",onClick:o}:{}},t.default.createElement(ef,{viewBox:"0 0 24 24",style:ep}))}eg.displayName="IconFdsChevronLeftO";let eh=(0,f.g)("header-chat-modal-body","sc"),em=Object.freeze({wrapper:`${eh}__wrapper`,cardButton:`${eh}__card-button`,card:`${eh}__card`,cardTitle:`${eh}__card-title`,cardSubtitle:`${eh}__card-subtitle`,button:`${eh}__button`}),ew=()=>{let e=et();return(0,n.jsxs)("div",{className:em.wrapper,children:[(0,n.jsx)(ec,{className:em.cardButton,variant:"secondary",pending:e.isChatLoading,onClick:()=>{var e,n,t;return null==(t=null==(n=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:n.open)?void 0:t.call(n)},eventActionText:"Напишите в чат",children:(0,n.jsxs)(C.Card,{className:em.card,variant:"secondary",children:[(0,n.jsxs)("div",{className:em.cardTitle,children:[(0,n.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,n.jsxs)("p",{className:em.cardSubtitle,children:["Виртуальный ассистент доступен 24/7, ",(0,n.jsx)("br",{}),"операторы — с 6:00 до 23:59 мск"]})]})}),!1]})},ev=({data:e,isMobile:i})=>{let l=et();return(0,n.jsx)("div",{className:y.s.contentWrapper,children:e.map(e=>(0,n.jsx)(t.Fragment,{children:e.sections.map(e=>{var t;return(0,n.jsxs)("div",{className:(0,u.default)(y.s.content,{[y.s.hidden]:l.openedSection!==e.id,[y.s.contentOpen]:!!l.openedSection}),children:[(0,n.jsx)("div",{className:y.s.contentHeader,children:(0,n.jsx)("label",{children:e.title})}),null==(t=e.content)?void 0:t.map((t,l)=>{var o,a;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("a",{className:(0,u.default)(y.s.contentTitle,{[y.s.removed]:!t.title,[y.s.contentTitleUrl]:!!t.url,[y.s.contentTitleLink]:!!e.isSeeAllLinkAvailable,[y.s.contentTitleNew]:!!t.new}),href:e.isSeeAllLinkAvailable?t.url:void 0,children:(0,n.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,n.jsx)("div",{className:y.s.arrowIcon,children:(0,n.jsx)(_.K,{})}),t.title]})})}),!(null!=(o=t.links)&&o.length)&&(0,n.jsx)(y.N,{items:t.chips||[],maxNumberOfLines:e.content.length<=1?99:i?3:2}),!!(null!=(a=t.links)&&a.length)&&(0,n.jsx)("div",{className:(0,u.default)(y.s.links,{[y.s.linksColumns]:!!t.columns,[y.s.linksTitleless]:!t.title}),children:t.links.map((e,t)=>(0,n.jsxs)("a",{href:e.url,onClick:()=>(0,m.h)(p.D.link,e.title,`${e.title}_${e.url}`),children:[(0,n.jsx)("div",{className:y.s.arrowIcon,children:(0,n.jsx)(_.K,{})}),(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{children:e.title}),!!e.new&&(0,n.jsx)("span",{className:(0,u.default)({[y.s.newInline]:!!e.new})})]})]},`${e.url}_${t}`))})]},`${t.url}_${l}`)})]},e.id)})},e.id))})},ex=(0,f.g)("navigation-section-icon","sc"),eb=Object.freeze({icon:`${ex}`}),eC={IconFdsAcademicCapO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsAcademicCapO),IconFdsBankO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsBankO),IconFdsBookOpenO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsBookOpenO),IconFdsCalculatorO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCalculatorO),IconFdsCardO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCardO),IconFdsChatDotsCircleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsChatDotsCircleO),IconFdsCoinMultipleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCoinMultipleO),IconFdsDotsHorizontalO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsDotsHorizontalO),IconFdsFlashO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsFlashO),IconFdsGraphO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsGraphO),IconFdsLayoutHorizontalO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsLayoutHorizontalO),IconFdsPortfolioO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsPortfolioO),IconFdsRubleCircleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsRubleCircleO),IconFdsSafeO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsSafeO),IconFdsShieldCheckO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsShieldCheckO),IconFdsWalletO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsWalletO)},e_=e=>Object.prototype.hasOwnProperty.call(eC,e),ey=({name:e,background:i})=>{let[l,o]=(0,t.useState)(null);if((0,t.useEffect)(()=>{if(!e||!e_(e))return void o(null);let n=!0;return eC[e]().then(t=>{n&&o({name:e,component:t})}).catch(()=>{n&&o(null)}),()=>{n=!1}},[e]),!e||!e_(e))return null;let a=(null==l?void 0:l.name)===e?l.component:null;return(0,n.jsx)("div",{className:eb.icon,style:{background:i},children:a&&(0,n.jsx)(a,{})})},ek=(0,f.g)("navigation","sc"),eI=Object.freeze({navigation:`${ek}`,navigationOpening:`${ek}--opening`,navigationClosing:`${ek}--closing`,wrapper:`${ek}__wrapper`,container:`${ek}__container`,containerOpen:`${ek}__container--open`,sections:`${ek}__sections`,sectionsOpen:`${ek}__sections--open`,citySelectButton:`${ek}__city-select-button`,sectionsTitle:`${ek}__sections-title`,sectionsWrapper:`${ek}__sections-wrapper`,section:`${ek}__section`,sectionArrow:`${ek}__section-arrow`,sectionExtra:`${ek}__section--extra`,sectionActive:`${ek}__section--active`,sectionTitle:`${ek}__section-title`,chatWrapper:`${ek}__chat-wrapper`,chatHeader:`${ek}__chat-header`,backButton:`${ek}__back-button`,useful:`${ek}__useful`,usefulOpen:`${ek}__useful--open`,usefulTitle:`${ek}__useful-title`,usefulGrid:`${ek}__useful-grid`,removed:`${ek}__removed`}),eS=({data:e})=>{var i;let l=et(),o=Z(),a=(0,b.useBreakpointDown)("m"),[s,d]=(0,t.useState)(!0);(0,t.useEffect)(()=>{d(a)},[a]);let f=(0,t.useRef)(null),g=(0,t.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>l.openedSection?l.setOpenedSection(null):l.isNavigationOpen?l.setOpenedBlock(null):void 0,50)},[l]),h=(0,t.useRef)(!1),v=(0,t.useRef)(null),C=(0,t.useCallback)(()=>{s&&(h.current=!0,v.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),g()},window.history.pushState(null,"",window.location.href))},[g,s]),_=(0,t.useCallback)(()=>{h.current=!1,window.onpopstate=v.current,window.history.go(-1)},[]),y=(0,t.useRef)(null),k=(0,t.useCallback)(e=>{if(s||!l.navMenuItemsRef.current||!l.navigationRef.current)return;let n=e.target,t=!l.navMenuItemsRef.current.contains(n)&&!l.navigationRef.current.contains(n);if(t&&!y.current){l.setIgnoreClicks(),y.current=setTimeout(()=>l.setOpenedBlock(null),300);return}!t&&y.current&&(clearTimeout(y.current),y.current=null)},[s,l]),I=(0,t.useRef)(null),S=(0,t.useCallback)(e=>{typeof window>"u"||(e?(I.current=k,window.addEventListener("mousemove",I.current)):I.current&&window.removeEventListener("mousemove",I.current))},[k]);(0,t.useEffect)(()=>{S(l.isNavigationOpen),l.isNavigationOpen&&!h.current&&C(),!l.isNavigationOpen&&h.current&&_()},[l.isNavigationOpen]);let O=(e,n)=>()=>{(0,m.h)(p.D.button,n),l.setOpenedSection(e)},{start:j,clear:N}=T(),R=()=>{s||N()};return(0,n.jsx)("div",{ref:l.navigationRef,className:(0,u.default)(eI.navigation,{[eI.removed]:!l.isNavigationMounted,[eI.navigationOpening]:l.isNavigationOpen,[eI.navigationClosing]:!l.isNavigationOpen}),children:(0,n.jsx)("div",{className:eI.wrapper,children:(0,n.jsxs)(c.Container,{className:(0,u.default)(eI.container,{[eI.containerOpen]:!!l.openedSection}),children:[(0,n.jsxs)("div",{className:(0,u.default)(eI.sections,{[eI.sectionsOpen]:!!l.openedSection}),children:[(0,n.jsx)(r.Button,{className:eI.citySelectButton,variant:"violet",appearance:"ghost",size:"xs",onClick:()=>o.handleButtonClick(!1),iconLeft:(0,n.jsx)(q,{size:24}),label:(null==(i=o.town)?void 0:i.name)||"Вся Россия"}),e.map(e=>(0,n.jsxs)("ul",{className:(0,u.default)(eI.sectionsWrapper,{[eI.removed]:l.openedBlock!==e.id&&!s}),children:[(0,n.jsx)("div",{className:eI.sectionsTitle,children:w.a[e.id]}),e.sections.map(e=>{let t,i;return(0,n.jsxs)("li",{className:(0,u.default)(eI.section,{[eI.sectionExtra]:!!e.extra,[eI.sectionActive]:l.openedSection===e.id}),onClick:O(e.id,e.title),onMouseEnter:(t=e.id,i=e.title,()=>{s||j(O(t,i),150)}),onMouseLeave:R,children:[l.isNavigationMounted&&(0,n.jsx)(ey,{name:e.uikitIcon,background:e.uikitIconBg}),(0,n.jsx)("span",{className:eI.sectionTitle,children:e.title}),(0,n.jsx)("div",{className:eI.sectionArrow,children:(0,n.jsx)(x._,{size:24})})]},e.id)})]},e.id)),(0,n.jsxs)("div",{className:eI.chatWrapper,children:[(0,n.jsx)("div",{className:eI.chatHeader,children:"Нужна помощь?"}),(0,n.jsx)(ew,{})]})]}),(0,n.jsxs)("button",{type:"button",className:(0,u.default)(eI.backButton,{[eI.removed]:!l.openedSection}),onClick:()=>{(0,m.h)(p.D.button,"Назад"),l.setOpenedSection(null)},children:[(0,n.jsx)(eg,{size:24}),(0,n.jsx)("span",{children:"Назад"})]}),(0,n.jsx)(ev,{data:e,isMobile:s}),(0,n.jsxs)("div",{className:(0,u.default)(eI.useful,{[eI.usefulOpen]:!!l.openedSection}),children:[(0,n.jsx)("div",{className:eI.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,n.jsx)(t.Fragment,{children:e.sections.map(e=>{var t;return(0,n.jsx)("div",{className:(0,u.default)(eI.usefulGrid,{[eI.removed]:l.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,n.jsxs)("a",{href:e.url,onClick:()=>(0,m.h)(p.D.link,e.title,`${e.title}_${e.url}`),children:[(0,n.jsx)("div",{children:(0,n.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id)})},e.id))]})]})})})},eO=(0,i.default)(()=>e.A(9466).then(e=>e.CertificatesWarningBanner),{ssr:!1}),ej=(0,i.default)(()=>e.A(14496).then(e=>e.CertificatesWarningPopup),{ssr:!1}),eN=(0,i.default)(()=>e.A(64532).then(e=>e.HeaderMobileAppBanner),{ssr:!1}),eR=({data:e,showcaseUrl:i="https://finuslugi.ru",minioUrl:f="https://assets.finuslugi.ru/mp-assets",lkUrl:g="https://lk.finuslugi.ru/registration",initialTown:h,isMainBannerPage:v,enableAppHeaderBanner:x=!1,enableCertificatesBanner:b=!1,enableExternalLinkWarning:C=!1,certificatesWarningProduct:_,news:y,className:k})=>{let I=et(),S=(0,t.useMemo)(()=>((e,n,t)=>{var i,l,o,a,s,r,c;let u=(null==(l=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:l.call(i,({id:e})=>"news"===e))??-1,p=(null==(a=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[u])?void 0:a.content)||[];if(null!=(c=null==(r=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[u])?void 0:r.content)&&c[0]&&Array.isArray(t)&&p.length){let i=t.map(({title:e,url:t})=>({title:e,url:(0,d.joinURL)(n||"",t),new:0}));e.NAVIGATOR[u].content[0].links=i}return[{id:"FINPRODUCTS",sections:Array.isArray(null==e?void 0:e.FINPRODUCTS)?null==e?void 0:e.FINPRODUCTS:[]},{id:"NAVIGATOR",sections:Array.isArray(null==e?void 0:e.NAVIGATOR)?null==e?void 0:e.NAVIGATOR:[]},{id:"ABOUT",sections:Array.isArray(null==e?void 0:e.ABOUT)?null==e?void 0:e.ABOUT:[]}]})(e,i,y),[e,i,y]),j=null==e?void 0:e.config,N=!!e&&b&&!!v,R=(({enableCertificatesBanner:e,enableExternalLinkWarning:n,isMainBannerPage:i})=>{let[l,o]=(0,t.useState)("checking"),[a,s]=(0,t.useState)(!1),[r,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(!1),[p,f]=(0,t.useState)(!1),g=(0,t.useRef)(),h=(0,t.useRef)(!1),m=(0,t.useRef)(!1),w=(0,t.useRef)(!1);(0,t.useRef)(null);let v=(0,t.useRef)(null),x=(0,t.useRef)(null),b=(0,t.useRef)(null),C=e&&i,_=C||n,y=(0,t.useCallback)(e=>{let n=g.current;n?n.call(window,e,"_blank","noopener,noreferrer"):window.open(e,"_blank","noopener,noreferrer")},[]),k=(0,t.useCallback)(()=>{s(!1),w.current=!1,v.current=null,x.current=null,b.current=null,f(!1)},[]),I=(0,t.useCallback)(e=>{H(L),m.current=!0,w.current=!1,v.current=e,f("external"===e&&null!==x.current),s(!0)},[]),S=(0,t.useCallback)(()=>!h.current&&("external"===v.current&&!w.current||!m.current),[]),O=(0,t.useCallback)(()=>{"external"!==v.current&&I("external")},[I]);(0,t.useEffect)(()=>{g.current=window.open;let e=window.navigator.userAgent.includes("YaBrowser/");return e&&H(M),h.current=e||W(M),m.current=W(L),d(h.current),c(!0),()=>{x.current=null,b.current=null}},[]),(0,t.useEffect)(()=>{if(r){if(!C)return void o("skipped");o(e=>"shown"===e||"closing"===e||"dismissed"===e?e:u||W(F)?"skipped":"shown")}},[u,C,r]),(0,t.useEffect)(()=>{},[k,_,r]),(0,t.useEffect)(()=>{if(!r||!n)return;let e=g.current;if(!e)return;let t=!0,i=e=>{if(0!==e.button&&1!==e.button||!(e.target instanceof Element))return;let n=e.target.closest("a[href]");if(!n||e.defaultPrevented)return;let i=D(n.href,window.location);if(!i||!S())return;e.preventDefault(),null===x.current&&(x.current=i.href,b.current={source:"external_anchor",host:i.hostname});let l=x.current;queueMicrotask(()=>{t&&S()&&x.current===l&&O()})},l=(n,t="_blank",i)=>{let l=D(n,window.location);return l&&S()?(null===x.current&&(x.current=l.href,b.current={source:"external_window_open",host:l.hostname}),O(),null):e.call(window,n,t,i)};return window.open=l,document.addEventListener("click",i,!0),document.addEventListener("auxclick",i,!0),()=>{t=!1,document.removeEventListener("click",i,!0),document.removeEventListener("auxclick",i,!0),window.open===l&&(window.open=e)}},[n,r,S,O]),(0,t.useEffect)(()=>{var e;n||(x.current=null,(null==(e=b.current)?void 0:e.source)!=="banner"&&(b.current=null),f(!1),"external"===v.current&&k())},[k,n]),(0,t.useEffect)(()=>{C||"banner"===v.current&&k()},[k,C]),(0,t.useEffect)(()=>{_||k()},[k,_]);let j=(0,t.useCallback)(()=>{H(F),o("closing")},[]),N=(0,t.useCallback)(()=>{o("dismissed")},[]),R=(0,t.useCallback)(()=>{x.current=null,b.current={source:"banner"},I("banner")},[I]),$=(0,t.useCallback)(()=>{y("https://www.gosuslugi.ru/crt")},[y]),A=(0,t.useCallback)(()=>{y("https://browser.yandex.ru/")},[y]),T=(0,t.useCallback)(()=>{let e=x.current;e&&(H(L),m.current=!0,w.current=!0,y(e))},[y]);return{bannerStatus:l,isPopupOpen:a,popupAnalyticsContext:b.current,dismissBanner:j,finishBannerClosing:N,openPopupFromBanner:R,closePopup:k,openCertificatesPage:$,openYandexBrowserPage:A,continueToExternalPage:p?T:void 0}})({enableCertificatesBanner:N,enableExternalLinkWarning:C,isMainBannerPage:!!v}),E="shown"===R.bannerStatus||"closing"===R.bannerStatus,B=!N||"skipped"===R.bannerStatus,P=A(R.isPopupOpen),z=(0,t.useMemo)(()=>S.reduce((e,n)=>{var t;return e[n.id]=null==(t=n.sections[0])?void 0:t.id,e},{}),[S]),U=I.isAuth?"Личный кабинет":"Войти",V=v&&I.isHeaderTransparent,G=(e,n,t,i)=>()=>{e!==I.openedBlock?(0,m.h)(p.D.toggle,n,"on"):(0,m.h)(p.D.button,"menu_close","on");let l=t?z[e]:"";I.setOpenedBlock(e,l,!!i)},{start:J,clear:q}=T(),Y=e=>()=>{I.ignoreClicks||e()},K=P?(0,n.jsx)(ej,{isOpen:R.isPopupOpen,analyticsContext:R.popupAnalyticsContext,certificatesWarningProduct:_,onClose:R.closePopup,onOpenCertificatesPage:R.openCertificatesPage,onOpenYandexBrowserPage:R.openYandexBrowserPage,onContinue:R.continueToExternalPage}):null;return e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:I.headerRef,className:(0,u.default)(w.s.header,k,{[w.s.transparent]:V}),children:(0,n.jsxs)("div",{ref:I.fixedContainerRef,className:(0,u.default)(w.s.fixed,{[w.s.hidden]:I.isHeaderHidden,[w.s.navigationOpen]:I.isNavigationOpen}),children:[E&&(0,n.jsx)(eO,{onDismiss:R.dismissBanner,onClosed:R.finishBannerClosing,onOpenDetails:R.openPopupFromBanner,onOpenCertificatesPage:R.openCertificatesPage,onOpenYandexBrowserPage:R.openYandexBrowserPage}),B&&!!(null!=j&&j.appBannerUrl)&&x&&(0,n.jsx)(eN,{mobileAppUrl:j.appBannerUrl,minioUrl:f}),(0,n.jsxs)(c.Container,{className:w.s.container,children:[(0,n.jsxs)("div",{className:w.s.leftRow,children:[(0,n.jsx)(eu,{className:w.s.logo,href:i,eventActionType:p.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${i}`,children:(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{srcSet:(0,d.joinURL)(f,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,n.jsx)("img",{src:(0,d.joinURL)(f,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,n.jsx)("nav",{ref:I.navMenuItemsRef,className:w.s.menuItems,children:(0,n.jsx)("ul",{children:w.b.map(({id:e,label:t})=>(0,n.jsx)("li",{children:(0,n.jsx)(r.Button,{className:(0,u.default)({[w.s.menuItemActive]:I.openedBlock===e&&I.isNavigationOpen}),label:t,variant:"white",size:"xs",onClick:Y(G(e,t,!0)),onMouseEnter:()=>{I.isNavigationOpen&&e===I.openedBlock||I.setIgnoreClicks(),J(G(e,t,!0,!0),200)},onMouseLeave:q})},e))})}),(0,n.jsx)(ec,{className:(0,u.default)(w.s.tabletMenuButton,{[w.s.menuItemActive]:I.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,n.jsx)(o.m,{size:24}),onClick:G("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,n.jsxs)("div",{className:(0,u.default)(w.s.buttonGroup,{[w.s.whiteIcons]:(null==j?void 0:j.iconColorOnMobileMainBanner)==="white"}),children:[(0,n.jsxs)("div",{className:w.s.chips,children:[(0,n.jsx)(ec,{as:"a",href:g,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${g}`,iconLeft:(0,n.jsx)(s.e,{size:20}),"aria-label":U}),(0,n.jsx)(ec,{onClick:()=>{var e,n,t;return null==(t=null==(n=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:n.open)?void 0:t.call(n)},size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,n.jsx)(l.G,{size:24}),"aria-label":"Онлайн чат"})]}),(0,n.jsx)(ec,{className:w.s.menuButton,size:"xs",shape:V?"icon":"default",appearance:V?"ghost":"fill",label:"Меню",onClick:G("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,n.jsx)($,{size:24})}),(0,n.jsxs)("div",{className:w.s.moreButtons,children:[(0,n.jsx)(er,{initialTown:h}),(0,n.jsx)(ec,{onClick:()=>{var e,n,t;return null==(t=null==(n=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:n.open)?void 0:t.call(n)},size:"xs",appearance:"ghost",eventActionText:"IconFdsChatDotsSquareAddO",iconLeft:(0,n.jsx)(O,{size:24}),children:"Онлайн чат"}),(0,n.jsx)(ec,{as:"a",href:g,size:"xs",eventActionText:U,eventLabel:`${U}_${g}`,label:U})]})]}),(0,n.jsxs)(eu,{className:w.s.auth,href:g,eventActionText:U,eventLabel:`${U}_${g}`,children:[(0,n.jsx)(ec,{size:"xs",shape:"circle-icon",iconLeft:(0,n.jsx)(s.e,{}),eventActionText:U,eventLabel:`${U}_${g}`}),(0,n.jsx)("p",{children:U})]}),(0,n.jsx)("div",{className:w.s.close,children:(0,n.jsx)(ec,{className:w.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,n.jsx)(a.a,{}),onClick:()=>I.setOpenedBlock(null),eventActionText:"IconFdsCloseO","aria-label":"Закрыть"})})]})]})}),(0,n.jsx)("div",{className:(0,u.default)(w.s.overlay,{[w.s.removed]:!I.isNavigationMounted,[w.s.overlayOpening]:I.isNavigationOpen,[w.s.overlayClosing]:!I.isNavigationOpen}),onClick:Y(()=>I.setOpenedBlock(null))}),(0,n.jsx)(eS,{data:S,minioUrl:f}),K]}):C?K:null};e.s(["CitySelectProvider",0,({children:e,initialRegion:i,initialTown:l,showStartGeoPopup:o=!0,lastRegionsUpdateUnixTimestamp:a,showcaseUrl:s="",dadataUrl:r=(0,g.d)(s,"/backend/money/dadata"),useNewCitiesApi:c=!1})=>{let u=(0,g.e)(c),d=Number((0,g.p)(u.lastRegionsUpdateUnixTimestamp)||0),f=Number(a||0)>d,[h,m]=(0,t.useState)((0,g.g)(c)),w=(0,t.useRef)(h),[{startRegion:v,startTown:x},b]=(0,t.useState)({startRegion:Q.startRegion,startTown:Q.startTown}),C=i??Q.region,_=l??Q.town,[{region:y,town:k},I]=(0,t.useState)({region:C,town:_}),[S,O]=(0,t.useState)(Q.startPopupVisible),[j,N]=(0,t.useState)(Q.popupVisible),R=(0,t.useRef)(""),$=(0,t.useRef)(!1),A=(0,t.useMemo)(()=>(0,g.a)(h),[h]);(0,t.useEffect)(()=>{w.current=h},[h]);let T=(0,t.useCallback)((e,n)=>{window.sessionStorage.setItem("start_popup_opened","1"),window.localStorage.setItem("auto_town",JSON.stringify(n)||""),window.localStorage.setItem("auto_region",JSON.stringify(e)||""),O(!0),b({startRegion:e,startTown:n})},[O,b]),E=(0,t.useCallback)((e,n)=>{window.sessionStorage.getItem("start_popup_opened")||T(e,n)},[T]),B=(0,t.useCallback)(()=>{if(R.current&&!y&&!k){let e=A.find(e=>e.name===R.current)??null;return E(h.find(n=>n.id===(null==e?void 0:e.parentId))??null,e)}E(y,k)},[y,k,A,h,E]),P=(0,t.useCallback)(e=>{N(e)},[N]),z=(0,t.useCallback)((e,n)=>{if(!e&&!n){window.localStorage.setItem(u.allRussiaSelected,"1"),window.localStorage.setItem(u.userRegion,""),window.localStorage.setItem(u.userTown,""),(0,g.s)(null,null,c);return}window.localStorage.setItem(u.allRussiaSelected,"0"),window.localStorage.setItem(u.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(u.userTown,JSON.stringify(n)||""),(0,g.s)(e||null,n||null,c)},[u,c]),M=(0,t.useCallback)(e=>{e?(0,g.h)(p.D.icon,"location"):(0,g.h)(p.D.button,(null==k?void 0:k.name)||"Вся Россия"),!o||window.sessionStorage.getItem("start_popup_opened")?P(!0):B()},[o,k,P,B]),F=(0,t.useCallback)((e,n)=>{z(e,n),I({region:e||null,town:n||null}),O(!1),P(!1);let t=new CustomEvent("onRegionChange",{detail:{region:e,town:n}});document.dispatchEvent(t)},[P,z]),L=()=>{let e=(0,g.f)(u.userRegion),n=e??(0,g.p)(u.userRegion),t=(0,g.f)(u.userTown)??(0,g.p)(u.userTown),i=(0,g.b)(w.current,n,t),l=c&&(0,g.j)(n,t);(0,g.k)(e,i.region)&&(0,g.s)(i.region,i.town,c),l&&($.current=!0),l&&(0,g.c)(i.region,i.town)&&(z(i.region,i.town),$.current=!1),I(i);let a=async({coords:{latitude:e,longitude:n}})=>{let t=`${r}?lat=${e}&lon=${n}`,i=await (0,g.m)(t);null!=i&&i.location&&(R.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&o)try{navigator.geolocation.getCurrentPosition(a,()=>null)}catch{}};return(0,t.useEffect)(()=>{(!(0,g.i)(h,c)||f)&&(0,g.l)({showcaseUrl:s,useNewCitiesApi:c}).then(e=>{e.length<1||m(e)})},[]),(0,t.useEffect)(()=>{let e=(0,g.b)(h,y,k);$.current&&(0,g.c)(e.region,e.town)&&(z(e.region,e.town),$.current=!1),I(e)},[h,y,z,k]),(0,t.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{L(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{L()},0)},[]),(0,n.jsx)(X.Provider,{value:{regions:h,towns:A,region:y,town:k,startPopupVisible:S,setStartPopupVisible:O,popupVisible:j,handleToggleModal:P,selectCity:F,handleButtonClick:M,startRegion:v,startTown:x},children:e})},"H",0,ec,"Header",0,e=>(0,n.jsx)(ei,{isMainBannerPage:e.isMainBannerPage,children:(0,n.jsx)(eR,{...e})}),"b",0,P,"p",0,z,"u",0,et,"useCitySelectContext",0,Z])}]);