(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[316],{7850:function(e,t,a){"use strict";a.r(t),a.d(t,{NavigatorDetail:function(){return G}});var i=a(5893),r=a(9194),n=a(6535),l=a(4588),o=a(6010),s=a(1163),c=a(7294),d=a(4249),p=a(5e3),u=a(468),_=a(3055),v=a(7843),g=a(5352),h=a(7701),m=a(2307),f=a(4386),N=a(1309),x=a(8059),j=a(8114),b=a(7315),I=a(2027),D=a(3627),w=a(6129),y=a(2864),k=a(2825),C=a(3161),L=a(7771),T=a(9574),P=a(4800),S=a(5131),W=a(1997),A=a(9298),E=a.n(A);let M=e=>{var t,a;let{post:n,BASE_URL:l,postViews:o}=e,s=(0,W.p6)(String(n.public_date||n.update_time||n.publ_date)),c=n.read_time||0;return(0,i.jsxs)("div",{className:E().wrapper,children:[(0,i.jsxs)("div",{className:E().info,children:[(0,i.jsx)("div",{className:E().unit,children:(0,i.jsx)("label",{children:s})}),!!c&&(0,i.jsxs)("div",{className:E().unit,children:[(0,i.jsx)(r.IconFdsClockO,{size:24}),(0,i.jsxs)("label",{children:[c," мин"]})]}),!!o&&(0,i.jsxs)("div",{className:E().unit,children:[(0,i.jsx)(r.IconFdsEyeO,{size:24}),(0,i.jsx)("label",{children:o})]})]}),!!(null==n?void 0:null===(t=n.author)||void 0===t?void 0:t.name)&&(null==n?void 0:null===(a=n.author)||void 0===a?void 0:a.url)&&(0,i.jsxs)("a",{className:E().author,href:"/navigator/author/".concat(null==n?void 0:n.author.url),target:"_self",children:[(null==n?void 0:n.author.photo)&&(0,i.jsx)("img",{className:E().image,src:"".concat(l,"/img/posts/original/").concat(null==n?void 0:n.author.photo),alt:n.author.name}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:E().name,children:n.author.name}),(0,i.jsx)("div",{className:E().position,children:n.author.position})]})]})]})};var R=a(2288),H=a(7311),B=a(2853);let F=async(e,t,a,i,r,n)=>{var l;let o=await (0,B.pW)(e,9,void 0,t,i?void 0:a,i?1:void 0),s=new Date;s.setDate(new Date().getDate()-30);let c=((null===(l=o.data)||void 0===l?void 0:l.articles)||[]).filter(e=>e.url!==n).map(e=>{let{url:t}=e;return t});return c.length||i?c:(r(),await F(e,1,"",!0,r,n))};var z=a(2888),O=a(2708),U=a.n(O);let G=e=>{var t,a,r,o,_,h,j;let{env:b,post:w,tags:y,description:k,isMobileApplication:L,extra:T,bestOffersBlock:W,bestOffersBlockPageData:A}=e,E=(0,N.I)(),{asPath:M}=(0,s.useRouter)(),[B,z]=(0,c.useState)(w),[O,G]=(0,c.useState)([]),J=(0,c.useRef)([]),X=(0,c.useRef)(0),Y=(0,c.useRef)(!1),[V,Z]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let e=()=>{var e;let t=document.getElementById(null===(e=window.location.hash)||void 0===e?void 0:e.slice(1));t&&(0,C.Q)((0,C.n)(t)-32),history.replaceState(null,"",window.location.pathname+window.location.search)};return window.addEventListener("hashchange",e),window.location.hash?e():window.scrollTo(0,0),()=>{window.removeEventListener("hashchange",e)}},[]);let Q=null===(t=B.tag_ids)||void 0===t?void 0:t.reduce((e,t)=>{let a=y.find(e=>{let{id:a}=e;return a===t}),i=M.replace("navigator-new/","navigator/"),r=i.includes((null==a?void 0:a.url)||"___");return a&&r&&e.unshift(a),a&&!r&&e.push(a),e},[]),q=(null==Q?void 0:Q[0])||y[0],$=()=>{Y.current=!0,X.current=1},ee=async()=>{var e,t;J.current.length||(X.current++,J.current=await F(b,X.current,q.url,Y.current,$,B.url));let a=J.current.shift();if(!a){Z(!0);return}let i=await (0,u.vM)(b,a),r=null===(e=i.data)||void 0===e?void 0:e.article;if((null==r?void 0:r.best_offers)&&A){let e=await (0,d.x)(b,A,r.best_offers),a=(null==e?void 0:null===(t=e.chips)||void 0===t?void 0:t[0])?(0,p.v)(e.chips[0]):null;a&&(r.bestOffersTab=a)}r.title?G(e=>[...e,r]):ee()},et=(0,x.M)(ee,.5),ea=(0,c.useMemo)(()=>{var e;return"Читать статью на тему “".concat(B.title.trimEnd(),"” онлайн на сайте.  Еще больше актуальных статей").concat(B.tag_ids&&B.tag_ids[0]?" по теме “".concat(null===(e=y[B.tag_ids[0]-1])||void 0===e?void 0:e.name,"” "):" ","в Журнале Финуслуги.")},[y,B]),ei=(0,c.useMemo)(()=>""!==k?k:ea,[k,ea]),er=(()=>{switch(q&&q.url){case"navigator/investirovat":return{pp:"cfbl",ps:"foam",p2:"hpaj"};case"navigator/kredity":return{pp:"cfbj",ps:"foam",p2:"hpaj"};case"navigator/nakopit-i-sohranit":return{pp:"cfek",ps:"foam",p2:"hpaj"};case"navigator/zastrahovat":return{pp:"cfbk",ps:"foam",p2:"hpaj"};default:return{pp:"i",ps:"foam",p2:"hpaj"}}})(),en=(0,D.z)({tag:{href:q.url,label:q.name},current:{label:B.title}}),el=(0,D.z)({includeBase:!1,tag:{href:q.url,label:q.name}}),eo=(0,I.z)(en),es=(0,I.z)(el),ec=JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"Article",name:B.title,headline:"".concat(B.title," - читайте на сайте Финуслуги"),description:ei,url:"".concat(f._n,"/").concat(B.url),about:{"@type":"Thing",...B.tag_ids&&{name:null===(a=y[B.tag_ids[0]-1])||void 0===a?void 0:a.name,sameAs:"".concat(f._n,"/").concat(null===(r=y[B.tag_ids[0]-1])||void 0===r?void 0:r.url)}},mainEntityOfPage:{"@type":"WebPage","@id":"".concat(f._n,"/").concat(B.url)},dateCreated:B.public_date||B.publ_date,datePublished:B.public_date||B.publ_date,dateModified:B.update_time||B.public_date,thumbnailUrl:"".concat(f._n,"/img/posts/big/").concat(null==B?void 0:null===(o=B.image)||void 0===o?void 0:o.file),...B.author&&{author:{"@type":"Person",name:null===(_=B.author)||void 0===_?void 0:_.name,url:"".concat(f._n,"/navigator/author/").concat(null===(h=B.author)||void 0===h?void 0:h.url)}},...(null==B?void 0:B.publisher)&&{publisher:{"@type":B.publisher.type,name:B.publisher.name,url:"".concat(f._n),address:{"@type":"PostalAddress",name:B.publisher.address},logo:{"@type":"ImageObject",url:"".concat(f._n,"/icons/header_logo.svg"),width:168,height:42}}}},JSON.parse(es)]}),{anons:ed,publ_date:ep}=B,eu=ep.split(" ")[0].split("-")[0],e_=(null==W?void 0:W.chips[0])?(0,p.v)(W.chips[0]):null;return(0,i.jsxs)("main",{ref:et,className:U().page,children:[!T&&(0,i.jsx)(g.N,{env:b,title:B.seo_title||B.custom_title||B.title,description:B.seo_description||ei,path:M,noindex:"Дарим 4000 рублей за первый вклад"===ed&&"2022"===eu,image:"img/posts/big/".concat(null==w?void 0:null===(j=w.image)||void 0===j?void 0:j.file),isDetailPage:!0}),(0,i.jsxs)(n.W2,{children:[!L&&!T&&(0,i.jsx)(l.Oo,{items:en,style:{padding:"16px 0"}}),!L&&!T&&(0,i.jsx)(S.v5,{env:b,isMobile:!0,tags:y,selectedTag:null==q?void 0:q.url}),(0,i.jsxs)("div",{className:U().content,children:[(0,i.jsx)(P.F,{env:b,tags:y,selectedTag:null==q?void 0:q.url}),(0,i.jsxs)("div",{className:U().main,children:[(0,i.jsx)(K,{...e,onReach:ee,handleChangePost:e=>z(e)}),(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:ec}}),(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:eo}}),e_&&(0,i.jsx)(v.e,{tab:e_}),!L&&(0,i.jsx)(m.Z,{config:E,params:er}),O.map(t=>{let{bestOffersTab:a,...r}=t;return(0,i.jsxs)(c.Fragment,{children:[(0,i.jsx)(K,{extra:!0,handleChangePost:z,...e,onReach:ee,post:r,otherPosts:[]}),a&&(0,i.jsx)(v.e,{tab:a})]},r.url)}),!V&&(0,i.jsx)(K,{...e,post:R.Wn,otherPosts:[],extra:!0,skeleton:!0})]})]})]}),(0,i.jsx)(H.w,{articleRef:et})]})},K=e=>{var t,a,n,l,d,p,v,g,m;let{env:f,post:N,tags:I,ctgs:D,isMobileApplication:P,extra:W,onReach:A,skeleton:E,handleChangePost:R}=e,{asPath:H,push:B}=(0,s.useRouter)(),[F,O]=(0,c.useState)(N.views||0),[G,K]=(0,c.useState)(!1),J=(0,x.M)(A,.5),X=(0,c.useRef)(!W),Y=(0,c.useRef)(!1),{overlayClassName:V,overlayStyles:Z}=(0,j.I)({wrapperRef:J}),Q=(null===(a=N.content)||void 0===a?void 0:null===(t=a.filter(e=>"header"===e.type))||void 0===t?void 0:t.map(e=>{var t;return null===(t=e.data)||void 0===t?void 0:t.text}))||[],q=(0,b.I)((0,k.$)(N.anons||(null===(d=N.content)||void 0===d?void 0:null===(l=d.find(e=>e.type===_.z.Annotation))||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.text)||"")),$=(null===(p=N.content)||void 0===p?void 0:p.filter(e=>!!N.anons||e.type!==_.z.Annotation))||[],ee=null===(v=N.tag_ids)||void 0===v?void 0:v.reduce((e,t)=>{let a=I.find(e=>{let{id:a}=e;return a===t}),i=H.replace("navigator-new/","navigator/"),r=i.includes((null==a?void 0:a.url)||"___");return a&&r&&e.unshift(a),a&&!r&&e.push(a),e},[]),et=(null==ee?void 0:ee[0])||I[0],ea=(()=>{switch(et&&et.url){case"navigator/investirovat":return{pp:"cfbl",ps:"foam",p2:"hpaj"};case"navigator/kredity":return{pp:"cfbj",ps:"foam",p2:"hpaj"};case"navigator/nakopit-i-sohranit":return{pp:"cfek",ps:"foam",p2:"hpaj"};case"navigator/zastrahovat":return{pp:"cfbk",ps:"foam",p2:"hpaj"};default:return{pp:"i",ps:"foam",p2:"hpaj"}}})(),ei=f.NEXT_PUBLIC_BASE_URL;(0,c.useEffect)(()=>{W||E||(Y.current=!0,(0,u.f6)(f,N.url).then(e=>{O((0,w.V)(N.url,e||N.views,1))}))},[]),(0,c.useEffect)(()=>{if(J.current&&!E){let e=J.current,t=()=>{if(!e||!J.current)return;let t=J.current.getBoundingClientRect(),a=t.top+window.scrollY,i=a+J.current.offsetHeight,r=window.scrollY+window.innerHeight/2,n=r>a&&r<i;!n||X.current||Y.current||(Y.current=!0,(0,u.f6)(f,N.url).then(e=>{O((0,w.V)(N.url,e||N.views,1))})),n&&!X.current&&(X.current=!0,R&&R(N),B("/".concat(N.url),void 0,{shallow:!0})),n||(X.current=!1)};return document.addEventListener("scroll",t),()=>{e&&document.removeEventListener("scroll",t)}}},[]);let er=e=>{let{index:t,post:a}=e;(0,y.I)({eventCategory:"".concat((0,L.b)("журнал"),"_").concat(location.pathname),eventActionType:y.i.link,eventActionText:(0,L.b)(a.title),eventLabel:""});let i=document.getElementById("".concat(a.id,"_content_header_").concat(t));i&&(0,C.Q)((0,C.n)(i)-32)},en=!P&&!!Q.length&&0!==N.show_content;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{ref:J,className:(0,o.Z)(U().article,{[U().app]:P,[U().skeleton]:E}),children:[(0,i.jsxs)("div",{className:U().articleContentWrapper,children:[!P&&(0,i.jsxs)("div",{className:U().topInfoWrapper,children:[(0,i.jsx)(S.Yx,{env:f,tag:et}),(0,i.jsxs)("div",{className:U().rightInfo,children:[(0,i.jsxs)("div",{className:U().share,onClick:()=>{(0,y.I)({eventCategory:"".concat((0,L.b)("журнал"),"_").concat(location.pathname),eventActionType:y.i.button,eventActionText:(0,L.b)("поделиться"),eventLabel:""}),K(e=>!e)},children:[(0,i.jsx)(r.IconFdsArrowForwardO,{size:24}),(0,i.jsx)("p",{className:"desktopOnly",children:"Поделиться"})]}),(0,i.jsx)(h.n,{className:(0,o.Z)(U().soc,{[U().show]:G}),title:N.title,url:"/".concat(N.url)})]})]}),(0,i.jsx)("h1",{dangerouslySetInnerHTML:{__html:(0,b.I)(N.title)}}),(0,i.jsx)("div",{className:U().anons,dangerouslySetInnerHTML:{__html:q}}),(0,i.jsx)(M,{post:N,BASE_URL:ei,postViews:F}),!!(null==N?void 0:null===(g=N.image)||void 0===g?void 0:g.file)&&(null==N?void 0:null===(m=N.image)||void 0===m?void 0:m.file)!=="."&&(0,i.jsx)(z.t,{isLazy:!1,srcDesktop:"".concat(ei,"/img/posts/big/").concat(N.image.file),srcMobile:"".concat(ei,"/img/posts/small/").concat(N.image.file),caption:N.cover_title,captionClassName:U().detailImageCaption,className:U().detailImageWrapper}),en&&(0,i.jsxs)("div",{className:U().contentTable,children:[(0,i.jsx)("label",{children:"Содержание статьи"}),(0,i.jsx)("div",{className:U().contentList,children:Q.map((e,t)=>(0,i.jsx)("div",{onClick:()=>er({index:t+1,post:N}),children:e},t))})]}),(0,i.jsx)(T.L,{env:f,data:$,params:ea,post:N,ctgs:D})]}),(0,i.jsx)("div",{className:V,style:{...Z,borderRadius:"20px"}})]})})}},2708:function(e){e.exports={contentTable:"NavigatorDetail_contentTable__KWjgZ",expertName:"NavigatorDetail_expertName__yLbfr",group:"NavigatorDetail_group__vb1OA",popularTitle:"NavigatorDetail_popularTitle__Feft2",popularItemCat:"NavigatorDetail_popularItemCat__traK5",popularItemTitle:"NavigatorDetail_popularItemTitle__L0HFY",article:"NavigatorDetail_article__1H_V4",skeleton:"NavigatorDetail_skeleton__vThIp",anons:"NavigatorDetail_anons__YKy3n",detailImageWrapper:"NavigatorDetail_detailImageWrapper__UWyrX",shine:"NavigatorDetail_shine__gQoSm",page:"NavigatorDetail_page__wU4Bs",content:"NavigatorDetail_content__3OnlR",main:"NavigatorDetail_main__GpWew",articleContentWrapper:"NavigatorDetail_articleContentWrapper__EfqF8",topInfoWrapper:"NavigatorDetail_topInfoWrapper__E1F9k",share:"NavigatorDetail_share__MzvJK",soc:"NavigatorDetail_soc__JTFnl",show:"NavigatorDetail_show__M8HgU",rightInfo:"NavigatorDetail_rightInfo__srdvn",articleBottomCard:"NavigatorDetail_articleBottomCard__xRPhV",catWrapper:"NavigatorDetail_catWrapper__18gpL",cat:"NavigatorDetail_cat__XQbDD",shareButton:"NavigatorDetail_shareButton__rTsxD",detailImageCaption:"NavigatorDetail_detailImageCaption__gkRYA",detailImage:"NavigatorDetail_detailImage__8q77t",detailImageM:"NavigatorDetail_detailImageM__3sJpR",contentList:"NavigatorDetail_contentList__K8JlZ",mobAppAd:"NavigatorDetail_mobAppAd__fihfG",expert:"NavigatorDetail_expert__rpM3K",expertPosition:"NavigatorDetail_expertPosition__AxXGB",shareWrapper:"NavigatorDetail_shareWrapper__weiO3",articleGridWrapper:"NavigatorDetail_articleGridWrapper__tdKxZ",fullInfoLink:"NavigatorDetail_fullInfoLink__2KvDF",popularContentWrapper:"NavigatorDetail_popularContentWrapper__HyLNV",slider:"NavigatorDetail_slider__doGWp",sliderLeftButton:"NavigatorDetail_sliderLeftButton__zcXcA",sliderRightButton:"NavigatorDetail_sliderRightButton__bIRrK",singleItem:"NavigatorDetail_singleItem__tUu90",popularItem:"NavigatorDetail_popularItem__2hyCD",popularItemImage:"NavigatorDetail_popularItemImage__GEEAk",popularItemContent:"NavigatorDetail_popularItemContent__D_aab",popularItemStatUnit:"NavigatorDetail_popularItemStatUnit__uIGqb",popularItemStat:"NavigatorDetail_popularItemStat__cd1qQ",popularItemStatLeft:"NavigatorDetail_popularItemStatLeft__SFtTF",stickySidebar:"NavigatorDetail_stickySidebar__M2MRx",sidebar:"NavigatorDetail_sidebar__4Mv5u"}},9298:function(e){e.exports={wrapper:"PostHeaderInfo_wrapper__iUNGo",info:"PostHeaderInfo_info__9xMwf",unit:"PostHeaderInfo_unit__spJLu",author:"PostHeaderInfo_author__lo1kv",image:"PostHeaderInfo_image__GCbNH",name:"PostHeaderInfo_name__P7sbO",position:"PostHeaderInfo_position__U6cYP",shine:"PostHeaderInfo_shine__FXTGX"}}}]);