(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[334],{166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var i=n(5775),l=n.n(i)},5775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let i=n(7043);n(7437),n(2265);let l=i._(n(5602));function o(e,t){var n;let i={loading:e=>{let{error:t,isLoading:n,pastDelay:i}=e;return null}};"function"==typeof e&&(i.loader=e);let o={...i,...t};return(0,l.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let i=n(8993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new i.BailoutToCSRError(t);return n}},5602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let i=n(7437),l=n(2265),o=n(1523),r=n(49);function s(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},c=function(e){let t={...a,...e},n=(0,l.lazy)(()=>t.loader().then(s)),c=t.loading;function u(e){let s=c?(0,i.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,a=t.ssr?(0,i.jsxs)(i.Fragment,{children:["undefined"==typeof window?(0,i.jsx)(r.PreloadCss,{moduleIds:t.modules}):null,(0,i.jsx)(n,{...e})]}):(0,i.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(n,{...e})});return(0,i.jsx)(l.Suspense,{fallback:s,children:a})}return u.displayName="LoadableComponent",u}},49:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return o}});let i=n(7437),l=n(544);function o(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),o=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));o.push(...t)}}return 0===o.length?null:(0,i.jsx)(i.Fragment,{children:o.map(e=>(0,i.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},6583:function(){},7565:function(){},1458:function(){},631:function(e,t,n){"use strict";function i(){return typeof window>"u"}function l(e){i()||(Array.isArray(window.dataLayer)?window.dataLayer.push(e):console.log("window.dataLayer does not exist"),Array.isArray(window._mtm)?window._mtm.push(e):console.log("window._mtm does not exist"))}function o(){if(i()){console.warn("Cant initialize tag manager on server side");return}"function"!=typeof window._init_gtm?console.warn("Cant init GTM, please check if GTM script exists"):window._init_gtm(),"function"!=typeof window._init_mtm?console.warn("Cant init MTM, please check if MTM script exists"):window._init_mtm()}n.d(t,{AB:function(){return l},zK:function(){return o}})},4181:function(e,t,n){"use strict";n.d(t,{D:function(){return A},P:function(){return B},U:function(){return M},u:function(){return b}});var i=n(7437),l=n(1994),o=n(2265),r=n(684),s=n(2074),a=n(4887);let c=300,u=({opened:e})=>{let[t,n]=(0,o.useState)(!1),i=(0,o.useRef)(null),l=(0,o.useRef)(!1);return(0,o.useEffect)(()=>(e&&!l.current?(l.current=!0,n(!0)):!e&&l.current&&(i.current=setTimeout(()=>{l.current=!1,n(!1)},c)),()=>{i.current&&clearTimeout(i.current)}),[e]),{mounted:t}},d=(0,s.g)("click-outside","sc"),p=Object.freeze({overlay:`${d}__overlay`,open:`${d}--open`,close:`${d}--close`}),m=({onClose:e,onToucheMove:t,isOpen:n,delay:r=c})=>{let s=(0,o.useRef)(null),a=(0,o.useCallback)(()=>{e&&(s.current=setTimeout(()=>{e()},r))},[r,e]),u=(0,o.useCallback)(e=>{"Escape"===e.key&&a()},[a]);return(0,o.useEffect)(()=>(n&&window.addEventListener("keydown",u),()=>{s.current&&clearTimeout(s.current),window.removeEventListener("keydown",u)}),[n,u]),(0,i.jsx)("div",{className:(0,l.Z)(p.overlay,{[p.open]:n,[p.close]:!n}),onTouchStart:t,onClick:a})},h=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},f=e=>{e.style.top||(window.prevScrollPosition=window.scrollY)},v=(e,t,n)=>{t.style.setProperty("overflow-y","scroll"),e.classList.toggle("scroll-disable-windows",!0),e.style.setProperty("width",`calc(100vw - ${n}px)`),e.style.setProperty("top",`-${window.prevScrollPosition}px`)},g=e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vh")},w=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},_=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},x=()=>document.querySelectorAll("[data-portal]").length>1,b=e=>{let t=(0,o.useRef)(null),n=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(n.current===e)return;n.current=e;let i=t.current,l=document.body,o=document.documentElement,r=window.innerWidth-o.clientWidth,s=r>0;if(e&&s)f(l),v(l,o,r),h(i,!0);else if(e)g(l),h(i,!0);else{let e=!x();e&&w(l),e&&_(),h(i,!1)}return()=>{let e=!x();e&&w(l),e&&_()}},[e]),t},j=(0,s.g)("drawer-footer","sc"),y=Object.freeze({footer:`${j}__footer`,hasScroll:`${j}__footer--has-scroll`}),$=({footer:e,hasScroll:t,className:n})=>(0,i.jsx)("div",{className:(0,l.Z)(y.footer,{[y.hasScroll]:t},n),children:"function"==typeof e?e():e}),N=(0,s.g)("drawer-content","sc"),k=Object.freeze({container:`${N}__container`,open:`${N}--open`,close:`${N}--close`,header:`${N}__header`,rowHeader:`${N}__header--row`,title:`${N}__title`,center:`${N}__title--center`,left:`${N}__title--left`,right:`${N}__title--right`,controlContainer:`${N}__control-container`,content:`${N}__content`,footer:`${N}__footer`}),C=({onClose:e,onContentClick:t,children:n,title:s,rowTitle:a,titleAlign:c,isCloseable:u,footer:d,closeButton:p,isOpen:m,contentClassName:h,footerClassName:f,contentStyle:v,width:g})=>{let w=(0,o.useRef)(null),_=(0,o.useRef)(null),[x,b]=(0,o.useState)(!1);(0,o.useEffect)(()=>{var e;if(!_.current||!w.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==w?void 0:w.current,i=()=>{let e=null==_?void 0:_.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let j=v||g?{width:g,...v||{}}:void 0;return(0,i.jsxs)("div",{ref:w,style:j,className:(0,l.Z)(k.container,{[k.open]:m,[k.close]:!m},h),children:[s||u?(0,i.jsxs)("div",{className:(0,l.Z)(k.header,{[k.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,i.jsx)("button",{type:"button",className:k.controlContainer,onClick:e,children:(0,i.jsx)(r.IconFdsCloseO,{size:24})}):null,s?(0,i.jsx)("h3",{className:(0,l.Z)(k.title,{[k[c]]:!0}),children:s}):null]}):null,(0,i.jsx)("div",{ref:_,className:k.content,onClick:t,children:n}),d&&(0,i.jsx)($,{className:(0,l.Z)(k.footer,f),footer:d,hasScroll:x})]})},T=(0,s.g)("drawer-layout","sc"),O=Object.freeze({window:`${T}__window`}),S=({onClose:e,isOpen:t,children:n,withDisabledScroll:r,className:s,...a})=>{let c=(0,o.useCallback)(e=>e.stopPropagation(),[]);return b(t&&r),(0,i.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(O.window,s),children:[(0,i.jsx)(m,{onClose:e,isOpen:t,delay:0}),(0,i.jsx)(C,{onContentClick:c,onClose:e,isOpen:t,...a,children:n})]})},A=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:l=!0,withDisabledScroll:o=!0,...r})=>{let{mounted:s}=u({opened:e});return s?(0,i.jsx)(S,{titleAlign:n,isCloseable:l,isOpen:e,withDisabledScroll:o,...r,children:t}):null};A.displayName="Drawer";let I=(0,s.g)("mobile-modal-footer","sc"),L=Object.freeze({footer:`${I}__footer`,footerWithoutShadow:`${I}__footer--without-shadow`}),R=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,i.jsx)("div",{className:(0,l.Z)(L.footer,t&&L.footerWithoutShadow,n),children:"function"==typeof e?e():e}),P=(0,s.g)("mobile-popup","sc"),z=Object.freeze({mobilePopup:`${P}`,mobilePopupOpen:`${P}--open`,content:`${P}__content`,contentFull:`${P}__content--full`,contentTransition:`${P}__content--transition`,contentTransitionOpen:`${P}__content--transition-open`,contentLine:`${P}__content-line`,contentContainer:`${P}__content-container`,smallContentContainer:`${P}__content-container--small`,min:`${P}__content-container--min`,title:`${P}__title`,closeContainer:`${P}__close-container`,closeButton:`${P}__close-button`}),E=({children:e,footer:t,isOpen:n,isSmallPopup:s,onClose:a,hasCloseButton:c=!0,full:u,touchDistance:d=100,withDisabledScroll:p=!0,contentClassName:h,className:f,title:v,closeButton:g,footerClassName:w})=>{let[_,x]=(0,o.useState)(!1),[j,y]=(0,o.useState)(!1),[$,N]=(0,o.useState)(!0),[k,C]=(0,o.useState)("120%"),T=(0,o.useRef)(null),O=(0,o.useRef)(0),S=(0,o.useRef)(!1),A=e=>{var t,n,i;let l=null==(t=T.current)?void 0:t.offsetTop,o=null==(n=T.current)?void 0:n.offsetHeight;if(S.current=!0,N(!1),l&&o){let t=(null==(i=null==e?void 0:e.touches[0])?void 0:i.clientY)-l,n=0;t>=0&&t<=o+30&&(n=t),t>o+30&&(n=o+30),C(`${n}px`),O.current=n}},I=()=>{S.current&&(O.current>d&&a?null==a||a():C("0"),N(!0),S.current=!1),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",I)};return(0,o.useEffect)(()=>{n&&setTimeout(()=>{x(!0),y(!0),C("0")},100),!n&&j&&(C("120%"),x(!1),y(!1))},[j,n]),b(n&&p),(0,i.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(z.mobilePopup,j&&z.mobilePopupOpen,f),children:[(0,i.jsx)(m,{onClose:()=>{n&&(null==a||a())},onToucheMove:()=>{n&&(x(!1),window.addEventListener("touchmove",A),window.addEventListener("touchend",I))},isOpen:n,delay:0}),(0,i.jsxs)("div",{className:(0,l.Z)(z.content,u&&z.contentFull,$&&z.contentTransition,$&&_&&z.contentTransitionOpen),ref:T,style:{transform:`translateY(${k})`},children:[(0,i.jsx)("div",{className:z.contentLine}),(0,i.jsxs)("div",{className:(0,l.Z)(z.contentContainer,s&&z.smallContentContainer,{[z.min]:!v&&!c},h),children:[!!v&&(0,i.jsx)("div",{className:z.title,children:v}),c?(0,i.jsx)("div",{className:z.closeContainer,children:c?g?"function"==typeof g?g():g:(0,i.jsx)("button",{onClick:a,className:z.closeButton,children:(0,i.jsx)(r.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,i.jsx)(R,{footerClassName:w,isSmallPopup:s,footer:t})]})]})},M=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...l})=>{let{mounted:o}=u({opened:n});return o?(0,i.jsx)(E,{isSmallPopup:t,isOpen:n,...l,children:e}):null};M.displayName="UiMobilePopup";let B=({children:e,id:t="portal-root"})=>{let[n,i]=(0,o.useState)(null);return(0,o.useEffect)(()=>{let e=document.getElementById(t);if(e){i(e);return}let n=document.createElement("div");return n.id=t,document.body.appendChild(n),i(n),()=>{document.body.removeChild(n)}},[t]),n?(0,a.createPortal)(e,n):null}},2074:function(e,t,n){"use strict";function i(e,t){return`finkit-widgets-${t}-${e}`}n.d(t,{g:function(){return i}})},5487:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});let i={getItem:e=>{if(typeof document>"u")return null;let t=document.cookie.split(";").find(t=>t.split("=")[0].trim()===e);return t?t.split("=")[1]??null:null},setItem:(e,t,n={})=>{if(typeof document>"u")return;(n={path:"/",...n}).expires instanceof Date&&(n.expires=n.expires.toUTCString());let i=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;for(let e in n){if(!n.hasOwnProperty(e))continue;i+=`; ${e}`;let t=n[e];!0!==t&&(i+=`=${t}`)}document.cookie=i},removeItem:e=>{i.setItem(e,"",{"max-age":-1})}}},8631:function(e,t,n){"use strict";let i;n.d(t,{D:function(){return a},h:function(){return u}});let l={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sch",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"},o=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in l?l[t]:e}).replaceAll(/[ \u00A0]/g,"_");var r=n(631);let s=(e,t)=>{if(typeof window>"u")return;let n=sessionStorage.getItem("pushedEvents"),i=n?JSON.parse(n):[];e.event||(e.event="data-event"),"string"==typeof e.eventAction&&(e.eventAction=e.eventAction.toLowerCase().replaceAll(" ","_")),"string"==typeof e.eventLabel&&(e.eventLabel=e.eventLabel.toLowerCase().replaceAll(" ","_")),e.eventLabel||(e.eventLabel="undefined");let l=i.find(n=>n.eventCategory===e.eventCategory&&n.eventAction===e.eventAction&&n.eventLabel===e.eventLabel&&("all"===t||"url"===t&&window.location.pathname===n.url));if(!t||!l){if(t){let t={...e};t.url=window.location.pathname,i.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(i))}(0,r.AB)(e)}};var a=((i=a||{}).icon="icon",i.chip="chip",i.accordion="accordion",i.button="button",i.checkbox="checkbox",i.radio="radio",i.select="select",i.toggle="toggle",i.tooltip="tooltip",i.link="link",i.banner="banner",i.tag="tag",i.date="date",i.field="field",i.offer="offer",i.tab="tab",i.submitButton="submitButton",i.popup="popup",i.block="block",i);let c={icon:"click_icon_",chip:"click_chip_",accordion:"show_acc_",button:"click_button_",checkbox:"click_check_",radio:"click_radio_",select:"click_sel_",toggle:"click_togg_",tooltip:"click_tip_",link:"click_link_",banner:"click_bnr_",tag:"click_tag_",date:"input_date_",field:"input_field_",offer:"click_offer_",tab:"click_tab_",submitButton:"form_button_",popup:"show_pop_up_",block:"click_block_"},u=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:i})=>{let l={event:"data-event",eventCategory:e,eventAction:c[t]+o(n)};void 0!==i&&(l.eventLabel=o("string"==typeof i?i:i.toString())),s(l)}},7809:function(e,t,n){"use strict";let i;n.d(t,{Footer:function(){return q}});var l=n(7437),o=n(5563),r=n(1994),s=n(7337),a=n(2074),c=n(5461),u=n(8631),d=n(684),p=n(2265),m=n(4181);let h=(0,a.g)("footer-contacts-block","sc"),f=Object.freeze({contactsWrapper:`${h}__contacts-wrapper`,gray:`${h}__gray`,phones:`${h}__phones`,contactsButtons:`${h}__contacts-buttons`,vkIcon:`${h}__vk-icon`,tgIcon:`${h}__tg-icon`,dzenIcon:`${h}__dzen-icon`,maxIcon:`${h}__max-icon`,link:`${h}__link`}),v=(0,a.g)("footer","sc"),g=Object.freeze({wrapper:`${v}__wrapper`,section:`${v}__section`,container:`${v}__container`,top:`${v}__top`,main:`${v}__main`,links:`${v}__links`,disclaimer:`${v}__disclaimer`,bottom:`${v}__bottom`,bottomLinks:`${v}__bottom-links`,bottomDisclaimer:`${v}__bottom-disclaimer`,compact:`${v}__wrapper--compact`,white:`${v}__wrapper--white`}),w="finkit-widgets-sc-footer",_=[{title:"8 (800) 505-32-32",url:"tel:88005053232"},{title:"+7 (495) 145-32-32",url:"tel:+74951453232"}],x=[..._,{title:"Онлайн чат",url:void 0}],b=[{type:"vk",className:f.vkIcon,iconName:"vk"},{type:"telegramChannel",className:f.tgIcon,iconName:"telegram"},{type:"dzen",className:f.dzenIcon,iconName:"dzen"},{type:"max",className:f.maxIcon,iconName:"max"}],j=(0,l.jsxs)("p",{children:["На сайте finuslugi.ru предоставляются услуги оператора финансовой платформы ПАО Московская Биржа, а также услуги ООО \xabМБ Маркетплейс\xbb, организации, не являющейся оператором финансовой платформы в соответствии с Федеральным законом от 20.07.2020 №211-ФЗ \xabО совершении финансовых сделок с использованием финансовой платформы\xbb. Услуги оператора финансовой платформы ПАО Московская Биржа обозначены пометкой \xabОткрытие онлайн на Финуслугах\xbb. Иная информация на сайте www.finuslugi.ru считается размещенной ООО \xabМБ Маркетплейс\xbb, если иное явно не следует из существа размещаемой информации. ООО \xabМБ Маркетплейс\xbb входит в Группу \xabМосковская Биржа\xbb.",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"Группа \xabМосковская Биржа\xbb - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),y=({onClick:e,eventActionText:t,eventLabel:n,...i})=>(0,l.jsx)(c.zx,{onClick:i=>{null==e||e(i),(0,u.h)({eventCategory:w,eventActionType:u.D.button,eventActionText:t||"",eventLabel:n})},...i}),$=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,chat:o,...r})=>(0,l.jsx)(c.rU,{onClick:l=>{var r,s,a;null==e||e(l),o&&(null==l||l.preventDefault(),null==(a=null==(s=null==(r=null==window?void 0:window.supportWidget)?void 0:r.craftTalk)?void 0:s.open)||a.call(s)),(0,u.h)({eventCategory:w,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:i})},...r}),N=({minioUrl:e,blogs:t})=>(0,l.jsxs)("div",{className:f.contactsWrapper,children:[(0,l.jsx)(o.xv,{className:f.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,l.jsx)("div",{className:f.phones,children:x.map(({title:e,url:t})=>(0,l.jsx)($,{href:t,eventActionText:e,chat:!t,children:e},e))}),(0,l.jsx)(o.xv,{className:f.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,l.jsx)("div",{className:f.contactsButtons,children:b.map(({type:n,className:i,iconName:o})=>(0,l.jsx)(y,{as:"a",href:null==t?void 0:t[n],target:"_blank",className:i,iconRight:(0,l.jsx)("img",{width:24,height:24,src:(0,s.xn)(e,`/widgets/footer/${o}.svg`),alt:n,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:n,eventLabel:null==t?void 0:t[n]},n))}),(0,l.jsx)(o.xv,{className:f.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,l.jsx)("div",{className:f.contactsButtons,children:(0,l.jsxs)($,{href:null==t?void 0:t.investTg,target:"_blank",className:f.link,eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg,children:[(0,l.jsx)(y,{className:f.tgIcon,iconRight:(0,l.jsx)("img",{width:24,height:24,src:(0,s.xn)(e,"/widgets/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg}),"Финуслуги Инвест"]})})]}),k=(0,a.g)("footer-disclaimer","sc"),C=Object.freeze({disclaimer:`${k}`}),T=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&(0,u.h)({eventCategory:w,eventActionType:u.D.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,l.jsx)("div",{className:(0,r.Z)(e.className,C.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,l.jsx)("div",{className:(0,r.Z)(e.className,C.disclaimer),onClick:t,children:e.children})},O=()=>{let e=new URL(window.location.href),t=new URLSearchParams;return e.searchParams.forEach((e,n)=>{/^utm_/i.test(n)&&t.set(n,e)}),t},S=(e="")=>{let[t,n]=(0,p.useState)(e);return(0,p.useEffect)(()=>{let t=O();if(!t||0===t.size)return;let[i,l=""]=e.split("?"),o=new URLSearchParams(l);t.forEach((e,t)=>{o.has(t)||o.set(t,e)});let r=o.toString();n(r?`${i}?${r}`:i)},[e]),t},A=(0,a.g)("footer-modal-body","sc"),I=Object.freeze({wrapper:`${A}__wrapper`,title:`${A}__title`,item:`${A}__item`,label:`${A}__label`,button:`${A}__button`,description:`${A}__description`}),L=({directions:e})=>(0,l.jsxs)("div",{className:I.wrapper,children:[(0,l.jsx)("div",{className:I.title,children:"Направления"}),e.map(e=>(0,l.jsxs)($,{className:I.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:`${e.name}_${e.url}`,children:[(0,l.jsxs)("div",{className:I.label,children:[(0,l.jsx)("span",{children:e.name}),(0,l.jsx)(y,{className:I.button,iconRight:(0,l.jsx)(d.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,l.jsx)("p",{className:I.description,children:e.description})]},e.url))]}),R=(0,a.g)("footer-popup","sc"),P=Object.freeze({wrapper:`${R}__wrapper`,button:`${R}__button`,icon:`${R}__icon`,buttonWrapper:`${R}__button-wrapper`}),z=({directions:e})=>{let t=(0,c._m)("l"),[n,i]=(0,p.useState)(!1),o=()=>{i(!1)};return(0,l.jsxs)("div",{className:P.wrapper,children:[(0,l.jsx)("div",{className:P.buttonWrapper,children:(0,l.jsx)(y,{className:P.button,appearance:"ghost",variant:"white",onClick:()=>{i(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,l.jsx)("div",{className:P.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,l.jsx)("div",{},e))})})}),(0,l.jsxs)(m.P,{children:[!t&&(0,l.jsx)(m.U,{isOpen:n,onClose:o,full:!0,children:(0,l.jsx)(L,{directions:e})}),t&&(0,l.jsx)(m.D,{isOpen:n,onClose:o,width:"804px",children:(0,l.jsx)(L,{directions:e})})]})]})},E=(0,a.g)("footer-left-column","sc"),M=Object.freeze({leftColumn:`${E}__left-column`,logoWrapper:`${E}__logo-wrapper`,banner:`${E}__banner`,mobAppLink:`${E}__mob-app-link`,br:`${E}__br`}),B=({showcaseUrl:e,minioUrl:t,directions:n,mobAppUrl:i})=>{let r=S(i);return(0,l.jsxs)("div",{className:M.leftColumn,children:[(0,l.jsx)($,{className:M.logoWrapper,href:e,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:(0,l.jsx)("img",{src:(0,s.xn)(t,"/widgets/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,l.jsx)(z,{directions:n??[]}),(0,l.jsx)($,{href:r,target:"_blank",eventActionType:u.D.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:r,className:M.mobAppLink,children:(0,l.jsxs)(o.Zb,{className:M.banner,children:[(0,l.jsxs)(o.xv,{weight:"medium",children:["Управляйте финансами",(0,l.jsx)("br",{}),"через приложение",(0,l.jsx)("br",{className:M.br})," Финуслуг"]}),(0,l.jsx)(y,{iconRight:(0,l.jsx)(d.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,l.jsxs)("picture",{children:[(0,l.jsx)("source",{srcSet:(0,s.xn)(t,"/widgets/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,l.jsx)("img",{src:(0,s.xn)(t,"/widgets/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},U=(0,a.g)("footer-logo","sc"),D=Object.freeze({wrapper:`${U}__wrapper`,link:`${U}__link`,fromMoex:`${U}__from-moex`,logo:`${U}__logo`,white:`${U}__wrapper--white`}),W=({showcaseUrl:e,minioUrl:t,isWhite:n})=>(0,l.jsx)("div",{className:(0,r.Z)(D.wrapper,{[D.white]:n}),children:(0,l.jsxs)($,{className:D.link,href:e,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:[(0,l.jsx)("img",{className:D.logo,src:`${t}/images/logo-brandmark-common-finuslugi.svg`}),(0,l.jsx)("img",{className:D.fromMoex,src:`${t}/images/fromMoex.svg`})]})});var F=((i=F||{}).BLACK="black",i.GRAY="gray",i);let Z=(0,a.g)("footer-warning","sc"),V=Object.freeze({reservedSpace:`${Z}__reserved-space`,wrapper:`${Z}__wrapper`,wrapperGray:`${Z}__wrapper--gray`,fixed:`${Z}__wrapper--fixed`,container:`${Z}__container`,text:`${Z}__text`,invisibleText:`${Z}__text--invisible`}),G=({text:e,variant:t,fixed:n,isPlaceholder:i})=>(0,l.jsx)("div",{className:(0,r.Z)(V.wrapper,{[V.wrapperGray]:"gray"===t,[V.fixed]:n&&!i}),children:(0,l.jsx)(o.W2,{className:V.container,children:(0,l.jsx)("div",{className:(0,r.Z)(V.text,{[V.invisibleText]:i}),dangerouslySetInnerHTML:{__html:e}})})}),H=({warning:e})=>{let t="string"==typeof e?{text:e}:e,n={text:t.text,fixed:t.fixed??!0,variant:t.variant??F.BLACK};return(0,l.jsxs)("div",{className:V.reservedSpace,children:[(0,l.jsx)(G,{...n,isPlaceholder:n.fixed}),n.fixed&&(0,l.jsx)(G,{...n,fixed:!0})]})},q=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",customDisclaimer:i,variant:s="default",className:a})=>{var c,u;let d=!i&&null!=e&&e.disclaimer?e.disclaimer:void 0,p=s.includes("compact"),m=s.includes("white"),h=null==(c=null==e?void 0:e.bottom)?void 0:c.concat(p?_:[]),f=e&&"warning"in e?e.warning:void 0;return e?(0,l.jsx)("footer",{className:(0,r.Z)(g.wrapper,a,{[g.compact]:p,[g.white]:m}),children:(0,l.jsxs)("section",{className:g.section,children:[(0,l.jsxs)(o.W2,{className:g.container,children:[!p&&(0,l.jsx)(B,{showcaseUrl:t,minioUrl:n,directions:null==e?void 0:e.directions,mobAppUrl:null==e?void 0:e.mobAppUrl}),(0,l.jsx)("div",{className:g.wrapper,children:(0,l.jsxs)("div",{className:g.top,children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:g.main,children:[!p&&(0,l.jsx)("div",{className:g.links,children:null==(u=null==e?void 0:e.top)?void 0:u.map(e=>(0,l.jsx)($,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,l.jsx)(W,{showcaseUrl:t,minioUrl:n,isWhite:m}),(0,l.jsx)(T,{className:g.disclaimer,disclaimer:d,children:i||j})]}),(0,l.jsxs)("div",{className:g.bottom,children:[(0,l.jsx)("div",{className:g.bottomLinks,children:null==h?void 0:h.map(e=>(0,l.jsx)($,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,l.jsx)(T,{className:g.bottomDisclaimer,disclaimer:null==e?void 0:e.bottomDisclaimer})]})]}),!p&&(0,l.jsx)(N,{minioUrl:n,blogs:null==e?void 0:e.blogs})]})})]}),p&&!!f&&(0,l.jsx)(H,{warning:f})]})}):null}},7422:function(e,t,n){"use strict";n.d(t,{CitySelectProvider:function(){return J},Header:function(){return eD}});var i=n(7437),l=n(684),o=n(5563),r=n(5461),s=n(1994),a=n(2265),c=n(7337),u=n(8631),d=n(4181),p=n(2074);let m=(0,p.g)("header","sc"),h=Object.freeze({header:`${m}`,fixed:`${m}__fixed`,hidden:`${m}__fixed--hidden`,transparent:`${m}--transparent`,navigationOpen:`${m}__navigation-open`,container:`${m}__container`,leftRow:`${m}__left-row`,logo:`${m}__logo`,menuItems:`${m}__menu-items`,menuItemActive:`${m}__menu-item-active`,tabletMenuButton:`${m}__tablet-menu-button`,buttonGroup:`${m}__button-group`,chips:`${m}__chips`,menuButton:`${m}__menu-button`,moreButtons:`${m}__more-buttons`,auth:`${m}__auth`,whiteIcons:`${m}__white-icons`,close:`${m}__close`,removed:`${m}__removed`,overlay:`${m}__overlay`,overlayOpening:`${m}__overlay--opening`,overlayClosing:`${m}__overlay--closing`}),f="user_region",v="user_town",g="cb-header",w=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],_=w.reduce((e,t)=>(e[t.id]=t.label,e),{}),x=Object.freeze({mobile:56,desktop:80});var b=n(5487);let j=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),l=!1,o=0,r=0,s=()=>window.innerWidth<768,a=s(),c=()=>window.scrollY||document.documentElement.scrollTop,u=()=>{let e=document.querySelector(":root");e&&(r=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),o=c())},d=()=>{let e=s();e!==a&&(a=e,r=0)},p=function(){let s=c(),a=document.getElementById("headerMobileBanner"),d=null==a?void 0:a.getAttribute("data-opening");if("true"===d)return;r||u();let p=s<r,m=s<((null==i?void 0:i.clientHeight)||0);if(n&&m||p){l=!1,e(!1),t(!0);return}e(l=s>o),l&&setTimeout(()=>t(!1),50);let h=l?"0px":"false"===d?`${r}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",h),document.documentElement.style.setProperty("--new-header-height-mobile",h),o=s<=0?0:s};return window.addEventListener("scroll",p),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",d)}},y=()=>{let e=new URLSearchParams(window.location.search),t={};for(let[n,i]of Array.from(e.entries()))n.startsWith("utm_")&&(t[n]=i);return Object.keys(t).length>0?t:null},$=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),N=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let l=encodeURIComponent(JSON.stringify(t));document.cookie=`${e}=${l};expires=${i.toUTCString()};path=/;SameSite=Lax`},k=()=>{let e=y();e&&!$()&&N("utm_params",e,90),e&&N("utm_last",e,90)},C=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{k()}catch(e){console.error("UTM tracking error:",e)}},0)},T=(e,t,n)=>(0,u.h)({eventCategory:g,eventActionType:e,eventActionText:t,eventLabel:n}),O=(0,p.g)("navigation-chips","sc"),S=Object.freeze({wrapper:`${O}__wrapper`,gray:`${O}__variantGray`,white:`${O}__variantWhite`,container:`${O}__container`,chip:`${O}__chip`,more:`${O}__chip--more`,active:`${O}__chip--active`,label:`${O}__label`,hidden:`${O}__hidden`}),A=(0,p.g)("navigation-content","sc"),I=Object.freeze({contentWrapper:`${A}__content-wrapper`,content:`${A}__content`,contentOpen:`${A}__content--open`,contentHeader:`${A}__content-header`,contentTitle:`${A}__content-title`,contentTitleUrl:`${A}__content-title--url`,contentTitleLink:`${A}__content-title--link`,contentTitleNew:`${A}__content-title--new`,new:`${A}__new`,vip:`${A}__vip`,arrowIcon:`${A}__arrow-icon`,links:`${A}__links`,linksColumns:`${A}__links--columns`,linksTitleless:`${A}__links--titleless`,removed:`${A}__removed`,hidden:`${A}__content--hidden`}),L=({chip:e,hidden:t,onClick:n,refCallback:o,activeChipId:r})=>{let a=!!n,c=()=>{if(a)return null==n?void 0:n(e.url);T(u.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:S.label,children:e.title}),e.arrow&&(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,s.Z)(S.chip,{[S.hidden]:t,[I.new]:!!e.new,[I.vip]:!!e.vip,[S.active]:e.url===r});return a?(0,i.jsx)("button",{type:"button",className:p,onClick:c,ref:o,children:d}):(0,i.jsx)("a",{href:e.url,className:p,onClick:c,ref:o,children:d})},R=({items:e=[],maxNumberOfLines:t,variant:n,className:o,activeChipId:r,onClick:c})=>{let d=(0,a.useRef)(null),p=(0,a.useRef)(null),m=(0,a.useRef)({}),[h,f]=(0,a.useState)(!1),[v,g]=(0,a.useState)(e.length),[w,_]=(0,a.useState)(!1);(0,a.useMemo)(()=>{let t=m.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(n=>{e.find(e=>String(e.url)===String(n))||delete t[n]})},[e]);let x=(0,a.useCallback)(()=>{let n=d.current;if(!n)return;let i=e=>e?e.getBoundingClientRect().width:0,l=i(n),o=Math.max(Number(t)||0,0),r=()=>{g(e.length),_(!1)};if(h||0===o||l<=0){r();return}let s=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),a=i(p.current),c=e.map(e=>i(m.current[e.url]));if(c.some(e=>0===e)){r();return}let u=1,f=0,v=0;for(let e of c){let t=u===o?a+s:0,n=0===f?e:f+s+e;if(n+t<=l-.5)f=n,v++;else{if(++u>o)break;f=e,v++}}_(v<e.length),g(v)},[h,e,t]);(0,a.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(x)});return t.observe(e),requestAnimationFrame(x),()=>{t.disconnect()}},[x]),(0,a.useEffect)(()=>{requestAnimationFrame(x)},[x]);let b=h||(t??0)<=0||!w;return(0,i.jsx)("div",{className:(0,s.Z)(o,S.wrapper,{[S.gray]:"gray"===n,[S.white]:"white"===n}),children:(0,i.jsxs)("div",{ref:d,className:S.container,children:[e.map((e,t)=>(0,i.jsx)(L,{chip:e,hidden:!b&&t>=v,activeChipId:r,onClick:c,refCallback:t=>{m.current[e.url]=t}},e.url)),!b&&w&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,s.Z)(S.chip,S.more),onClick:()=>{T(u.D.chip,"Еще"),f(!0)},children:[(0,i.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:S.label,children:"Еще"})]}),(b||!w)&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,s.Z)(S.chip,S.more,S.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,i.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:S.label,children:"Еще"})]})]})})},P=(e,t)=>{if(!(typeof document>"u")){if(!e&&!t){b.a.removeItem(f),b.a.removeItem(v);return}b.a.setItem(f,JSON.stringify(e)||"",{"max-age":31536e3}),b.a.setItem(v,JSON.stringify(t)||"",{"max-age":31536e3})}},z=e=>{if(typeof document>"u")return null;let t=b.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},E=function(e){if(typeof window>"u"||!window.localStorage)return null;let t=window.localStorage.getItem(e);if(!t||"undefined"===t)return null;try{return JSON.parse(t)}catch(t){console.warn(`Invalid object in localStorage for key "${e}": ${t}`)}return null},M=()=>{if(typeof window>"u")return[];if(Array.isArray(window.allRegions)&&window.allRegions.length>0)return window.allRegions;let e=E("all_regions")||[];return window.allRegions=e,e},B=e=>{let t={};return e.map(({id:e,name:n,towns:i})=>(i.forEach(i=>{i.parentId=e,t[i.name]=t[i.name]||{},t[i.name][i.id]=n}),i)).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},U=async()=>{let e={regions:[]};try{e=await (await fetch("https://finuslugi.ru/money_data/Root.json?short=1")).json()}catch(e){console.warn(e)}let t=null!=e&&e.regions?e.regions:[];return t.length<1?[]:(window.allRegions=t,window.localStorage.setItem("all_regions",JSON.stringify(t)),window.localStorage.setItem("lastRegionsUpdateUnixTimestamp",JSON.stringify(Date.now())),t)},D=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},W=(e,t,n)=>{(0,u.h)({eventCategory:G,eventActionType:e,eventActionText:t,eventLabel:n})},F=M(),Z=B(F),V={regions:F,towns:Z,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},G="finkit-widgets-sc-city-select",H=(0,a.createContext)(V);function q(){return(0,a.useContext)(H)}let J=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:l=!0,lastRegionsUpdateUnixTimestamp:o,dadataUrl:r="https://finuslugi.ru/backend/money/dadata"})=>{let s=Number(E("lastRegionsUpdateUnixTimestamp")||0),c=Number(o||0)>s,[d,p]=(0,a.useState)(M()),[{startRegion:m,startTown:h},g]=(0,a.useState)({startRegion:V.startRegion,startTown:V.startTown}),w=t??V.region,_=n??V.town,[{region:x,town:b},j]=(0,a.useState)({region:w,town:_}),[y,$]=(0,a.useState)(V.startPopupVisible),[N,k]=(0,a.useState)(V.popupVisible),C=(0,a.useRef)(""),T=(0,a.useMemo)(()=>B(d),[d.length]),O=(0,a.useCallback)((e,t)=>{window.sessionStorage.setItem("start_popup_opened","1"),window.localStorage.setItem("auto_town",JSON.stringify(t)||""),window.localStorage.setItem("auto_region",JSON.stringify(e)||""),$(!0),g({startRegion:e,startTown:t})},[$,g]),S=(0,a.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||O(e,t)},[O]),A=(0,a.useCallback)(()=>{if(C.current&&!x&&!b){let e=T.find(e=>e.name===C.current)??null;return S(d.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}S(x,b)},[x,b,T,d,S]),I=(0,a.useCallback)(e=>{k(e)},[k]),L=(0,a.useCallback)(e=>{e?W(u.D.icon,"location"):W(u.D.button,(null==b?void 0:b.name)||"Вся Россия"),!l||window.sessionStorage.getItem("start_popup_opened")?I(!0):A()},[l,b,I,A]),R=(0,a.useCallback)((e,t)=>{e||t?(window.localStorage.setItem("all_russia_selected","0"),window.localStorage.setItem(f,JSON.stringify(e)||""),window.localStorage.setItem(v,JSON.stringify(t)||""),P(e||null,t||null)):(window.localStorage.setItem("all_russia_selected","1"),window.localStorage.setItem(f,""),window.localStorage.setItem(v,""),P(null,null)),j({region:e||null,town:t||null}),$(!1),I(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[I]),F=()=>{j({region:z(f)??E(f),town:z(v)??E(v)});let e=async({coords:{latitude:e,longitude:t}})=>{let n=`${r}?lat=${e}&lon=${t}`,i=await D(n);null!=i&&i.location&&(C.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&l)try{navigator.geolocation.getCurrentPosition(e,()=>null)}catch{}};return(0,a.useEffect)(()=>{if((d.length<1||c)&&U().then(e=>p(e)),window.innerWidth<1024){let e=()=>{F(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{F()},0)},[]),(0,i.jsx)(H.Provider,{value:{regions:d,towns:T,region:x,town:b,startPopupVisible:y,setStartPopupVisible:$,popupVisible:N,handleToggleModal:I,selectCity:R,handleButtonClick:L,startRegion:m,startTown:h},children:e})},Q=()=>{let e=(0,a.useRef)(null),t=(0,a.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,a.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,a.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},Y=(0,p.g)("city-select-modal-body","sc"),K=Object.freeze({wrapper:`${Y}__wrapper`,subtitle:`${Y}__subtitle`,hintWrapper:`${Y}__hint-wrapper`,hintText:`${Y}__hint-text`,input:`${Y}__input`,chips:`${Y}__chips`,townsListWrapper:`${Y}__towns-list-wrapper`,townsList:`${Y}__towns-list`,townsGroup:`${Y}__towns-group`,townsGroupLabel:`${Y}__towns-group-label`,townsGroupList:`${Y}__towns-group-list`,townsName:`${Y}__towns-name`,regionName:`${Y}__region-name`}),X=({groupedTowns:e,chips:t,query:n,setQuery:o,isDrawer:s})=>{var c;let d=q(),p=(0,a.useRef)(null),[m,h]=(0,a.useState)("10000px");(0,a.useEffect)(()=>{if(!s||!p.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let l=n.map(e=>[...e]),o=l.map(e),r=o.reduce((e,t,n)=>t<o[e]?n:e,0);0===r&&l[0].push(l[1].shift()),2===r&&l[2].unshift(l[1].pop()),1===r&&o[0]>o[2]&&l[1].unshift(l[0].pop()),1===r&&o[0]<o[2]&&l[1].push(l[2].shift());let s=Math.max(...l.map(e));return s>=i?i:t(l,s)};new ResizeObserver(()=>{var e;if(!(null!=(e=p.current)&&e.children))return;let n=Array.from(p.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let i=0;try{i=t([[],n,[]],1/0)}catch{i=0}i>0&&h(`${i}px`)}).observe(p.current)},[]);let f=e=>{if(W(u.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return d.selectCity();let t=d.regions.find(t=>t.id===Number(e.parentId))||null;d.selectCity(t,e)};return(0,i.jsxs)("div",{className:K.wrapper,children:[(0,i.jsxs)("div",{className:K.subtitle,children:["Покажем предложения рядом с вами",(0,i.jsxs)("div",{className:K.hintWrapper,children:[(0,i.jsx)(l.IconFdsQuestionCircleO,{size:24}),(0,i.jsx)("div",{className:K.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,i.jsx)(r.MA,{className:K.input,value:n,onChange:o,size:"s",placeholder:"Введите название города",icon:n?(0,i.jsx)(l.IconFdsCloseCircleO,{size:24,onClick:()=>o("")}):(0,i.jsx)(l.IconFdsSearchO,{size:24})}),(0,i.jsx)(r.cL,{className:K.chips,chips:t,value:(null==(c=d.town)?void 0:c.id)||0,onChipClick:e=>{f(d.towns.find(t=>t.id===e))}}),(0,i.jsx)("div",{className:K.townsListWrapper,children:(0,i.jsx)("div",{ref:p,className:K.townsList,style:{maxHeight:m},children:e.map(e=>(0,i.jsxs)("div",{className:K.townsGroup,children:[(0,i.jsx)("div",{className:K.townsGroupLabel,children:e.letter}),(0,i.jsx)("div",{className:K.townsGroupList,children:e.towns.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>f(e),children:[(0,i.jsx)("div",{className:K.townsName,children:e.name}),(0,i.jsx)("div",{className:K.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},ee=[1095,1096,134,720,189,180],et=()=>{var e;let t=q(),n=(0,r._m)("l"),[l,o]=(0,a.useState)(""),s=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,c=(0,a.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(l.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[l,t.towns.length]),p=(0,a.useMemo)(()=>[{id:0,label:"Вся Россия"},...ee.map(e=>{let n=t.towns.find(t=>t.id===e);return{id:null==n?void 0:n.id,label:null==n?void 0:n.name}}).filter(e=>(null==e?void 0:e.id)!==void 0)],[t.towns.length]),m=()=>{W(u.D.button,"close"),t.handleToggleModal(!1)};return(0,i.jsxs)(d.P,{children:[!n&&(0,i.jsx)(d.U,{title:s,isOpen:t.popupVisible,onClose:m,full:!0,children:(0,i.jsx)(X,{groupedTowns:c,chips:p,query:l,setQuery:o})}),n&&(0,i.jsx)(d.D,{title:s,isOpen:t.popupVisible,onClose:m,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,i.jsx)(X,{groupedTowns:c,chips:p,query:l,setQuery:o,isDrawer:!0})})]})},en={"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"},ei=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(en,e)?en[e]:en["finuslugi.ru"]},el=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=`${e}/assets/css/${t}`,document.head.appendChild(n);let i=document.createElement("script");i.src=`${e}/get-bootstrap/${t}`,i.defer=!0,document.body.appendChild(i)},eo=()=>new MutationObserver(e=>{e.forEach(e=>{if("style"===e.attributeName){let e=document.querySelector(".webchat"),t=!!e&&"none"!==e.style.display;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.isOpened=t)}})}),er=()=>{let[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),l=(0,a.useRef)(!1),o=e=>{l.current=e,i(e)};return(0,a.useEffect)(()=>{if(typeof window>"u")return;let e=ei(),n="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:t=>{if(t.host&&(e=t.host),t.channel&&(n=t.channel),t.user){let e="function"==typeof t.user?t.user:()=>({...t.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((r,s)=>{if(l.current){s(Error("chat is already opened"));return}i?(i.openWidget(),t(!1),r()):(o(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let l=document.querySelector(".webchat");l&&eo().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),o(!1),t(!1),r()},el(e,n))}),window.supportWidget.craftTalk.toggle=()=>{var e,t,n,i;null!=(t=null==(e=window.supportWidget)?void 0:e.craftTalk)&&t.isOpened?window.supportWidget.craftTalk.close():null==(i=null==(n=window.supportWidget)?void 0:n.craftTalk)||i.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:t,isChatLoading:n}},es=(0,a.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 ea(){return(0,a.useContext)(es)}let ec=e=>{let[t,n]=(0,a.useState)(!1),[l,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p}=er(),[m,h]=(0,a.useState)(null),[f,v]=(0,a.useState)(null),[g,w]=(0,a.useState)(!1),[_,x]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),$=(0,a.useRef)(null),N=(0,d.u)(g),k=(0,a.useRef)(null),T=(0,a.useRef)(null),O=(0,a.useRef)(null),S=(0,a.useRef)(null),A=(0,a.useCallback)(()=>{N.current&&N.current.scrollTo({top:0})},[N]),I=(0,a.useCallback)(e=>{v(e),A()},[A]),L=(0,a.useCallback)(e=>{k.current&&clearTimeout(k.current),e&&x(!0),e||(k.current=setTimeout(()=>{x(!1),I(null)},300))},[I]),R=(0,a.useCallback)((e,t,n)=>{if(t&&I(t),!n&&e===m||!e){L(!g),w(!g);return}h(e),L(!0),w(!0)},[m,I,g,L]),P=(0,a.useCallback)(()=>{T.current&&clearTimeout(T.current),y(!0),T.current=setTimeout(()=>{y(!1)},650)},[]);return(0,a.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=j(o,s,e.isMainBannerPage);return C(),t},[]),(0,i.jsx)("header",{children:(0,i.jsx)(es.Provider,{value:{isAuth:t,isHeaderHidden:l,isHeaderTransparent:r,openedBlock:m,setOpenedBlock:R,openedSection:f,setOpenedSection:I,isNavigationOpen:g,isNavigationMounted:_,navMenuItemsRef:$,navigationRef:N,ignoreClicks:b,setIgnoreClicks:P,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p,fixedContainerRef:O,headerRef:S},children:e.children})})},eu=({label:e,onClick:t,eventActionText:n,eventLabel:l,...o})=>(0,i.jsx)(r.zx,{label:e,onClick:e=>{null==t||t(e),(0,u.h)({eventCategory:g,eventActionType:u.D.button,eventActionText:n||"",eventLabel:l||""})},...o}),ed=(0,p.g)("header-popup","sc"),ep=Object.freeze({popup:`${ed}__popup`,popupHeader:`${ed}__popup-header`,popupClose:`${ed}__popup-close`,body:`${ed}__body`}),em=({isOpen:e,onClose:t,children:n,title:o})=>{let s=(0,r._m)("l");return(0,i.jsxs)(d.P,{children:[!s&&(0,i.jsx)(d.U,{title:o,isOpen:e,onClose:t,children:n}),s&&e&&(0,i.jsxs)("div",{className:ep.popup,children:[(0,i.jsxs)("div",{className:ep.popupHeader,children:[o,(0,i.jsx)(eu,{className:ep.popupClose,iconLeft:(0,i.jsx)(l.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,i.jsx)("div",{className:ep.body,children:n})]})]})},eh=(0,p.g)("start-choice-popup","sc"),ef=Object.freeze({top:`${eh}__top`,progress:`${eh}__progress`,innerCircle:`${eh}__inner-circle`,title:`${eh}__title`,subtitle:`${eh}__subtitle`,actions:`${eh}__actions`}),ev=()=>{var e,t;let n=q(),[l,o]=(0,a.useState)(10),[r,s]=(0,a.useState)(0),c=(0,a.useRef)(void 0),d=()=>{W(u.D.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(n.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(n.startRegion)||""),n.setStartPopupVisible(!1)};return(0,a.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+l).slice(1)),t=1e3*e/100,n=0,i=0;c.current=setInterval(()=>{n++,i+=t,s(3.6*n);let r=e-Math.floor(i/1e3);r<l&&o(r),100===n&&(clearInterval(c.current),d())},t)})():(clearInterval(c.current),o(10),s(0))},[n.startPopupVisible]),(0,i.jsxs)(em,{isOpen:n.startPopupVisible,onClose:d,title:(0,i.jsx)("button",{type:"button",className:ef.progress,style:{background:`conic-gradient(#ff0508 ${r}deg, #e3e7ec 0deg)`},onClick:d,children:(0,i.jsx)("div",{className:ef.innerCircle,children:l})}),children:[(0,i.jsxs)("div",{className:ef.top,children:[(0,i.jsxs)("div",{className:ef.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,i.jsx)("div",{className:ef.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,i.jsxs)("div",{className:ef.actions,children:[(0,i.jsx)(eu,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{W(u.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,i.jsx)(eu,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{W(u.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},eg=(0,p.g)("city-select","sc"),ew=Object.freeze({button:`${eg}__button`,minimal:`${eg}__minimal`,full:`${eg}__full`}),e_=({initialTown:e})=>{var t;let n=q(),o=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:u}=ea(),{startPopupVisible:d,setStartPopupVisible:p,popupVisible:m}=n,h=(0,a.useRef)();(0,a.useEffect)(()=>{m&&(h.current="popup")},[m]),(0,a.useEffect)(()=>{u&&(h.current="chat")},[u]),(0,a.useEffect)(()=>{d&&(h.current="startPopup")},[d]),(0,a.useEffect)(()=>{h.current&&("chat"===h.current&&d?p(!1):["startPopup","popup"].includes(h.current)&&u&&c(!1))},[m,u,d,p,c]);let f={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,i.jsx)(l.IconFdsLocationO,{size:24})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.zx,{...f,className:(0,s.Z)(ew.button,ew.full),label:o}),(0,i.jsx)(r.zx,{...f,className:(0,s.Z)(ew.button,ew.minimal),shape:"icon"}),(0,i.jsx)(et,{}),(0,i.jsx)(ev,{})]})},ex=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:l,...o})=>(0,i.jsx)(r.rU,{onClick:i=>{null==e||e(i),(0,u.h)({eventCategory:g,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:l||""})},...o}),eb=(0,p.g)("header-mobile-app-banner","sc"),ej=Object.freeze({wrapper:`${eb}__wrapper`,container:`${eb}__container`,closeButton:`${eb}__close-button`,innerWrapper:`${eb}__inner-wrapper`,imageWrapper:`${eb}__image-wrapper`,image:`${eb}__image`,title:`${eb}__title`,description:`${eb}__description`,callToAction:`${eb}__call-to-action`,scanQr:`${eb}__scan-qr`}),ey=Object.freeze({mobile:56,desktop:68}),e$="headerBannerShownAt",eN=()=>{let e=localStorage.getItem(e$);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},ek=()=>{localStorage.setItem(e$,new Date().toISOString())},eC=()=>{let e=eN();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},eT=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:d,headerRef:p}=ea(),[m,h]=(0,a.useState)(!1),[f,v]=(0,a.useState)(!1),[g,w]=(0,a.useState)(!1),_=(0,a.useCallback)((e="desktop")=>{let t=d.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${ey[e]+x[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ey.desktop+x.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ey.mobile+x.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ey.mobile+x.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ey.desktop+x.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ey[e]+108}px`))},[]),b=(0,a.useCallback)(()=>{let e=d.current;e&&(document.documentElement.style.removeProperty("--fixed-header-height"),document.documentElement.style.removeProperty("--new-header-height-desktop"),document.documentElement.style.removeProperty("--new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-desktop"),document.documentElement.style.removeProperty("--header-height"),e.style.transform="")},[]);return(0,a.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{f&&h(!1),w(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[f]),(0,a.useEffect)(()=>{eC()&&h(!0)},[]),(0,a.useEffect)(()=>{let e=window.innerWidth<768;m&&(_(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):w(!0));let t=()=>{if(!m)return null;_(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{b(),window.removeEventListener("resize",t)}},[m,_,b]),m?(0,i.jsx)("div",{id:"headerMobileBanner",role:"region","aria-label":"Мобильное приложение","data-opening":g,className:(0,s.Z)(ej.wrapper,t),children:(0,i.jsx)(o.W2,{children:(0,i.jsxs)("div",{className:ej.container,children:[(0,i.jsxs)("div",{className:ej.innerWrapper,children:[(0,i.jsxs)("picture",{className:ej.imageWrapper,children:[(0,i.jsx)("source",{srcSet:(0,c.xn)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{className:ej.image,src:(0,c.xn)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,i.jsxs)("div",{className:ej.scanQr,children:[(0,i.jsx)("div",{className:ej.title,children:"Скачайте приложение Финуслуги"}),(0,i.jsx)("div",{className:ej.description,children:"Сканируйте QR-код"})]}),(0,i.jsxs)("div",{className:ej.callToAction,children:[(0,i.jsxs)("div",{children:["Приложение",(0,i.jsx)("br",{}),"Финуслуги"]}),(0,i.jsx)(r.zx,{onClick:()=>{T(u.D.button,"skachat_mob_prilozheniye_fu"),window.open(n,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,i.jsx)("div",{"aria-label":"Закрыть",role:"button",className:ej.closeButton,onClick:()=>{ek(),b(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):v(!0)},children:(0,i.jsx)(l.IconFdsCloseO,{size:"100%"})})]})})}):null},eO=(0,p.g)("header-chat-modal-body","sc"),eS=Object.freeze({wrapper:`${eO}__wrapper`,cardButton:`${eO}__card-button`,card:`${eO}__card`,cardTitle:`${eO}__card-title`,cardSubtitle:`${eO}__card-subtitle`,button:`${eO}__button`}),eA=()=>{let e=ea();return(0,i.jsxs)("div",{className:eS.wrapper,children:[(0,i.jsx)(eu,{className:eS.cardButton,variant:"secondary",pending:e.isChatLoading,onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},eventActionText:"Напишите в чат",children:(0,i.jsxs)(o.Zb,{className:eS.card,variant:"secondary",children:[(0,i.jsxs)("div",{className:eS.cardTitle,children:[(0,i.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat"}),"Напишите в чат"]}),(0,i.jsxs)("p",{className:eS.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,i.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eI=({data:e,isMobile:t})=>{let n=ea();return(0,i.jsx)("div",{className:I.contentWrapper,children:e.map(e=>(0,i.jsx)(a.Fragment,{children:e.sections.map(e=>(0,i.jsxs)("div",{className:(0,s.Z)(I.content,{[I.hidden]:n.openedSection!==e.id,[I.contentOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:I.contentHeader,children:(0,i.jsx)("label",{children:e.title})}),e.content.map((n,o)=>{var r,a;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:(0,s.Z)(I.contentTitle,{[I.removed]:!n.title,[I.contentTitleUrl]:!!n.url,[I.contentTitleLink]:!!e.isSeeAllLinkAvailable,[I.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,i.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,i.jsx)("div",{className:I.arrowIcon,children:(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(r=n.links)&&r.length)&&(0,i.jsx)(R,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(a=n.links)&&a.length)&&(0,i.jsx)("div",{className:(0,s.Z)(I.links,{[I.linksColumns]:!!n.columns,[I.linksTitleless]:!n.title}),children:n.links.map(e=>(0,i.jsxs)("a",{href:e.url,className:(0,s.Z)({[I.new]:!!e.new}),onClick:()=>T(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{className:I.arrowIcon,children:(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{})}),(0,i.jsx)("span",{children:e.title})]},e.url))})]},`${n.url}_${o}`)})]},e.id))},e.id))})},eL=(0,p.g)("navigation-section-icon","sc"),eR=Object.freeze({icon:`${eL}`}),eP=({name:e,background:t})=>{let n=(0,a.useMemo)(()=>e&&l[e]||null,[e]);return e&&n?(0,i.jsx)("div",{className:eR.icon,style:{background:t},children:(0,i.jsx)(n,{})}):null},ez=(0,p.g)("navigation","sc"),eE=Object.freeze({navigation:`${ez}`,navigationOpening:`${ez}--opening`,navigationClosing:`${ez}--closing`,wrapper:`${ez}__wrapper`,container:`${ez}__container`,containerOpen:`${ez}__container--open`,sections:`${ez}__sections`,sectionsOpen:`${ez}__sections--open`,citySelectButton:`${ez}__city-select-button`,sectionsTitle:`${ez}__sections-title`,sectionsWrapper:`${ez}__sections-wrapper`,section:`${ez}__section`,sectionArrow:`${ez}__section-arrow`,sectionExtra:`${ez}__section--extra`,sectionActive:`${ez}__section--active`,sectionTitle:`${ez}__section-title`,chatWrapper:`${ez}__chat-wrapper`,chatHeader:`${ez}__chat-header`,backButton:`${ez}__back-button`,useful:`${ez}__useful`,usefulOpen:`${ez}__useful--open`,usefulTitle:`${ez}__useful-title`,usefulGrid:`${ez}__useful-grid`,removed:`${ez}__removed`}),eM=({data:e})=>{var t;let n=ea(),c=q(),d=(0,r.aF)("m"),[p,m]=(0,a.useState)(!0);(0,a.useEffect)(()=>{m(d)},[d]);let h=(0,a.useRef)(null),f=(0,a.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),v=(0,a.useRef)(!1),g=(0,a.useRef)(null),w=(0,a.useCallback)(()=>{p&&(v.current=!0,g.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),f()},window.history.pushState(null,"",window.location.href))},[f,p]),x=(0,a.useCallback)(()=>{v.current=!1,window.onpopstate=g.current,window.history.go(-1)},[]),b=(0,a.useRef)(null),j=(0,a.useCallback)(e=>{if(p||!n.navMenuItemsRef.current||!n.navigationRef.current)return;let t=e.target,i=!n.navMenuItemsRef.current.contains(t)&&!n.navigationRef.current.contains(t);if(i&&!b.current){n.setIgnoreClicks(),b.current=setTimeout(()=>n.setOpenedBlock(null),300);return}!i&&b.current&&(clearTimeout(b.current),b.current=null)},[p,n]),y=(0,a.useRef)(null),$=(0,a.useCallback)(e=>{typeof window>"u"||(e?(y.current=j,window.addEventListener("mousemove",y.current)):y.current&&window.removeEventListener("mousemove",y.current))},[j]);(0,a.useEffect)(()=>{$(n.isNavigationOpen),n.isNavigationOpen&&!v.current&&w(),!n.isNavigationOpen&&v.current&&x()},[n.isNavigationOpen]);let N=(e,t)=>()=>{T(u.D.button,t),n.setOpenedSection(e)},{start:k,clear:C}=Q(),O=(e,t)=>()=>{p||k(N(e,t),150)},S=()=>{p||C()};return(0,i.jsx)("div",{ref:n.navigationRef,className:(0,s.Z)(eE.navigation,{[eE.removed]:!n.isNavigationMounted,[eE.navigationOpening]:n.isNavigationOpen,[eE.navigationClosing]:!n.isNavigationOpen}),children:(0,i.jsx)("div",{className:eE.wrapper,children:(0,i.jsxs)(o.W2,{className:(0,s.Z)(eE.container,{[eE.containerOpen]:!!n.openedSection}),children:[(0,i.jsxs)("div",{className:(0,s.Z)(eE.sections,{[eE.sectionsOpen]:!!n.openedSection}),children:[(0,i.jsx)(r.zx,{className:eE.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>c.handleButtonClick(!1),iconLeft:(0,i.jsx)(l.IconFdsLocationO,{size:24}),label:(null==(t=c.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,i.jsxs)("ul",{className:(0,s.Z)(eE.sectionsWrapper,{[eE.removed]:n.openedBlock!==e.id&&!p}),children:[(0,i.jsx)("div",{className:eE.sectionsTitle,children:_[e.id]}),e.sections.map(e=>(0,i.jsxs)("li",{className:(0,s.Z)(eE.section,{[eE.sectionExtra]:!!e.extra,[eE.sectionActive]:n.openedSection===e.id}),onClick:N(e.id,e.title),onMouseEnter:O(e.id,e.title),onMouseLeave:S,children:[(0,i.jsx)(eP,{name:e.uikitIcon,background:e.uikitIconBg}),(0,i.jsx)("span",{className:eE.sectionTitle,children:e.title}),(0,i.jsx)("div",{className:eE.sectionArrow,children:(0,i.jsx)(l.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,i.jsxs)("div",{className:eE.chatWrapper,children:[(0,i.jsx)("div",{className:eE.chatHeader,children:"Нужна помощь?"}),(0,i.jsx)(eA,{})]})]}),(0,i.jsxs)("button",{type:"button",className:(0,s.Z)(eE.backButton,{[eE.removed]:!n.openedSection}),onClick:()=>{T(u.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,i.jsx)(l.IconFdsChevronLeftO,{size:24}),(0,i.jsx)("span",{children:"Назад"})]}),(0,i.jsx)(eI,{data:e,isMobile:p}),(0,i.jsxs)("div",{className:(0,s.Z)(eE.useful,{[eE.usefulOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:eE.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,i.jsx)(a.Fragment,{children:e.sections.map(e=>(0,i.jsx)("div",{className:(0,s.Z)(eE.usefulGrid,{[eE.removed]:n.openedSection!==e.id}),children:e.useful.map((e,t)=>(0,i.jsxs)("a",{href:e.url,onClick:()=>T(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{children:(0,i.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id))},e.id))]})]})})})},eB=(e,t,n)=>{var i,l,o,r,s,a,u;let d=(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==(r=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[d])?void 0:r.content)||[];if(null!=(u=null==(a=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[d])?void 0:a.content)&&u[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,c.xn)(t||"",n),new:0}));e.NAVIGATOR[d].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:[]}]},eU=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:d="https://lk.finuslugi.ru/registration",initialTown:p,isMainBannerPage:m,enableAppHeaderBanner:f=!1,news:v,className:g})=>{let _=ea(),x=(0,a.useMemo)(()=>eB(e,t,v),[e,t,v]),b=null==e?void 0:e.config,j=(0,a.useMemo)(()=>x.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[x]),y=_.isAuth?"Личный кабинет":"Войти",$=m&&_.isHeaderTransparent,N=(e,t,n,i)=>()=>{e!==_.openedBlock?T(u.D.toggle,t,"on"):T(u.D.button,"menu_close","on");let l=n?j[e]:"";_.setOpenedBlock(e,l,!!i)},{start:k,clear:C}=Q(),O=(e,t,n,i)=>()=>{_.isNavigationOpen&&e===_.openedBlock||_.setIgnoreClicks(),k(N(e,t,n,i),200)},S=e=>()=>{_.ignoreClicks||e()},A=e=>_.openedBlock===e&&_.isNavigationOpen;return e?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:_.headerRef,className:(0,s.Z)(h.header,g,{[h.transparent]:$}),children:(0,i.jsxs)("div",{ref:_.fixedContainerRef,className:(0,s.Z)(h.fixed,{[h.hidden]:_.isHeaderHidden,[h.navigationOpen]:_.isNavigationOpen}),children:[!!(null!=b&&b.appBannerUrl)&&f&&(0,i.jsx)(eT,{mobileAppUrl:b.appBannerUrl,minioUrl:n}),(0,i.jsxs)(o.W2,{className:h.container,children:[(0,i.jsxs)("div",{className:h.leftRow,children:[(0,i.jsx)(ex,{className:h.logo,href:t,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,i.jsxs)("picture",{children:[(0,i.jsx)("source",{srcSet:(0,c.xn)(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{src:(0,c.xn)(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,i.jsx)("nav",{ref:_.navMenuItemsRef,className:h.menuItems,children:(0,i.jsx)("ul",{children:w.map(({id:e,label:t})=>(0,i.jsx)("li",{children:(0,i.jsx)(r.zx,{className:(0,s.Z)({[h.menuItemActive]:A(e)}),label:t,variant:"white",size:"xs",onClick:S(N(e,t,!0)),onMouseEnter:O(e,t,!0,!0),onMouseLeave:C})},e))})}),(0,i.jsx)(eu,{className:(0,s.Z)(h.tabletMenuButton,{[h.menuItemActive]:_.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,i.jsx)(l.IconFdsChevronDownO,{size:24}),onClick:N("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,i.jsxs)("div",{className:(0,s.Z)(h.buttonGroup,{[h.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,i.jsxs)("div",{className:h.chips,children:[(0,i.jsx)(eu,{as:"a",href:d,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${d}`,iconLeft:(0,i.jsx)(l.IconFdsUserO,{size:20})}),(0,i.jsx)(eu,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,i.jsx)(l.IconFdsChatDotsCircleO,{size:24})})]}),(0,i.jsx)(eu,{className:h.menuButton,size:"xs",shape:$?"icon":"default",appearance:$?"ghost":"fill",label:"Меню",onClick:N("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,i.jsx)(l.IconFdsMenuSkewedO,{size:24})}),(0,i.jsxs)("div",{className:h.moreButtons,children:[(0,i.jsx)(e_,{initialTown:p}),(0,i.jsx)(eu,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",appearance:"ghost",eventActionText:"IconFdsChatDotsSquareAddO",iconLeft:(0,i.jsx)(l.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,i.jsx)(eu,{as:"a",href:d,size:"xs",eventActionText:y,eventLabel:`${y}_${d}`,label:y})]})]}),(0,i.jsxs)(ex,{className:h.auth,href:d,eventActionText:y,eventLabel:`${y}_${d}`,children:[(0,i.jsx)(eu,{size:"xs",shape:"circle-icon",iconLeft:(0,i.jsx)(l.IconFdsUserO,{}),eventActionText:y,eventLabel:`${y}_${d}`}),(0,i.jsx)("p",{children:y})]}),(0,i.jsx)("div",{className:h.close,children:(0,i.jsx)(eu,{className:h.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,i.jsx)(l.IconFdsCloseO,{}),onClick:()=>_.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,i.jsx)("div",{className:(0,s.Z)(h.overlay,{[h.removed]:!_.isNavigationMounted,[h.overlayOpening]:_.isNavigationOpen,[h.overlayClosing]:!_.isNavigationOpen}),onClick:S(()=>_.setOpenedBlock(null))}),(0,i.jsx)(eM,{data:x,minioUrl:n})]}):null},eD=e=>(0,i.jsx)(ec,{isMainBannerPage:e.isMainBannerPage,children:(0,i.jsx)(eU,{...e})})},7337:function(e,t,n){"use strict";n.d(t,{xn:function(){return l}});let i=/^\.?\//;function l(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(i,"");n=function(e="",t){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}Symbol.for("ufo:protocolRelative")}}]);