(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95],{7146:function(e,t,n){"use strict";function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}n.r(t),n.d(t,{default:function(){return r}});var i=n(2265),l=n(9172);function r(e){let{locale:t,...n}=e;if(!t)throw Error("Failed to determine locale in `NextIntlClientProvider`, please provide the `locale` prop explicitly.\n\nSee https://next-intl-docs.vercel.app/docs/configuration#locale");return i.createElement(l.IntlProvider,o({locale:t},n))}},3313:function(e,t){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DOMAttributeNames:function(){return o},isEqualNode:function(){return l},default:function(){return r}});let o={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function i(e){let{type:t,props:n}=e,i=document.createElement(t);for(let e in n){if(!n.hasOwnProperty(e)||"children"===e||"dangerouslySetInnerHTML"===e||void 0===n[e])continue;let l=o[e]||e.toLowerCase();"script"===t&&("async"===l||"defer"===l||"noModule"===l)?i[l]=!!n[e]:i.setAttribute(l,n[e])}let{children:l,dangerouslySetInnerHTML:r}=n;return r?i.innerHTML=r.__html||"":l&&(i.textContent="string"==typeof l?l:Array.isArray(l)?l.join(""):""),i}function l(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let n=t.getAttribute("nonce");if(n&&!e.getAttribute("nonce")){let o=t.cloneNode(!0);return o.setAttribute("nonce",""),o.nonce=n,n===e.nonce&&e.isEqualNode(o)}}return e.isEqualNode(t)}function r(){return{mountedInstances:new Set,updateHead:e=>{let t={};e.forEach(e=>{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+e.props["data-href"]+'"]'))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let n=t[e.type]||[];n.push(e),t[e.type]=n});let o=t.title?t.title[0]:null,i="";if(o){let{children:e}=o.props;i="string"==typeof e?e:Array.isArray(e)?e.join(""):""}i!==document.title&&(document.title=i),["meta","base","link","style","script"].forEach(e=>{n(e,t[e]||[])})}}}n=(e,t)=>{let n=document.getElementsByTagName("head")[0],o=n.querySelector("meta[name=next-head-count]"),r=Number(o.content),s=[];for(let t=0,n=o.previousElementSibling;t<r;t++,n=(null==n?void 0:n.previousElementSibling)||null){var a;(null==n?void 0:null==(a=n.tagName)?void 0:a.toLowerCase())===e&&s.push(n)}let c=t.map(i).filter(e=>{for(let t=0,n=s.length;t<n;t++)if(l(s[t],e))return s.splice(t,1),!1;return!0});s.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),c.forEach(e=>n.insertBefore(e,o)),o.content=(r-s.length+c.length).toString()},("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)},2185:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{requestIdleCallback:function(){return n},cancelIdleCallback:function(){return o}});let n="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("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)},5935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{handleClientScriptLoad:function(){return v},initScriptLoader:function(){return g},default:function(){return w}});let o=n(6921),i=n(1884),l=n(7437),r=o._(n(4887)),s=i._(n(2265)),a=n(7484),c=n(3313),u=n(2185),d=new Map,p=new Set,m=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],h=e=>{if(r.default.preinit){e.forEach(e=>{r.default.preinit(e,{as:"style"})});return}if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.appendChild(n)})}},f=e=>{let{src:t,id:n,onLoad:o=()=>{},onReady:i=null,dangerouslySetInnerHTML:l,children:r="",strategy:s="afterInteractive",onError:a,stylesheets:u}=e,f=n||t;if(f&&p.has(f))return;if(d.has(t)){p.add(f),d.get(t).then(o,a);return}let v=()=>{i&&i(),p.add(f)},g=document.createElement("script"),_=new Promise((e,t)=>{g.addEventListener("load",function(t){e(),o&&o.call(this,t),v()}),g.addEventListener("error",function(e){t(e)})}).catch(function(e){a&&a(e)});for(let[n,o]of(l?(g.innerHTML=l.__html||"",v()):r?(g.textContent="string"==typeof r?r:Array.isArray(r)?r.join(""):"",v()):t&&(g.src=t,d.set(t,_)),Object.entries(e))){if(void 0===o||m.includes(n))continue;let e=c.DOMAttributeNames[n]||n.toLowerCase();g.setAttribute(e,o)}"worker"===s&&g.setAttribute("type","text/partytown"),g.setAttribute("data-nscript",s),u&&h(u),document.body.appendChild(g)};function v(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>f(e))}):f(e)}function g(e){e.forEach(v),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");p.add(t)})}function _(e){let{id:t,src:n="",onLoad:o=()=>{},onReady:i=null,strategy:c="afterInteractive",onError:d,stylesheets:m,...h}=e,{updateScripts:v,scripts:g,getIsSsr:_,appDir:w,nonce:x}=(0,s.useContext)(a.HeadManagerContext),b=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=t||n;b.current||(i&&e&&p.has(e)&&i(),b.current=!0)},[i,t,n]);let j=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{!j.current&&("afterInteractive"===c?f(e):"lazyOnload"===c&&("complete"===document.readyState?(0,u.requestIdleCallback)(()=>f(e)):window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>f(e))})),j.current=!0)},[e,c]),("beforeInteractive"===c||"worker"===c)&&(v?(g[c]=(g[c]||[]).concat([{id:t,src:n,onLoad:o,onReady:i,onError:d,...h}]),v(g)):_&&_()?p.add(t||n):_&&!_()&&f(e)),w){if(m&&m.forEach(e=>{r.default.preinit(e,{as:"style"})}),"beforeInteractive"===c)return n?(r.default.preload(n,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"}),(0,l.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([n,{...h,id:t}])+")"}})):(h.dangerouslySetInnerHTML&&(h.children=h.dangerouslySetInnerHTML.__html,delete h.dangerouslySetInnerHTML),(0,l.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...h,id:t}])+")"}}));"afterInteractive"===c&&n&&r.default.preload(n,h.integrity?{as:"script",integrity:h.integrity}:{as:"script"})}return null}Object.defineProperty(_,"__nextScript",{value:!0});let w=_;("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)},9928:function(){},4380:function(){},5530:function(){},1277:function(){},682:function(e,t,n){"use strict";n.d(t,{D:function(){return A},P:function(){return B},U:function(){return z},u:function(){return b}});var o=n(7437),i=n(3167),l=n(2265),r=n(6094),s=n(3919),a=n(4887);let c=300,u=({opened:e})=>{let[t,n]=(0,l.useState)(!1),o=(0,l.useRef)(null),i=(0,l.useRef)(!1);return(0,l.useEffect)(()=>(e&&!i.current?(i.current=!0,n(!0)):!e&&i.current&&(o.current=setTimeout(()=>{i.current=!1,n(!1)},c)),()=>{o.current&&clearTimeout(o.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,l.useRef)(null),a=(0,l.useCallback)(()=>{e&&(s.current=setTimeout(()=>{e()},r))},[r,e]),u=(0,l.useCallback)(e=>{"Escape"===e.key&&a()},[a]);return(0,l.useEffect)(()=>(n&&window.addEventListener("keydown",u),()=>{s.current&&clearTimeout(s.current),window.removeEventListener("keydown",u)}),[n,u]),(0,o.jsx)("div",{className:(0,i.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","100vw")},_=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},w=()=>{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,l.useRef)(null),n=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{if(n.current===e)return;n.current=e;let o=t.current,i=document.body,l=document.documentElement,r=window.innerWidth-l.clientWidth,s=r>0;if(e&&s)f(i),v(i,l,r),h(o,!0);else if(e)g(i),h(o,!0);else{let e=!x();e&&_(i),e&&w(),h(o,!1)}return()=>{let e=!x();e&&_(i),e&&w()}},[e]),t},j=(0,s.g)("drawer-footer","sc"),y=Object.freeze({footer:`${j}__footer`,hasScroll:`${j}__footer--has-scroll`}),C=({footer:e,hasScroll:t,className:n})=>(0,o.jsx)("div",{className:(0,i.Z)(y.footer,{[y.hasScroll]:t},n),children:"function"==typeof e?e():e}),k=(0,s.g)("drawer-content","sc"),N=Object.freeze({container:`${k}__container`,open:`${k}--open`,close:`${k}--close`,header:`${k}__header`,rowHeader:`${k}__header--row`,title:`${k}__title`,center:`${k}__title--center`,left:`${k}__title--left`,right:`${k}__title--right`,controlContainer:`${k}__control-container`,content:`${k}__content`,footer:`${k}__footer`}),O=({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 _=(0,l.useRef)(null),w=(0,l.useRef)(null),[x,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{var e;if(!w.current||!_.current)return;let t=(null==(e=null==w?void 0:w.current)?void 0:e.getBoundingClientRect().top)||0,n=null==_?void 0:_.current,o=()=>{let e=null==w?void 0:w.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",o,!1),()=>{null==n||n.removeEventListener("scroll",o,!1)}},[]);let j=v||g?{width:g,...v||{}}:void 0;return(0,o.jsxs)("div",{ref:_,style:j,className:(0,i.Z)(N.container,{[N.open]:m,[N.close]:!m},h),children:[s||u?(0,o.jsxs)("div",{className:(0,i.Z)(N.header,{[N.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,o.jsx)("button",{type:"button",className:N.controlContainer,onClick:e,children:(0,o.jsx)(r.IconFdsCloseO,{size:24})}):null,s?(0,o.jsx)("h3",{className:(0,i.Z)(N.title,{[N[c]]:!0}),children:s}):null]}):null,(0,o.jsx)("div",{ref:w,className:N.content,onClick:t,children:n}),d&&(0,o.jsx)(C,{className:(0,i.Z)(N.footer,f),footer:d,hasScroll:x})]})},T=(0,s.g)("drawer-layout","sc"),S=Object.freeze({window:`${T}__window`}),I=({onClose:e,isOpen:t,children:n,withDisabledScroll:r,className:s,...a})=>{let c=(0,l.useCallback)(e=>e.stopPropagation(),[]);return b(t&&r),(0,o.jsxs)("div",{"data-portal":!0,className:(0,i.Z)(S.window,s),children:[(0,o.jsx)(m,{onClose:e,isOpen:t,delay:0}),(0,o.jsx)(O,{onContentClick:c,onClose:e,isOpen:t,...a,children:n})]})},A=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:i=!0,withDisabledScroll:l=!0,...r})=>{let{mounted:s}=u({opened:e});return s?(0,o.jsx)(I,{titleAlign:n,isCloseable:i,isOpen:e,withDisabledScroll:l,...r,children:t}):null};A.displayName="Drawer";let L=(0,s.g)("mobile-modal-footer","sc"),R=Object.freeze({footer:`${L}__footer`,footerWithoutShadow:`${L}__footer--without-shadow`}),E=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,o.jsx)("div",{className:(0,i.Z)(R.footer,t&&R.footerWithoutShadow,n),children:"function"==typeof e?e():e}),M=(0,s.g)("mobile-popup","sc"),$=Object.freeze({mobilePopup:`${M}`,mobilePopupOpen:`${M}--open`,content:`${M}__content`,contentFull:`${M}__content--full`,contentTransition:`${M}__content--transition`,contentTransitionOpen:`${M}__content--transition-open`,contentLine:`${M}__content-line`,contentContainer:`${M}__content-container`,smallContentContainer:`${M}__content-container--small`,min:`${M}__content-container--min`,title:`${M}__title`,closeContainer:`${M}__close-container`,closeButton:`${M}__close-button`}),P=({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:_})=>{let[w,x]=(0,l.useState)(!1),[j,y]=(0,l.useState)(!1),[C,k]=(0,l.useState)(!0),[N,O]=(0,l.useState)("120%"),T=(0,l.useRef)(null),S=(0,l.useRef)(0),I=(0,l.useRef)(!1),A=e=>{var t,n,o;let i=null==(t=T.current)?void 0:t.offsetTop,l=null==(n=T.current)?void 0:n.offsetHeight;if(I.current=!0,k(!1),i&&l){let t=(null==(o=null==e?void 0:e.touches[0])?void 0:o.clientY)-i,n=0;t>=0&&t<=l+30&&(n=t),t>l+30&&(n=l+30),O(`${n}px`),S.current=n}},L=()=>{I.current&&(S.current>d&&a?null==a||a():O("0"),k(!0),I.current=!1),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",L)};return(0,l.useEffect)(()=>{n&&setTimeout(()=>{x(!0),y(!0),O("0")},100),!n&&j&&(O("120%"),x(!1),y(!1))},[j,n]),b(n&&p),(0,o.jsxs)("div",{"data-portal":!0,className:(0,i.Z)($.mobilePopup,j&&$.mobilePopupOpen,f),children:[(0,o.jsx)(m,{onClose:()=>{n&&(null==a||a())},onToucheMove:()=>{n&&(x(!1),window.addEventListener("touchmove",A),window.addEventListener("touchend",L))},isOpen:n,delay:0}),(0,o.jsxs)("div",{className:(0,i.Z)($.content,u&&$.contentFull,C&&$.contentTransition,C&&w&&$.contentTransitionOpen),ref:T,style:{transform:`translateY(${N})`},children:[(0,o.jsx)("div",{className:$.contentLine}),(0,o.jsxs)("div",{className:(0,i.Z)($.contentContainer,s&&$.smallContentContainer,{[$.min]:!v&&!c},h),children:[!!v&&(0,o.jsx)("div",{className:$.title,children:v}),c?(0,o.jsx)("div",{className:$.closeContainer,children:c?g?"function"==typeof g?g():g:(0,o.jsx)("button",{onClick:a,className:$.closeButton,children:(0,o.jsx)(r.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,o.jsx)(E,{footerClassName:_,isSmallPopup:s,footer:t})]})]})},z=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...i})=>{let{mounted:l}=u({opened:n});return l?(0,o.jsx)(P,{isSmallPopup:t,isOpen:n,...i,children:e}):null};z.displayName="UiMobilePopup";let B=({children:e,id:t="portal-root"})=>{let[n,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=document.getElementById(t);if(e){o(e);return}let n=document.createElement("div");return n.id=t,document.body.appendChild(n),o(n),()=>{document.body.removeChild(n)}},[t]),n?(0,a.createPortal)(e,n):null}},3919:function(e,t,n){"use strict";function o(e,t){return`finkit-widgets-${t}-${e}`}n.d(t,{g:function(){return o}})},2331:function(e,t,n){"use strict";n.d(t,{D:function(){return a},h:function(){return u}});let o={а:"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"},i=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in o?o[t]:e}).replaceAll(/[ \u00A0]/g,"_");var l,r=n(915);let s=(e,t)=>{if(typeof window>"u")return;let n=sessionStorage.getItem("pushedEvents"),o=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 i=o.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||!i){if(t){let t={...e};t.url=window.location.pathname,o.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(o))}(0,r.AB)(e)}};var a=((l=a||{}).icon="icon",l.chip="chip",l.accordion="accordion",l.button="button",l.checkbox="checkbox",l.radio="radio",l.select="select",l.toggle="toggle",l.tooltip="tooltip",l.link="link",l.banner="banner",l.tag="tag",l.date="date",l.field="field",l.offer="offer",l.tab="tab",l.submitButton="submitButton",l.popup="popup",l.block="block",l);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:o})=>{let l={event:"data-event",eventCategory:e,eventAction:c[t]+i(n)};void 0!==o&&(l.eventLabel=i("string"==typeof o?o:o.toString())),s(l)}},2116:function(e,t,n){"use strict";n.r(t),n.d(t,{CookiesPlate:function(){return d}});var o=n(7437),i=n(6094),l=n(3167),r=n(2265),s=n(3919);let a={getItem:e=>{var t;if(typeof document>"u")return null;let n=document.cookie.split(";").find(t=>t.split("=")[0].trim()===e);return n&&null!==(t=n.split("=")[1])&&void 0!==t?t:null},setItem:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(typeof document>"u")return;(n={path:"/",...n}).expires instanceof Date&&(n.expires=n.expires.toUTCString());let o="".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t));for(let e in n){if(!n.hasOwnProperty(e))continue;o+="; ".concat(e);let t=n[e];!0!==t&&(o+="=".concat(t))}document.cookie=o},removeItem:e=>{a.setItem(e,"",{"max-age":-1})}},c=(0,s.g)("cookies-plate","sc"),u=Object.freeze({wrapper:"".concat(c,"__wrapper"),contentWrapper:"".concat(c,"__content-wrapper"),visible:"".concat(c,"--visible"),hidden:"".concat(c,"--hidden"),content:"".concat(c,"__content"),text:"".concat(c,"__text"),link:"".concat(c,"__link"),button:"".concat(c,"__button")}),d=e=>{let{className:t,mountDelay:n=3e3,href:s="https://assets.finuslugi.ru/mp-assets/user-agreement.pdf",children:c,closeIcon:d,onMount:p,onLinkClick:m,onClose:h,mountAfterScroll:f=!0}=e,[v,g]=(0,r.useState)(!1),[_,w]=(0,r.useState)(!1),[x,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=()=>{document.removeEventListener("scroll",e),a.getItem("Allow-Cookie")||(b(!0),setTimeout(()=>{g(!0),null==p||p()},n))};return f?document.addEventListener("scroll",e):e(),()=>document.removeEventListener("scroll",e)},[]);let j=(0,r.useCallback)(()=>{a.setItem("Allow-Cookie","1"),w(!0),null==h||h(),setTimeout(()=>b(!1),1e3)},[h]);return x?(0,o.jsx)("div",{className:u.wrapper,children:(0,o.jsx)("div",{className:(0,l.Z)(u.contentWrapper,{[u.visible]:v,[u.hidden]:_}),children:(0,o.jsxs)("div",{className:(0,l.Z)(t,u.content),children:[c||(0,o.jsxs)("p",{className:u.text,children:["Мы используем"," ",(0,o.jsx)("a",{className:u.link,href:s,target:"_blank",rel:"noreferrer",onClick:m,children:"cookie"})," ","для лучшей работы сайта"]}),(0,o.jsx)("button",{className:u.button,onClick:j,children:d||(0,o.jsx)(i.IconFdsCloseO,{})})]})})}):(0,o.jsx)(o.Fragment,{})}},9623:function(e,t,n){"use strict";n.d(t,{$:function(){return q}});var o=n(7437),i=n(2833),l=n(3167),r=n(4866),s=n(6094),a=n(3919),c=n(1810),u=n(2331),d=n(2265),p=n(682);let m=(0,a.g)("footer-contacts-block","sc"),h=Object.freeze({contactsWrapper:"".concat(m,"__contacts-wrapper"),gray:"".concat(m,"__gray"),phones:"".concat(m,"__phones"),contactsButtons:"".concat(m,"__contacts-buttons"),vkIcon:"".concat(m,"__vk-icon"),tgIcon:"".concat(m,"__tg-icon"),dzenIcon:"".concat(m,"__dzen-icon"),ytIcon:"".concat(m,"__yt-icon"),link:"".concat(m,"__link")}),f=(0,a.g)("footer","sc"),v=Object.freeze({wrapper:"".concat(f,"__wrapper"),section:"".concat(f,"__section"),container:"".concat(f,"__container"),top:"".concat(f,"__top"),main:"".concat(f,"__main"),links:"".concat(f,"__links"),disclaimer:"".concat(f,"__disclaimer"),bottom:"".concat(f,"__bottom"),bottomLinks:"".concat(f,"__bottom-links"),bottomDisclaimer:"".concat(f,"__bottom-disclaimer"),compact:"".concat(f,"__wrapper--compact"),white:"".concat(f,"__wrapper--white")}),g="finkit-widgets-sc-footer",_=[{title:"8 (800) 505-32-32",url:"tel:88005053232"},{title:"+7 (495) 145-32-32",url:"tel:+74951453232"}],w=[..._,{title:"Онлайн чат",url:void 0}],x=[{type:"vk",className:h.vkIcon,iconName:"vk"},{type:"dzen",className:h.dzenIcon,iconName:"dzen"},{type:"telegramChannel",className:h.tgIcon,iconName:"telegram"},{type:"yt",className:h.ytIcon,iconName:"",icon:(0,o.jsx)(s.IconFdsYoutubeF,{})}],b=(0,o.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,o.jsx)("br",{}),(0,o.jsx)("br",{}),"Группа \xabМосковская Биржа\xbb - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),j=e=>{let{onClick:t,eventActionText:n,eventLabel:i,...l}=e;return(0,o.jsx)(c.Button,{onClick:e=>{null==t||t(e),(0,u.h)({eventCategory:g,eventActionType:u.D.button,eventActionText:n||"",eventLabel:i})},...l})},y=e=>{let{onClick:t,eventActionType:n,eventActionText:i,eventLabel:l,chat:r,...s}=e;return(0,o.jsx)(c.Link,{onClick:e=>{var o,s,a;null==t||t(e),r&&(null==e||e.preventDefault(),null==(a=null==(s=null==(o=null==window?void 0:window.supportWidget)?void 0:o.craftTalk)?void 0:s.open)||a.call(s)),(0,u.h)({eventCategory:g,eventActionType:n||u.D.link,eventActionText:i||"",eventLabel:l})},...s})},C=e=>{let{minioUrl:t,blogs:n}=e;return(0,o.jsxs)("div",{className:h.contactsWrapper,children:[(0,o.jsx)(i.xv,{className:h.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,o.jsx)("div",{className:h.phones,children:w.map(e=>{let{title:t,url:n}=e;return(0,o.jsx)(y,{href:n,eventActionText:t,chat:!n,children:t},t)})}),(0,o.jsx)(i.xv,{className:h.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,o.jsx)("div",{className:h.contactsButtons,children:x.map(e=>{let{type:i,className:l,iconName:s,icon:a}=e;return(0,o.jsx)(j,{as:"a",href:null==n?void 0:n[i],target:"_blank",className:l,iconRight:a||(0,o.jsx)("img",{src:(0,r.xn)(t,"/pl-common-blocks-renderer/footer/".concat(s,".svg")),alt:i,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:i,eventLabel:null==n?void 0:n[i]},i)})}),(0,o.jsx)(i.xv,{className:h.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,o.jsx)("div",{className:h.contactsButtons,children:(0,o.jsxs)(y,{href:null==n?void 0:n.investTg,target:"_blank",className:h.link,eventActionText:"telegram",eventLabel:null==n?void 0:n.investTg,children:[(0,o.jsx)(j,{className:h.tgIcon,iconRight:(0,o.jsx)("img",{src:(0,r.xn)(t,"/pl-common-blocks-renderer/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==n?void 0:n.investTg}),"Финуслуги Инвест"]})})]})},k=(0,a.g)("footer-disclaimer","sc"),N=Object.freeze({disclaimer:"".concat(k)}),O=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&(0,u.h)({eventCategory:g,eventActionType:u.D.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,o.jsx)("div",{className:(0,l.Z)(e.className,N.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,o.jsx)("div",{className:(0,l.Z)(e.className,N.disclaimer),onClick:t,children:e.children})},T=()=>{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=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",[t,n]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let t=T();if(!t||0===t.size)return;let[o,i=""]=e.split("?"),l=new URLSearchParams(i);t.forEach((e,t)=>{l.has(t)||l.set(t,e)});let r=l.toString();n(r?"".concat(o,"?").concat(r):o)},[e]),t},I=(0,a.g)("footer-modal-body","sc"),A=Object.freeze({wrapper:"".concat(I,"__wrapper"),title:"".concat(I,"__title"),item:"".concat(I,"__item"),label:"".concat(I,"__label"),button:"".concat(I,"__button"),description:"".concat(I,"__description")}),L=e=>{let{directions:t}=e;return(0,o.jsxs)("div",{className:A.wrapper,children:[(0,o.jsx)("div",{className:A.title,children:"Направления"}),t.map(e=>(0,o.jsxs)(y,{className:A.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:"".concat(e.name,"_").concat(e.url),children:[(0,o.jsxs)("div",{className:A.label,children:[(0,o.jsx)("span",{children:e.name}),(0,o.jsx)(j,{className:A.button,iconRight:(0,o.jsx)(s.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,o.jsx)("p",{className:A.description,children:e.description})]},e.url))]})},R=(0,a.g)("footer-popup","sc"),E=Object.freeze({wrapper:"".concat(R,"__wrapper"),button:"".concat(R,"__button"),icon:"".concat(R,"__icon"),buttonWrapper:"".concat(R,"__button-wrapper")}),M=e=>{let{directions:t}=e,n=(0,c.useBreakpointUp)("l"),[i,l]=(0,d.useState)(!1),r=()=>{l(!1)};return(0,o.jsxs)("div",{className:E.wrapper,children:[(0,o.jsx)("div",{className:E.buttonWrapper,children:(0,o.jsx)(j,{className:E.button,appearance:"ghost",variant:"white",onClick:()=>{l(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,o.jsx)("div",{className:E.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,o.jsx)("div",{},e))})})}),(0,o.jsxs)(p.P,{children:[!n&&(0,o.jsx)(p.U,{isOpen:i,onClose:r,full:!0,children:(0,o.jsx)(L,{directions:t})}),n&&(0,o.jsx)(p.D,{isOpen:i,onClose:r,width:"804px",children:(0,o.jsx)(L,{directions:t})})]})]})},$=(0,a.g)("footer-left-column","sc"),P=Object.freeze({leftColumn:"".concat($,"__left-column"),logoWrapper:"".concat($,"__logo-wrapper"),banner:"".concat($,"__banner")}),z=e=>{let{showcaseUrl:t,minioUrl:n,directions:l,mobAppUrl:a}=e,c=S(a);return(0,o.jsxs)("div",{className:P.leftColumn,children:[(0,o.jsx)(y,{className:P.logoWrapper,href:t,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:"finuslugi_logo_".concat(t),children:(0,o.jsx)("img",{src:(0,r.xn)(n,"/pl-common-blocks-renderer/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,o.jsx)(M,{directions:null!=l?l:[]}),(0,o.jsx)(y,{href:c,target:"_blank",eventActionType:u.D.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:c,children:(0,o.jsxs)(i.Zb,{className:P.banner,children:[(0,o.jsxs)(i.xv,{weight:"medium",children:["Управляйте финансами",(0,o.jsx)("br",{}),"через приложение Финуслуг"]}),(0,o.jsx)(j,{iconRight:(0,o.jsx)(s.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,o.jsxs)("picture",{children:[(0,o.jsx)("source",{srcSet:(0,r.xn)(n,"/pl-common-blocks-renderer/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,o.jsx)("img",{src:(0,r.xn)(n,"/pl-common-blocks-renderer/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},B=(0,a.g)("footer-logo","sc"),U=Object.freeze({wrapper:"".concat(B,"__wrapper"),link:"".concat(B,"__link"),fromMoex:"".concat(B,"__from-moex"),logo:"".concat(B,"__logo"),white:"".concat(B,"__wrapper--white")}),D=e=>{let{showcaseUrl:t,minioUrl:n,isWhite:i}=e;return(0,o.jsx)("div",{className:(0,l.Z)(U.wrapper,{[U.white]:i}),children:(0,o.jsxs)(y,{className:U.link,href:t,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:"finuslugi_logo_".concat(t),children:[(0,o.jsx)("img",{className:U.logo,src:"".concat(n,"/images/logo-brandmark-common-finuslugi.svg")}),(0,o.jsx)("img",{className:U.fromMoex,src:"".concat(n,"/images/fromMoex.svg")})]})})},W=(0,a.g)("footer-warning","sc"),F=Object.freeze({reservedSpace:"".concat(W,"__reserved-space"),wrapper:"".concat(W,"__wrapper"),fixed:"".concat(W,"__wrapper--fixed"),container:"".concat(W,"__container")}),Z=e=>{let{text:t,fixed:n}=e;return(0,o.jsx)("div",{className:(0,l.Z)(F.wrapper,{[F.fixed]:n}),children:(0,o.jsx)(i.W2,{className:F.container,children:t})})},H=e=>{let{text:t}=e;return(0,o.jsxs)("div",{className:F.reservedSpace,children:[(0,o.jsx)(Z,{text:t}),(0,o.jsx)(Z,{text:t,fixed:!0})]})},q=e=>{var t,n;let{data:r,showcaseUrl:s="https://finuslugi.ru",minioUrl:a="https://assets.finuslugi.ru/mp-assets",customDisclaimer:c,variant:u="default"}=e,d=!c&&null!=r&&r.disclaimer?r.disclaimer:void 0,p=u.includes("compact"),m=u.includes("white"),h=null==(t=null==r?void 0:r.bottom)?void 0:t.concat(p?_:[]),f="warning"in r?r.warning:void 0;return(0,o.jsx)("footer",{className:(0,l.Z)(v.wrapper,{[v.compact]:p,[v.white]:m}),children:(0,o.jsxs)("section",{className:v.section,children:[(0,o.jsxs)(i.W2,{className:v.container,children:[!p&&(0,o.jsx)(z,{showcaseUrl:s,minioUrl:a,directions:r.directions,mobAppUrl:r.mobAppUrl}),(0,o.jsx)("div",{className:v.wrapper,children:(0,o.jsxs)("div",{className:v.top,children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:v.main,children:[!p&&(0,o.jsx)("div",{className:v.links,children:null==(n=null==r?void 0:r.top)?void 0:n.map(e=>(0,o.jsx)(y,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,o.jsx)(D,{showcaseUrl:s,minioUrl:a,isWhite:m}),(0,o.jsx)(O,{className:v.disclaimer,disclaimer:d,children:c||b})]}),(0,o.jsxs)("div",{className:v.bottom,children:[(0,o.jsx)("div",{className:v.bottomLinks,children:null==h?void 0:h.map(e=>(0,o.jsx)(y,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,o.jsx)(O,{className:v.bottomDisclaimer,disclaimer:null==r?void 0:r.bottomDisclaimer})]})]}),!p&&(0,o.jsx)(C,{minioUrl:a,blogs:r.blogs})]})})]}),p&&!!f&&(0,o.jsx)(H,{text:f})]})})}},4479:function(e,t,n){"use strict";n.r(t),n.d(t,{CitySelectProvider:function(){return F},Header:function(){return eI},useCitySelectContext:function(){return W}});var o=n(7437),i=n(2265),l=n(2331),r=n(6094),s=n(2833),a=n(1810),c=n(3167),u=n(4866),d=n(682),p=n(3919);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`,close:`${m}__close`,removed:`${m}__removed`,overlay:`${m}__overlay`,overlayOpening:`${m}__overlay--opening`,overlayClosing:`${m}__overlay--closing`}),f="cb-header",v=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],g=v.reduce((e,t)=>(e[t.id]=t.label,e),{}),_=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let o=document.getElementById("mainHomeBanner"),i=!1,l=0;window.addEventListener("scroll",function(){let r=window.scrollY||document.documentElement.scrollTop,s=window.innerWidth<768?55:80,a=r<((null==o?void 0:o.clientHeight)||0);if(n&&a||r<s){i=!1,e(!1),t(!0);return}i=r>l,e(r>l),i&&setTimeout(()=>t(!1),50);let c=i?"0px":"";document.documentElement.style.setProperty("--new-header-height-desktop",c),document.documentElement.style.setProperty("--new-header-height-mobile",c),l=r<=0?0:r})},w=()=>{let e=new URLSearchParams(window.location.search),t={};for(let[n,o]of Array.from(e.entries()))n.startsWith("utm_")&&(t[n]=o);return Object.keys(t).length>0?t:null},x=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),b=(e,t)=>{let n=new Date;n.setTime(n.getTime()+864e5*t);let o=encodeURIComponent(JSON.stringify(e));document.cookie=`utm_params=${o};expires=${n.toUTCString()};path=/;SameSite=Lax`},j=()=>{if(x())return;let e=w();e&&b(e,90)},y=()=>{setTimeout(()=>{if(!(typeof document>"u"||!document.cookie))try{j()}catch(e){console.error("UTM tracking error:",e)}},0)},C=(e,t,n)=>(0,l.h)({eventCategory:f,eventActionType:e,eventActionText:t,eventLabel:n}),k=(0,p.g)("navigation-chips","sc"),N=Object.freeze({wrapper:`${k}__wrapper`,gray:`${k}__variantGray`,white:`${k}__variantWhite`,container:`${k}__container`,chip:`${k}__chip`,more:`${k}__chip--more`,active:`${k}__chip--active`,label:`${k}__label`,hidden:`${k}__hidden`}),O=(0,p.g)("navigation-content","sc"),T=Object.freeze({contentWrapper:`${O}__content-wrapper`,content:`${O}__content`,contentOpen:`${O}__content--open`,contentHeader:`${O}__content-header`,contentTitle:`${O}__content-title`,contentTitleUrl:`${O}__content-title--url`,contentTitleLink:`${O}__content-title--link`,contentTitleNew:`${O}__content-title--new`,new:`${O}__new`,vip:`${O}__vip`,arrowIcon:`${O}__arrow-icon`,links:`${O}__links`,linksColumns:`${O}__links--columns`,linksTitleless:`${O}__links--titleless`,removed:`${O}__removed`,hidden:`${O}__content--hidden`}),S=({chip:e,hidden:t,onClick:n,refCallback:i,activeChipId:s})=>{let a=!!n,u=()=>{if(a)return null==n?void 0:n(e.url);C(l.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:N.label,children:e.title}),e.arrow&&(0,o.jsx)(r.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,c.Z)(N.chip,{[N.hidden]:t,[T.new]:!!e.new,[T.vip]:!!e.vip,[N.active]:e.url===s});return a?(0,o.jsx)("button",{type:"button",className:p,onClick:u,ref:i,children:d}):(0,o.jsx)("a",{href:e.url,className:p,onClick:u,ref:i,children:d})},I=({items:e=[],maxNumberOfLines:t,variant:n,className:s,activeChipId:a,onClick:u})=>{let d=(0,i.useRef)(null),p=(0,i.useRef)(null),m=(0,i.useRef)({}),[h,f]=(0,i.useState)(!1),[v,g]=(0,i.useState)(e.length),[_,w]=(0,i.useState)(!1);(0,i.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,i.useCallback)(()=>{let n=d.current;if(!n)return;let o=e=>e?e.getBoundingClientRect().width:0,i=o(n),l=Math.max(Number(t)||0,0),r=()=>{g(e.length),w(!1)};if(h||0===l||i<=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=o(p.current),c=e.map(e=>o(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===l?a+s:0,n=0===f?e:f+s+e;if(n+t<=i-.5)f=n,v++;else{if(++u>l)break;f=e,v++}}w(v<e.length),g(v)},[h,e,t]);(0,i.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(x)});return t.observe(e),requestAnimationFrame(x),()=>{t.disconnect()}},[x]),(0,i.useEffect)(()=>{requestAnimationFrame(x)},[x]);let b=h||(t??0)<=0||!_;return(0,o.jsx)("div",{className:(0,c.Z)(s,N.wrapper,{[N.gray]:"gray"===n,[N.white]:"white"===n}),children:(0,o.jsxs)("div",{ref:d,className:N.container,children:[e.map((e,t)=>(0,o.jsx)(S,{chip:e,hidden:!b&&t>=v,activeChipId:a,onClick:u,refCallback:t=>{m.current[e.url]=t}},e.url)),!b&&_&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,c.Z)(N.chip,N.more),onClick:()=>{C(l.D.chip,"Еще"),f(!0)},children:[(0,o.jsx)(r.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:N.label,children:"Еще"})]}),(b||!_)&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,c.Z)(N.chip,N.more,N.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,o.jsx)(r.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:N.label,children:"Еще"})]})]})})},A=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 "'.concat(e,'": ').concat(t))}return null},L=()=>{if(typeof window>"u")return[];if(Array.isArray(window.allRegions)&&window.allRegions.length>0)return window.allRegions;let e=A("all_regions")||[];return window.allRegions=e,e},R=e=>{let t={};return e.map(e=>{let{id:n,name:o,towns:i}=e;return i.forEach(e=>{e.parentId=n,t[e.name]=t[e.name]||{},t[e.name][e.id]=o}),i}).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},E=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)},M=async e=>{let t=null;try{t=await (await fetch("".concat(e),{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},$=(e,t,n)=>{(0,l.h)({eventCategory:U,eventActionType:e,eventActionText:t,eventLabel:n})},P=L(),z=R(P),B={regions:P,towns:z,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},U="finkit-widgets-sc-city-select",D=(0,i.createContext)(B);function W(){return(0,i.useContext)(D)}let F=e=>{let{children:t,showStartGeoPopup:n=!0,lastRegionsUpdateUnixTimestamp:r,dadataUrl:s="https://finuslugi.ru/backend/money/dadata"}=e,a=Number(A("lastRegionsUpdateUnixTimestamp")||0),c=Number(r||0)>a,[u,d]=(0,i.useState)(L()),[{startRegion:p,startTown:m},h]=(0,i.useState)({startRegion:B.startRegion,startTown:B.startTown}),[{region:f,town:v},g]=(0,i.useState)({region:B.region,town:B.town}),[_,w]=(0,i.useState)(B.startPopupVisible),[x,b]=(0,i.useState)(B.popupVisible),j=(0,i.useRef)(""),y=(0,i.useMemo)(()=>R(u),[u.length]),C=(0,i.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)||""),w(!0),h({startRegion:e,startTown:t})},[w,h]),k=(0,i.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||C(e,t)},[C]),N=(0,i.useCallback)(()=>{if(j.current&&!f&&!v){var e,t;let n=null!==(e=y.find(e=>e.name===j.current))&&void 0!==e?e:null;return k(null!==(t=u.find(e=>e.id===(null==n?void 0:n.parentId)))&&void 0!==t?t:null,n)}k(f,v)},[f,v,y,u,k]),O=(0,i.useCallback)(e=>{b(e)},[b]),T=(0,i.useCallback)(e=>{e?$(l.D.icon,"location"):$(l.D.button,(null==v?void 0:v.name)||"Вся Россия"),!n||window.sessionStorage.getItem("start_popup_opened")?O(!0):N()},[n,v,O,N]),S=(0,i.useCallback)((e,t)=>{e||t?(window.localStorage.setItem("all_russia_selected","0"),window.localStorage.setItem("user_region",JSON.stringify(e)||""),window.localStorage.setItem("user_town",JSON.stringify(t)||"")):(window.localStorage.setItem("all_russia_selected","1"),window.localStorage.setItem("user_region",""),window.localStorage.setItem("user_town","")),g({region:e||null,town:t||null}),w(!1),O(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[O]),I=()=>{g({region:A("user_region"),town:A("user_town")});let e=async e=>{let{coords:{latitude:t,longitude:n}}=e,o="".concat(s,"?lat=").concat(t,"&lon=").concat(n),i=await M(o);null!=i&&i.location&&(j.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&n)try{navigator.geolocation.getCurrentPosition(e,()=>null)}catch(e){}};return(0,i.useEffect)(()=>{if((u.length<1||c)&&E().then(e=>d(e)),window.innerWidth<1024){let e=()=>{I(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{I()},0)},[]),(0,o.jsx)(D.Provider,{value:{regions:u,towns:y,region:f,town:v,startPopupVisible:_,setStartPopupVisible:w,popupVisible:x,handleToggleModal:O,selectCity:S,handleButtonClick:T,startRegion:p,startTown:m},children:t})},Z=()=>{let e=(0,i.useRef)(null),t=(0,i.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,i.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,i.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},H=(0,p.g)("city-select-modal-body","sc"),q=Object.freeze({wrapper:"".concat(H,"__wrapper"),subtitle:"".concat(H,"__subtitle"),hintWrapper:"".concat(H,"__hint-wrapper"),hintText:"".concat(H,"__hint-text"),input:"".concat(H,"__input"),chips:"".concat(H,"__chips"),townsListWrapper:"".concat(H,"__towns-list-wrapper"),townsList:"".concat(H,"__towns-list"),townsGroup:"".concat(H,"__towns-group"),townsGroupLabel:"".concat(H,"__towns-group-label"),townsGroupList:"".concat(H,"__towns-group-list"),townsName:"".concat(H,"__towns-name"),regionName:"".concat(H,"__region-name")}),V=e=>{var t;let{groupedTowns:n,chips:s,query:c,setQuery:u,isDrawer:d}=e,p=W(),m=(0,i.useRef)(null),[h,f]=(0,i.useState)("10000px");(0,i.useEffect)(()=>{if(!d||!m.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,o)=>{let i=n.map(e=>[...e]),l=i.map(e),r=l.reduce((e,t,n)=>t<l[e]?n:e,0);0===r&&i[0].push(i[1].shift()),2===r&&i[2].unshift(i[1].pop()),1===r&&l[0]>l[2]&&i[1].unshift(i[0].pop()),1===r&&l[0]<l[2]&&i[1].push(i[2].shift());let s=Math.max(...i.map(e));return s>=o?o:t(i,s)};new ResizeObserver(()=>{var e;if(!(null!=(e=m.current)&&e.children))return;let n=Array.from(m.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let o=0;try{o=t([[],n,[]],1/0)}catch(e){o=0}o>0&&f("".concat(o,"px"))}).observe(m.current)},[]);let v=e=>{if($(l.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return p.selectCity();let t=p.regions.find(t=>t.id===Number(e.parentId))||null;p.selectCity(t,e)};return(0,o.jsxs)("div",{className:q.wrapper,children:[(0,o.jsxs)("div",{className:q.subtitle,children:["Покажем предложения рядом с вами",(0,o.jsxs)("div",{className:q.hintWrapper,children:[(0,o.jsx)(r.IconFdsQuestionCircleO,{size:24}),(0,o.jsx)("div",{className:q.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,o.jsx)(a.InputBase,{className:q.input,value:c,onChange:u,size:"s",placeholder:"Введите название города",icon:c?(0,o.jsx)(r.IconFdsCloseCircleO,{size:24,onClick:()=>u("")}):(0,o.jsx)(r.IconFdsSearchO,{size:24})}),(0,o.jsx)(a.Chips,{className:q.chips,chips:s,value:(null==(t=p.town)?void 0:t.id)||0,onChipClick:e=>{v(p.towns.find(t=>t.id===e))}}),(0,o.jsx)("div",{className:q.townsListWrapper,children:(0,o.jsx)("div",{ref:m,className:q.townsList,style:{maxHeight:h},children:n.map(e=>(0,o.jsxs)("div",{className:q.townsGroup,children:[(0,o.jsx)("div",{className:q.townsGroupLabel,children:e.letter}),(0,o.jsx)("div",{className:q.townsGroupList,children:e.towns.map(e=>(0,o.jsxs)("button",{type:"button",onClick:()=>v(e),children:[(0,o.jsx)("div",{className:q.townsName,children:e.name}),(0,o.jsx)("div",{className:q.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},G=[1095,1096,134,720,189,180],J=()=>{var e;let t=W(),n=(0,a.useBreakpointUp)("l"),[r,s]=(0,i.useState)(""),c="Ваш выбор: ".concat((null==(e=t.town)?void 0:e.name)||"Вся Россия"),u=(0,i.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(r.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},[]),[r,t.towns.length]),p=(0,i.useMemo)(()=>[{id:0,label:"Вся Россия"},...G.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=()=>{$(l.D.button,"close"),t.handleToggleModal(!1)};return(0,o.jsxs)(d.P,{children:[!n&&(0,o.jsx)(d.U,{title:c,isOpen:t.popupVisible,onClose:m,full:!0,children:(0,o.jsx)(V,{groupedTowns:u,chips:p,query:r,setQuery:s})}),n&&(0,o.jsx)(d.D,{title:c,isOpen:t.popupVisible,onClose:m,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,o.jsx)(V,{groupedTowns:u,chips:p,query:r,setQuery:s,isDrawer:!0})})]})},Y=e=>{let{label:t,onClick:n,eventActionText:i,eventLabel:r,...s}=e;return(0,o.jsx)(a.Button,{label:t,onClick:e=>{null==n||n(e),(0,l.h)({eventCategory:f,eventActionType:l.D.button,eventActionText:i||"",eventLabel:r||""})},...s})},Q=(0,p.g)("header-popup","sc"),K=Object.freeze({popup:"".concat(Q,"__popup"),popupHeader:"".concat(Q,"__popup-header"),popupClose:"".concat(Q,"__popup-close"),body:"".concat(Q,"__body")}),X=e=>{let{isOpen:t,onClose:n,children:i,title:l}=e,s=(0,a.useBreakpointUp)("l");return(0,o.jsxs)(d.P,{children:[!s&&(0,o.jsx)(d.U,{title:l,isOpen:t,onClose:n,children:i}),s&&t&&(0,o.jsxs)("div",{className:K.popup,children:[(0,o.jsxs)("div",{className:K.popupHeader,children:[l,(0,o.jsx)(Y,{className:K.popupClose,iconLeft:(0,o.jsx)(r.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:n,eventActionText:"IconFdsCloseO"})]}),(0,o.jsx)("div",{className:K.body,children:i})]})]})},ee=(0,p.g)("start-choice-popup","sc"),et=Object.freeze({top:"".concat(ee,"__top"),progress:"".concat(ee,"__progress"),innerCircle:"".concat(ee,"__inner-circle"),title:"".concat(ee,"__title"),subtitle:"".concat(ee,"__subtitle"),actions:"".concat(ee,"__actions")}),en=()=>{var e,t;let n=W(),[r,s]=(0,i.useState)(10),[a,c]=(0,i.useState)(0),u=(0,i.useRef)(void 0),d=()=>{$(l.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,i.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+r).slice(1)),t=1e3*e/100,n=0,o=0;u.current=setInterval(()=>{n++,o+=t,c(3.6*n);let i=e-Math.floor(o/1e3);i<r&&s(i),100===n&&(clearInterval(u.current),d())},t)})():(clearInterval(u.current),s(10),c(0))},[n.startPopupVisible]),(0,o.jsxs)(X,{isOpen:n.startPopupVisible,onClose:d,title:(0,o.jsx)("button",{type:"button",className:et.progress,style:{background:"conic-gradient(#ff0508 ".concat(a,"deg, #e3e7ec 0deg)")},onClick:d,children:(0,o.jsx)("div",{className:et.innerCircle,children:r})}),children:[(0,o.jsxs)("div",{className:et.top,children:[(0,o.jsxs)("div",{className:et.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,o.jsx)("div",{className:et.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,o.jsxs)("div",{className:et.actions,children:[(0,o.jsx)(Y,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{$(l.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,o.jsx)(Y,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{$(l.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},eo=(0,p.g)("city-select","sc"),ei=Object.freeze({button:"".concat(eo,"__button")}),el=e=>{var t;let{initialTown:n}=e,i=W(),l=(null==(t=i.town)?void 0:t.name)||n||"Вся Россия";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.Button,{className:ei.button,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>i.handleButtonClick(!1),iconLeft:(0,o.jsx)(r.IconFdsLocationO,{size:16}),label:l}),(0,o.jsx)(J,{}),(0,o.jsx)(en,{})]})},er={"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"},es=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(er,e)?er[e]:er["finuslugi.ru"]},ea=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href="".concat(e,"/assets/css/").concat(t),document.head.appendChild(n);let o=document.createElement("script");o.src="".concat(e,"/get-bootstrap/").concat(t),o.defer=!0,document.body.appendChild(o)},ec=()=>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)}})}),eu=()=>{let[e,t]=(0,i.useState)(!1),[n,o]=(0,i.useState)(!1),l=(0,i.useRef)(!1),r=e=>{l.current=e,o(e)};return(0,i.useEffect)(()=>{if(typeof window>"u")return;let e=es(),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 o=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((i,s)=>{if(l.current){s(Error("chat is already opened"));return}o?(o.openWidget(),t(!1),i()):(r(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;o=e;let l=document.querySelector(".webchat");l&&ec().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=o.closeWidget),null==o||o.openWidget(),r(!1),t(!1),i()},ea(e,n))}),window.supportWidget.craftTalk.toggle=()=>{var e,t,n,o;null!=(t=null==(e=window.supportWidget)?void 0:e.craftTalk)&&t.isOpened?window.supportWidget.craftTalk.close():null==(o=null==(n=window.supportWidget)?void 0:n.craftTalk)||o.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:t,isChatLoading:n}},ed=(0,i.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});function ep(){return(0,i.useContext)(ed)}let em=e=>{let[t,n]=(0,i.useState)(!1),[l,r]=(0,i.useState)(!1),[s,a]=(0,i.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p}=eu(),[m,h]=(0,i.useState)(null),[f,v]=(0,i.useState)(null),[g,w]=(0,i.useState)(!1),[x,b]=(0,i.useState)(!1),[j,C]=(0,i.useState)(!1),k=(0,i.useRef)(null),N=(0,d.u)(g),O=(0,i.useRef)(null),T=(0,i.useRef)(null),S=(0,i.useCallback)(()=>{N.current&&N.current.scrollTo({top:0})},[N]),I=(0,i.useCallback)(e=>{v(e),S()},[S]),A=(0,i.useCallback)(e=>{O.current&&clearTimeout(O.current),e&&b(!0),e||(O.current=setTimeout(()=>{b(!1),I(null)},300))},[I]),L=(0,i.useCallback)((e,t,n)=>{if(t&&I(t),!n&&e===m||!e){A(!g),w(!g);return}h(e),A(!0),w(!0)},[m,I,g,A]),R=(0,i.useCallback)(()=>{T.current&&clearTimeout(T.current),C(!0),T.current=setTimeout(()=>{C(!1)},650)},[]);return(0,i.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id")),_(r,a,e.isMainBannerPage),y()},[]),(0,o.jsx)("div",{children:(0,o.jsx)(ed.Provider,{value:{isAuth:t,isHeaderHidden:l,isHeaderTransparent:s,openedBlock:m,setOpenedBlock:L,openedSection:f,setOpenedSection:I,isNavigationOpen:g,isNavigationMounted:x,navMenuItemsRef:k,navigationRef:N,ignoreClicks:j,setIgnoreClicks:R,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p},children:e.children})})},eh=(0,p.g)("header-chat-modal-body","sc"),ef=Object.freeze({wrapper:"".concat(eh,"__wrapper"),cardButton:"".concat(eh,"__card-button"),card:"".concat(eh,"__card"),cardTitle:"".concat(eh,"__card-title"),cardSubtitle:"".concat(eh,"__card-subtitle"),button:"".concat(eh,"__button")}),ev=()=>{let e=ep();return(0,o.jsxs)("div",{className:ef.wrapper,children:[(0,o.jsx)(Y,{className:ef.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,o.jsxs)(s.Zb,{className:ef.card,variant:"secondary",children:[(0,o.jsxs)("div",{className:ef.cardTitle,children:[(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat"}),"Напишите в чат"]}),(0,o.jsxs)("p",{className:ef.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,o.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),(0,o.jsx)(Y,{as:"a",href:"https://finuslugi.ru/landing/fingpt",target:"_blank",className:ef.button,variant:"secondary",size:"s",iconLeft:(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/robot_icon_hover.svg",alt:"robot"}),eventActionText:"Новости от ФинGPT",children:"Новости от ФинGPT"})]})},eg=(0,p.g)("header-chat-modal","sc"),e_=Object.freeze({wrapper:"".concat(eg,"__wrapper")}),ew=()=>{let e=ep();return(0,o.jsx)(d.P,{children:(0,o.jsx)(X,{isOpen:e.isChatModalOpen,onClose:()=>e.setIsChatModalOpen(!1),title:"Нужна помощь?",children:(0,o.jsx)("div",{className:e_.wrapper,children:(0,o.jsx)(ev,{})})})})},ex=e=>{let{onClick:t,eventActionType:n,eventActionText:i,eventLabel:r,...s}=e;return(0,o.jsx)(a.Link,{onClick:e=>{null==t||t(e),(0,l.h)({eventCategory:f,eventActionType:n||l.D.link,eventActionText:i||"",eventLabel:r||""})},...s})},eb=e=>{let{data:t,isMobile:n}=e,s=ep();return(0,o.jsx)("div",{className:T.contentWrapper,children:t.map(e=>(0,o.jsx)(i.Fragment,{children:e.sections.map(e=>(0,o.jsxs)("div",{className:(0,c.Z)(T.content,{[T.hidden]:s.openedSection!==e.id,[T.contentOpen]:!!s.openedSection}),children:[(0,o.jsx)("div",{className:T.contentHeader,children:(0,o.jsx)("label",{children:e.title})}),e.content.map((t,i)=>{var s,a;return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{children:(0,o.jsx)("a",{className:(0,c.Z)(T.contentTitle,{[T.removed]:!t.title,[T.contentTitleUrl]:!!t.url,[T.contentTitleLink]:!!e.isSeeAllLinkAvailable,[T.contentTitleNew]:!!t.new}),href:e.isSeeAllLinkAvailable?t.url:void 0,children:(0,o.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,o.jsx)("div",{className:T.arrowIcon,children:(0,o.jsx)(r.IconFdsArrowUpRightSmallO,{})}),t.title]})})}),!(null!=(s=t.links)&&s.length)&&(0,o.jsx)(I,{items:t.chips||[],maxNumberOfLines:e.content.length<=1?99:n?3:2}),!!(null!=(a=t.links)&&a.length)&&(0,o.jsx)("div",{className:(0,c.Z)(T.links,{[T.linksColumns]:!!t.columns,[T.linksTitleless]:!t.title}),children:t.links.map(e=>(0,o.jsxs)("a",{href:e.url,className:(0,c.Z)({[T.new]:!!e.new}),onClick:()=>C(l.D.link,e.title,"".concat(e.title,"_").concat(e.url)),children:[(0,o.jsx)("div",{className:T.arrowIcon,children:(0,o.jsx)(r.IconFdsArrowUpRightSmallO,{})}),(0,o.jsx)("span",{children:e.title})]},e.url))})]},"".concat(t.url,"_").concat(i))})]},e.id))},e.id))})},ej=(0,p.g)("navigation-section-icon","sc"),ey=Object.freeze({icon:"".concat(ej)}),eC=e=>{let{name:t,background:n}=e,l=(0,i.useMemo)(()=>t&&r[t]||null,[t]);return t&&l?(0,o.jsx)("div",{className:ey.icon,style:{background:n},children:(0,o.jsx)(l,{})}):null},ek=(0,p.g)("navigation","sc"),eN=Object.freeze({navigation:"".concat(ek),navigationOpening:"".concat(ek,"--opening"),navigationClosing:"".concat(ek,"--closing"),wrapper:"".concat(ek,"__wrapper"),container:"".concat(ek,"__container"),containerOpen:"".concat(ek,"__container--open"),sections:"".concat(ek,"__sections"),sectionsOpen:"".concat(ek,"__sections--open"),citySelectButton:"".concat(ek,"__city-select-button"),sectionsTitle:"".concat(ek,"__sections-title"),sectionsWrapper:"".concat(ek,"__sections-wrapper"),section:"".concat(ek,"__section"),sectionArrow:"".concat(ek,"__section-arrow"),sectionExtra:"".concat(ek,"__section--extra"),sectionActive:"".concat(ek,"__section--active"),sectionTitle:"".concat(ek,"__section-title"),chatWrapper:"".concat(ek,"__chat-wrapper"),chatHeader:"".concat(ek,"__chat-header"),backButton:"".concat(ek,"__back-button"),useful:"".concat(ek,"__useful"),usefulOpen:"".concat(ek,"__useful--open"),usefulTitle:"".concat(ek,"__useful-title"),usefulGrid:"".concat(ek,"__useful-grid"),removed:"".concat(ek,"__removed")}),eO=e=>{var t;let{data:n}=e,u=ep(),d=W(),p=(0,a.useBreakpointDown)("m"),[m,h]=(0,i.useState)(!0);(0,i.useEffect)(()=>{h(p)},[p]);let f=(0,i.useRef)(null),v=(0,i.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u.openedSection?u.setOpenedSection(null):u.isNavigationOpen?u.setOpenedBlock(null):void 0,50)},[u]),_=(0,i.useRef)(!1),w=(0,i.useRef)(null),x=(0,i.useCallback)(()=>{m&&(_.current=!0,w.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),v()},window.history.pushState(null,"",window.location.href))},[v,m]),b=(0,i.useCallback)(()=>{_.current=!1,window.onpopstate=w.current,window.history.go(-1)},[]),j=(0,i.useRef)(null),y=(0,i.useCallback)(e=>{if(m||!u.navMenuItemsRef.current||!u.navigationRef.current)return;let t=e.target,n=!u.navMenuItemsRef.current.contains(t)&&!u.navigationRef.current.contains(t);if(n&&!j.current){u.setIgnoreClicks(),j.current=setTimeout(()=>u.setOpenedBlock(null),300);return}!n&&j.current&&(clearTimeout(j.current),j.current=null)},[m,u]),k=(0,i.useRef)(null),N=(0,i.useCallback)(e=>{typeof window>"u"||(e?(k.current=y,window.addEventListener("mousemove",k.current)):k.current&&window.removeEventListener("mousemove",k.current))},[y]);(0,i.useEffect)(()=>{N(u.isNavigationOpen),u.isNavigationOpen&&!_.current&&x(),!u.isNavigationOpen&&_.current&&b()},[u.isNavigationOpen]);let O=(e,t)=>()=>{C(l.D.button,t),u.setOpenedSection(e)},{start:T,clear:S}=Z(),I=(e,t)=>()=>{m||T(O(e,t),200)},A=()=>{m||S()};return(0,o.jsx)("div",{ref:u.navigationRef,className:(0,c.Z)(eN.navigation,{[eN.removed]:!u.isNavigationMounted,[eN.navigationOpening]:u.isNavigationOpen,[eN.navigationClosing]:!u.isNavigationOpen}),children:(0,o.jsx)("div",{className:eN.wrapper,children:(0,o.jsxs)(s.W2,{className:(0,c.Z)(eN.container,{[eN.containerOpen]:!!u.openedSection}),children:[(0,o.jsxs)("div",{className:(0,c.Z)(eN.sections,{[eN.sectionsOpen]:!!u.openedSection}),children:[(0,o.jsx)(a.Button,{className:eN.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>d.handleButtonClick(!1),iconLeft:(0,o.jsx)(r.IconFdsLocationO,{size:24}),label:(null==(t=d.town)?void 0:t.name)||"Вся Россия"}),n.map(e=>(0,o.jsxs)("ul",{className:(0,c.Z)(eN.sectionsWrapper,{[eN.removed]:u.openedBlock!==e.id&&!m}),children:[(0,o.jsx)("div",{className:eN.sectionsTitle,children:g[e.id]}),e.sections.map(e=>(0,o.jsxs)("li",{className:(0,c.Z)(eN.section,{[eN.sectionExtra]:!!e.extra,[eN.sectionActive]:u.openedSection===e.id}),onClick:O(e.id,e.title),onMouseEnter:I(e.id,e.title),onMouseLeave:A,children:[(0,o.jsx)(eC,{name:e.uikitIcon,background:e.uikitIconBg}),(0,o.jsx)("span",{className:eN.sectionTitle,children:e.title}),(0,o.jsx)("div",{className:eN.sectionArrow,children:(0,o.jsx)(r.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,o.jsxs)("div",{className:eN.chatWrapper,children:[(0,o.jsx)("div",{className:eN.chatHeader,children:"Нужна помощь?"}),(0,o.jsx)(ev,{})]})]}),(0,o.jsxs)("button",{type:"button",className:(0,c.Z)(eN.backButton,{[eN.removed]:!u.openedSection}),onClick:()=>{C(l.D.button,"Назад"),u.setOpenedSection(null)},children:[(0,o.jsx)(r.IconFdsChevronLeftO,{size:24}),(0,o.jsx)("span",{children:"Назад"})]}),(0,o.jsx)(eb,{data:n,isMobile:m}),(0,o.jsxs)("div",{className:(0,c.Z)(eN.useful,{[eN.usefulOpen]:!!u.openedSection}),children:[(0,o.jsx)("div",{className:eN.usefulTitle,children:"Полезное на Финуслугах"}),n.map(e=>(0,o.jsx)(i.Fragment,{children:e.sections.map(e=>(0,o.jsx)("div",{className:(0,c.Z)(eN.usefulGrid,{[eN.removed]:u.openedSection!==e.id}),children:e.useful.map((e,t)=>(0,o.jsxs)("a",{href:e.url,onClick:()=>C(l.D.link,e.title,"".concat(e.title,"_").concat(e.url)),children:[(0,o.jsx)("div",{children:(0,o.jsx)("img",{src:e.icon,srcSet:e.icon2?"".concat(e.icon,", ").concat(e.icon2," 2x"):void 0,alt:e.title,loading:"lazy"})}),(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},"".concat(e.title,"_").concat(t)))},e.id))},e.id))]})]})})})},eT=(e,t,n)=>{var o,i,l;let r=(null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o.findIndex(e=>{let{id:t}=e;return"news"===t}))||-1,s=(null==(l=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i[r])?void 0:l.content)||[];if(e&&Array.isArray(n)&&s.length){let o=n.map(e=>{let{title:n,url:o}=e;return{title:n,url:(0,u.xn)(t||"",o),new:0}});e.NAVIGATOR[r].content[0].links=o}return[{id:"FINPRODUCTS",sections:(null==e?void 0:e.FINPRODUCTS)||[]},{id:"NAVIGATOR",sections:(null==e?void 0:e.NAVIGATOR)||[]},{id:"ABOUT",sections:(null==e?void 0:e.ABOUT)||[]}]},eS=e=>{let{data:t,showcaseUrl:n="https://finuslugi.ru",minioUrl:d="https://assets.finuslugi.ru/mp-assets",lkUrl:p="https://lk.finuslugi.ru/registration",initialTown:m,isMainBannerPage:f,news:g}=e,_=ep(),w=eT(t,n,g),x=(0,i.useMemo)(()=>w.reduce((e,t)=>(e[t.id]=t.sections[0].id,e),{}),[w]),b=_.isAuth?"Личный кабинет":"Войти",j=f&&_.isHeaderTransparent,y=(e,t,n,o)=>()=>{e!==_.openedBlock?C(l.D.toggle,t,"on"):C(l.D.button,"menu_close","on");let i=n?x[e]:"";_.setOpenedBlock(e,i,!!o)},{start:k,clear:N}=Z(),O=(e,t,n,o)=>()=>{_.isNavigationOpen&&e===_.openedBlock||_.setIgnoreClicks(),k(y(e,t,n,o),200)},T=e=>()=>{_.ignoreClicks||e()},S=e=>_.openedBlock===e&&_.isNavigationOpen;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("header",{className:(0,c.Z)(h.header,{[h.transparent]:j}),children:(0,o.jsx)("div",{className:(0,c.Z)(h.fixed,{[h.hidden]:_.isHeaderHidden,[h.navigationOpen]:_.isNavigationOpen}),children:(0,o.jsxs)(s.W2,{className:h.container,children:[(0,o.jsxs)("div",{className:h.leftRow,children:[(0,o.jsx)(ex,{className:h.logo,href:n,eventActionType:l.D.icon,eventActionText:"finuslugi_logo",eventLabel:"finuslugi_logo_".concat(n),children:(0,o.jsxs)("picture",{children:[(0,o.jsx)("source",{srcSet:(0,u.xn)(d,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,o.jsx)("img",{src:(0,u.xn)(d,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,o.jsx)("nav",{ref:_.navMenuItemsRef,className:h.menuItems,children:(0,o.jsx)("ul",{children:v.map(e=>{let{id:t,label:n}=e;return(0,o.jsx)("li",{children:(0,o.jsx)(a.Button,{className:(0,c.Z)({[h.menuItemActive]:S(t)}),label:n,variant:"white",size:"xs",onClick:T(y(t,n,!0)),onMouseEnter:O(t,n,!0,!0),onMouseLeave:N})},t)})})}),(0,o.jsx)(Y,{className:(0,c.Z)(h.tabletMenuButton,{[h.menuItemActive]:_.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,o.jsx)(r.IconFdsChevronDownO,{size:24}),onClick:y("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,o.jsxs)("div",{className:h.buttonGroup,children:[(0,o.jsxs)("div",{className:h.chips,children:[(0,o.jsx)(Y,{onClick:()=>_.setIsChatModalOpen(!_.isChatModalOpen),size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,o.jsx)(r.IconFdsChatDotsCircleO,{size:24})}),(0,o.jsx)(Y,{as:"a",href:p,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:"profile_".concat(p),iconLeft:(0,o.jsx)(r.IconFdsUserO,{size:24})})]}),(0,o.jsx)(Y,{className:h.menuButton,size:"xs",shape:j?"icon":"default",appearance:j?"ghost":"fill",label:"Меню",onClick:y("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,o.jsx)(r.IconFdsMenuSkewedO,{size:24})}),(0,o.jsxs)("div",{className:h.moreButtons,children:[(0,o.jsx)(el,{initialTown:m}),(0,o.jsx)(ew,{}),(0,o.jsx)(Y,{onClick:()=>_.setIsChatModalOpen(!_.isChatModalOpen),size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,o.jsx)(r.IconFdsChatDotsCircleO,{size:24})}),(0,o.jsx)(Y,{as:"a",href:p,size:"xs",eventActionText:b,eventLabel:"".concat(b,"_").concat(p),label:b})]})]}),(0,o.jsxs)(ex,{className:h.auth,href:p,eventActionText:b,eventLabel:"".concat(b,"_").concat(p),children:[(0,o.jsx)(Y,{size:"xs",shape:"circle-icon",iconLeft:(0,o.jsx)(r.IconFdsUserO,{}),eventActionText:b,eventLabel:"".concat(b,"_").concat(p)}),(0,o.jsx)("p",{children:b})]}),(0,o.jsx)("div",{className:h.close,children:(0,o.jsx)(Y,{className:h.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,o.jsx)(r.IconFdsCloseO,{}),onClick:()=>_.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})})}),(0,o.jsx)("div",{className:(0,c.Z)(h.overlay,{[h.removed]:!_.isNavigationMounted,[h.overlayOpening]:_.isNavigationOpen,[h.overlayClosing]:!_.isNavigationOpen}),onClick:T(()=>_.setOpenedBlock(null))}),(0,o.jsx)(eO,{data:w,minioUrl:d})]})},eI=e=>(0,o.jsx)(em,{isMainBannerPage:e.isMainBannerPage,children:(0,o.jsx)(eS,{...e})})},4866:function(e,t,n){"use strict";n.d(t,{xn:function(){return i}});let o=/^\.?\//;function i(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(o,"");n=function(e="",t){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}Symbol.for("ufo:protocolRelative")}}]);