"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3382],{13382:function(e,t,n){n.d(t,{C:function(){return V},H:function(){return eB},u:function(){return H}});var i=n(57437),l=n(2265),o=n(80684),r=n(35563),s=n(75461),a=n(61994),c=n(77337),u=n(49750),d=n(94246),p=n(55487),m=n(4267);let h={userRegion:m.U,userTown:m.a,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},f={userRegion:m.U,userTown:m.a,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},w=(e=!1)=>e?f:h,g=(e=!1)=>e?window.allRegionsNewApi:window.allRegions,v=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},_=(e,t,n=!1)=>{if(typeof document>"u")return;let i=w(n);if(!e&&!t){p.a.removeItem(i.userRegion),p.a.removeItem(i.userTown);return}p.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),p.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},x=e=>{if(typeof document>"u")return null;let t=p.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},b=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},y=(e=!1)=>{if(typeof window>"u")return[];let t=g(e);if(Array.isArray(t)&&t.length>0)return t;let n=b(w(e).allRegions)||[];return v(n,e),n},j=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),C=(e,t=!1)=>!(e.length<1)&&(!t||j(e)),k=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]),[])},$=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,N=e=>e?1:0,O=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},S=(e,t=!1)=>{if(e.length<1)return;let n=w(t);v(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},T=(e,t)=>{let n=t.filter(e=>e.isActive).map(e=>({id:e.geoRegionId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,region_id:e.geoRegionId,enabled:N(e.isActive),fiasId:e.fiasId,towns:[]})),i=n.reduce((e,t)=>(e[t.id]=t,e),{});return e.forEach(e=>{let t=i[e.geoRegionId];t&&t.towns.push({id:e.legacyId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,main:N(e.isRegionalCenter),newId:e.id,fiasId:e.fiasId})}),n},I=(e,t,n)=>{let i=null,l=null;n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,l=t,!0)});let o=t?e.find(e=>e.id===t.id)??null:null;return{region:i??o??t,town:l??n}},R=(e,t)=>(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId),A=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),L=async()=>{let e=await O("https://finuslugi.ru/money_data/Root.json?short=1"),t=Array.isArray(null==e?void 0:e.regions)?e.regions:[];return S(t),t},E=async e=>{let[t,n]=await Promise.all([O($(e,"/sc/api/v1/cities?all=true&isActive=true")),O($(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==t?void 0:t.content)||!Array.isArray(null==n?void 0:n.content))return[];let i=T(t.content,n.content);return j(i)?(S(i,!0),i):[]},P=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?E(e):L(),z=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},B=(e,t,n)=>{(0,u.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})};var U=n(52074),M=n(85241);let F=y(),D=k(F),W={regions:F,towns:D,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},Z=(0,l.createContext)(W);function H(){return(0,l.useContext)(Z)}let V=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:o=!0,lastRegionsUpdateUnixTimestamp:r,dadataUrl:s="https://finuslugi.ru/backend/money/dadata",showcaseUrl:a="",useNewCitiesApi:c=!1})=>{let d=w(c),p=Number(b(d.lastRegionsUpdateUnixTimestamp)||0),m=Number(r||0)>p,[h,f]=(0,l.useState)(y(c)),g=(0,l.useRef)(h),[{startRegion:v,startTown:j},$]=(0,l.useState)({startRegion:W.startRegion,startTown:W.startTown}),N=t??W.region,O=n??W.town,[{region:S,town:T},L]=(0,l.useState)({region:N,town:O}),[E,U]=(0,l.useState)(W.startPopupVisible),[M,F]=(0,l.useState)(W.popupVisible),D=(0,l.useRef)(""),H=(0,l.useRef)(!1),V=(0,l.useMemo)(()=>k(h),[h]);(0,l.useEffect)(()=>{g.current=h},[h]);let G=(0,l.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)||""),U(!0),$({startRegion:e,startTown:t})},[U,$]),J=(0,l.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||G(e,t)},[G]),q=(0,l.useCallback)(()=>{if(D.current&&!S&&!T){let e=V.find(e=>e.name===D.current)??null;return J(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}J(S,T)},[S,T,V,h,J]),Q=(0,l.useCallback)(e=>{F(e)},[F]),Y=(0,l.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(d.allRussiaSelected,"1"),window.localStorage.setItem(d.userRegion,""),window.localStorage.setItem(d.userTown,""),_(null,null,c);return}window.localStorage.setItem(d.allRussiaSelected,"0"),window.localStorage.setItem(d.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(d.userTown,JSON.stringify(t)||""),_(e||null,t||null,c)},[d,c]),K=(0,l.useCallback)(e=>{e?B(u.D.icon,"location"):B(u.D.button,(null==T?void 0:T.name)||"Вся Россия"),!o||window.sessionStorage.getItem("start_popup_opened")?Q(!0):q()},[o,T,Q,q]),X=(0,l.useCallback)((e,t)=>{Y(e,t),L({region:e||null,town:t||null}),U(!1),Q(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[Q,Y]),ee=()=>{let e=x(d.userRegion)??b(d.userRegion),t=x(d.userTown)??b(d.userTown),n=I(g.current,e,t),i=c&&R(e,t);i&&(H.current=!0),i&&A(n.region,n.town)&&(Y(n.region,n.town),H.current=!1),L(n);let l=async({coords:{latitude:e,longitude:t}})=>{let n=`${s}?lat=${e}&lon=${t}`,i=await z(n);null!=i&&i.location&&(D.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&o)try{navigator.geolocation.getCurrentPosition(l,()=>null)}catch{}};return(0,l.useEffect)(()=>{(!C(h,c)||m)&&P({showcaseUrl:a,useNewCitiesApi:c}).then(e=>{e.length<1||f(e)})},[]),(0,l.useEffect)(()=>{if(!c)return;let e=I(h,S,T);H.current&&A(e.region,e.town)&&(Y(e.region,e.town),H.current=!1),L(e)},[h,S,Y,T,c]),(0,l.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{ee(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{ee()},0)},[]),(0,i.jsx)(Z.Provider,{value:{regions:h,towns:V,region:S,town:T,startPopupVisible:E,setStartPopupVisible:U,popupVisible:M,handleToggleModal:Q,selectCity:X,handleButtonClick:K,startRegion:v,startTown:j},children:e})},G=()=>{let e=(0,l.useRef)(null),t=(0,l.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,l.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,l.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},J=(0,U.g)("city-select-modal-body","sc"),q=Object.freeze({wrapper:`${J}__wrapper`,subtitle:`${J}__subtitle`,hintWrapper:`${J}__hint-wrapper`,hintText:`${J}__hint-text`,input:`${J}__input`,chips:`${J}__chips`,townsListWrapper:`${J}__towns-list-wrapper`,townsList:`${J}__towns-list`,townsGroup:`${J}__towns-group`,townsGroupLabel:`${J}__towns-group-label`,townsGroupList:`${J}__towns-group-list`,townsName:`${J}__towns-name`,regionName:`${J}__region-name`}),Q=({groupedTowns:e,chips:t,query:n,setQuery:r,isDrawer:a})=>{var c;let d=H(),p=(0,l.useRef)(null),[m,h]=(0,l.useState)("10000px");(0,l.useEffect)(()=>{if(!a||!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(B(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:q.wrapper,children:[(0,i.jsxs)("div",{className:q.subtitle,children:["Покажем предложения рядом с вами",(0,i.jsxs)("div",{className:q.hintWrapper,children:[(0,i.jsx)(o.IconFdsQuestionCircleO,{size:24}),(0,i.jsx)("div",{className:q.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,i.jsx)(s.MA,{className:q.input,value:n,onChange:r,size:"s",placeholder:"Введите название города",icon:n?(0,i.jsx)(o.IconFdsCloseCircleO,{size:24,onClick:()=>r("")}):(0,i.jsx)(o.IconFdsSearchO,{size:24})}),(0,i.jsx)(s.cL,{className:q.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:q.townsListWrapper,children:(0,i.jsx)("div",{ref:p,className:q.townsList,style:{maxHeight:m},children:e.map(e=>(0,i.jsxs)("div",{className:q.townsGroup,children:[(0,i.jsx)("div",{className:q.townsGroupLabel,children:e.letter}),(0,i.jsx)("div",{className:q.townsGroupList,children:e.towns.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>f(e),children:[(0,i.jsx)("div",{className:q.townsName,children:e.name}),(0,i.jsx)("div",{className:q.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},Y=[1095,1096,134,720,189,180],K=()=>{var e;let t=H(),n=(0,s._m)("l"),[o,r]=(0,l.useState)(""),a=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,c=(0,l.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(o.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},[]),[o,t.towns.length]),p=(0,l.useMemo)(()=>[{id:0,label:"Вся Россия"},...Y.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=()=>{B(u.D.button,"close"),t.handleToggleModal(!1)};return(0,i.jsxs)(d.P,{children:[!n&&(0,i.jsx)(d.U,{title:a,isOpen:t.popupVisible,onClose:m,full:!0,children:(0,i.jsx)(Q,{groupedTowns:c,chips:p,query:o,setQuery:r})}),n&&(0,i.jsx)(d.D,{title:a,isOpen:t.popupVisible,onClose:m,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,i.jsx)(Q,{groupedTowns:c,chips:p,query:o,setQuery:r,isDrawer:!0})})]})},X={"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"},ee=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(X,e)?X[e]:X["finuslugi.ru"]},et=(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)},en=()=>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)}})}),ei=()=>{let[e,t]=(0,l.useState)(!1),[n,i]=(0,l.useState)(!1),o=(0,l.useRef)(!1),r=e=>{o.current=e,i(e)};return(0,l.useEffect)(()=>{if(typeof window>"u")return;let e=ee(),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((l,s)=>{if(o.current){s(Error("chat is already opened"));return}i?(i.openWidget(),t(!1),l()):(r(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let o=document.querySelector(".webchat");o&&en().observe(o,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),r(!1),t(!1),l()},et(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}},el=(0,l.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 eo(){return(0,l.useContext)(el)}let er=e=>{let[t,n]=(0,l.useState)(!1),[o,r]=(0,l.useState)(!1),[s,a]=(0,l.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p}=ei(),[m,h]=(0,l.useState)(null),[f,w]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[_,x]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),j=(0,l.useRef)(null),C=(0,d.u)(g),k=(0,l.useRef)(null),$=(0,l.useRef)(null),N=(0,l.useRef)(null),O=(0,l.useRef)(null),S=(0,l.useCallback)(()=>{C.current&&C.current.scrollTo({top:0})},[C]),T=(0,l.useCallback)(e=>{w(e),S()},[S]),I=(0,l.useCallback)(e=>{k.current&&clearTimeout(k.current),e&&x(!0),e||(k.current=setTimeout(()=>{x(!1),T(null)},300))},[T]),R=(0,l.useCallback)((e,t,n)=>{if(t&&T(t),!n&&e===m||!e){I(!g),v(!g);return}h(e),I(!0),v(!0)},[m,T,g,I]),A=(0,l.useCallback)(()=>{$.current&&clearTimeout($.current),y(!0),$.current=setTimeout(()=>{y(!1)},650)},[]);return(0,l.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,M.s)(r,a,e.isMainBannerPage);return(0,M.i)(),t},[]),(0,i.jsx)("header",{children:(0,i.jsx)(el.Provider,{value:{isAuth:t,isHeaderHidden:o,isHeaderTransparent:s,openedBlock:m,setOpenedBlock:R,openedSection:f,setOpenedSection:T,isNavigationOpen:g,isNavigationMounted:_,navMenuItemsRef:j,navigationRef:C,ignoreClicks:b,setIgnoreClicks:A,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p,fixedContainerRef:N,headerRef:O},children:e.children})})},es=({label:e,onClick:t,eventActionText:n,eventLabel:l,...o})=>(0,i.jsx)(s.zx,{label:e,onClick:e=>{null==t||t(e),(0,u.h)({eventCategory:m.H,eventActionType:u.D.button,eventActionText:n||"",eventLabel:l||""})},...o}),ea=(0,U.g)("header-popup","sc"),ec=Object.freeze({popup:`${ea}__popup`,popupHeader:`${ea}__popup-header`,popupClose:`${ea}__popup-close`,body:`${ea}__body`}),eu=({isOpen:e,onClose:t,children:n,title:l})=>{let r=(0,s._m)("l");return(0,i.jsxs)(d.P,{children:[!r&&(0,i.jsx)(d.U,{title:l,isOpen:e,onClose:t,children:n}),r&&e&&(0,i.jsxs)("div",{className:ec.popup,children:[(0,i.jsxs)("div",{className:ec.popupHeader,children:[l,(0,i.jsx)(es,{className:ec.popupClose,iconLeft:(0,i.jsx)(o.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,i.jsx)("div",{className:ec.body,children:n})]})]})},ed=(0,U.g)("start-choice-popup","sc"),ep=Object.freeze({top:`${ed}__top`,progress:`${ed}__progress`,innerCircle:`${ed}__inner-circle`,title:`${ed}__title`,subtitle:`${ed}__subtitle`,actions:`${ed}__actions`}),em=()=>{var e,t;let n=H(),[o,r]=(0,l.useState)(10),[s,a]=(0,l.useState)(0),c=(0,l.useRef)(void 0),d=()=>{B(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,l.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+o).slice(1)),t=1e3*e/100,n=0,i=0;c.current=setInterval(()=>{n++,i+=t,a(3.6*n);let l=e-Math.floor(i/1e3);l<o&&r(l),100===n&&(clearInterval(c.current),d())},t)})():(clearInterval(c.current),r(10),a(0))},[n.startPopupVisible]),(0,i.jsxs)(eu,{isOpen:n.startPopupVisible,onClose:d,title:(0,i.jsx)("button",{type:"button",className:ep.progress,style:{background:`conic-gradient(#ff0508 ${s}deg, #e3e7ec 0deg)`},onClick:d,children:(0,i.jsx)("div",{className:ep.innerCircle,children:o})}),children:[(0,i.jsxs)("div",{className:ep.top,children:[(0,i.jsxs)("div",{className:ep.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,i.jsx)("div",{className:ep.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,i.jsxs)("div",{className:ep.actions,children:[(0,i.jsx)(es,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{B(u.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,i.jsx)(es,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{B(u.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},eh=(0,U.g)("city-select","sc"),ef=Object.freeze({button:`${eh}__button`,minimal:`${eh}__minimal`,full:`${eh}__full`}),ew=({initialTown:e})=>{var t;let n=H(),r=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:u}=eo(),{startPopupVisible:d,setStartPopupVisible:p,popupVisible:m}=n,h=(0,l.useRef)();(0,l.useEffect)(()=>{m&&(h.current="popup")},[m]),(0,l.useEffect)(()=>{u&&(h.current="chat")},[u]),(0,l.useEffect)(()=>{d&&(h.current="startPopup")},[d]),(0,l.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)(o.IconFdsLocationO,{size:24})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.zx,{...f,className:(0,a.Z)(ef.button,ef.full),label:r}),(0,i.jsx)(s.zx,{...f,className:(0,a.Z)(ef.button,ef.minimal),shape:"icon"}),(0,i.jsx)(K,{}),(0,i.jsx)(em,{})]})},eg=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:l,...o})=>(0,i.jsx)(s.rU,{onClick:i=>{null==e||e(i),(0,u.h)({eventCategory:m.H,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:l||""})},...o}),ev=(0,U.g)("header-mobile-app-banner","sc"),e_=Object.freeze({wrapper:`${ev}__wrapper`,container:`${ev}__container`,closeButton:`${ev}__close-button`,innerWrapper:`${ev}__inner-wrapper`,imageWrapper:`${ev}__image-wrapper`,image:`${ev}__image`,title:`${ev}__title`,description:`${ev}__description`,callToAction:`${ev}__call-to-action`,scanQr:`${ev}__scan-qr`}),ex=Object.freeze({mobile:56,desktop:68}),eb="headerBannerShownAt",ey=()=>{let e=localStorage.getItem(eb);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},ej=()=>{localStorage.setItem(eb,new Date().toISOString())},eC=()=>{let e=ey();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},ek=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:d,headerRef:p}=eo(),[h,f]=(0,l.useState)(!1),[w,g]=(0,l.useState)(!1),[v,_]=(0,l.useState)(!1),x=(0,l.useCallback)((e="desktop")=>{let t=d.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${ex[e]+m.F[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ex.desktop+m.F.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ex.mobile+m.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ex.mobile+m.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ex.desktop+m.F.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ex[e]+108}px`))},[]),b=(0,l.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,l.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{w&&f(!1),_(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[w]),(0,l.useEffect)(()=>{eC()&&f(!0)},[]),(0,l.useEffect)(()=>{let e=window.innerWidth<768;h&&(x(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?f(!0):_(!0));let t=()=>{if(!h)return null;x(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{b(),window.removeEventListener("resize",t)}},[h,x,b]),h?(0,i.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":v,className:(0,a.Z)(e_.wrapper,t),children:(0,i.jsx)(r.W2,{children:(0,i.jsxs)("div",{className:e_.container,children:[(0,i.jsxs)("div",{className:e_.innerWrapper,children:[(0,i.jsxs)("picture",{className:e_.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:e_.image,src:(0,c.xn)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,i.jsxs)("div",{className:e_.scanQr,children:[(0,i.jsx)("div",{className:e_.title,children:"Скачайте приложение Финуслуги"}),(0,i.jsx)("div",{className:e_.description,children:"Сканируйте QR-код"})]}),(0,i.jsxs)("div",{className:e_.callToAction,children:[(0,i.jsxs)("div",{children:["Приложение",(0,i.jsx)("br",{}),"Финуслуги"]}),(0,i.jsx)(s.zx,{onClick:()=>{(0,M.h)(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:e_.closeButton,onClick:()=>{ej(),b(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?f(!1):g(!0)},children:(0,i.jsx)(o.IconFdsCloseO,{size:"100%"})})]})})}):null},e$=(0,U.g)("header-chat-modal-body","sc"),eN=Object.freeze({wrapper:`${e$}__wrapper`,cardButton:`${e$}__card-button`,card:`${e$}__card`,cardTitle:`${e$}__card-title`,cardSubtitle:`${e$}__card-subtitle`,button:`${e$}__button`}),eO=()=>{let e=eo();return(0,i.jsxs)("div",{className:eN.wrapper,children:[(0,i.jsx)(es,{className:eN.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)(r.Zb,{className:eN.card,variant:"secondary",children:[(0,i.jsxs)("div",{className:eN.cardTitle,children:[(0,i.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,i.jsxs)("p",{className:eN.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,i.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eS=({data:e,isMobile:t})=>{let n=eo();return(0,i.jsx)("div",{className:M.a.contentWrapper,children:e.map(e=>(0,i.jsx)(l.Fragment,{children:e.sections.map(e=>{var l;return(0,i.jsxs)("div",{className:(0,a.Z)(M.a.content,{[M.a.hidden]:n.openedSection!==e.id,[M.a.contentOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:M.a.contentHeader,children:(0,i.jsx)("label",{children:e.title})}),null==(l=e.content)?void 0:l.map((n,l)=>{var r,s;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:(0,a.Z)(M.a.contentTitle,{[M.a.removed]:!n.title,[M.a.contentTitleUrl]:!!n.url,[M.a.contentTitleLink]:!!e.isSeeAllLinkAvailable,[M.a.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,i.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,i.jsx)("div",{className:M.a.arrowIcon,children:(0,i.jsx)(o.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(r=n.links)&&r.length)&&(0,i.jsx)(M.N,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(s=n.links)&&s.length)&&(0,i.jsx)("div",{className:(0,a.Z)(M.a.links,{[M.a.linksColumns]:!!n.columns,[M.a.linksTitleless]:!n.title}),children:n.links.map(e=>(0,i.jsxs)("a",{href:e.url,className:(0,a.Z)({[M.a.new]:!!e.new}),onClick:()=>(0,M.h)(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{className:M.a.arrowIcon,children:(0,i.jsx)(o.IconFdsArrowUpRightSmallO,{})}),(0,i.jsx)("span",{children:e.title})]},e.url))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},eT=(0,U.g)("navigation-section-icon","sc"),eI=Object.freeze({icon:`${eT}`}),eR=({name:e,background:t})=>{let n=(0,l.useMemo)(()=>e&&o[e]||null,[e]);return e&&n?(0,i.jsx)("div",{className:eI.icon,style:{background:t},children:(0,i.jsx)(n,{})}):null},eA=(0,U.g)("navigation","sc"),eL=Object.freeze({navigation:`${eA}`,navigationOpening:`${eA}--opening`,navigationClosing:`${eA}--closing`,wrapper:`${eA}__wrapper`,container:`${eA}__container`,containerOpen:`${eA}__container--open`,sections:`${eA}__sections`,sectionsOpen:`${eA}__sections--open`,citySelectButton:`${eA}__city-select-button`,sectionsTitle:`${eA}__sections-title`,sectionsWrapper:`${eA}__sections-wrapper`,section:`${eA}__section`,sectionArrow:`${eA}__section-arrow`,sectionExtra:`${eA}__section--extra`,sectionActive:`${eA}__section--active`,sectionTitle:`${eA}__section-title`,chatWrapper:`${eA}__chat-wrapper`,chatHeader:`${eA}__chat-header`,backButton:`${eA}__back-button`,useful:`${eA}__useful`,usefulOpen:`${eA}__useful--open`,usefulTitle:`${eA}__useful-title`,usefulGrid:`${eA}__useful-grid`,removed:`${eA}__removed`}),eE=({data:e})=>{var t;let n=eo(),c=H(),d=(0,s.aF)("m"),[p,h]=(0,l.useState)(!0);(0,l.useEffect)(()=>{h(d)},[d]);let f=(0,l.useRef)(null),w=(0,l.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),g=(0,l.useRef)(!1),v=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{p&&(g.current=!0,v.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),w()},window.history.pushState(null,"",window.location.href))},[w,p]),x=(0,l.useCallback)(()=>{g.current=!1,window.onpopstate=v.current,window.history.go(-1)},[]),b=(0,l.useRef)(null),y=(0,l.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]),j=(0,l.useRef)(null),C=(0,l.useCallback)(e=>{typeof window>"u"||(e?(j.current=y,window.addEventListener("mousemove",j.current)):j.current&&window.removeEventListener("mousemove",j.current))},[y]);(0,l.useEffect)(()=>{C(n.isNavigationOpen),n.isNavigationOpen&&!g.current&&_(),!n.isNavigationOpen&&g.current&&x()},[n.isNavigationOpen]);let k=(e,t)=>()=>{(0,M.h)(u.D.button,t),n.setOpenedSection(e)},{start:$,clear:N}=G(),O=(e,t)=>()=>{p||$(k(e,t),150)},S=()=>{p||N()};return(0,i.jsx)("div",{ref:n.navigationRef,className:(0,a.Z)(eL.navigation,{[eL.removed]:!n.isNavigationMounted,[eL.navigationOpening]:n.isNavigationOpen,[eL.navigationClosing]:!n.isNavigationOpen}),children:(0,i.jsx)("div",{className:eL.wrapper,children:(0,i.jsxs)(r.W2,{className:(0,a.Z)(eL.container,{[eL.containerOpen]:!!n.openedSection}),children:[(0,i.jsxs)("div",{className:(0,a.Z)(eL.sections,{[eL.sectionsOpen]:!!n.openedSection}),children:[(0,i.jsx)(s.zx,{className:eL.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>c.handleButtonClick(!1),iconLeft:(0,i.jsx)(o.IconFdsLocationO,{size:24}),label:(null==(t=c.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,i.jsxs)("ul",{className:(0,a.Z)(eL.sectionsWrapper,{[eL.removed]:n.openedBlock!==e.id&&!p}),children:[(0,i.jsx)("div",{className:eL.sectionsTitle,children:m.b[e.id]}),e.sections.map(e=>(0,i.jsxs)("li",{className:(0,a.Z)(eL.section,{[eL.sectionExtra]:!!e.extra,[eL.sectionActive]:n.openedSection===e.id}),onClick:k(e.id,e.title),onMouseEnter:O(e.id,e.title),onMouseLeave:S,children:[(0,i.jsx)(eR,{name:e.uikitIcon,background:e.uikitIconBg}),(0,i.jsx)("span",{className:eL.sectionTitle,children:e.title}),(0,i.jsx)("div",{className:eL.sectionArrow,children:(0,i.jsx)(o.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,i.jsxs)("div",{className:eL.chatWrapper,children:[(0,i.jsx)("div",{className:eL.chatHeader,children:"Нужна помощь?"}),(0,i.jsx)(eO,{})]})]}),(0,i.jsxs)("button",{type:"button",className:(0,a.Z)(eL.backButton,{[eL.removed]:!n.openedSection}),onClick:()=>{(0,M.h)(u.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,i.jsx)(o.IconFdsChevronLeftO,{size:24}),(0,i.jsx)("span",{children:"Назад"})]}),(0,i.jsx)(eS,{data:e,isMobile:p}),(0,i.jsxs)("div",{className:(0,a.Z)(eL.useful,{[eL.usefulOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:eL.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,i.jsx)(l.Fragment,{children:e.sections.map(e=>{var t;return(0,i.jsx)("div",{className:(0,a.Z)(eL.usefulGrid,{[eL.removed]:n.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,i.jsxs)("a",{href:e.url,onClick:()=>(0,M.h)(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))]})]})})})},eP=(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:[]}]},ez=({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:h,enableAppHeaderBanner:f=!1,news:w,className:g})=>{let v=eo(),_=(0,l.useMemo)(()=>eP(e,t,w),[e,t,w]),x=null==e?void 0:e.config,b=(0,l.useMemo)(()=>_.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[_]),y=v.isAuth?"Личный кабинет":"Войти",j=h&&v.isHeaderTransparent,C=(e,t,n,i)=>()=>{e!==v.openedBlock?(0,M.h)(u.D.toggle,t,"on"):(0,M.h)(u.D.button,"menu_close","on");let l=n?b[e]:"";v.setOpenedBlock(e,l,!!i)},{start:k,clear:$}=G(),N=(e,t,n,i)=>()=>{v.isNavigationOpen&&e===v.openedBlock||v.setIgnoreClicks(),k(C(e,t,n,i),200)},O=e=>()=>{v.ignoreClicks||e()},S=e=>v.openedBlock===e&&v.isNavigationOpen;return e?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:v.headerRef,className:(0,a.Z)(m.s.header,g,{[m.s.transparent]:j}),children:(0,i.jsxs)("div",{ref:v.fixedContainerRef,className:(0,a.Z)(m.s.fixed,{[m.s.hidden]:v.isHeaderHidden,[m.s.navigationOpen]:v.isNavigationOpen}),children:[!!(null!=x&&x.appBannerUrl)&&f&&(0,i.jsx)(ek,{mobileAppUrl:x.appBannerUrl,minioUrl:n}),(0,i.jsxs)(r.W2,{className:m.s.container,children:[(0,i.jsxs)("div",{className:m.s.leftRow,children:[(0,i.jsx)(eg,{className:m.s.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:v.navMenuItemsRef,className:m.s.menuItems,children:(0,i.jsx)("ul",{children:m.c.map(({id:e,label:t})=>(0,i.jsx)("li",{children:(0,i.jsx)(s.zx,{className:(0,a.Z)({[m.s.menuItemActive]:S(e)}),label:t,variant:"white",size:"xs",onClick:O(C(e,t,!0)),onMouseEnter:N(e,t,!0,!0),onMouseLeave:$})},e))})}),(0,i.jsx)(es,{className:(0,a.Z)(m.s.tabletMenuButton,{[m.s.menuItemActive]:v.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,i.jsx)(o.IconFdsChevronDownO,{size:24}),onClick:C("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,i.jsxs)("div",{className:(0,a.Z)(m.s.buttonGroup,{[m.s.whiteIcons]:(null==x?void 0:x.iconColorOnMobileMainBanner)==="white"}),children:[(0,i.jsxs)("div",{className:m.s.chips,children:[(0,i.jsx)(es,{as:"a",href:d,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${d}`,iconLeft:(0,i.jsx)(o.IconFdsUserO,{size:20})}),(0,i.jsx)(es,{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)(o.IconFdsChatDotsCircleO,{size:24})})]}),(0,i.jsx)(es,{className:m.s.menuButton,size:"xs",shape:j?"icon":"default",appearance:j?"ghost":"fill",label:"Меню",onClick:C("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,i.jsx)(o.IconFdsMenuSkewedO,{size:24})}),(0,i.jsxs)("div",{className:m.s.moreButtons,children:[(0,i.jsx)(ew,{initialTown:p}),(0,i.jsx)(es,{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)(o.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,i.jsx)(es,{as:"a",href:d,size:"xs",eventActionText:y,eventLabel:`${y}_${d}`,label:y})]})]}),(0,i.jsxs)(eg,{className:m.s.auth,href:d,eventActionText:y,eventLabel:`${y}_${d}`,children:[(0,i.jsx)(es,{size:"xs",shape:"circle-icon",iconLeft:(0,i.jsx)(o.IconFdsUserO,{}),eventActionText:y,eventLabel:`${y}_${d}`}),(0,i.jsx)("p",{children:y})]}),(0,i.jsx)("div",{className:m.s.close,children:(0,i.jsx)(es,{className:m.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,i.jsx)(o.IconFdsCloseO,{}),onClick:()=>v.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,i.jsx)("div",{className:(0,a.Z)(m.s.overlay,{[m.s.removed]:!v.isNavigationMounted,[m.s.overlayOpening]:v.isNavigationOpen,[m.s.overlayClosing]:!v.isNavigationOpen}),onClick:O(()=>v.setOpenedBlock(null))}),(0,i.jsx)(eE,{data:_,minioUrl:n})]}):null},eB=e=>(0,i.jsx)(er,{isMainBannerPage:e.isMainBannerPage,children:(0,i.jsx)(ez,{...e})})},85241:function(e,t,n){n.d(t,{N:function(){return y},a:function(){return x},h:function(){return w},i:function(){return f},s:function(){return u}});var i=n(57437),l=n(2265),o=n(80684),r=n(61994),s=n(49750),a=n(4267),c=n(52074);let u=(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("headerNotice"),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)}},d=()=>{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},p=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),m=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let l=encodeURIComponent(JSON.stringify(t)),o=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${l};expires=${i.toUTCString()};path=/;SameSite=Lax${o}`},h=()=>{let e=d();e&&!p()&&m("utm_params",e,90),e&&m("utm_last",e,90)},f=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{h()}catch(e){console.error("UTM tracking error:",e)}},0)},w=(e,t,n)=>(0,s.h)({eventCategory:a.H,eventActionType:e,eventActionText:t,eventLabel:n}),g=(0,c.g)("navigation-chips","sc"),v=Object.freeze({wrapper:`${g}__wrapper`,gray:`${g}__variantGray`,white:`${g}__variantWhite`,container:`${g}__container`,chip:`${g}__chip`,more:`${g}__chip--more`,active:`${g}__chip--active`,label:`${g}__label`,hidden:`${g}__hidden`}),_=(0,c.g)("navigation-content","sc"),x=Object.freeze({contentWrapper:`${_}__content-wrapper`,content:`${_}__content`,contentOpen:`${_}__content--open`,contentHeader:`${_}__content-header`,contentTitle:`${_}__content-title`,contentTitleUrl:`${_}__content-title--url`,contentTitleLink:`${_}__content-title--link`,contentTitleNew:`${_}__content-title--new`,new:`${_}__new`,vip:`${_}__vip`,arrowIcon:`${_}__arrow-icon`,links:`${_}__links`,linksColumns:`${_}__links--columns`,linksTitleless:`${_}__links--titleless`,removed:`${_}__removed`,hidden:`${_}__content--hidden`}),b=({chip:e,hidden:t,onClick:n,refCallback:l,activeChipId:a})=>{let c=!!n,u=()=>{if(c)return null==n?void 0:n(e.url);w(s.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:v.label,children:e.title}),e.arrow&&(0,i.jsx)(o.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,r.Z)(v.chip,{[v.hidden]:t,[x.new]:!!e.new,[x.vip]:!!e.vip,[v.active]:e.url===a});return c?(0,i.jsx)("button",{type:"button",className:p,onClick:u,ref:l,children:d}):(0,i.jsx)("a",{href:e.url,className:p,onClick:u,ref:l,children:d})},y=({items:e=[],maxNumberOfLines:t,variant:n,className:a,activeChipId:c,onClick:u})=>{let d=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)({}),[h,f]=(0,l.useState)(!1),[g,_]=(0,l.useState)(e.length),[x,y]=(0,l.useState)(!1);(0,l.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 j=(0,l.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=()=>{_(e.length),y(!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,w=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,w++;else{if(++u>o)break;f=e,w++}}y(w<e.length),_(w)},[h,e,t]);(0,l.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(j)});return t.observe(e),requestAnimationFrame(j),()=>{t.disconnect()}},[j]),(0,l.useEffect)(()=>{requestAnimationFrame(j)},[j]);let C=h||(t??0)<=0||!x;return(0,i.jsx)("div",{className:(0,r.Z)(a,v.wrapper,{[v.gray]:"gray"===n,[v.white]:"white"===n}),children:(0,i.jsxs)("div",{ref:d,className:v.container,children:[e.map((e,t)=>(0,i.jsx)(b,{chip:e,hidden:!C&&t>=g,activeChipId:c,onClick:u,refCallback:t=>{m.current[e.url]=t}},e.url)),!C&&x&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,r.Z)(v.chip,v.more),onClick:()=>{w(s.D.chip,"Еще"),f(!0)},children:[(0,i.jsx)(o.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:v.label,children:"Еще"})]}),(C||!x)&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,r.Z)(v.chip,v.more,v.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,i.jsx)(o.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:v.label,children:"Еще"})]})]})})}},94246:function(e,t,n){n.d(t,{D:function(){return I},P:function(){return U},U:function(){return B},u:function(){return b}});var i=n(57437),l=n(2265),o=n(61994),r=n(80684),s=n(52074),a=n(54887);let c=300,u=({opened:e})=>{let[t,n]=(0,l.useState)(!1),i=(0,l.useRef)(null),o=(0,l.useRef)(!1);return(0,l.useEffect)(()=>(e&&!o.current?(o.current=!0,n(!0)):!e&&o.current&&(i.current=setTimeout(()=>{o.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,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,i.jsx)("div",{className:(0,o.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)},w=(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")},v=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,l.useRef)(null),n=(0,l.useRef)(!1);return(0,l.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),w(l,o,r),h(i,!0);else if(e)g(l),h(i,!0);else{let e=!x();e&&v(l),e&&_(),h(i,!1)}return()=>{let e=!x();e&&v(l),e&&_()}},[e]),t},y=(0,s.g)("drawer-footer","sc"),j=Object.freeze({footer:`${y}__footer`,hasScroll:`${y}__footer--has-scroll`}),C=({footer:e,hasScroll:t,className:n})=>(0,i.jsx)("div",{className:(0,o.Z)(j.footer,{[j.hasScroll]:t},n),children:"function"==typeof e?e():e}),k=(0,s.g)("drawer-content","sc"),$=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`}),N=({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:w,width:g})=>{let v=(0,l.useRef)(null),_=(0,l.useRef)(null),[x,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{var e;if(!_.current||!v.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.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 y=w||g?{width:g,...w||{}}:void 0;return(0,i.jsxs)("div",{ref:v,style:y,className:(0,o.Z)($.container,{[$.open]:m,[$.close]:!m},h),children:[s||u?(0,i.jsxs)("div",{className:(0,o.Z)($.header,{[$.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,i.jsx)("button",{type:"button",className:$.controlContainer,onClick:e,children:(0,i.jsx)(r.IconFdsCloseO,{size:24})}):null,s?(0,i.jsx)("h3",{className:(0,o.Z)($.title,{[$[c]]:!0}),children:s}):null]}):null,(0,i.jsx)("div",{ref:_,className:$.content,onClick:t,children:n}),d&&(0,i.jsx)(C,{className:(0,o.Z)($.footer,f),footer:d,hasScroll:x})]})},O=(0,s.g)("drawer-layout","sc"),S=Object.freeze({window:`${O}__window`}),T=({onClose:e,isOpen:t,children:n,withDisabledScroll:r,className:s,...a})=>{let c=(0,l.useCallback)(e=>e.stopPropagation(),[]);return b(t&&r),(0,i.jsxs)("div",{"data-portal":!0,className:(0,o.Z)(S.window,s),children:[(0,i.jsx)(m,{onClose:e,isOpen:t,delay:0}),(0,i.jsx)(N,{onContentClick:c,onClose:e,isOpen:t,...a,children:n})]})},I=({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)(T,{titleAlign:n,isCloseable:l,isOpen:e,withDisabledScroll:o,...r,children:t}):null};I.displayName="Drawer";let R=(0,s.g)("mobile-modal-footer","sc"),A=Object.freeze({footer:`${R}__footer`,footerWithoutShadow:`${R}__footer--without-shadow`}),L=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,i.jsx)("div",{className:(0,o.Z)(A.footer,t&&A.footerWithoutShadow,n),children:"function"==typeof e?e():e}),E=(0,s.g)("mobile-popup","sc"),P=Object.freeze({mobilePopup:`${E}`,mobilePopupOpen:`${E}--open`,content:`${E}__content`,contentFull:`${E}__content--full`,contentTransition:`${E}__content--transition`,contentTransitionOpen:`${E}__content--transition-open`,contentLine:`${E}__content-line`,contentContainer:`${E}__content-container`,smallContentContainer:`${E}__content-container--small`,min:`${E}__content-container--min`,title:`${E}__title`,closeContainer:`${E}__close-container`,closeButton:`${E}__close-button`}),z=({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:w,closeButton:g,footerClassName:v})=>{let[_,x]=(0,l.useState)(!1),[y,j]=(0,l.useState)(!1),[C,k]=(0,l.useState)(!0),[$,N]=(0,l.useState)("120%"),O=(0,l.useRef)(null),S=(0,l.useRef)(0),T=(0,l.useRef)(!1),I=e=>{var t,n,i;let l=null==(t=O.current)?void 0:t.offsetTop,o=null==(n=O.current)?void 0:n.offsetHeight;if(T.current=!0,k(!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),N(`${n}px`),S.current=n}},R=()=>{T.current&&(S.current>d&&a?null==a||a():N("0"),k(!0),T.current=!1),window.removeEventListener("touchmove",I),window.removeEventListener("touchend",R)};return(0,l.useEffect)(()=>{n&&setTimeout(()=>{x(!0),j(!0),N("0")},100),!n&&y&&(N("120%"),x(!1),j(!1))},[y,n]),b(n&&p),(0,i.jsxs)("div",{"data-portal":!0,className:(0,o.Z)(P.mobilePopup,y&&P.mobilePopupOpen,f),children:[(0,i.jsx)(m,{onClose:()=>{n&&(null==a||a())},onToucheMove:()=>{n&&(x(!1),window.addEventListener("touchmove",I),window.addEventListener("touchend",R))},isOpen:n,delay:0}),(0,i.jsxs)("div",{className:(0,o.Z)(P.content,u&&P.contentFull,C&&P.contentTransition,C&&_&&P.contentTransitionOpen),ref:O,style:{transform:`translateY(${$})`},children:[(0,i.jsx)("div",{className:P.contentLine}),(0,i.jsxs)("div",{className:(0,o.Z)(P.contentContainer,s&&P.smallContentContainer,{[P.min]:!w&&!c},h),children:[!!w&&(0,i.jsx)("div",{className:P.title,children:w}),c?(0,i.jsx)("div",{className:P.closeContainer,children:c?g?"function"==typeof g?g():g:(0,i.jsx)("button",{onClick:a,className:P.closeButton,children:(0,i.jsx)(r.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,i.jsx)(L,{footerClassName:v,isSmallPopup:s,footer:t})]})]})},B=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...l})=>{let{mounted:o}=u({opened:n});return o?(0,i.jsx)(z,{isSmallPopup:t,isOpen:n,...l,children:e}):null};B.displayName="UiMobilePopup";let U=({children:e,id:t="portal-root"})=>{let[n,i]=(0,l.useState)(null);return(0,l.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}},4267:function(e,t,n){n.d(t,{F:function(){return u},H:function(){return s},U:function(){return o},a:function(){return r},b:function(){return c},c:function(){return a},s:function(){return l}});let i=(0,n(52074).g)("header","sc"),l=Object.freeze({header:`${i}`,fixed:`${i}__fixed`,hidden:`${i}__fixed--hidden`,transparent:`${i}--transparent`,navigationOpen:`${i}__navigation-open`,container:`${i}__container`,leftRow:`${i}__left-row`,logo:`${i}__logo`,menuItems:`${i}__menu-items`,menuItemActive:`${i}__menu-item-active`,tabletMenuButton:`${i}__tablet-menu-button`,buttonGroup:`${i}__button-group`,chips:`${i}__chips`,menuButton:`${i}__menu-button`,moreButtons:`${i}__more-buttons`,auth:`${i}__auth`,whiteIcons:`${i}__white-icons`,close:`${i}__close`,removed:`${i}__removed`,overlay:`${i}__overlay`,overlayOpening:`${i}__overlay--opening`,overlayClosing:`${i}__overlay--closing`}),o="user_region",r="user_town",s="cb-header",a=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],c=a.reduce((e,t)=>(e[t.id]=t.label,e),{}),u=Object.freeze({mobile:56,desktop:80})},55487:function(e,t,n){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})}}},49750:function(e,t,n){let i;n.d(t,{D:function(){return s},h:function(){return c}});var l=n(31620),o=n(30631);let r=(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,o.AB)(e)}};var s=((i=s||{}).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 a={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_"},c=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:i})=>{let o={event:"data-event",eventCategory:e,eventAction:a[t]+(0,l.t)(n)};void 0!==i&&(o.eventLabel=(0,l.t)("string"==typeof i?i:i.toString())),r(o)}},31620:function(e,t,n){n.d(t,{t:function(){return l}});let i={а:"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"},l=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in i?i[t]:e}).replaceAll(/[ \u00A0]/g,"_")}}]);