(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9446],{9640:(e,t,a)=>{"use strict";a.d(t,{l:()=>r});var n=a(37876),l=a(20988);function r(e){var t;let{value:a,...r}=e,o=(t=a,r.options.find(e=>e.value===t));return(0,n.jsx)(l.l6,{...r,value:o,onChange:e=>{let t=null==e?void 0:e.value;r.onChange(t)}})}},10741:e=>{e.exports={content:"mortgages-filter-content_content__SnZqu",form:"mortgages-filter-content_form__Y3Me4",wrap:"mortgages-filter-content_wrap__ZundD",separator:"mortgages-filter-content_separator__4pj05",sort_title:"mortgages-filter-content_sort_title__4H6Ji",sort_wrap:"mortgages-filter-content_sort_wrap__xUbD8",sort_field:"mortgages-filter-content_sort_field__LwKrM",checkboxField:"mortgages-filter-content_checkboxField__8YkvP",footer:"mortgages-filter-content_footer__2q7g7",submit:"mortgages-filter-content_submit__NEcSP"}},11404:(e,t,a)=>{"use strict";a.d(t,{g:()=>l});var n=a(14232);function l(){let[e,t]=(0,n.useState)(!1);return{visible:e,show:(0,n.useCallback)(()=>t(!0),[]),hide:(0,n.useCallback)(()=>t(!1),[])}}},12341:e=>{e.exports={title:"MortgagesList_title__l06z9",offersListContainer:"MortgagesList_offersListContainer__ZgMuQ",listTitle:"MortgagesList_listTitle__skUIP",container:"MortgagesList_container__cgMaG",listItem:"MortgagesList_listItem__IZLd8"}},12837:(e,t,a)=>{"use strict";a.d(t,{t:()=>o});var n=a(37876),l=a(26685),r=a.n(l);function o(e){let{comment:t,text:a}=e;return void 0!==t&&void 0!==a?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:a}}),(0,n.jsx)("div",{className:r().commentText,dangerouslySetInnerHTML:{__html:t}})]}):void 0!==a?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:a}}):void 0!==t?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t}}):void 0}},14834:e=>{e.exports={listTitle:"styles_listTitle__MeOax",list:"styles_list__bYSPt",card:"styles_card__HXa22",button_more_offers:"styles_button_more_offers__YXOO_"}},15462:(e,t,a)=>{"use strict";a.d(t,{L$:()=>n,ZV:()=>l});let n=(e,t)=>(null==e?void 0:e.includes(t))?e.filter(e=>e!==t):(e||[]).concat([t]),l=e=>r(e.toString().split("").reverse(),3).reverse().map(e=>e.reverse().join("")).join(" "),r=(e,t)=>{let a=[];for(let n=0;n<e.length;++n){let l=Math.floor(n/t);a[l]||(a[l]=[]),a[l].push(e[n])}return a}},16904:e=>{e.exports={wrap:"styles_wrap__d_QXg",content:"styles_content__y9L_W",page_title:"styles_page_title__Y8O0t"}},18315:(e,t,a)=>{"use strict";a.d(t,{a:()=>m});var n=a(37876),l=a(14232),r=a(20988),o=a(3010),s=a(74356),i=a(16416),c=a(32266),u=a(94289),d=a.n(u);let m=(0,l.memo)(e=>{let{isOpen:t,cancelButton:a,submitButton:u,onClose:m,bankName:_,dataPoints:p,offerUpdateData:h,pageUrl:v}=e,g=(0,n.jsxs)("div",{className:d().content,children:[p.map(e=>(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)("h2",{className:d().title,children:e.sectionTitle}),(0,n.jsx)("div",{className:d().list,children:e.body.length?e.body.map((e,t)=>(0,n.jsxs)("div",{className:d().field,children:[(0,n.jsxs)("div",{className:d().titleWrapper,children:[(0,n.jsx)("h3",{className:d().fieldTitle,children:null==e?void 0:e.label}),(null==e?void 0:e.description)&&(0,n.jsx)(c.A,{triggerClassName:d().icon,content:e.description})]}),(0,n.jsx)("div",{className:d().fieldContent,children:null==e?void 0:e.value})]},t)):Array.from({length:6},(e,t)=>(0,n.jsx)(s.E,{className:d().skeletonContent},t))})]},e.sectionTitle)),(0,n.jsx)(i.n,{className:d().actualDate,pageUrl:v,offerDate:h})]}),f=(0,n.jsxs)("div",{className:d().footer,children:[(0,n.jsx)(r.$n,{variant:"secondary",onClick:a.onClick,children:a.title}),(0,n.jsx)(r.$n,{rel:"nofollow",as:"a",href:u.url,onClick:u.onClick,children:u.title})]});return(0,n.jsx)(o.Z,{children:(0,n.jsx)(r.aF,{open:t,onClose:m,footer:{children:f},header:{title:null!=_?_:""},className:d().mobilePopup,size:"l",children:(0,n.jsx)("div",{className:d().container,children:g})})})});m.displayName="OfferInfoModal"},19852:(e,t,a)=>{"use strict";var n=a(14232),l=a(38806),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=l.useSyncExternalStore,s=n.useRef,i=n.useEffect,c=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,a,n,l){var d=s(null);if(null===d.current){var m={hasValue:!1,value:null};d.current=m}else m=d.current;var _=o(e,(d=c(function(){function e(e){if(!i){if(i=!0,o=e,e=n(e),void 0!==l&&m.hasValue){var t=m.value;if(l(t,e))return s=t}return s=e}if(t=s,r(o,e))return t;var a=n(e);return void 0!==l&&l(t,a)?t:(o=e,s=a)}var o,s,i=!1,c=void 0===a?null:a;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,a,n,l]))[0],d[1]);return i(function(){m.hasValue=!0,m.value=_},[_]),u(_),_}},22252:(e,t,a)=>{"use strict";a.d(t,{P:()=>n,s:()=>l});let n=(e,t)=>new Date(e,t+1,0).getDate(),l=e=>isNaN(e.getTime())?"":new Intl.DateTimeFormat("ru-RU",{day:"numeric",month:"long",year:"numeric"}).format(e)},24459:(e,t,a)=>{"use strict";var n=a(14232),l="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,o=n.useEffect,s=n.useLayoutEffect,i=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!l(e,a)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),n=r({inst:{value:a,getSnapshot:t}}),l=n[0].inst,u=n[1];return s(function(){l.value=a,l.getSnapshot=t,c(l)&&u({inst:l})},[e,a,t]),o(function(){return c(l)&&u({inst:l}),e(function(){c(l)&&u({inst:l})})},[e]),i(a),a};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},24523:(e,t,a)=>{"use strict";a.d(t,{O:()=>n});let n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,t=null;return a=>{t&&clearInterval(t),t=setTimeout(a,e)}}},26685:e=>{e.exports={commentText:"offer-terms_commentText__S3vmq"}},27526:e=>{e.exports={logo:"MortgageListItem_logo__jaNvS",placeholderLogo:"MortgageListItem_placeholderLogo__QyaLT"}},27607:e=>{e.exports={row:"styles_row__dHTUh",open:"styles_open__GqvFI",firstRow:"styles_firstRow__is75c",toggle:"styles_toggle__2r_74"}},28502:e=>{e.exports={wrap:"styles_wrap___CLvg",filter_wrapper:"styles_filter_wrapper__5o6ZP",newLayout:"styles_newLayout__xY8R1",products_list_container:"styles_products_list_container__Opwa2",title:"styles_title__sj9KH",titleHide:"styles_titleHide__0VpmN",offers_lists:"styles_offers_lists__sXzjq",placeholder:"styles_placeholder__yy33F",subtitle:"styles_subtitle__jCooy"}},28732:e=>{e.exports={filter:"styles_filter__jrtk3"}},31070:e=>{e.exports={container:"styles_container__SqFUD",utpTags:"styles_utpTags__899sO",content:"styles_content__pxEzH",breadcrumbs:"styles_breadcrumbs__jH8EC",text:"styles_text__0SGL8",title:"styles_title__WaTv0",location:"styles_location__z_oKT",subtitle:"styles_subtitle__oSzuM",moreButton:"styles_moreButton___h8zi",banner:"styles_banner__6_J8S",background:"styles_background__KxgOM",newLayout:"styles_newLayout__iR_wy"}},31443:e=>{e.exports={notFoundWrapper:"CreditsNotFound_notFoundWrapper__QdXvJ",searchIcon:"CreditsNotFound_searchIcon__m8B3S",notFoundText:"CreditsNotFound_notFoundText__vZE_n",changeParamsButton:"CreditsNotFound_changeParamsButton__0_UOj"}},31758:e=>{e.exports={section:"styles_section__C_XdG",title:"styles_title__lnE9N",card:"styles_card__hTNw7",imgWrapper:"styles_imgWrapper__Ue6gi",cardBody:"styles_cardBody__r7l0F",subTitle:"styles_subTitle__ayqhw",cardButton:"styles_cardButton__xJxcm",iconArrow:"styles_iconArrow__q2lrn",sliderContainer:"styles_sliderContainer__ox24U"}},32180:e=>{e.exports={title:"MortgageCalculator_title__4voM_",container:"MortgageCalculator_container__obbIq",collapseArrow:"MortgageCalculator_collapseArrow__hRzZc",collapseArrowOpened:"MortgageCalculator_collapseArrowOpened__I21wK",fieldsContainer:"MortgageCalculator_fieldsContainer__w9LxI",field:"MortgageCalculator_field__oVB4u",fieldRange:"MortgageCalculator_fieldRange__sz28u",collapseContainerWrapper:"MortgageCalculator_collapseContainerWrapper__ghdFY",collapseContainer:"MortgageCalculator_collapseContainer__Q7_hC",fieldWrapper:"MortgageCalculator_fieldWrapper__BjPhj",tooltip:"MortgageCalculator_tooltip__KD02w",typeDescription:"MortgageCalculator_typeDescription__rfz_b",link:"MortgageCalculator_link__dOau3",chips:"MortgageCalculator_chips__MoApk",legend:"MortgageCalculator_legend__MgAJW",chipsForm:"MortgageCalculator_chipsForm__oVkqA",additionalItemsWrapper:"MortgageCalculator_additionalItemsWrapper__Fbp0i",additionalItemsTitle:"MortgageCalculator_additionalItemsTitle__i__HE",additionalItem:"MortgageCalculator_additionalItem__roEmt",divider:"MortgageCalculator_divider__3m4Vm",additionalItemName:"MortgageCalculator_additionalItemName__3Yczj",fieldsWrapper:"MortgageCalculator_fieldsWrapper__AQ_Rz",fieldValue:"MortgageCalculator_fieldValue__ZvdYe",label:"MortgageCalculator_label__k_Jz1",additionalItemCollapsible:"MortgageCalculator_additionalItemCollapsible__gjP85",collapsedContainer:"MortgageCalculator_collapsedContainer__qn0lC",toggle:"MortgageCalculator_toggle__4yNag",toggleInput:"MortgageCalculator_toggleInput__320VY",toggleTrack:"MortgageCalculator_toggleTrack___PN4n",toggleThumb:"MortgageCalculator_toggleThumb__JzFTQ",firstPaymentRangeWrapper:"MortgageCalculator_firstPaymentRangeWrapper__Fp1GW",firstPaymentLabels:"MortgageCalculator_firstPaymentLabels__Uclje",firstPaymentLabel:"MortgageCalculator_firstPaymentLabel__jcOTO"}},34850:(e,t,a)=>{"use strict";a.d(t,{NC:()=>l,cT:()=>n});let n={pp:"h",ps:"foam",p2:"hojk"},l="К сожалению, мы не нашли кредитов с такими параметрами"},35807:e=>{e.exports={experts:"mortgages-offers-page_experts__A4Sbb"}},38806:(e,t,a)=>{"use strict";e.exports=a(24459)},40090:(e,t,a)=>{"use strict";a.d(t,{L:()=>r});var n=a(37876),l=a(20988);function r(e){let{label:t,options:a,values:r,className:o,onChange:s}=e,i=null==r?void 0:r.reduce((e,t)=>{let n=a.find(e=>String(e.value)===String(t));return n&&e.push(n),e},[]);return(0,n.jsx)(l.l6,{className:o,label:t,options:a,value:null!=i?i:void 0,selectedValue:e=>e.length>1?"Выбрано (".concat(e.length,")"):e[0].label,onChange:e=>{s(e?e.map(e=>e.value):void 0)},multiple:!0})}},40431:e=>{e.exports={page:"MortgageDetail_page__sKQYA",breadcrumbs:"MortgageDetail_breadcrumbs__teCQy",faqSection:"MortgageDetail_faqSection__UW6NG",supportSection:"MortgageDetail_supportSection__05Wn6",about:"MortgageDetail_about___qTO0"}},41402:e=>{e.exports={container:"MortgageApplySteps_container__sxW1j"}},42256:e=>{e.exports={container:"fab-button_container__OxsQu",expandableContainer:"fab-button_expandableContainer__DaTzp",expanded:"fab-button_expanded__KfN3z"}},43734:e=>{e.exports={title:"DetailModal_title__byAo_",container:"DetailModal_container__0QySE",content:"DetailModal_content__wNrBy",logo:"DetailModal_logo__Y3Gfm",body:"DetailModal_body__OhBkH",text:"DetailModal_text__bzuql"}},45712:(e,t,a)=>{"use strict";e.exports=a(19852)},46119:(e,t,a)=>{"use strict";a.d(t,{I:()=>l});var n=a(14232);let l=()=>{let[e,t]=(0,n.useState)(!1),[a,l]=(0,n.useState)(!1),r=(0,n.useRef)({x:0,y:0}),o=(0,n.useCallback)(e=>{l(!0),r.current={x:e.screenX,y:e.screenY},r.current&&r.current.x===e.screenX&&r.current.y===e.screenY&&t(!1)},[]);return{isDragged:e,isTouched:a,onMouseDown:o,onMouseMove:(0,n.useCallback)(e=>{r.current&&r.current.x===e.screenX&&r.current.y===e.screenY||(t(!0),r.current={x:e.screenX,y:e.screenY})},[]),resetState:(0,n.useCallback)(()=>{t(!1),l(!1)},[])}}},47245:e=>{e.exports={mobilePopup:"styles_mobilePopup__qG2vn",container:"styles_container__o8xJL",title:"styles_title__u7Vww",content:"styles_content__5LJ6m",buttons:"styles_buttons__VE9L_",contentRow:"styles_contentRow__m3ok_",findConfigBlock:"styles_findConfigBlock__KOllm",footer:"styles_footer__kJQ4n",header:"styles_header__4RRDv",bankName:"styles_bankName__hzrqV",field:"styles_field__R6qky",titleWrapper:"styles_titleWrapper__Y4kn3",icon:"styles_icon__Cfzrb",fieldTitle:"styles_fieldTitle__koHjG",fieldContent:"styles_fieldContent__55SfP",comment:"styles_comment__DgBXq"}},54767:(e,t,a)=>{"use strict";a.d(t,{O:()=>n});let n=e=>{switch(e){case 2:case"2":case"USD":return{shortName:"долл.",unit:"$",name:"долларах",code:"USD",locale:"en",num:2};case 3:case"3":case"EUR":return{shortName:"евро",unit:"€",name:"евро",code:"EUR",locale:"en",num:3};case 4:case"4":case"CNY":return{shortName:"юань",unit:"\xa5",name:"юанях",code:"CNY",locale:"zh-CN",num:4};case 5:case"5":case"CHF":return{shortName:"франк",unit:"₣",name:"франках",code:"CHF",locale:"en",num:5};case 6:case"6":case"GBP":return{shortName:"фунт",unit:"\xa3",name:"фунтах",code:"GBP",locale:"en",num:6};case 7:case"7":case"JPY":return{shortName:"иена",unit:"\xa5",name:"иенах",code:"JPY",locale:"ja-JP",num:7};default:return{shortName:"руб.",unit:"₽",name:"рублях",code:"RUB",locale:"ru",num:1}}}},56685:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n={src:"/kredity/assets/_next/static/media/search.b3dc20e8.svg",height:192,width:212,blurWidth:0,blurHeight:0}},58082:e=>{e.exports={wrap:"styles_wrap__xmlYe",top_row:"styles_top_row__a2v4e",top_row_content:"styles_top_row_content__Y_c8l",top_row_buttons:"styles_top_row_buttons__X2LpS",action_button:"styles_action_button__4LW6f",show_button:"styles_show_button__Z61tW",chips_row:"styles_chips_row__WBMhp",addon:"styles_addon__kq2V5",params_button:"styles_params_button__Em2ZN"}},66451:e=>{e.exports={title:"MortgagesCreditsCatalog_title__3ALPZ",card:"MortgagesCreditsCatalog_card__v_YKX",subTitle:"MortgagesCreditsCatalog_subTitle__JnyUy",container:"MortgagesCreditsCatalog_container__5BmyA",cardsList:"MortgagesCreditsCatalog_cardsList__gHJUT",icon:"MortgagesCreditsCatalog_icon__S5VCn",link:"MortgagesCreditsCatalog_link__Bbro2"}},67129:e=>{e.exports={widget:"yandex-realty_widget__xtPmC"}},72809:(e,t,a)=>{"use strict";a.d(t,{O:()=>d});var n=a(37876),l=a(54587),r=a.n(l),o=a(20988),s=a(56685),i=a(34850),c=a(31443),u=a.n(c);let d=e=>{let{onChangeParams:t}=e;return(0,n.jsxs)("div",{className:u().notFoundWrapper,children:[(0,n.jsx)(r(),{className:u().infoIcon,src:s.A,alt:"?"}),(0,n.jsx)("p",{className:u().notFoundText,children:i.NC}),void 0!==t&&(0,n.jsx)(o.$n,{variant:"secondary",className:u().changeParamsButton,onClick:t,children:"Изменить параметры"})]})}},78131:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n={src:"/kredity/assets/_next/static/media/banner-6.5d66df25.svg",height:230,width:256,blurWidth:0,blurHeight:0}},78240:e=>{e.exports={container:"PaymentScheduleModal_container__WjKOq",withoutTabsContainer:"PaymentScheduleModal_withoutTabsContainer__sL5TF",value:"PaymentScheduleModal_value__hb6Gt",content:"PaymentScheduleModal_content__ccBR7",buttons:"PaymentScheduleModal_buttons__t_rw3",schedulePaymentsWrapper:"PaymentScheduleModal_schedulePaymentsWrapper__vuMsP",tabsContentWrapper:"PaymentScheduleModal_tabsContentWrapper__SBdzq",button:"PaymentScheduleModal_button__XgN14",active:"PaymentScheduleModal_active__ghKAR",tabelsWrapper:"PaymentScheduleModal_tabelsWrapper__Vrtbe",tableSchedule:"PaymentScheduleModal_tableSchedule__9C31o",columnTitles:"PaymentScheduleModal_columnTitles__2Nev8",columnTotalParams:"PaymentScheduleModal_columnTotalParams__noafF",titleYearSchedule:"PaymentScheduleModal_titleYearSchedule__GDqLl",contentSchedule:"PaymentScheduleModal_contentSchedule__D3Ifo",rowTabel:"PaymentScheduleModal_rowTabel__cgkZo",bodyField:"PaymentScheduleModal_bodyField__si6mT",field:"PaymentScheduleModal_field__EmCax",fieldLargeText:"PaymentScheduleModal_fieldLargeText__V8hm7",copyButton:"PaymentScheduleModal_copyButton__Afvcu",socialNetworkSection:"PaymentScheduleModal_socialNetworkSection__tXKRk",socialNetworkTitle:"PaymentScheduleModal_socialNetworkTitle__kutAv",socialButton:"PaymentScheduleModal_socialButton__VLXdF",footer:"PaymentScheduleModal_footer__P_fi8",fullWidth:"PaymentScheduleModal_fullWidth__d7e6Q",yearAccordion:"PaymentScheduleModal_yearAccordion__vT35D",mobileFooter:"PaymentScheduleModal_mobileFooter__A_gys",mobileActionButton:"PaymentScheduleModal_mobileActionButton__0eHGc",paymentSummaryButton:"PaymentScheduleModal_paymentSummaryButton__nUjmZ",expandableSocialMediaButton:"PaymentScheduleModal_expandableSocialMediaButton__d1PP8"}},80020:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/ipoteka/[[...segments]]",function(){return a(95315)}])},86700:e=>{e.exports={faq_container:"styles_faq_container__YZoO_"}},88548:e=>{e.exports={container:"MortgageInfo_container__sbkaS",containerFull:"MortgageInfo_containerFull__7m2O1",containerWithoutCalculator:"MortgageInfo_containerWithoutCalculator__0CoQ_",promo:"MortgageInfo_promo__7syHy",left:"MortgageInfo_left__5QAPk",right:"MortgageInfo_right__nwez0",qrDesc:"MortgageInfo_qrDesc__5dVqL",qrMobile:"MortgageInfo_qrMobile__W15cn",typeDescription:"MortgageInfo_typeDescription__bvIrV",legend:"MortgageInfo_legend__mTeDq",firstPaymentAddonAfter:"MortgageInfo_firstPaymentAddonAfter__bG4Wd"}},91423:e=>{e.exports={wrap:"styles_wrap__6TRS7",icon_button:"styles_icon_button__dK1LA",top_row:"styles_top_row__Uk7QJ",top_row_content:"styles_top_row_content__kk_4z",preposition:"styles_preposition__zJ_qc",top_row_buttons:"styles_top_row_buttons__KXpZP",show_button:"styles_show_button__VDLP9",chips_row:"styles_chips_row__k80AF",chip:"styles_chip__oznHA",mortgage_info:"styles_mortgage_info__jKRJE",bank_info:"styles_bank_info__UeeJT",icon:"styles_icon__Oug2a",groups:"styles_groups__LmVvB",group:"styles_group__5qWoM",title_group:"styles_title_group__lbYNP"}},94289:e=>{e.exports={title:"styles_title__b38Q2",mobilePopup:"styles_mobilePopup__G3e3Z",container:"styles_container__IGo0H",list:"styles_list__eSXKF",content:"styles_content__44gQX",buttons:"styles_buttons__co1FZ",contentRow:"styles_contentRow__VrBta",findConfigBlock:"styles_findConfigBlock__Mv4DU",footer:"styles_footer__hi3PE",field:"styles_field__u00Wg",titleWrapper:"styles_titleWrapper___05yj",icon:"styles_icon__38Wzs",fieldTitle:"styles_fieldTitle__03wac",fieldContent:"styles_fieldContent__OnBG0",comment:"styles_comment__gnX9Y",actualDate:"styles_actualDate__sl9Yc",skeletonContent:"styles_skeletonContent__8znd2"}},95315:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>nd,default:()=>nm});var n,l,r=a(37876),o=a(14232),s=a(74055),i=a(33126);a(62862);var c=a(37397),u=a(30557),d=a(28131),m=a(48230),_=a.n(m),p=a(25972),h=a(20988),v=a(10027),g=a(83188),f=a(87162),y=a(5153),b=a(37105);let x=[{id:1,label:"Условия",name:y.o1.conditions},{id:2,label:"Требования",name:y.o1.requirements},{id:3,label:"Требуемые документы",name:y.o1.requirementsDocs},{id:4,label:"Выдача и погашение",name:y.o1.redemption}],j=b.h.IPOTEKA;var C=a(62728);let A=(0,o.memo)(e=>{var t,a;let{data:n,bank:l,pageUrl:s}=e,{tabsContent:i,tabsList:c}=(e=>{let{data:t}=e,a=(0,o.useMemo)(()=>(0,y.qZ)(t),[t]),n=(0,o.useMemo)(()=>x.filter(e=>a[e.name].some(e=>(0,C.a)(e.value))),[a]);return{tabsContent:a,tabsList:n}})({data:n});return(0,r.jsx)(g.H,{scrollBlockId:f.uB,pageUrl:s,seoText:(null==n?void 0:n.short_description)&&(null==n?void 0:n.short_description.length)>5?null==n?void 0:n.short_description:void 0,title:"Об ипотеке",offerUpdateData:null==n?void 0:n.m_updated_at,bank:{logoMobile:null==l?void 0:l.logo_mob,description:null==l?void 0:l.short_description,url:"/banki/".concat(null==l?void 0:l.url),name:null==l?void 0:l.name,creditRating:null==l?void 0:l.credit_rating,netAssetsPlace:null==l||null==(t=l.ratings)?void 0:t.net_assets_place,netProfitRating:null==l?void 0:l.net_profit_rating},tabsList:c,tabsContent:i,aboutCompanyLabel:"О банке",site:null!=(a=null==l?void 0:l.site.title)?a:void 0})});A.displayName="MortgageAbout";var N=a(26700),k=a(78131),M=a(14873),w=function(e){return e.LEAD="lead",e.MASS="mass",e}({}),T=a(41402),P=a.n(T);let S=e=>{let{url:t,isMobile:a,className:n}=e,l=(0,o.useMemo)(()=>[{id:3,image:k.A,text:"Перейдите на сайт банка,<br /> чтобы оформить заявку",buttonText:"Оформить на сайте банка",link:t},{id:4,image:N.A,text:w.LEAD?"Эту ипотеку нельзя открыть через Финуслуги":"Эту ипотеку сейчас нельзя открыть онлайн на Финуслугах",buttonText:"Выбрать другую ипотеку",link:"/".concat(b.h.IPOTEKA)}],[t]);return(0,r.jsx)("div",{className:P().container,children:(0,r.jsx)(M.N,{className:n,title:"Где оформить ипотеку",pageUrl:b.h.IPOTEKA,id:f.ov,isMobile:a,slides:l})})};var L=a(49995),E=a(54808),I=a(5219),O=a(56420),R=a(52841),F=a(63292),D=a(14082),B=a(53244),W=a(35415),U=a(31257),q=a(89064),K=a(87087),V=a(87057),z=a(79807),H=a(32266),Y=a(32180),Z=a.n(Y);let G=e=>{let{calculator:t,data:a,isMobile:n}=e,[l,s]=(0,o.useState)(!1),[i,c]=(0,o.useState)(()=>!!t.matCapital),u=(0,o.useCallback)(()=>{s(e=>!e)},[]),d=(0,o.useCallback)(()=>{c(!0)},[]),m=(0,o.useCallback)(e=>{e&&((0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.filterCatalog,eventLabel:"Платеж",eventValue:null==e?void 0:e.label}),t.setPaymentType([e]))},[t]),_=(0,o.useMemo)(()=>{let e=t.periodMin===t.periodMax?t.periodMin-1:t.periodMin;return{value:Math.max(e,Math.min(t.period,t.periodMax)),max:t.periodMax,min:e,onChange:a=>{let n=Math.max(e,Math.min(null!=a?a:e,t.periodMax));t.periodMin!==t.periodMax&&t.setPeriod(n)},step:1,ticks:[{label:(0,W.Hb)(t.periodMin),value:t.periodMin},{label:(0,W.Hb)(t.periodMax),value:t.periodMax}],unit:[q.U9.ONE,q.U9.FEW,q.U9.MANY]}},[t]),p=(0,o.useMemo)(()=>({value:Math.max(t.propertyPriceMin,Math.min(t.propertyPrice,t.propertyPriceMax)),max:t.propertyPriceMax,min:t.propertyPriceMin,onChange:e=>{let a=Math.max(t.propertyPriceMin,Math.min(null!=e?e:t.propertyPriceMin,t.propertyPriceMax));t.propertyPriceMin!==t.propertyPriceMax&&t.handleChangePropertyPrice(a)},step:1e5,ticks:[{label:"".concat((0,z.um)(t.propertyPriceMin)," ₽"),value:t.propertyPriceMin},{label:"".concat((0,z.um)(t.propertyPriceMax)," ₽"),value:t.propertyPriceMax}],unit:"₽"}),[t]),v=(0,o.useMemo)(()=>{let e=t.firstPaymentRangeMin,a=Math.max(e,t.firstPaymentMax),n=Math.max(e,Math.min(t.firstPayment,a));return{key:"first-payment-".concat(e,"-").concat(a),value:n,max:a,min:e,onChange:n=>{let l=Math.max(e,Math.min(null!=n?n:e,a));t.handleChangeFirstPayment(l)},step:1e3,unit:"₽"}},[t]),g=(0,o.useMemo)(()=>"".concat((0,z.um)(t.firstPaymentMin)," ₽"),[t.firstPaymentMin]),y=(0,o.useMemo)(()=>"".concat((0,z.um)(Math.max(t.firstPaymentRangeMin,t.firstPaymentMax))," ₽"),[t.firstPaymentRangeMin,t.firstPaymentMax]),x=(0,o.useMemo)(()=>t.paymentTypeOptions.filter(e=>{var a;return e.value===(null==(a=t.paymentType[0])?void 0:a.value)}),[t.paymentTypeOptions,t.paymentType]),j=(0,o.useMemo)(()=>[{id:1,label:(0,W.l5)(t.period)},{id:2,label:"".concat((0,z.ZV)(t.propertyPrice)," ₽")}],[t.propertyPrice,t.period]),C=(0,o.useMemo)(()=>{var e;return(null==a||null==(e=a.rate_corrections)?void 0:e.filter(e=>e.rate).map(e=>({name:e.title,label:e.content,labelPosition:"left",checked:!!t.additionalParams[(0,K.y)(e.title)],onChange:(a,n)=>t.handleChangeAdditionalParams({key:(0,K.y)(e.title),value:n.target.checked&&e.rate||0})})))||[]},[t,a.rate_corrections]);return(0,r.jsx)(D.t,{isMobile:n,title:"Настройки ипотеки",pageUrl:b.h.IPOTEKA,infoLink:{isShow:!n,text:"Подробнее об ипотеке",idScrollBlock:f.uB,offPadding:!0,widthMaxContent:!0},items:[],chips:j,additionalItemsTitle:"Уменьшить ставку",additionalItems:C,isShowChips:n&&!!(null==j?void 0:j.length)&&!l,isExpandSettings:l,onToggleSettings:u,renderCustomItems:()=>{var e;return(0,r.jsxs)("div",{className:Z().fieldsWrapper,children:[(0,r.jsxs)("div",{className:Z().fieldWrapper,children:[(0,r.jsx)("label",{className:Z().label,children:"Стоимость недвижимости"}),(0,r.jsxs)("div",{className:Z().fieldValue,children:[(0,r.jsx)(h.Qr,{...p,className:(0,L.A)(Z().field,Z().fieldRange)}),(0,r.jsx)(H.A,{triggerClassName:Z().tooltip,content:"Впишите сюда стоимость жилья. Если деньги нужны вам не только на покупку недвижимости, но и на другие цели, выберите другой тип кредита"})]})]}),(0,r.jsxs)("div",{className:Z().fieldWrapper,children:[(0,r.jsx)("label",{className:Z().label,children:"Срок погашения"}),(0,r.jsx)(h.Qr,{..._,className:(0,L.A)(Z().field,Z().fieldRange)})]}),(0,r.jsxs)("div",{className:Z().fieldWrapper,children:[(0,r.jsx)("label",{className:Z().label,children:"Первый взнос"}),(0,r.jsxs)("div",{className:Z().firstPaymentRangeWrapper,children:[(0,r.jsx)(h.Qr,{...v,className:(0,L.A)(Z().field,Z().fieldRange)}),(0,r.jsxs)("div",{className:Z().firstPaymentLabels,children:[(0,r.jsx)("span",{className:Z().firstPaymentLabel,children:g}),(0,r.jsx)("span",{className:Z().firstPaymentLabel,children:y})]})]})]}),a.maternal_capital.has>0&&(0,r.jsxs)("div",{className:Z().collapseContainerWrapper,children:[(0,r.jsxs)("div",{className:(0,L.A)(Z().additionalItem,Z().additionalItemCollapsible,!i&&Z().collapsedContainer),children:[(0,r.jsxs)("div",{className:Z().additionalItemName,children:[(0,r.jsx)("span",{children:"Использовать материнский капитал"}),(0,r.jsx)(H.A,{content:"Государство выделяет деньги на поддержку семей с детьми. Эти деньги можно вложить в ипотеку"})]}),(0,r.jsx)(h.lM,{value:i,onChange:e=>c(e),className:Z().toggle})]}),i&&(0,r.jsxs)("div",{className:Z().collapseContainer,children:[(0,r.jsx)("div",{className:Z().fieldWrapper,children:(0,r.jsx)(V.F,{label:"Сумма сертификата",value:t.matCapital,onFocus:d,onChange:t.handleChangeMatCapital})}),(0,r.jsx)("div",{className:Z().fieldWrapper,children:(0,r.jsx)(V.F,{label:"Личные средства",value:t.personalFunds,onChange:t.handleChangePersonalFunds})})]})]}),t.paymentType&&t.paymentTypeOptions.length>1&&(0,r.jsxs)("div",{className:Z().fieldWrapper,children:[(0,r.jsx)("label",{className:Z().label,children:"Тип погашения"}),(0,r.jsx)(h.l6,{options:t.paymentTypeOptions,value:x,onChange:m,className:Z().field}),(0,r.jsx)(B.q,{className:Z().typeDescription,type:null==(e=t.paymentType[0])?void 0:e.value})]})]})}})};var Q=a(47019),J=a(54587),X=a.n(J);let $={src:"/kredity/assets/_next/static/media/chain.2d44409a.svg",height:24,width:24,blurWidth:0,blurHeight:0};var ee=a(86710),et=a(3010),ea=a(81202),en=a(22252),el=a(80010);let er=e=>{let t,a=new Date().getFullYear(),n=new Date().getMonth()+e,l=new Date().getDate(),r=n%12;t=n<=12?n:0===r?12:r;let o=a+(n<=12?0:n%12?Math.floor(n/12):Math.floor(n/12-1)),s=(0,en.P)(o,t);return{date:"".concat(l>s?s:l,".").concat(t<12?"0":"").concat(t,".").concat(o),year:o}},eo=e=>{let{rate:t,periodWithMoth:a,defaultBalanceDebt:n,balanceDebtPrevMonth:l,month:r}=e,o=t/12/100,s=(0,el.r)((1+o)**a,5),i=(0,el.r)(n*o*s/(s-1),1),c=(0,el.r)(l*o,1),u=(0,el.r)(i-c,1),d=(0,el.r)(l-u,1);return{...er(r),paymentPerMoth:i,interestRepayment:c,loanRepayment:u,balanceDebt:d}},es=e=>{let{rate:t,periodWithMoth:a,balanceDebtPrevMonth:n,month:l}=e,r=(0,el.r)(t/12/100*n,1),o=(0,el.r)(n/a,1),s=(0,el.r)(r+o,1),i=(0,el.r)(n-o,1);return{...er(l),paymentPerMoth:s,interestRepayment:r,loanRepayment:o,balanceDebt:i}},ei=(e,t)=>{let a=[];for(let l=1,r=0;l<e.periodWithMoth;l++,r++){var n;a.push(t({...e,balanceDebtPrevMonth:(null==(n=a[r-1])?void 0:n.balanceDebt)||e.defaultBalanceDebt,month:l}))}return a};var ec=a(5552),eu=a(42256),ed=a.n(eu);let em=e=>{let{elementList:t,isExpanded:a,...n}=e;return(0,r.jsxs)("div",{className:ed().container,children:[(0,r.jsx)("div",{className:(0,L.A)(ed().expandableContainer,a&&ed().expanded),children:t.map(e=>e)}),(0,r.jsx)(h.$n,{...n})]})},e_=e=>e.reduce((e,t)=>{let a=e.findIndex(e=>e.year===t.year);return -1===a?e.push({year:t.year,schedule:[t]}):e[a].schedule.push(t),e},[]),ep=[{label:"Дата",key:"date"},{label:"Платеж",key:"paymentPerMoth"},{label:"Проценты",key:"interestRepayment"},{label:"Оплата долга",key:"loanRepayment"},{label:"Остаток долга",key:"balanceDebt"}],eh=["vk","tg","ok"];var ev=a(78240),eg=a.n(ev),ef=a(24945),ey=a(3458),eb=a(76082);let ex=e=>{let{children:t,className:a}=e;return(0,r.jsx)("div",{className:(0,L.A)(eg().field,a),children:t})},ej=e=>{let{isMobile:t,formatedData:a}=e;return(0,r.jsxs)("div",{className:(0,L.A)(eg().columnTotalParams,eg().rowTabel),children:[(0,r.jsx)(ex,{className:eg().fieldLargeText,children:t?"Итоговая выплата":"Итого"}),ep.map(e=>"date"!==e.key&&(0,r.jsxs)(ex,{children:[t&&(0,r.jsx)("span",{children:e.label}),(0,r.jsxs)("span",{children:[" ",(0,el.r)(a[e.key],1).toLocaleString("ru-RU",{useGrouping:!0}).replace(".",","),t&&" ₽"]})]},e.key))]})},eC=(0,o.forwardRef)((e,t)=>{let{data:a,isMobile:n}=e,l=a.reduce((e,t)=>(t.schedule.forEach(t=>{e.balanceDebt+=t.balanceDebt,e.interestRepayment+=t.interestRepayment,e.loanRepayment+=t.loanRepayment,e.paymentPerMoth+=t.paymentPerMoth}),e),{balanceDebt:0,interestRepayment:0,loanRepayment:0,paymentPerMoth:0}),o=e=>{let{it:t,index:a}=e;return(0,r.jsxs)(r.Fragment,{children:[!n&&(0!==a?(0,r.jsx)("h4",{className:eg().titleYearSchedule,children:t.year}):(0,r.jsx)("div",{})),t.schedule.map(e=>(0,r.jsx)("div",{className:(0,L.A)(eg().rowTabel,eg().bodyField),children:ep.map((t,a)=>{let l,o=e[t.key];return l=0===a?o:o.toLocaleString("ru-RU",{useGrouping:!0}).replace(".",","),(0,r.jsxs)(ex,{children:[!!n&&"date"!==t.key&&(0,r.jsx)("span",{children:t.label+(n?"":", ₽")}),(0,r.jsx)("span",{className:eg().value,children:l})]},t.key)})},e.date))]})};return(0,r.jsxs)("div",{className:eg().tableSchedule,children:[!n&&(0,r.jsx)("div",{className:(0,L.A)(eg().columnTitles,eg().rowTabel),children:ep.map(e=>(0,r.jsx)(ex,{children:e.label+("date"===e.key||n?"":", ₽")},e.key))}),(0,r.jsxs)("div",{ref:t,className:eg().contentSchedule,children:[a.map((e,t)=>(0,r.jsx)("div",{className:eg().yearSchedule,children:n?(0,r.jsx)(h.As,{id:"years",title:e.year.toString(),className:eg().yearAccordion,children:(0,r.jsx)(o,{it:e,index:t})}):(0,r.jsx)(o,{it:e,index:t})},e.year)),n&&(0,r.jsx)(ej,{isMobile:n,formatedData:l})]}),!n&&(0,r.jsx)(ej,{isMobile:n,formatedData:l})]})});eC.displayName="ScheduleTable";let eA=(0,o.forwardRef)((e,t)=>{let{isMobile:a,paymentScheduleParametrs:n,payments:l}=e,s=(0,o.useMemo)(()=>a?l:l.length>1?[...l,{label:"Оба платежа",value:"all"}]:l,[l,a]),[i,c]=(0,o.useState)(s[0].value),u=e_(ei(n,eo)),d=e_(ei(n,es)),m=(0,o.useRef)(null),_=(0,o.useRef)(null);return(((e,t)=>(0,o.useLayoutEffect)(()=>{let a=e.current,n=t.current;if(null===a||null===n)throw Error("Dead code branch");let l=e=>{e.target!==a?a.scrollTop=n.scrollTop:n.scrollTop=a.scrollTop};return a.addEventListener("scroll",l),n.addEventListener("scroll",l),()=>{a.removeEventListener("scroll",l),n.removeEventListener("scroll",l)}},[e,t]))(m,_),(0,o.useImperativeHandle)(t,()=>({onScrollToBottomHandle(){let e;null==(e=ea.w.annuity&&m.current?m.current:_.current)||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}}),[]),u&&d)?(0,r.jsxs)("div",{className:eg().schedulePaymentsWrapper,children:[l.length>1&&(0,r.jsx)("div",{className:eg().tabsContentWrapper,children:s.map(e=>(0,r.jsx)(h.$n,{variant:"secondary",size:a?"xs":"s",label:e.label,className:(0,L.A)(eg().button,{[eg().active]:i===e.value}),onClick:()=>c(e.value)},e.label))}),(0,r.jsxs)("div",{className:eg().tabelsWrapper,children:[[ea.w.annuity,"all"].includes(i)&&(0,r.jsx)(eC,{ref:m,data:u,isMobile:a}),[ea.w.differentiated,"all"].includes(i)&&(0,r.jsx)(eC,{ref:_,data:d,isMobile:a})]})]}):null});eA.displayName="PaymentScheduleModalContent";let eN=e=>{let{isMobile:t,url:a}=e,[n,l]=(0,o.useState)(!1),s=async e=>{try{(0,U._)({eventAction:U.y.button,eventActionText:e,eventCategory:j}),await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}catch(e){console.error("Failed to copy uri: ",e)}};return(0,r.jsxs)(h.$n,{variant:"secondary",size:t?"s":"m",className:(0,L.A)(eg().copyButton,t&&eg().mobileActionButton),onClick:()=>s((0,K.y)("Скопировать ссылку")),children:[(0,r.jsx)(X(),{src:$,alt:"Чат",height:"24"}),!t&&(n?"Ссылка скопирована":"Скопировать ссылку")]})},ek=e=>{var t;let a=(0,ec.sw)();(0,o.useEffect)(()=>{var t,a;e.bankName&&(null==(t=e.data)?void 0:t.id)&&e.isOpen&&(0,U._)({eventAction:U.y.popup,eventActionText:null==e?void 0:e.bankName,eventCategory:e.mainPageUrl,eventLabel:null==(a=e.data)?void 0:a.id})},[e.isOpen,e.mainPageUrl,e.bankName,null==(t=e.data)?void 0:t.id]);let n=e=>{let{socialNetwork:t}=e;switch(t){case"vk":return(0,r.jsx)(eb.A,{});case"tg":return(0,r.jsx)(ey.A,{});case"ok":return(0,r.jsx)(ef.A,{});default:return null}},l=t=>{let{socialNetwork:l,className:o}=t;return(0,r.jsx)("button",{onClick:()=>(t=>{var n;let l=e.url;if(a)return void navigator.share({url:l});switch(t){case"vk":let r;r=e.url,l="https://vk.com/share.php?url=".concat(encodeURIComponent(r));break;case"tg":let o;o=e.url,l="https://t.me/share/url?url=".concat(encodeURIComponent(o));break;case"ok":let s;s=e.url,l="https://connect.ok.ru/offer?url=".concat(encodeURIComponent(s))}null==(n=window.open(l,"_blank"))||n.focus(),(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.button,eventActionText:"share",url:l})})(l),className:o,children:(0,r.jsx)(n,{socialNetwork:l})})},s=(0,r.jsxs)("div",{className:eg().footer,children:[(0,r.jsxs)("div",{className:eg().socialNetworkSection,children:[(0,r.jsx)("p",{className:eg().socialNetworkTitle,children:"Поделиться"}),(0,r.jsx)("div",{className:eg().socialNetworkButtonsWrapper,children:eh.map(e=>(0,r.jsx)(l,{socialNetwork:e,className:(0,L.A)(eg().action,eg().socialButton)},e))})]}),(0,r.jsx)(eN,{isMobile:a,url:e.url})]}),i=(0,o.useRef)(null),[c,u]=(0,o.useState)(!1),d=(0,r.jsxs)("div",{className:eg().mobileFooter,children:[(0,r.jsx)(h.$n,{className:eg().paymentSummaryButton,size:"normal",onClick:()=>{var e;return null==(e=i.current)?void 0:e.onScrollToBottomHandle()},children:"Итоговая выплата"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(h.m_,{text:"Ссылка скопирована",children:(0,r.jsx)(r.Fragment,{children:t=>{let{show:n,hide:l}=t;return(0,r.jsx)("button",{onClick:()=>{n(),setTimeout(l,2e3)},children:(0,r.jsx)(eN,{isMobile:a,url:e.url})})}})}),(0,r.jsx)(em,{className:eg().mobileActionButton,variant:"secondary",isExpanded:c,onClick:()=>{u(e=>!e)},elementList:eh.map(e=>(0,r.jsx)(l,{socialNetwork:e,className:eg().expandableSocialMediaButton},e)),children:(0,r.jsx)(X(),{src:ee.A,alt:"Чат",height:"24"})})]})]});return(0,r.jsx)(et.Z,{children:(0,r.jsx)(h.aF,{open:e.isOpen,onClose:e.onClose,footer:{children:a?d:s},header:{title:"График платежей"},children:(0,r.jsx)("div",{className:(0,L.A)(eg().container,e.payments.length<=1&&eg().withoutTabsContainer),children:(0,r.jsx)(eA,{ref:i,paymentScheduleParametrs:e.paymentScheduleParametrs,payments:e.payments,isMobile:a})})})})};var eM=a(89099),ew=a(75464),eT=a(21754),eP=a(53172),eS=a(88548),eL=a.n(eS);let eE="Оформить на сайте банка",eI="Где оформить ипотеку",eO=e=>{let{bank:t,data:a,isMobile:n}=e,l=(0,o.useRef)(null),s=(e=>{var t,a,n;let l=Number(null!=(t=e.period.from)?t:1),r=Number(e.period.to),s=Number(null!=(a=e.amount.from)?a:0),i=Number(null!=(n=e.amount.to)?n:1e8),c=((e,t)=>{let a=[];return e&&a.push({label:"Аннуитетный",value:ea.w.annuity}),t&&a.push({label:"Дифференцированный",value:ea.w.differentiated}),a})(!!e.repayment_procedure.annuity,!!e.repayment_procedure.differentiated),[u,d]=(0,o.useState)(r),[m,_]=(0,o.useState)({}),[p,h]=(0,o.useState)([c[0]]),{loanRateFrom:v,loanRateTo:g}=(0,o.useMemo)(()=>{let t=(m?Object.values(m):[]).reduce((e,t)=>e+t,0);return{loanRateFrom:Number(e.interest_rate.from)-t,loanRateTo:Number(e.interest_rate.to)-t}},[m,e.interest_rate.from,e.interest_rate.to]),{asPath:f}=(0,eM.useRouter)(),y=(0,o.useRef)(),b=s+(0,el.r)(s*e.first_payment.from/(100-e.first_payment.from-1),1),x=Math.min(1e8,i+(0,el.r)(i*e.first_payment.from/(100-e.first_payment.from),1)),j=Math.max(b,x),[C,A]=(0,o.useState)(j),N=(0,o.useCallback)(e=>Math.max(b,Math.min(e,1e8)),[1e8,b]),k=(0,o.useMemo)(()=>(0,el.r)(b/100*(e.first_payment.from-1),1),[e.first_payment.from,b]),M=(0,o.useMemo)(()=>(0,el.r)(x/100*e.first_payment.from,1),[e.first_payment.from,x]),[w,T]=(0,o.useState)(M),P=(0,o.useCallback)(t=>t>i?(0,el.r)(t-i,1):x===t?M:b===t?k:(0,el.r)(t/100*e.first_payment.from,1),[i,e.first_payment.from,M,k,x,b]),S=(0,o.useMemo)(()=>P(C),[P,C]),L=(0,o.useCallback)(t=>b===t?(0,el.r)(b/100*e.first_payment.from,1):(0,el.r)(t-s,1),[s,e.first_payment.from,b]),E=(0,o.useMemo)(()=>L(C),[L,C]),I=(0,o.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C,a=P(t),n=L(t),l=Math.min(Math.max(e,a),n),r=Math.floor((n-k)/1e3),o=Math.min(Math.max(Math.ceil((l-k)/1e3),0),r);return(0,el.r)(k+1e3*o,1)},[L,P,k,C]),O=(0,o.useMemo)(()=>I(w),[w,I]),[R,F]=(0,o.useState)(0),[D,B]=(0,o.useState)(0),W=(0,o.useMemo)(()=>(0,el.r)(O/C*100,1),[O,C]),U=(0,o.useMemo)(()=>(0,el.r)(b===C?C-E:C-O,1),[O,b,E,C]),q=(0,o.useMemo)(()=>"".concat(window.location.href.split("?")[0],"?propertyPrice=").concat((0,el.r)(C,1),"&firstPayment=").concat((0,el.r)(O,1)).concat(R>0?"&matCapital=".concat((0,el.r)(R,1)):"").concat(D>0?"&personalFunds=".concat((0,el.r)(D,1)):"","&period=").concat(u).concat(c.length>1?"&paymentType=".concat(p[0].value):"").concat(Object.keys(m).filter(e=>!!m[e]).length?"&additionalParams=".concat(encodeURIComponent(Object.entries(m).filter(e=>!!e.at(-1)).map(e=>e[0]).join(","))):""),[C,O,R,D,u,c.length,p,m]),V=(0,o.useMemo)(()=>{var t,a;let n=(null==(a=e.rate_corrections_first_payment)||null==(t=a.find(e=>{let t=O/(C/100);return e.rate_from<=t&&t<=e.rate_to}))?void 0:t.rate)||0;return e.interest_rate.from-Object.values(m).reduce((e,t)=>e+=t,0)-n},[e.rate_corrections_first_payment,e.interest_rate.from,m,C,O]),{paymentPerMoth:z}=(0,o.useMemo)(()=>{var e;return((null==(e=p[0])?void 0:e.value)===ea.w.annuity?eo:es)({rate:V,periodWithMoth:u,defaultBalanceDebt:U,balanceDebtPrevMonth:U,month:1})},[V,U,p,u]),{totalOverpayment:H,totalCost:Y}=(0,o.useMemo)(()=>((e,t,a)=>{let n=a*t;return{totalOverpayment:n-e,totalCost:n}})(U,u,z),[z,U,u]),Z=(0,o.useCallback)(e=>{let{key:t,value:a}=e;_(e=>({...e,[t]:a}))},[]),G=(0,o.useCallback)(e=>{let t=N(e),a=E-S,n=a>0?(O-S)/a:0,l=P(t),r=I(l+n*(L(t)-l),t);A(t),T(r),B(r-R)},[L,P,N,O,E,S,R,I]),Q=(0,o.useCallback)(e=>{let t=I(e);T(t),B(t-R)},[R,I]),J=(0,o.useCallback)(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=D+t;if(a>1e8-s)return;F(t);let n=C;a>E&&A(n=Math.min(a+Number(e.amount.from),1e8)),O<S&&A(n=(0,el.r)(D/e.first_payment.from*100,1)),T(I(a,n))},[D,s,E,O,S,e.amount.from,e.first_payment.from,I,C]),X=(0,o.useCallback)(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;y.current&&clearInterval(y.current);let a=(null!=R?R:0)+t;if(a>1e8-s)return;B(t);let n=C;a>E&&A(n=Math.min(a+Number(e.amount.from),1e8)),t<S&&A(n=(0,el.r)((t<k?k:t/e.first_payment.from)*100,1)),T(I(a,n))},[R,s,k,E,S,e.amount.from,e.first_payment.from,I,C]);return(0,o.useEffect)(()=>{var t,a,n,o,s;let i=(0,ew.$)(f,"?"),u=Array.isArray(i.property_price)?i.property_price[0]:i.property_price,m=Array.isArray(i.first_payment)?i.first_payment[0]:i.first_payment,p=Number(Array.isArray(i.period)?i.period[0]:i.period),v=Number(i.matCapital);if(0===v||Number.isNaN(v)||F(v),i.additionalParams&&decodeURI(i.additionalParams.toString()).split("%2C").forEach(t=>{var a;let n=null==(a=e.rate_corrections)?void 0:a.find(e=>(0,K.y)(e.title)===t);n&&null!==n.rate&&_(e=>({...e,[t]:n.rate}))}),void 0!==u){let e=N(Number(u));A(e),T(t=>I(t,e))}if(void 0!==m){let e=void 0!==u?N(Number(u)):C;T(I(Number(m),e))}if(void 0!==i.firstPayment&&(""!==i.firstPayment||(null==(t=i.firstPayment)?void 0:t.length)!==0)){let e=void 0!==i.propertyPrice&&(""!==i.propertyPrice||(null==(s=i.propertyPrice)?void 0:s.length)!==0)?N(Number(i.propertyPrice.toString())):C;T(I(Number(i.firstPayment.toString()),e))}if(void 0!==i.personalFunds&&(""!==i.personalFunds||(null==(a=i.personalFunds)?void 0:a.length)!==0)){let e=Number(i.personalFunds.toString());Number.isNaN(e)||B(e)}if(void 0!==i.propertyPrice&&(""!==i.propertyPrice||(null==(n=i.propertyPrice)?void 0:n.length)!==0)){let e=N(Number(i.propertyPrice.toString()));T(t=>I(t,e)),A(e)}if(void 0!==i.paymentType&&(""!==i.paymentType||(null==(o=i.paymentType)?void 0:o.length)!==0)){let e=c.find(e=>e.value===i.paymentType);void 0!==e&&h([e])}return!Number.isNaN(p)&&p>=l&&p<=r&&d(p),()=>{let e=y.current;e&&clearTimeout(e)}},[]),(0,o.useMemo)(()=>({totalOverpayment:H,totalCost:Y,currectMonthlyPayment:z,firstPaymentPercent:W,calculatorQueryParamsInLink:q,mortgageCredit:U,personalFunds:D,matCapital:null!=R?R:0,currectInterestRate:V,firstPaymentMin:S,firstPaymentRangeMin:k,firstPaymentMax:E,propertyPriceMin:b,propertyPriceMax:1e8,propertyPrice:C,firstPayment:O,period:u,setPeriod:d,periodMin:l,periodMax:r,paymentTypeOptions:c,paymentType:p,setPaymentType:h,additionalParams:m,handleChangePropertyPrice:G,handleChangeAdditionalParams:Z,handleChangePersonalFunds:X,handleChangeMatCapital:J,handleChangeFirstPayment:Q,loanRateFrom:v,loanRateTo:g}),[H,Y,z,W,q,U,D,R,V,S,k,E,b,1e8,C,O,u,l,r,c,p,m,G,Z,X,J,Q,v,g])})(a),i=(0,o.useMemo)(()=>{var e;let t=(null==(e=a.application_term.custom_text)?void 0:e.from)!==void 0?(0,O.v)(a.application_term.custom_text.from):0,n=new Date;n.setDate(n.getDate()+t);let l=n.getDate(),r=n.getMonth()+1,o=n.getFullYear();return"Деньги у вас до ".concat(l," ").concat((0,eT.F)("".concat(r,"-").concat(l,"-").concat(o)))},[a.application_term.custom_text]),c=(0,o.useCallback)(()=>{l.current&&l.current.focus()},[]),d=(0,o.useMemo)(()=>{let e=[],t=a.full_price;t&&e.push({label:"ПСК",value:(0,u.o)(t),description:"ПСК (полная стоимость кредита) — это процентная ставка, отражающая все ваши затраты по кредиту за год. ПСК включает не только проценты, но и сопутствующие платежи.\n          Информация на сайте носит справочный характер. Указанные значения ПСК получены из открытых источников. Актуальная и точная информация будет содержаться в вашем кредитном договоре."},{label:"Процентная ставка",value:(0,z.sP)(s.loanRateFrom,s.loanRateTo)}),e.push({label:"Первый взнос",value:"".concat((0,z.um)((0,el.r)(s.firstPayment,1)),"&#160;₽")},{label:"Платеж в месяц",value:"".concat((0,z.um)(s.currectMonthlyPayment),"&#160;₽")},{label:"Налоговый вычет",value:"".concat((0,z.um)((0,el.r)(((e,t)=>{let a=.13*e;return e<=2e6?a:(a=a>26e4?26e4:a)+(.13*t>39e4?39e4:.13*t)})(s.propertyPrice,s.totalOverpayment),1))," ₽")});let n=s.paymentType;if(n){var l;e.push({label:"Тип погашения",value:(null==(l=n[0])?void 0:l.value)===ea.w.annuity?"Аннуитетный":"Дифференцированный"})}return e.push({label:"Переплата",value:"".concat((0,z.um)(s.totalOverpayment),"&#160;₽"),description:"Это сумма процентов, которые заемщик платит за пользование кредитом. Она может уменьшиться, если гасить кредит досрочно"},{label:"Итоговая выплата",value:"".concat((0,z.um)(s.totalCost),"&#160;₽")}),e},[s.currectMonthlyPayment,s.firstPayment,s.loanRateFrom,s.loanRateTo,s.paymentType,s.propertyPrice,s.totalCost,s.totalOverpayment,a.full_price]),[m,_]=(0,o.useState)(!1),v=(0,o.useCallback)(()=>{_(e=>!e)},[]),g=(0,o.useMemo)(()=>[m,v],[m,v]),y=void 0!==a.amount.from&&void 0!==a.amount.to&&+a.amount.to>+a.amount.from;return(0,r.jsxs)(Q.v.Provider,{value:g,children:[(0,r.jsxs)(p.mc,{className:(0,L.A)(eL().container,eL().containerFull,{[eL().containerWithoutCalculator]:!y}),children:[(e=>{var l;return(0,r.jsx)(R.E,{url:a.url,bank:{logoMob:null==t?void 0:t.logo_mob,url:"/banki/".concat(null==t?void 0:t.url),name:null!=(l=null==t?void 0:t.name)?l:a.bank_name},pageUrl:b.h.IPOTEKA,title:a.title,isSmall:e,isMobile:n,tagTheme:"green",className:eL().promo})})(),y&&(0,r.jsxs)("div",{className:eL().left,children:[(0,r.jsx)(G,{calculator:s,data:a,isMobile:n}),(0,r.jsx)(F.P,{text:"Все для ипотеки: страхуем недвижимость, жизнь, здоровье или все сразу",hideButtons:!0,hideQr:!0,isSmall:!0,className:eL().qrDesc})]}),(0,r.jsxs)("div",{className:(0,L.A)({[eL().right]:y}),children:[(0,r.jsx)(I.r,{captionTitle:i,pageUrl:b.h.IPOTEKA,onEdit:c,amount:s.mortgageCredit,repayment:s.totalOverpayment,disclaimer:"Предварительные условия. Не оферта",tag:a.online_application.commercial_desc,footerActions:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.$n,{as:"a",target:"_blank",className:eL().button,href:a.online_application.url,onClick:()=>{(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.link,eventActionText:eE})},children:eE}),(0,r.jsx)(h.$n,{as:"a",onClick:()=>{(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.button,eventActionText:eI}),(0,eP.e)(f.ov,{offset:n?0:-100,position:"top"})},className:eL().button,variant:"secondary",children:eI}),(0,r.jsx)(E.e,{offPadding:!1,widthMaxContent:!1,text:"График платежей",iconColor:"light",mainPageUrl:b.h.IPOTEKA,className:eL().link,onClick:v})]}),valuesList:d,showChart:!0}),(0,r.jsx)(F.P,{text:"Все для ипотеки: страхуем недвижимость, жизнь, здоровье или все сразу",hideButtons:!0,hideQr:!0,isSmall:!0,className:eL().qrMobile})]})]}),(0,r.jsx)(ek,{data:a,bankName:null==t?void 0:t.name,isOpen:m,paymentScheduleParametrs:{rate:Number(s.currectInterestRate),periodWithMoth:Number(s.period),defaultBalanceDebt:s.mortgageCredit},onClose:v,payments:s.paymentTypeOptions,logo:null==t?void 0:t.logo_mob,url:s.calculatorQueryParamsInLink,mainPageUrl:b.h.IPOTEKA})]})};var eR=a(40419),eF=a(13394),eD=a(16891),eB=a(91063),eW=a(44694),eU=a(27526),eq=a.n(eU);let eK=(0,o.memo)(e=>{let{data:t,className:a,onDetailInfoClick:n,onClick:l}=e,s=[],i=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useRef)(null),d={text:(0,z.ej)({from:t.amountFrom,to:t.amountTo},{currency:t.currency}),caption:"Сумма кредита"},m={text:"от ".concat((0,z.ZV)(t.payment),"%"),caption:"Первый взнос"};s.push({label:"Ипотека",variant:"green"}),s.push({label:t.typeText,variant:"primary"});let _=(0,o.useCallback)(e=>{let[a]=e;1===a.intersectionRatio&&!c.current&&((0,eB.o)({event:"data-event",eventAction:"show_in_catalog",eventCategory:b.h.IPOTEKA,eventLabel:t.id}),c.current=!0,i.current&&u.current&&i.current.unobserve(u.current))},[t.id]);return(0,o.useEffect)(()=>{i.current&&u.current&&i.current.unobserve(u.current),!c.current&&u.current&&(i.current=new IntersectionObserver(_,{root:null,threshold:[1]}),i.current.observe(u.current))},[_]),(0,r.jsx)("div",{ref:u,className:a,onClick:()=>{var e;return e="click_button_".concat((0,K.y)("Подать заявку")),void((0,eB.o)({event:"data-event",eventAction:e,eventCategory:b.h.IPOTEKA,eventLabel:t.id,eventValue:t.eventValue}),null==l||l(t))},children:(0,r.jsx)(eW.M,{icon:t.logo?(0,r.jsx)("div",{className:eq().logo,children:(0,r.jsx)(X(),{width:56,height:56,src:t.logo,alt:"logo"})}):(0,r.jsx)("div",{className:eq().placeholderLogo}),companyName:t.bankName,productName:t.title,productUrl:t.url,buttonUrl:t.url,tags:s,advantageAmountFrom:d,advantageAmountTo:m,onDetailInfoClick:()=>{n(t),(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.button,eventActionText:"open_modal"})},className:eq().plate})})});eK.displayName="MortgageListItem";var eV=a(62576),ez=a(96759);let eH=e=>{var t,a,n,l;let{banks:r,mortgage:o,period:s}=e,i="/".concat(b.h.IPOTEKA,"/").concat(o.url),c=r.find(e=>+o.bank_id==+e.id),u="",d="";return 2===o.online_application.type?u="Открытие в банке":(u="Заявка через сайт банка",d="non_commercial"),{id:o.id,bankName:null!=(a=null==c?void 0:c.name)?a:o.bank_name,bankId:null!=(n=null==c?void 0:c.id)?n:"",logo:null!=(l=null==c?void 0:c.logo_mob)?l:"",title:o.title,url:i,legalName:(e=>{if(e)try{let t=JSON.parse(e);if(Array.isArray(t))return t[0].name;return t.name}catch(t){return e}return""})("string"==typeof(null==c?void 0:c.legal_entities)?JSON.parse(null==c?void 0:c.legal_entities)[0].name:null==c||null==(t=c.legal_entities)?void 0:t[0].name),isPermanentRegistation:1==+o.registration_address.permanent,period:s||+o.period.to,rate:+o.interest_rate.from,rateTo:+o.interest_rate.to,payment:+o.first_payment.from||0,currency:"₽",detailUrl:"/".concat(b.h.IPOTEKA,"/").concat(o.url),typeText:u,eventValue:d,notLoan:1===o.loan.not_required,incomeProof:0===o.income_proof.not_required,amountFrom:Number(o.amount.from),amountTo:Number(o.amount.to)}};var eY=a(92666),eZ=a(12341),eG=a.n(eZ);let eQ=(0,o.memo)(e=>{let{bank:t,banks:a,currentCardId:n,mortgagesList:l,mortgagesFinuslugiList:s,className:c,newContainer:u=!1}=e,{town:d}=(0,eY.z)(),[m,_]=(0,o.useState)(),h=(0,o.useCallback)(()=>{_(void 0)},[]),v=(0,o.useCallback)(e=>{(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.link,eventActionText:e.title,eventLabel:e.id,url:e.url})},[]),g=(0,o.useMemo)(()=>{let e=l.length?l.filter(e=>e.id!==n):[];return(0,ez.q)({productList:e,anotherList:e,count:eV.gx})},[l,n]),f=(0,o.useMemo)(()=>{let e=s||[];return(0,ez.q)({productList:e,anotherList:e,count:eV.a0-g.length})},[g.length,s]),y=(0,o.useMemo)(()=>({bankList:g.map(e=>eH({banks:[t],mortgage:e})),finuslugiList:f.map(e=>eH({banks:a,mortgage:e}))}),[t,a,g,f]),x=(0,o.useCallback)(e=>{if(!e)return;let a=[g,f].reduce((e,t)=>[...e,...t],[]).find(t=>t.id===e.id);if(a)return{...a,site:{title:t.site.title,url:t.site.url},bankName:e.bankName,detailUrl:e.detailUrl,logo:e.logo,url:e.url}},[t.site.title,t.site.url,g,f]),j=(0,o.useCallback)(e=>{_(x(e)),e&&(0,U._)({eventCategory:b.h.IPOTEKA,eventAction:U.y.popup,eventActionText:e.title,eventLabel:e.id})},[x]),C="".concat((0,i.UK)().mainBaseUrl,"/banki/").concat(t.url,"/ipoteka").concat((null==d?void 0:d.url.length)?"/reg_"+d.url:""),A=(0,r.jsx)(r.Fragment,{children:!!y.bankList.length&&(0,r.jsxs)("section",{className:eG().offersListContainer,children:[(0,r.jsxs)("p",{className:eG().listTitle,children:["Ипотека от ",t.name]}),y.bankList.map(e=>(0,r.jsx)(eK,{text:"Подать заявку",className:eG().listItem,data:e,onDetailInfoClick:j,onClick:v},e.url)),(0,r.jsx)(eR.e,{offPadding:!0,text:"Bсе предложения от банка",href:C,target:"_blank",iconColor:"light",mainPageUrl:b.h.IPOTEKA})]})});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("section",{className:(0,L.A)(eG().container,c),children:[(0,r.jsx)("h3",{className:eG().title,children:"Другие предложения"}),u?(0,r.jsx)(p.mc,{children:A}):(0,r.jsx)(eD.J,{children:A})]}),(0,r.jsx)(eF.u,{data:m,isOpen:!!m,onClose:h,mainPageUrl:b.h.IPOTEKA})]})});eQ.displayName="MortgagesList";var eJ=a(36598),eX=a(9837),e$=a(66460),e0=a(6980),e1=a(80490),e2=a(99275),e4=a(40431),e3=a.n(e4);function e8(e){var t;let{offer:a,journal:n,questions:l,description:s,banks:c,refererTag:u,offers:d,offersFinuslugi:m,support:g}=e,f=(0,ec.sw)(),{region:y,town:x}=(0,eY.z)(),j=c.find(e=>+e.id===a.bank_id),C=(null==l?void 0:l.map(e=>({title:e.title,text:e.text.map(e=>e.data.html).join(""),plainText:e.text.map(e=>(0,eJ.NC)(e.data.html)).join("").trim()})))||[],N="Ипотека \xab".concat(a.title,"\xbb от ").concat(null!=(t=null==j?void 0:j.name_r)?t:""),k=(0,o.useMemo)(()=>{var e;let t=(null==x?void 0:x.name_p)||(null==y?void 0:y.name_p)?" в ".concat((null==x?void 0:x.name_p)||(null==y?void 0:y.name_p)):"",n="".concat((null==y?void 0:y.url)?"/reg_".concat(null==y?void 0:y.url):"").concat((null==x?void 0:x.url)?"/".concat(null==x?void 0:x.url):""),l=[{label:"Главная",href:"/"},{label:"Ипотеки".concat(t),href:"/".concat(b.h.IPOTEKA).concat(n)}];return u&&l.push({label:"".concat(u.name).concat(t),href:"/".concat(b.h.IPOTEKA,"/teg_").concat(u.url).concat(n)}),l.push({label:"".concat(null!=(e=null==j?void 0:j.name)?e:a.bank_name," Ипотека ").concat(a.title)}),l},[null==j?void 0:j.name,a.bank_name,a.title,u,null==y?void 0:y.name_p,null==y?void 0:y.url,null==x?void 0:x.name_p,null==x?void 0:x.url]);return(0,r.jsxs)("main",{className:e3().page,children:[(0,r.jsx)(v.I,{productId:String(a.id),title:N,description:s}),(0,r.jsx)(e$.t,{}),(0,r.jsx)(eX.c,{questions:C}),(0,r.jsx)("div",{className:e3().navigationWrapper,children:(0,r.jsx)(p.mc,{children:(0,r.jsx)(h.BI,{className:e3().breadcrumbs,items:k})})}),(0,r.jsx)(eO,{bank:j,data:a,isMobile:f}),(0,r.jsx)(p.mc,{className:e3().about,children:(0,r.jsx)(A,{data:a,bank:j,pageUrl:b.h.IPOTEKA})}),(0,r.jsx)(S,{isMobile:f,url:a.online_application.url}),void 0!==j&&(0,r.jsx)(eQ,{newContainer:!0,bank:j,banks:c,currentCardId:a.id,mortgagesList:d,mortgagesFinuslugiList:m}),(null==n?void 0:n.posts.length)>0&&(0,r.jsx)(p.mc,{children:(0,r.jsx)(e0.C,{posts:null==n?void 0:n.posts,eventCategory:b.h.IPOTEKA})}),(0,r.jsx)("div",{className:e3().supportSection,children:(0,r.jsx)(e1.E,{value:g})}),(0,r.jsx)("div",{className:e3().faqSection,children:(0,r.jsx)(e2.m,{isAllExpanded:!0,newContainer:!0,faqBlockTitle:"",Link:e=>(0,r.jsx)(_(),{...e}),dataLayerPush:eB.o,questions:C,eventCategory:"ipoteki_support_block",href:"".concat((0,i.UK)().mainBaseUrl,"/help"),checkAllText:"Читать все вопросы про ипотеку"})})]})}var e5=a(37071);a(81787);var e6=a(23857);function e7(e){let{layout:t,mortgage:a,journal:n,questions:l,description:o,banks:s,offers:i,offersFinuslugi:c,support:u}=e;return(0,r.jsx)(e6.P,{data:t,children:(0,r.jsx)(e8,{offer:a,journal:n,questions:l,description:o,banks:s,refererTag:null,offers:i,offersFinuslugi:c,support:u})})}a(7455),a(3067);let e9={offers:{list:(e,t,a,n,l,r)=>{let o;return(o="/money_data/Mortgages.json?".concat(Object.entries({...(e=>{var t,a,n,l;let r={};return void 0!==e.amount&&(r.amount=e.amount),void 0!==e.downpayment&&(r.first_payment=e.downpayment),void 0!==e.term&&(r.period=e.term),void 0!==e.property_type&&(r.property_type=e.property_type),void 0!==e.market&&(r.real_estate_market=null!=(t=({first:"primary",second:"secondary"})[e.market])?t:"primary"),void 0!==e.form&&(r.form=null!=(a=({cash:"cash",account:"to_account",third_party_bank_account:"to_custom_account"})[e.form])?a:"to_account"),void 0!==e.proof&&(r.income_proof=e.proof),void 0!==e.provision&&(r.loan=null!=(n=({not_required:"not_required",deposit:"pledge",guarantee:"guarantee",not_required_and_guarantee:"pledge,guarantee"})[e.provision])?n:""),e.banks&&e.banks.length>0&&(r.bank=e.banks.join(",")),void 0!==e.flags&&e.flags.includes("maternal_capital")&&(r.maternal_capital=1),r.sort=null!=(l=void 0!==e.sort?({rate:"rate",payment:"amount",downpayment:"firstPayment"})[e.sort]:void 0)?l:"rate",r.order=e.sortDir,r})(e),limit:t,page:a}).map(e=>{let[t,a]=e;return"".concat(t,"=").concat(encodeURIComponent(a))}).join("&"),"&tag=").concat(n).concat(void 0!==l?"&region=".concat(l).concat(void 0!==r?"&town=".concat(r):""):"","&archive=0"),(0,c.Q)(o).then(e=>{let{data:t,error:a}=e;return a?Promise.reject(a):t})).then(e=>{if(!e)return{title:"",subtitle:"",description:"",page:[],count:0,total_count:0};let{title:t,description:n,subtitle:l,mortgages_count:r,mortgages_total_count:o,mortgages:s,mortgages_online:i}=e;if(void 0!==a&&1!==a&&0===s.length&&0===i.length)throw new d.m_("Invalid mortgages page: ".concat(a));return{title:t,subtitle:l,description:n,page:i.concat(s).map(e=>({...e,full_price:(0,u.j)(e.full_price)})),count:r,total_count:o}})}}};var te=a(50261),tt=a(66451),ta=a.n(tt);let tn=[{id:1,logo:{src:"/kredity/assets/_next/static/media/icon-1.adb0626c.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Займы</span>",value:"potrebitelskie_kredity/teg_bystro",isLink:!0},{id:2,logo:{src:"/kredity/assets/_next/static/media/icon-2.0c7d47df.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Кредит <br> на любые цели</span>",value:"potrebitelskie_kredity?purpose=other",isLink:!0},{id:3,logo:{src:"/kredity/assets/_next/static/media/icon-3.b9b622cd.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Кредит <br> на автомобиль</span>",value:"avtokredity",isLink:!0},{id:4,logo:{src:"/kredity/assets/_next/static/media/icon-4.15a4284d.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Кредит <br> на лечение</span>",value:"potrebitelskie_kredity?purpose=treatment",isLink:!0},{id:5,logo:{src:"/kredity/assets/_next/static/media/icon-5.ee0778ef.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Кредит <br> на учебу</span>",value:"potrebitelskie_kredity?purpose=education",isLink:!0},{id:6,logo:{src:"/kredity/assets/_next/static/media/icon-6.bc466745.svg",height:60,width:158,blurWidth:0,blurHeight:0},title:"<span>Ипотека</span>",value:"mortgages",isLink:!1}],tl=(0,o.memo)(e=>{let{pageUrl:t}=e,{mainBaseUrl:a}=(0,i.UK)(),n=(0,o.useCallback)((e,n)=>{var l;e.stopPropagation();let r=(0,K.y)(null!=(l=n.title)?l:"");(0,eB.o)({event:"data-event",eventAction:n.isLink?"click_link_".concat(r):"click_button_".concat(r),eventCategory:t}),n.isLink?window.open("".concat(a,"/").concat(n.value),"_blank"):window.scrollTo({top:0,behavior:"smooth"})},[a,t]);return(0,r.jsxs)(p.mc,{className:ta().container,children:[(0,r.jsx)("h2",{className:ta().title,children:"Каталог кредитов"}),(0,r.jsx)("div",{className:ta().cardsList,children:tn.map(e=>(0,r.jsxs)("div",{className:ta().card,onClick:t=>n(t,e),children:[(0,r.jsx)(X(),{className:ta().icon,width:158,height:60,alt:"banner-".concat(e.value),src:e.logo}),(0,r.jsx)("p",{className:ta().subTitle,dangerouslySetInnerHTML:{__html:e.title}})]},e.id))})]})}),tr="/ipoteka",to="DEFAULT",ts="reg_",ti="teg_",tc={RATE:"rate",AMOUNT:"amount",DOWNPAYMENT:"downpayment"};tc.RATE,tc.AMOUNT,tc.DOWNPAYMENT;var tu=a(36012),td=a(18258),tm=a(86700),t_=a.n(tm);let tp=e=>{let{posts:t,regions:a,tags:n,questionsData:l,currentTag:o,region:s,town:c,support:u}=e,{query:d}=(0,eM.useRouter)(),m=function(e,t,a,n,l,o){let s=e.map(e=>({title:(0,te.w)(e.title),text:(0,r.jsx)(eJ.eW,{data:(0,te.j)(e).content})}));s.push(...(0,td.N)(b.h.IPOTEKA,a,n,l,o,{nominativeCase:"Ипотека",genitiveCase:"ипотек"}));let i=t.reduce((e,t)=>{if(void 0===t.url_redirect){let a=(0,tu.AP)(t.url,t.name);e.push(a)}return e},[]);return s.push({title:"Виды ипотек",text:(0,r.jsx)(tu.oL,{children:i})}),s}(l,n.reduce((e,t)=>(t.url_redirect||e.push({...t,url:((e,t)=>{let a="teg_".concat(e.url_redirect||e.url);if(!t)return"".concat(a);let n=(Array.isArray(t)?t:[t]).filter(e=>!e.includes(ti));return"".concat([a,...n].join("/"))})(t,d.segments)}),e),[]),a,o,s,c);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:t_().faq_container,children:(0,r.jsx)(e2.m,{isAllExpanded:!0,newContainer:!0,Link:e=>(0,r.jsx)(_(),{...e}),dataLayerPush:eB.o,questions:m,eventCategory:"mortgages_support_block",href:"".concat((0,i.UK)().mainBaseUrl,"/help"),checkAllText:"Читать все вопросы про ипотеку"})}),t.length>0&&(0,r.jsx)(e0.C,{eventCategory:tr,posts:t}),(0,r.jsx)(e1.E,{value:u}),(0,r.jsx)(tl,{pageUrl:tr})]})};var th=a(24523),tv=a(25904),tg=a(20912),tf=a(99542),ty=a.n(tf);function tb(e){let{chips:t,onChipClick:a,lastInFirstRowChipIndex:n,isMobile:l,isFirstRow:o,useLinkChips:s}=e,{asPath:c}=(0,eM.useRouter)(),{mainBaseUrl:u}=(0,i.UK)(),d="".concat(u).concat(c),m=(e,t)=>{let{value:s,label:i,color:c}=e;return(0,r.jsx)("div",{className:(0,L.A)(ty().chip,ty()[c],{[ty().transparentChip]:o&&t>n},{[ty().hiddenChip]:!o&&l&&t<=n}),onClick:()=>a(s),children:i},s)};return(0,r.jsx)(r.Fragment,{children:t.map(s?(e,t)=>{let a=e.value,n=new URL(d);return n.searchParams.delete("property_type"),n.searchParams.append("property_type",e.value),(0,r.jsx)(_(),{className:ty().link,href:n.toString(),onClick:e=>e.preventDefault(),children:m(e,t)},a)}:m)})}var tx=a(27607),tj=a.n(tx);function tC(){return(tC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(null,arguments)}let tA=function(e){return o.createElement("svg",tC({xmlns:"http://www.w3.org/2000/svg",width:12,height:6,fill:"none",viewBox:"0 0 12 6"},e),n||(n=o.createElement("path",{fill:"#fff",d:"M11.663.28a1.25 1.25 0 0 0-.802-.28c-.301 0-.59.1-.803.28l-4.086 3.4-4.03-3.4A1.25 1.25 0 0 0 1.139 0C.84 0 .55.1.337.28a1 1 0 0 0-.25.312.83.83 0 0 0 0 .739 1 1 0 0 0 .25.312l4.826 4.073q.161.136.37.21a1.32 1.32 0 0 0 .876 0 1.2 1.2 0 0 0 .37-.21l4.884-4.073a1 1 0 0 0 .25-.312.83.83 0 0 0 0-.74 1 1 0 0 0-.25-.312"})))},tN=e=>{let{onChipClick:t,chips:a,className:n}=e,[l,s]=(0,o.useState)(!1),i=!(0,tg.K)("sm"),c=l?"Скрыть":"Ещё",[u,d,m,_]=((e,t)=>{let[a,n]=(0,o.useState)(e),[l,r]=(0,o.useState)(e),s=(0,o.useRef)(null),i=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=s.current;if(null===e)throw Error("Dead code branch");let a=new ResizeObserver(e=>{let a=e[0];if(a){let{width:e}=a.contentRect,l=0,o=0,s=Array.from(a.target.children);for(let a=0;a<s.length;a++)if((l+=s[a].offsetWidth+12)<=e&&r(a),l<=(t?2*e:e))o=a;else{n(o);break}}});return a.observe(e),()=>{a.unobserve(e)}},[t,a,l]),[l,a,s,i]})(a.length,i);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{ref:m,className:(0,L.A)(tj().row,n,{[tj().open]:l}),children:[(0,r.jsx)(tb,{chips:a,onChipClick:t,lastInFirstRowChipIndex:u,isMobile:!1,useLinkChips:!0}),d<a.length-1&&(0,r.jsxs)("div",{ref:_,className:(0,L.A)(tj().toggle,{[tj().open]:l}),onClick:()=>{(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)(c)}),s(e=>!e)},children:[(0,r.jsx)(tA,{})," ",c]})]})})};var tk=a(58082),tM=a.n(tk);let tw=e=>{let{count:t,children:a,addon:n,chips:l,header:o,isLoading:s,onChipClick:i,onParamsClick:c,onShowClick:u,useLinkChips:d}=e,m=(0,r.jsx)(tN,{chips:l,onChipClick:i,useLinkChips:d});return(0,r.jsxs)("div",{className:tM().wrap,children:[o,(0,r.jsxs)("div",{className:tM().top_row,children:[(0,r.jsx)("div",{className:tM().top_row_content,children:a}),(0,r.jsxs)("div",{className:tM().top_row_buttons,children:[(0,r.jsx)(h.$n,{variant:"secondary",label:"Все параметры",pending:s,disabled:s,onClick:c,iconLeft:(0,r.jsx)(tv.IconFdsParametersHorizontalO,{}),className:tM().params_button}),(0,r.jsx)(h.$n,{onClick:u,className:tM().show_button,pending:s,disabled:s,label:"Показать".concat(t?" ".concat(t):"")})]}),(0,r.jsx)("div",{className:tM().chips_row,children:m}),n&&(0,r.jsx)("div",{className:tM().addon,children:n})]})]})};tw.displayName="MainFilter";var tT=a(62835),tP=a(40818),tS=a(47052),tL=a(38200),tE=a(67129),tI=a.n(tE);function tO(){return(0,r.jsx)("iframe",{className:tI().widget,src:"https://realty.ya.ru/widgets/back-call-request"})}var tR=a(67347),tF=a(99448),tD=a.n(tF),tB=a(31070),tW=a.n(tB);let tU=e=>{let{currentTag:t,subtitle:a,className:n}=e,{handleToggleModal:l}=(0,s.u)(),c=(0,tS.Y)(),u=(0,ec.sw)(),d=(0,tL.G)(),m=t?t.name:"Ипотека",{region:_,town:v}=(0,eY.z)(),g=(null==v?void 0:v.name_p)||(null==_?void 0:_.name_p),f=g?" в ".concat(g):"",y="".concat(_?"/".concat(ts).concat(_.url):"").concat(v?"/".concat(v.url):""),{mainBaseUrl:b,isYandexRealty:x}=(0,i.UK)(),j=((e,t,a,n,l)=>{let r='{"@type":"ListItem","position":1,"name":"Финуслуги","item":"'.concat(e,'"}'),o='{"@type":"ListItem","position":2,"name":"Ипотека'.concat(n,'","item":"').concat(e,"/\n      ").concat(tr).concat(l,'\n      "}'),s=',{"@type":"ListItem","position":3,"name":"&#128181 '.concat(a).concat(n,'","item":"').concat(e,"/").concat(tr).concat(t?"/".concat(ti).concat(t.url):"").concat(l,'"}'),i=t?s:"";return"{".concat('"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":['.concat(r),",").concat(o).concat(i,"]}")})(b,t,m,f,y),C=(0,o.useCallback)(()=>{(0,U._)({eventAction:U.y.link,eventActionText:(0,K.y)("Главная"),url:b})},[b]),A=(0,o.useCallback)(()=>{l(!0),(0,U._)({eventAction:U.y.popup,eventActionText:"".concat((0,K.y)("регион"),"_").concat(g)})},[g,l]);return(0,r.jsxs)("div",{className:(0,L.A)(n,tD().wrap,"bg-".concat(d)),children:[(0,r.jsx)(p.mc,{children:(0,r.jsxs)("div",{className:(0,L.A)(tD().breadcrumbs),children:[(0,r.jsx)(h.BI,{items:(()=>{let e=[{label:"Главная",href:"/"}];return t&&e.push({label:"Ипотека".concat(f),href:"".concat(tr).concat(y)}),e.push({label:"".concat(m).concat(t?"":f)}),e})(),isMobile:u,onClick:C}),(0,r.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:j}})]})}),x&&(0,r.jsx)(p.mc,{children:(0,r.jsx)(tO,{})}),(0,r.jsx)(p.mc,{children:(0,r.jsxs)("div",{className:tD().content,children:[(0,r.jsxs)("div",{className:tD().text,children:[(0,r.jsxs)("h1",{className:tD().title,children:[m," ",g&&(0,r.jsxs)(r.Fragment,{children:["в"," ",(0,r.jsx)("span",{onClick:A,className:tD().location,children:g})]})]}),(0,r.jsx)(tR.j,{tag:"p",className:tW().subtitle,children:a})]}),(0,r.jsx)("div",{className:tD().banner,children:(0,r.jsx)(tT.L,{config:c,params:tP.ZA})})]})})]})},tq=[{value:"not_required",label:"Не требуется"},{value:"ndfl",label:"Справка 2-НДФЛ"},{value:"bank_form",label:"Справка по форме банка"},{value:"custom_form",label:"Альтернативные формы"}],tK=[{value:"not_required",label:"Не требуется"},{value:"deposit",label:"Залог"},{value:"guarantee",label:"Поручительство"},{value:"not_required_and_guarantee",label:"Залог и поручительство"}],tV=[{value:"cash",label:"Наличными"},{value:"account",label:"На счет"},{value:"third_party_bank_account",label:"На счет в стороннем банке"}],tz=[{value:"flat",label:"Квартира"},{value:"townhouse",label:"Таунхаус"},{value:"vacation_home",label:"Загородный дом или коттедж"},{value:"room",label:"Комната или доля"},{value:"apartment",label:"Апартаменты"},{value:"commerce_estate",label:"Коммерческая недвижимость"},{value:"garage",label:"Гараж"},{value:"other",label:"Другое"}],tH=[{value:"first",label:"Первичный"},{value:"second",label:"Вторичный"}],tY=[{label:"По ставке",value:"rate",shortLabel:"Ставка"},{label:"По взносу",value:"downpayment",shortLabel:"Взнос"},{label:"По платежу",value:"payment",shortLabel:"Платеж"}],tZ=[{label:"Семейная ипотека",value:"family"},{label:"Дальневосточная ипотека",value:"far_east"},{label:"Материнский капитал",value:"maternal_capital"}];var tG=a(67221),tQ=a(11404),tJ=a(3187);function tX(){let{query:e,push:t}=(0,eM.useRouter)(),{amount:a,payment:n,downpayment:l,term:r,property_type:s,market:i,form:c,proof:u,banks:d,provision:m,flags:_,sort:p,sortDir:h,...v}=e,g=(0,o.useMemo)(()=>(function(e){let{amount:t,payment:a,downpayment:n,term:l,property_type:r,market:o,form:s,proof:i,banks:c,provision:u,flags:d,sort:m,sortDir:_}=e,p={};return"string"==typeof t&&(p.amount=Number(t)),"string"==typeof a&&(p.payment=Number(a)),"string"==typeof n&&(p.downpayment=Number(n)),"string"==typeof l&&(p.term=Number(l)),"string"==typeof r&&(p.property_type=r),"string"==typeof o&&(p.market=o),"string"==typeof s&&(p.form=s),"string"==typeof i&&(p.proof=i),"string"==typeof c&&(p.banks=(0,tJ.pi)(c)),"string"==typeof u&&(p.provision=u),"string"==typeof d&&(p.flags=(0,tJ.pi)(d)),"string"==typeof m?p.sort=m:p.sort="rate","string"==typeof _?p.sortDir=_:p.sortDir="asc",p})({amount:a,payment:n,downpayment:l,term:r,property_type:s,market:i,form:c,proof:u,banks:d,provision:m,flags:_,sort:p,sortDir:h}),[a,n,l,r,s,i,c,u,d,m,_,p,h]),f=(0,o.useRef)(v),y=(0,o.useRef)(g),b=(0,o.useRef)(t);return f.current=v,y.current=g,b.current=t,{filter:g,setFilter:(0,o.useCallback)(e=>{var t,a,n,l,r,o,s,i,c,u;if(t=y.current,a=e,t.amount===a.amount&&t.payment===a.payment&&t.downpayment===a.downpayment&&t.term===a.term&&t.property_type===a.property_type&&t.market===a.market&&t.form===a.form&&t.proof===a.proof&&(null==(n=t.banks)?void 0:n.length)===(null==(l=a.banks)?void 0:l.length)&&(null==(r=t.banks)?void 0:r.slice().sort().toString())===(null==(o=a.banks)?void 0:o.slice().sort().toString())&&t.provision===a.provision&&(null==(s=t.flags)?void 0:s.length)===(null==(i=a.flags)?void 0:i.length)&&(null==(c=t.flags)?void 0:c.slice().sort().toString())===(null==(u=a.flags)?void 0:u.slice().sort().toString())&&t.sort===a.sort&&t.sortDir===a.sortDir)return!1;let d={...function(e){let{amount:t,payment:a,downpayment:n,term:l,property_type:r,market:o,form:s,proof:i,banks:c,provision:u,flags:d,sort:m,sortDir:_}=e,p={};return void 0!==t&&(p.amount=String(t)),void 0!==a&&(p.payment=String(a)),void 0!==n&&(p.downpayment=String(n)),void 0!==l&&(p.term=String(l)),void 0!==r&&(p.property_type=r),void 0!==o&&(p.market=o),void 0!==s&&(p.form=s),void 0!==i&&(p.proof=i),void 0!==c&&(p.banks=(0,tJ.t9)(c)),void 0!==u&&(p.provision=u),void 0!==d&&(p.flags=(0,tJ.t9)(d)),void 0!==m&&(p.sort=m),void 0!==_&&(p.sortDir=_),p}(e),...f.current};return b.current({query:d},void 0,{shallow:!0}),!0},[])}}var t$=a(45712);let{useDebugValue:t0}=o,{useSyncExternalStoreWithSelector:t1}=t$,t2=e=>{let t,a=new Set,n=(e,n)=>{let l="function"==typeof e?e(t):e;if(!Object.is(l,t)){let e=t;t=(null!=n?n:"object"!=typeof l||null===l)?l:Object.assign({},t,l),a.forEach(a=>a(t,e))}},l=()=>t,r={setState:n,getState:l,getInitialState:()=>o,subscribe:e=>(a.add(e),()=>a.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),a.clear()}},o=t=e(n,l,r);return r},t4=null,t3=e=>(function(e,t=e=>e,a){let n=t1(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,void 0);return t0(n),n})(t4=null!=t4?t4:(e=>e?t2(e):t2)(t=>{var a,n,l,r,o,s,i,c;return{subtitle:null!=(o=null==(a=e.mortgagesData)?void 0:a.subtitle)?o:"",offers:null!=(s=null==(n=e.mortgagesData)?void 0:n.page)?s:[],loading:!1,count:null!=(i=null==(l=e.mortgagesData)?void 0:l.count)?i:0,total_count:null!=(c=null==(r=e.mortgagesData)?void 0:r.total_count)?c:0,delayTimer:null,reload:async function(e,a,n,l,r){t({loading:!0});let{subtitle:o,page:s,count:i,total_count:c}=await e9.offers.list(e,a,1,r,n,l),u=null==t4?void 0:t4.getState().delayTimer;u&&clearTimeout(u),null==t4||t4.getState().delayUpdate(()=>{t({subtitle:o}),t({offers:s}),t({count:i}),t({total_count:c}),t({loading:!1})})},delayUpdate:function(e){let a=null==t4?void 0:t4.getState().delayTimer;a&&clearTimeout(a),t({delayTimer:setTimeout(e,1e3)})},load:async function(a,n,l,r,o){var s,i;t({loading:!0});let{subtitle:c,page:u,count:d,total_count:m}=await e9.offers.list(a,n,l,null!=(i=null==(s=e.currentTag)?void 0:s.url)?i:to,r,o);null==t4||t4.getState().delayUpdate(()=>{t({subtitle:c}),t(e=>{let{offers:t}=e;return{offers:t.concat(u)}}),t({count:d}),t({total_count:m}),t({loading:!1})})},clear:()=>{t({subtitle:"",offers:[],count:0,total_count:0,loading:!1})}}}));var t8=a(35987),t5=a(87768),t6=a(15462),t7=a(40090),t9=a(9640),ae=a(10741),at=a.n(ae);let aa=e=>{let{filter:t,banksOptions:a,onChange:n}=e;return(0,r.jsxs)("div",{className:at().content,children:[(0,r.jsxs)("div",{className:at().form,children:[(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(V.F,{label:"Сумма кредита",value:t.amount,onChange:e=>{n("amount",void 0!==e&&0!==e?Math.abs(e):void 0,"Сумма")}})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(V.F,{label:"Ежемесячный платеж до",value:t.payment,onChange:e=>{n("payment",void 0!==e&&0!==e?Math.abs(e):void 0,"Ежемесячный платеж до")}})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(V.F,{label:"Первый взнос",value:t.downpayment,onChange:e=>{n("downpayment",void 0!==e&&0!==e?Math.abs(e):void 0,"Первый взнос")}})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(h.YI,{label:"Срок",value:t.term,max:600,decimals:"never",unit:void 0!==t.term?(0,q.UB)(t.term):void 0,onChange:e=>{n("term",void 0!==e&&0!==e?Math.abs(e):void 0,"Срок")},withoutControls:!0})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t9.l,{className:at().select_fix,label:"Вид недвижимости",options:tz,value:t.property_type,onChange:e=>n("property_type",e,"Вид недвижимости")})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t9.l,{className:at().select_fix,label:"Рынок недвижимости",options:tH,value:t.market,onChange:e=>n("market",e,"Рынок недвижимости")})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t9.l,{className:at().select_fix,label:"Форма выдачи",options:tV,value:t.form,onChange:e=>n("form",e,"Форма выдачи")})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t9.l,{className:at().select_fix,label:"Подтверждение дохода",options:tq,value:t.proof,onChange:e=>n("proof",e,"Подтверждение дохода")})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t7.L,{className:at().select_fix,label:"Банки",options:a,values:t.banks,onChange:e=>n("banks",e,"Банки")})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(t9.l,{className:at().select_fix,label:"Обеспечение",options:tK,value:t.provision,onChange:e=>n("provision",e,"Обеспечение")})})]}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsxs)("div",{className:at().sort,children:[(0,r.jsx)("h3",{className:at().sort_title,children:"Дополнительно"}),tZ.map((e,a)=>{var l;return(0,r.jsx)("div",{className:at().fieldWrapper,children:(0,r.jsx)(h.Sc,{className:at().checkboxField,value:null==(l=t.flags)?void 0:l.includes(e.value),label:e.label,onChange:()=>{var a;return n("flags",(0,t6.L$)(null!=(a=t.flags)?a:[],e.value),"Дополнительно")}})},a)})]})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsx)(p.cG,{className:at().separator})}),(0,r.jsx)("div",{className:(0,L.A)(at().wrap),children:(0,r.jsxs)("div",{className:at().sort,children:[(0,r.jsx)("h3",{className:at().sort_title,children:"Сортировка"}),tY.map((e,a)=>(0,r.jsx)("div",{className:at().sort_wrap,children:(0,r.jsx)(h.sx,{name:"radio",value:t.sort,label:e.label,checked:t.sort===e.value,className:at().checkboxField,onChange:()=>n("sort",e.value,"Сортировка")})},a))]})})]})},an=e=>{let{visible:t,filter:a,offersCount:n,banksOptions:l,onHide:o,onChange:s,onDrop:i,onShow:c}=e;return(0,r.jsx)(t5.K,{count:n,isOpen:t,isMobile:!1,pageUrl:b.h.IPOTEKA,title:"Все параметры",onCLickShow:()=>c(),onClose:o,onClickReset:()=>i(),children:(0,r.jsx)(aa,{filter:a,onChange:s,banksOptions:l})})};var al=a(16904),ar=a.n(al);let ao=(0,th.O)(),as=e=>{let{ssr:t}=e,{scrollSmooth:a}=(0,t8.Ll)(),{filter:n,setFilter:l}=tX(),{visible:s,show:i,hide:c}=(0,tQ.g)(),{subtitle:u,count:d}=t3({filter:n,mortgagesData:t.mortgagesData,currentTag:t.currentTag}),m=(0,o.useMemo)(()=>tz.map(e=>{let{value:t,label:a}=e;return{value:t,label:a,color:n.property_type===t?"black":"default"}}),[n.property_type]),_=(0,o.useCallback)(e=>{var t,a;(0,U._)({eventAction:U.y.filterCatalog,eventCategory:U.y.filterCatalog,eventLabel:"property_type",eventValue:(0,K.y)(null!=(a=null==(t=tz.find(t=>t.value===e))?void 0:t.label)?a:"")}),l({...n,property_type:e===n.property_type?"":e})},[n,l]),h=(0,o.useCallback)(()=>l({}),[l]),[v]=(0,tG.e)(()=>(0,e5.C3)().then(e=>null!=e?e:[]),[]),g=(0,o.useMemo)(()=>(null!=v?v:[]).map(e=>({value:e.id,label:e.name})),[v]),y=()=>{(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)("показать")}),a({offset:-90})},b=(0,o.useCallback)(()=>{(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)("все параметры")}),i()},[i]),x=(e,t,a)=>{!function(e,t){ao(()=>(0,U._)({eventAction:U.y.filterCatalog,eventCategory:U.y.filterCatalog,eventLabel:(0,K.y)(e),eventValue:"string"==typeof t?t:JSON.stringify(t)}))}(a,t),l({...n,[e]:t})};return(0,r.jsxs)("div",{className:ar().wrap,children:[(0,r.jsx)(tU,{subtitle:u,currentTag:t.currentTag}),(0,r.jsxs)(p.mc,{id:f.sn,children:[(0,r.jsxs)(tw,{count:d,onChipClick:_,chips:m,onParamsClick:b,onShowClick:y,children:[(0,r.jsx)(V.F,{label:"Сумма кредита",value:n.amount,onChange:e=>{x("amount",void 0!==e&&0!==e?Math.abs(e):void 0,"Сумма")}}),(0,r.jsx)(V.F,{label:"Ежемесячный платеж до",value:n.payment,onChange:e=>{x("payment",void 0!==e&&0!==e?Math.abs(e):void 0,"Ежемесячный платеж до")}})]}),(0,r.jsx)(an,{offersCount:d,visible:s,filter:n,banksOptions:g,onChange:x,onHide:c,onDrop:h,onShow:()=>{c(),y()}})]})]})};var ai=a(74356),ac=a(72809),au=a(60650),ad=a(18315),am=a(12837),a_=a(47245),ap=a.n(a_);let ah=e=>{let{isOpen:t,url:a,data:n,onAllConditionsClick:l,onClose:s}=e,i=(0,o.useMemo)(()=>n?(e=>{let t={sectionTitle:"Условия ипотеки",body:[{label:"Сумма кредита",value:(0,z.jC)(e.amount.from,e.amount.to)}]},a=e.full_price;if(a){let n=e.interest_rate;t.body.push({label:"ПСК",value:(0,u.o)(a),description:"ПСК (полная стоимость кредита) — это процентная ставка, отражающая все ваши затраты по кредиту за год. ПСК включает не только проценты, но и сопутствующие платежи.\n          Информация на сайте носит справочный характер. Указанные значения ПСК получены из открытых источников. Актуальная и точная информация будет содержаться в вашем кредитном договоре."},{label:"Процентная ставка",value:(0,r.jsxs)("div",{children:[(0,z.sP)(Number(n.from),Number(n.to)),n.comment&&(0,r.jsx)("div",{className:ap().comment,dangerouslySetInnerHTML:{__html:n.comment}})]})})}return void 0!==e.first_payment.from&&t.body.push({label:"Минимальный первый взнос",value:"от ".concat(e.first_payment.from,"%")}),(e.loan.not_required||e.loan.comment||e.loan.text)&&t.body.push({label:"Обеспечение",value:e.loan.not_required?"Не требуется":(0,am.t)(e.loan)}),(e.period.from||e.period.to)&&t.body.push({label:"Срок погашения кредита",value:"".concat((0,z.Qd)(Number(e.period.from),Number(e.period.to))," мес.")}),(e.property_type.comment||e.property_type.text)&&t.body.push({label:"Вид недвижимости",value:(0,am.t)(e.property_type)}),(e.real_estate_market.comment||e.real_estate_market.text)&&t.body.push({label:"Рынок недвижимости",value:(0,am.t)(e.real_estate_market)}),(e.insurance.comment||e.insurance.text)&&t.body.push({label:"Страхование",value:(0,am.t)(e.insurance)}),[t,{sectionTitle:"О банке",body:[{label:"Сайт",value:e.site.title}]}]})(n):[],[n]);return void 0===n||void 0===a?null:(0,r.jsx)(ad.a,{isOpen:t,cancelButton:{title:"Все условия по ипотеке",onClick:l},submitButton:{title:"Оформить онлайн",url:a},onClose:s,bankName:n.bankName,dataPoints:i,pageUrl:b.h.IPOTEKA,offerUpdateData:n.m_updated_at})};var av=a(43734),ag=a.n(av);let af="DetailModalText",ay=e=>{var t,a;let{data:n,isMobile:l=!1,onClose:s,mainPageUrl:i,onFlag:c}=e,[u,d]=(0,o.useState)(null),m=null!=(t=null==u?void 0:u.link)?t:"",p=null!=(a=null==m?void 0:m.includes("#"))&&a,v=(0,tJ.vh)(m),g=()=>{if(s(),u&&(0,eB.o)({event:"data-event",eventAction:"click_button_".concat((0,K.y)(u.modalButtonText)),eventCategory:i}),(null==u?void 0:u.filterFlags)&&c&&c(u.filterFlags),p){let e=m.split("#")[1];(0,eP.e)(e,{position:"top"})}m||(0,eP.e)(f.cA,{offset:l?0:-100,position:"top"})};return(0,o.useEffect)(()=>{n&&d(n)},[n]),(0,o.useEffect)(()=>{let e=document.querySelectorAll("#".concat(af," > a")),t=e=>{e.target instanceof HTMLAnchorElement&&(0,U._)({eventAction:U.y.link,eventActionText:e.target.innerText,url:e.target.href})};return e.forEach(e=>{e.addEventListener("click",t)}),()=>{e.forEach(e=>{e.removeEventListener("click",t)})}}),(0,r.jsxs)("div",{className:ag().content,children:[(0,r.jsx)("div",{className:ag().logo,children:(null==u?void 0:u.logo)&&(0,r.jsx)(X(),{width:l?344:494,height:l?128:180,src:null==u?void 0:u.logo,alt:"logo"})}),(0,r.jsxs)("div",{className:ag().body,children:[(0,r.jsx)("h3",{className:ag().title,children:null==u?void 0:u.title}),(0,r.jsx)("p",{id:af,className:ag().text,dangerouslySetInnerHTML:{__html:u?u.modalText:""}})]}),v||p?(0,r.jsx)(h.$n,{as:"a",target:"_blank",href:p?void 0:m,size:"big",onClick:g,children:null==u?void 0:u.modalButtonText}):(0,r.jsx)(_(),{href:m,children:(0,r.jsx)(h.$n,{size:"big",onClick:g,children:null==u?void 0:u.modalButtonText})})]})},ab=e=>{let{data:t,isOpen:a,onClose:n,mainPageUrl:l,onFlag:o}=e,s=(0,ec.sw)();return(0,r.jsx)(et.Z,{children:(0,r.jsx)(h.aF,{open:a,onClose:n,header:{title:""},size:"l",children:(0,r.jsx)("div",{className:ag().container,children:(0,r.jsx)(ay,{data:t,isMobile:s,onClose:n,mainPageUrl:l,onFlag:o})})})})};var ax=a(46119),aj=a(31758),aC=a.n(aj);function aA(){return(aA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(null,arguments)}let aN=function(e){return o.createElement("svg",aA({xmlns:"http://www.w3.org/2000/svg",width:17,height:17,fill:"none",viewBox:"0 0 17 17"},e),l||(l=o.createElement("path",{fill:"#525BBB",stroke:"#525BBB",strokeWidth:.654,d:"M10.498 6.982 4.073 11.48l-.382-.545 6.426-4.499.642-.45-.772-.14-3.06-.553.085-.5 4.793.867-.822 4.793-.5-.09.524-3.06.133-.772z"})))},ak={src:"/kredity/assets/_next/static/media/life-situations-1.a2fc9534.png",height:180,width:494,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAANlBMVEXOsISxuJvSvIjSSUbn3LXYr3/QjW316q/p1Ji+opLZvZaoPEDx7cuxc2fGTU66S1HLaF7r3p+cEv2jAAAACnRSTlP+/////////Pz4xwPQRQAAAAlwSFlzAAALEwAACxMBAJqcGAAAACNJREFUeJxj4GBnYmDlEGRn4OLh5WNmY2RhYGAR4OdmZeAEAAlXALLihgonAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:3},aM={src:"/kredity/assets/_next/static/media/life-situations-2.17787fd4.png",height:180,width:494,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAAM1BMVEWvelPeum9/SjWVQTHNp2fjzIvw14fy45vVwIGvVDy1mnDowHPGfVuCQCivhWGoaUK9jlh/j3KTAAAACnRSTlP9////+P///Pr+jghZTQAAAAlwSFlzAAALEwAACxMBAJqcGAAAACNJREFUeJxj4GBjZWVnZWNn4GLk5+Nh4GZlYBDgZWLmZGQBAAkHAKZDFTImAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:3},aw={src:"/kredity/assets/_next/static/media/life-situations-3.1396f824.png",height:180,width:494,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAAOVBMVEXWxXPMsInKh3PMPiqul1zRwZLd26bt5Jvf7LC5tWna4LDVvnDe1Z/Zx5OhPDm3LS7TsWhwOTXv2qEeoPlIAAAACnRSTlP9/////v///fz45qrS1AAAAAlwSFlzAAALEwAACxMBAJqcGAAAACNJREFUeJxjYGfnYWXl4eBgEOJl5ONn4mJjYOAWYBZkYeAEAAskAMzGoQhaAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:3},aT=(0,o.memo)(e=>{let{mainPageUrl:t,onFlag:a,isMobile:n}=e,[l,s]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),{onMouseDown:d,onMouseMove:m,resetState:_}=(0,ax.I)(),v=(0,o.useMemo)(()=>n?288:348,[n]),g=e=>e.preventDefault,y=(0,o.useCallback)(e=>{u(e),s(!0),(0,U._)({eventAction:U.y.popup,eventActionText:e.title})},[]),b=(0,o.useCallback)(()=>{var e;(0,U._)({eventAction:U.y.popdown,eventActionText:null!=(e=null==c?void 0:c.title)?e:""}),u(null),s(!1)},[null==c?void 0:c.title]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("section",{className:aC().section,id:f.ov,children:(0,r.jsxs)(p.mc,{children:[(0,r.jsx)("h2",{className:aC().title,children:"Как вам помочь?"}),(0,r.jsx)("div",{className:aC().sliderContainer,children:(0,r.jsx)(h.Ap,{options:{slidesPerView:n?1:3,spaceBetween:n?16:32,centeredSlides:n,autoplay:{delay:5e3}},wrapperClass:aC().sliderWrapper,pagination:n,children:(function(){let{mainBaseUrl:e}=(0,i.zj)();return[{id:1,logo:ak,logoMobile:ak,title:"Льготная ипотека",modalText:"Найдем для вас предложения с пониженной ставкой — например, семейную ипотеку или ипотеку для ИТ-специалистов. Выберите льготную программу и подайте заявку на ипотечный кредит на Финуслугах",modalButtonText:"Выбрать ипотеку",link:"#".concat(f.cA),filterFlags:["3"]},{id:2,logo:aM,logoMobile:aM,title:"Рефинансирование кредита",modalText:"Хотите снизить ставку или уменьшить ежемесячный платеж по ипотеке? Покажем банки, в которые вы сможете перевести свой ипотечный кредит и получить более комфортные условия",modalButtonText:"Выбрать ипотеку",link:"/ipoteka/teg_refinansirovanie"},{id:3,logo:aw,logoMobile:aw,title:"Налоговый вычет за ипотеку",modalText:'Если вы работаете официально, государство может вернуть 13% налога. Это 650 000 ₽ — до 260 000 ₽ от стоимости недвижимости и до 390 000 ₽ за проценты по ипотеке. Больше о том, как оформить налоговый вычет — в <a href="'.concat(e,'/glossariy/imushchestvennyj_nalogovyj_vychet_pri_ipoteke" target="_blank" style="color: var(--color-purple-600)">инструкции</a> на Финуслугах'),modalButtonText:"Выбрать ипотеку",link:"#".concat(f.cA)}]})().map(e=>(0,r.jsxs)(h.DQ,{className:aC().card,onMouseDown:d,onMouseMove:m,onMouseLeave:_,onMouseUp:_,onClick:()=>y(e),onTouchStart:g,onTouchMove:g,onTouchEnd:g,children:[(0,r.jsx)("div",{className:aC().imgWrapper,children:(0,r.jsx)(X(),{width:v,height:128,alt:"banner"+e.id,src:n?e.logoMobile:e.logo})}),(0,r.jsxs)("div",{className:aC().cardBody,children:[(0,r.jsx)("p",{className:aC().subTitle,children:e.title}),(0,r.jsx)(h.$n,{shape:"circle-icon",className:aC().cardButton,iconLeft:(0,r.jsx)(aN,{className:aC().iconArrow})})]})]},e.id))})})]})}),(0,r.jsx)(ab,{mainPageUrl:t,data:c,isOpen:l,onClose:b,onFlag:a})]})});var aP=a(54767),aS=a(72278),aL=a(91423),aE=a.n(aL);let aI=e=>{let{icon:t,offer:a,onDetails:n,isMobile:l}=e,s=(0,o.useMemo)(()=>{let e=[],t=a.full_price;return t&&e.push({caption:"ПСК",tooltipText:"ПСК (полная стоимость кредита) — это процентная ставка, отражающая все ваши затраты по кредиту за год. ПСК включает не только проценты, но и сопутствующие платежи.\n        Информация на сайте носит справочный характер. Указанные значения ПСК получены из открытых источников. Актуальная и точная информация будет содержаться в вашем кредитном договоре.",text:(0,u.o)(t)}),e.push({caption:"Сумма",text:(0,z.ej)({from:Number(a.amount.from),to:Number(a.amount.to)},{currency:(0,aP.O)(a.currency_id).unit})},{caption:"Первый взнос",text:a.first_payment?"от ".concat(a.first_payment.from,"%"):""}),e},[a.full_price,a.amount.from,a.amount.to,a.currency_id,a.first_payment]);return(0,r.jsxs)("div",{className:aE().mortgage_info,children:[(0,r.jsxs)("div",{className:aE().bank_info,children:[(0,r.jsx)("div",{className:aE().icon,children:t}),(0,r.jsx)(aS.U,{caption:a.title,text:a.bank_name,className:(0,L.A)(aE().group,aE().title_group)}),l&&(0,r.jsx)("div",{className:aE().icon_button,onClick:n,children:(0,r.jsx)(tv.IconFdsInfoCircleO,{})})]}),(0,r.jsx)("div",{className:aE().groups,children:s.map((e,t)=>e.text&&(0,r.jsx)(aS.U,{caption:e.caption,text:e.text,tooltipText:e.tooltipText,className:aE().group},t))})]})},aO=e=>{let{className:t,icon:a,offer:n,onDetails:l,onOpen:s,isMobile:i}=e,c=(0,o.useMemo)(()=>(e=>{let t=[];return 3===e.online_application.type?t.push({label:"Открытие онлайн на Финуслугах",variant:"purple"}):1===e.online_application.commercial?t.push({label:"Подача заявки на сайте банка",variant:"primary"}):t.push({label:"Открытие в банке",variant:"primary"}),t.push({label:1===e.income_proof.not_required?"Без справок":"Требуется подтверждение дохода",variant:"primary"}),t})(n),[n]),u=(0,o.useCallback)(e=>{e.stopPropagation(),null==l||l()},[l]),d=(0,r.jsx)("div",{className:aE().chips_row,children:c.map(e=>(0,r.jsx)("div",{children:(0,r.jsx)(h.vw,{label:e.label,variant:e.variant,className:aE().chip,rounded:!0})},e.label))});return(0,r.jsxs)("div",{className:(0,L.A)(t,aE().wrap),onClick:s,children:[(0,r.jsxs)("div",{className:aE().top_row,children:[(0,r.jsx)("div",{className:aE().top_row_content,children:(0,r.jsx)(aI,{icon:a,offer:n,onDetails:u,isMobile:i})}),(0,r.jsxs)("div",{className:aE().top_row_buttons,children:[!i&&(0,r.jsx)("div",{className:aE().icon_button,onClick:u,children:(0,r.jsx)(tv.IconFdsInfoCircleO,{})}),i&&d,(0,r.jsx)(h.$n,{className:aE().show_button,size:"xs",label:"Оформить"})]})]}),!i&&d]})};var aR=a(14834),aF=a.n(aR);let aD=e=>{let{className:t,title:a,offers:n,onDetails:l,onOpen:s,isMobile:i}=e,c=(0,o.useCallback)(e=>{(0,U._)({eventAction:U.y.button,eventActionText:"information_".concat(e.bank_url),eventLabel:e.id}),(0,U._)({eventAction:U.y.popup,eventActionText:"information_".concat(e.bank_url),eventLabel:e.id}),l(e.id)},[l]),u=(0,o.useCallback)(e=>{(0,U._)({eventAction:U.y.link,eventActionText:(0,K.y)(e.title),url:"".concat(tr,"/").concat(e.bank_url)}),s(e)},[s]);return(0,r.jsxs)("div",{className:t,children:[(0,r.jsx)("p",{className:aF().listTitle,children:a}),(0,r.jsx)("div",{className:aF().list,children:n.map(e=>(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(aO,{onDetails:()=>c(e),onOpen:()=>u(e),className:aF().card,icon:(0,r.jsx)(X(),{width:40,height:40,src:e.bank_logo_mob,alt:"logo"}),offer:e,isMobile:i})},e.id))})]})};var aB=a(88508),aW=a(28732),aU=a.n(aW);let aq=(0,o.memo)(e=>{let{chips:t,sort:a,sortOrder:n,onChangeSort:l,onChangeSortOrder:o,sortOptions:s,onClick:i,inView:c,filterRef:u,className:d,onClickChip:m}=e,_=(0,tg.K)("xs");return(0,r.jsx)("div",{ref:u,className:aU().filter,children:(0,r.jsx)(aB.x,{className:d,isNewSortRadios:!0,chips:t,isIncreaseSort:"asc"===n,onChangeIncreaseSort:e=>{let t=e?"asc":"desc";o(t),(0,U._)({eventAction:U.y.button,eventActionText:"sort_direction_".concat(t)})},sortTypeItems:s,sortTypeValue:null!=a?a:tc.RATE,onChangeSortType:e=>{var t;l(e),(0,U._)({eventAction:U.y.button,eventActionText:"sort_type_".concat(null==(t=tY.find(t=>t.value===e))?void 0:t.label)})},onClickParams:i,isMobile:!_,isFixed:c,onClickChip:m})})});aq.displayName="SmallFilter";var aK=a(8868),aV=a(41329),az=a(54926),aH=a(27964),aY=a(27116);let aZ=(0,o.memo)(e=>{let t=function(e){let{name:t,description:a,offers:n,offersCount:l,url:r}=e,{mainBaseUrl:o}=(0,i.UK)();if(0===n.length)return;let s=(0,aV.l)({url:"".concat(o).concat(tr).concat(r),priceCurrency:"RUB",offers:n,getLowPrice:e=>{let{amount:t}=e;return void 0!==t.from&&""!==t.from?Number(t.from):1e4},getHighPrice:e=>{let{amount:t}=e;return void 0!==t.to&&""!==t.to?Number(t.to):void 0},offerCount:l});return(0,aH.Z)({name:t,description:a,image:"".concat(o).concat(aK.au),offers:s,aggregateRating:(0,az.E)({ratingValue:4.7,reviewCount:1645,bestRating:5,worstRating:1})})}(e);return void 0===t?null:(0,r.jsx)(aY.S,{schema:t})});aZ.displayName="MortgageOffersSchema";var aG=a(5435),aQ=a(95018),aJ=a(28502),aX=a.n(aJ);let a$=e=>3===e.online_application.type,a0=e=>1===e.online_application.commercial,a1=e=>!a$(e)&&!a0(e),a2=e=>{var t,a,n,l;let{ssr:s}=e,i=(0,t8.yX)(),{query:c}=(0,eM.useRouter)(),[u,d]=(0,o.useState)(Number(c.page)||1),{filter:m,setFilter:_}=tX(),{show:h}=(0,tQ.g)(),v=(0,ec.sw)(),[g,y]=(0,o.useState)(!1),b=(0,o.useRef)(null),x=(0,o.useRef)(()=>null),{offers:j,loading:C,reload:A,load:N,clear:k,count:M,total_count:w}=t3({...s,filter:m}),T=null!=(n=null==(t=s.currentTag)?void 0:t.url)?n:to,{region:P,town:S}=(0,eY.z)(),E=(0,o.useRef)(!0);(0,o.useEffect)(()=>{E.current?E.current=!1:A(m,10,null==P?void 0:P.url,null==S?void 0:S.url,T)},[m,null==P?void 0:P.url,null==S?void 0:S.url,T,A]);let I=(0,o.useRef)(!0);(0,tG.s)(()=>{I.current?I.current=!1:(k(),N(m,10,u,null==P?void 0:P.url,null==S?void 0:S.url))},[m],500);let O=(0,o.useCallback)(()=>{d(e=>{let t=e+1;return N(m,10,t,null==P?void 0:P.url,null==S?void 0:S.url),(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)("показать еще предложения")}),t})},[N,m,null==P?void 0:P.url,null==S?void 0:S.url]),R=(e=>[{label:"Сумма кредита: ".concat(e.amount?(0,t6.ZV)(e.amount):"от 1"," ₽"),id:"amount"},{label:"Платеж: ".concat(e.payment?"до ".concat((0,t6.ZV)(e.payment)," ₽ в мес"):"любой"),id:"payment"},{label:"Срок: ".concat(e.term?"".concat(String(e.term)," мес."):"любой"),id:"term"},{label:"Банки: ".concat(e.banks?String(e.banks.length):"любые"),id:"banks"}])(m),F=(0,o.useMemo)(()=>j.filter(a$),[j]),D=(0,o.useMemo)(()=>j.filter(a0),[j]),B=(0,o.useMemo)(()=>j.filter(a1),[j]),W=s.currentTag?s.currentTag.name:"Ипотека",q=(null==S?void 0:S.name_p)||(null==P?void 0:P.name_p),V=[...F,...D,...B],z="".concat((null==(a=s.currentTag)?void 0:a.url)?"/".concat(ti).concat(s.currentTag.url):"").concat(P?"/".concat(ts).concat(P.url):"").concat(S?"/".concat(S.url):""),H=function(e){let[t,a]=(0,o.useState)(),n=(0,o.useMemo)(()=>{var a;return null!=(a=e.find(e=>e.id===t))?a:null},[t,e]),l=(0,o.useCallback)(()=>a(void 0),[]);return{data:n,visible:null!==t,show:a,hide:l}}(j),Y=(0,o.useMemo)(()=>{var e,t,a,n;if(!H.data)return;let l=s.banks.find(e=>{var t;return(null==(t=H.data)?void 0:t.bank_id)===+e.id});return{...H.data,site:{title:null!=(e=null==l?void 0:l.site.title)?e:null,url:null!=(t=null==l?void 0:l.site.url)?t:null},bankName:null!=(a=null==l?void 0:l.name)?a:H.data.bank_name,logo:null!=(n=null==l?void 0:l.logo_mob)?n:""}},[H.data,s.banks]),Z=(0,o.useCallback)(()=>{(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)("все параметры")}),h()},[h]),G=e=>1===e.online_application.commercial?e.online_application.url:"".concat(tr,"/").concat(e.url),Q=(0,o.useCallback)(e=>{window.open(G(e))},[]),J=(0,o.useCallback)(()=>{var e,t;(0,U._)({eventAction:U.y.popdown,eventActionText:"information_".concat(null==(e=H.data)?void 0:e.bank_name),eventLabel:null==(t=H.data)?void 0:t.id}),H.hide()},[H]),X=(0,o.useCallback)(()=>{var e,t;(0,U._)({eventAction:U.y.button,eventActionText:(0,K.y)("Все условия по ипотеке"),eventLabel:null==(e=H.data)?void 0:e.id}),(null==H||null==(t=H.data)?void 0:t.url)&&window.open("".concat(tr,"/").concat(H.data.url),"_blank")},[H]),$=H.data?G(H.data):void 0;(0,o.useEffect)(()=>(window.removeEventListener("scroll",x.current),x.current=()=>{if(!b.current)return;let{top:e}=b.current.getBoundingClientRect();y(e<=32)},window.addEventListener("scroll",x.current),()=>window.removeEventListener("scroll",x.current)),[]);let ee=(0,o.useCallback)(e=>{_({...m,sort:e})},[m,_]),et=(0,o.useCallback)(e=>{_({...m,sortDir:e})},[m,_]),ea=10*u<M;return(0,r.jsxs)("div",{className:aX().wrap,children:[(0,r.jsx)(aT,{mainPageUrl:"#",onFlag:e=>{_({...m,flags:e})},isMobile:v}),(0,r.jsxs)("div",{id:f.cA,className:aX().products_list_container,children:[j&&(0,r.jsxs)("h2",{className:aX().title,children:["Найдено ",M," ",(0,r.jsx)("span",{className:aX().titleHide,children:(0,au.v)(M)})," ",M===w?"":"из ".concat(w)]}),(0,r.jsx)("div",{className:(0,L.A)(aX().filter_wrapper,aX().newLayout),children:(0,r.jsx)(aq,{chips:R,sort:m.sort||tc.RATE,sortOrder:m.sortDir||"asc",onChangeSort:ee,onChangeSortOrder:et,sortOptions:tY,onClick:Z,filterRef:b,inView:g,onClickChip:()=>{h()}})}),!C&&0===M&&(0,r.jsx)(p.mc,{children:(0,r.jsx)(ac.O,{onChangeParams:h})}),(0,r.jsxs)(p.mc,{as:"section",children:[(0,r.jsx)("div",{ref:i,children:j.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:aX().offers_lists,children:[F.length>0&&(0,r.jsx)(aD,{onOpen:Q,onDetails:H.show,title:"Онлайн-ипотеки от Финуслуг",offers:F,isMobile:v}),D.length>0&&(0,r.jsx)(aD,{onOpen:Q,onDetails:H.show,title:"Предложения на Финуслугах",offers:D,isMobile:v}),B.length>0&&(0,r.jsx)(aD,{onOpen:Q,onDetails:H.show,title:"Предложения рынка кредитов",offers:B,isMobile:v})]}),(0,r.jsx)(aZ,{name:"".concat(W).concat(q?" в ".concat(q):""),description:null!=(l=s.mortgagesData.description)?l:"",offers:V,offersCount:M,url:z}),ea&&(0,r.jsx)(aQ.e,{page:u,onClick:O})]})}),C&&(0,r.jsx)("div",{className:aX().placeholder,children:[,,,,,].fill(0).map((e,t)=>(0,r.jsx)(ai.E,{},t))}),(0,r.jsx)(aG.h,{tag:"p",className:aX().subtitle,children:s.mortgagesData.subtitle})]}),(0,r.jsx)(ah,{data:Y,isOpen:H.visible,url:$,onClose:J,onAllConditionsClick:X})]})]})};var a4=a(3633),a3=a(48673),a8=a(12771),a5=a(73584);async function a6(e){let t=await (0,a8.zy)("Mortgages.json?".concat("url","=").concat(encodeURIComponent(e)));if(1!==t.length)throw new d.m_("Mortgages tag not found: ".concat(e));return function(e){let{url:t,name:a}=e;return{name:a,url:t}}(t[0])}new a5.AP(a6);var a7=a(23517),a9=a(2510);async function ne(){return(await (0,a8.zy)("Mortgages.json?tags&short=1")).mortgage_tags.reduce((e,t)=>(t.name!==a9.Z2&&e.set(t.url,function(e){let{name:t,url:a,url_redirect:n}=e,l={name:t,url:a},r=(0,a7.Y)(n);return void 0!==r&&(l.url_redirect=r),l}(t)),e),new Map)}new a5.B4(ne);var nt=a(24323);a(46215);var na=a(162),nn=a(64998);a(99514);var nl=a(79790);a(44860);var nr=a(35807),no=a.n(nr);let ns=[(0,r.jsx)(o.Fragment,{children:"Используйте фильтры для указания желаемых параметров: суммы, срока и формы выдачи"},0),(0,r.jsx)(o.Fragment,{children:"Изучите и выберите подходящее предложение"},1),(0,r.jsx)(o.Fragment,{children:"Перейдите к оформлению"},2),(0,r.jsx)(o.Fragment,{children:"Заполните анкету, дождитесь одобрения и получите деньги любым удобным для вас способом"},3)];function ni(e){var t,a,n,l;let{layout:s,regions:i,tags:c,tag:u,mortgagesData:d,posts:m,questionsData:_,banks:p,expertQuote:h,experts:g,support:f}=e,{region:y,town:b}=(0,eY.z)(),[x,j]=(0,o.useState)(null!=h?h:void 0),C=null!=g?g:void 0,{asPath:A}=(0,eM.useRouter)(),N=null!=(a=null==(t=A.split("/").find(e=>e.includes("teg_")))?void 0:t.slice(4))?a:"DEFAULT",k=null!=(n=c.find(e=>e.url===N))?n:void 0,M=(0,tJ.m)(A);return(0,a3.w5)(()=>{(0,na.Zs)(M).then(j)},[M]),(0,r.jsxs)(e6.P,{data:s,children:[(0,r.jsx)(v.I,{title:d.title,description:d.description}),(0,r.jsx)(e$.t,{}),(0,r.jsx)(as,{ssr:{mortgagesData:d,currentRegion:null!=(l=null==y?void 0:y.url)?l:"",currentTag:k}}),(0,r.jsx)(a2,{ssr:{mortgagesData:d,currentTag:k,banks:p}}),(0,r.jsx)(a4.f,{type:"bank"}),(0,r.jsx)(nt.I,{steps:ns,variant:"secondary"}),void 0!==x&&(0,r.jsx)(nn.V,{quote:x}),void 0!==C&&(0,r.jsx)("section",{className:no().experts,children:(0,r.jsx)(eD.J,{children:(0,r.jsx)(nl.o,{heading:"Ипотека",experts:C})})}),(0,r.jsx)(tp,{currentTag:u,region:y,town:b,posts:m,questionsData:_,regions:i,tags:c?c.filter(e=>e.url!==N):[],support:f})]})}var nc=a(48523),nu=a(36612),nd=!0;let nm=(0,o.memo)(function(e){var t,a;let{mainApiUrl:n}=(0,i.UK)();return(0,r.jsx)(s.C,{showcaseUrl:n,children:e.isShowcase?(0,r.jsx)(nc.N,{region:null!=(t=e.region)?t:void 0,town:null!=(a=e.town)?a:void 0,children:(0,r.jsx)(ni,{...e})}):(0,r.jsx)(nu.K,{children:(0,r.jsx)(e7,{...e})})})})},99448:e=>{e.exports={wrap:"styles_wrap__urJsb",content:"styles_content__gWWJg",text:"styles_text__bvQ2U",breadcrumbs:"styles_breadcrumbs__sV21c",title:"styles_title__pRY_s",location:"styles_location__Lr8si",subtitle:"styles_subtitle__rpqbj",moreButton:"styles_moreButton__YLOZP",banner:"styles_banner__H82c_"}},99542:e=>{e.exports={link:"styles_link__XzCzB",chip:"styles_chip__bgIDt",black:"styles_black__aacN4",transparentChip:"styles_transparentChip__4ZT35",hiddenChip:"styles_hiddenChip__COVhQ"}}},e=>{e.O(0,[7492,2224,8325,7404,4587,4981,5695,822,8231,5189,1653,167,9581,222,3795,636,6593,8792],()=>e(e.s=80020)),_N_E=e.O()}]);