(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[408],{5185:function(e,t,a){Promise.resolve().then(a.bind(a,9006)),Promise.resolve().then(a.bind(a,9994)),Promise.resolve().then(a.bind(a,4370)),Promise.resolve().then(a.bind(a,589)),Promise.resolve().then(a.bind(a,9195)),Promise.resolve().then(a.bind(a,965)),Promise.resolve().then(a.bind(a,2217))},4370:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return S}});var n=a(7437),r=a(296),o=a(28),i=a(2265),c=a(2833),l=a(1810),s=a(3167),u=a(7816),d=a(6094),h=a(3919);let p=(0,h.g)("check-all","sc"),y=Object.freeze({wrapper:`${p}__wrapper`,link:`${p}__link`,icon:`${p}__icon`,iconGray:`${p}__icon--gray`}),m=({children:e,className:t,linkClassName:a,iconGrayBackground:r,Link:o,event:i,href:c,dataLayerPush:u})=>{let h=o??l.rU;return(0,n.jsx)("div",{className:(0,s.Z)(y.wrapper,t),onClick:()=>{i&&u(i)},children:(0,n.jsxs)(h,{className:(0,s.Z)(y.link,a),href:c,children:[e,(0,n.jsx)("span",{className:(0,s.Z)(y.icon,{[y.iconGray]:r}),children:(0,n.jsx)(d.IconFdsArrowUpRightSmallO,{size:24})})]})})},v=(0,h.g)("faq-block","sc"),f=Object.freeze({faqBlock:v,titleWrapper:`${v}__title-wrapper`,title:`${v}__title`,accordionWrapper:`${v}__accordion-wrapper`,accordionItems:`${v}__accordion-items`,accordionItemGray:`${v}__accordion-item--gray`,accordionItemContent:`${v}__accordion-item-content`,accordionActiveItemContent:`${v}__accordion-item-content--active`,states:{primary:`${v}--primary`,secondary:`${v}--secondary`,gray:`${v}--gray`}}),k=e=>{e.data.forEach((t,a)=>{"header"===t.type&&(e.headerBlocksCount++,3===e.headerBlocksCount&&("banner"===e.data[a-1].type&&(e.banner=e.data.splice(a-1,1)),"banner"===e.data[a+1].type&&(e.banner=e.data.splice(a+1,1))),e.banner&&4===e.headerBlocksCount&&e.data.splice(a,0,e.banner[0]))})},g=(0,h.g)("faq-content-block","sc"),b=Object.freeze({contentBlocks:`${g}__content-blocks`,blockLink:`${g}__block-link`,keynoteWrapper:`${g}__keynote-wrapper`,keynote:`${g}__keynote`,annotation:`${g}__annotation`,contentTableWrapper:`${g}__content-table-wrapper`}),_=({className:e,data:t})=>{if(!Array.isArray(t))return null;let a=(()=>{let e=[],a=1,r={data:t,headerBlocksCount:0,banner:[]};k(r),k(r);let o={},i=e=>{var t,a,n,r;let i=(null==(t=e.data)?void 0:t.text)??(null==(a=e.data)?void 0:a.url)??(null==(n=e.data)?void 0:n.html)??(null!=(r=e.data)&&r.year?String(e.data.year):"");return o[e.type]=(o[e.type]??0)+1,`${e.type}-${String(i).slice(0,80)}-${o[e.type]}`};return t.forEach(t=>{let r=i(t);switch(t.type){case"header":e.push((0,n.jsx)("h2",{id:`content_header_${a}`,role:"header",children:t.data.text||""},r)),a++;break;case"sub_header":e.push((0,n.jsx)("h3",{role:"sub-header",children:t.data.text||""},r));break;case"paragraph":e.push((0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"paragraph"},r));break;case"link":e.push((0,n.jsx)("div",{className:b.blockLink,children:(0,n.jsx)("a",{target:"_blank",href:t.data.url||"",role:"link",rel:"noreferrer",children:t.data.text||""})},r));break;case"dossier":e.push((0,n.jsxs)("div",{children:[(0,n.jsx)("span",{role:"dossier-year",children:t.data.year||""}),(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"dossier-text"})]},r));break;case"html":e.push((0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.html||""},role:"html"},r));break;case"annotation":e.push((0,n.jsx)("div",{className:b.annotation,dangerouslySetInnerHTML:{__html:t.data.text||""},role:"annotation"},r));break;case"company-annotation":e.push((0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"company-annotation"},r));break;case"keynote":e.push((0,n.jsx)("div",{className:b.keynoteWrapper,children:(0,n.jsx)("p",{className:b.keynote,dangerouslySetInnerHTML:{__html:t.data.text||""},role:"keynote"})},r));break;case"image":e.push((0,n.jsx)("img",{src:t.data.url||"",alt:"image"},r))}}),e})();return(0,n.jsx)("div",{className:(0,s.Z)(b.contentBlocks,e),role:"blocks",children:a})},x=({question:e,eventCategory:t,dataLayerPush:a,...r})=>(0,n.jsx)(l.Qd,{...r,title:e.question,children:(0,n.jsx)("div",{className:(0,s.Z)(f.accordionItemContent,{[f.accordionActiveItemContent]:r.isActive}),onClick:e=>{e.target instanceof HTMLAnchorElement&&a({event:"data-event",eventCategory:t,eventAction:"click_link",eventLabel:e.target.href})},children:"string"==typeof e.answer?(0,n.jsx)(_,{data:[{type:"html",data:{html:e.answer}}]}):e.answer})}),j=e=>{setTimeout(()=>{let{top:t}=e.getBoundingClientRect();t<80&&e.scrollIntoView({behavior:"smooth",block:"start"})},300)},C=({sectionTitle:e="Частые вопросы",innerTitle:t,questions:a=[],href:r,checkAllText:o,Link:d,className:h,eventCategory:p="cb-faq",multiple:y=!1,variant:v="secondary",dataLayerPush:k,tagTitle:g})=>{let b=y?a.map(e=>e.question):[],[_,C]=(0,i.useState)(b),N="gray"===v;return(0,n.jsx)("section",{className:(0,s.Z)(f.faqBlock,f.states[v],h),children:(0,n.jsxs)(c.W2,{children:[!t&&(0,n.jsx)("div",{className:f.titleWrapper,children:(0,n.jsx)(c.X6,{as:"h2",type:"display",className:f.title,children:e})}),(0,n.jsxs)("div",{className:f.accordionWrapper,children:[t&&(0,n.jsx)(c.X6,{as:"h3",type:"h1",style:{paddingBottom:"12px"},className:(0,s.Z)(f.title,`${f.title}--inner`),children:t}),(0,n.jsx)("div",{className:f.accordionItems,children:(0,n.jsx)(l.UQ,{activeIndex:_,variant:N?"primary":"secondary",withoutOutline:N,onTabToggle:e=>{let t=(null==e?void 0:e.length)>(null==_?void 0:_.length),a=e.filter(e=>!_.includes(e))[0]||_.filter(t=>!e.includes(t))[0];k({event:"data-event",eventCategory:p,eventAction:`click_togg_${t?"on":"off"}`,eventLabel:(0,u.t)(String(a))}),C(e);let n=`[data-accordion-index="${a}"]`,r=document.querySelector(n);r&&j(r)},multiple:y,children:a.map(e=>{let t=`faq-${e.question}`;return(0,n.jsx)(x,{id:t,question:e,dataLayerPush:k,eventCategory:p,className:N?f.accordionItemGray:void 0,tagTitle:g},t)})})}),r&&o&&(0,n.jsx)(m,{href:r,event:{event:"data-event",eventCategory:p,eventAction:"сlick_link_answer-link",eventLabel:r},dataLayerPush:k,...null!=d?{Link:d}:{},iconGrayBackground:!0,children:o||"Читать все вопросы"})]})]})})};var N=a(8980),L=a.n(N),$=a(9788),w=a.n($),P=a(8459),T=a(467);let A=(0,P.SJ)("NEXT_PUBLIC_SHOWCASE_ORIGIN"),q={fetchHeaderData:async()=>(0,T.Z)("/sc/api/v1/data/page-data",{baseURL:A,params:{scLayoutName:"PageHeaderWidget",scPageUrl:"homepage"}}),fetchFooterData:async()=>(0,T.Z)("/sc/api/v1/data/page-data",{baseURL:A,params:{scLayoutName:"PageFooter",scPageUrl:"homepage"}}),fetchPageData:async e=>(0,T.Z)("/api/v1/page/".concat(e)),async fetchFaqData(e,t){try{var a,n;let r=await (0,T.Z)("/sc/api/v1/data/page-data",{baseURL:A,params:{scLayoutName:"FAQ",scPageUrl:"invest-currency"}});if(null==r?void 0:null===(n=r.value)||void 0===n?void 0:null===(a=n.blocks)||void 0===a?void 0:a[0]){let a=r.value.blocks[0];return{...a,faqs:a.faqs.filter(e=>{var a,n;return(null==e?void 0:null===(n=e.question)||void 0===n?void 0:null===(a=n.split("///"))||void 0===a?void 0:a[0])===t}).map(t=>({...t,question:t.question.split("///")[1].replaceAll("{CityCaseName}",e.caseName),answer:String(t.answer).replaceAll("{CityCaseName}",e.caseName)}))}}return null}catch(e){return null}}};var I=a(915);function S(e){var t,a;let{initialFaq:c}=e,[l,s]=(0,i.useState)(c),{cities:u}=(0,i.useContext)(r.ne),[d,h]=(0,o.g1)();return(0,i.useEffect)(()=>{let e=u.find(e=>{let{englishName:t}=e;return L()(t)===d});q.fetchFaqData(e,w()(h)).then(s)},[d,h,u]),!!(null==l?void 0:l.faqs.length)&&(0,n.jsx)(C,{sectionTitle:l.title,questions:l.faqs,dataLayerPush:I.AB,href:null===(t=l.readAllText)||void 0===t?void 0:t.link,checkAllText:null===(a=l.readAllText)||void 0===a?void 0:a.text,variant:"primary"})}},28:function(e,t,a){"use strict";a.d(t,{z$:function(){return g.useAnalytics},$:function(){return u},J8:function(){return c},lY:function(){return f},_G:function(){return p},g1:function(){return y},D9:function(){return m.usePrevious},MG:function(){return k}});var n=a(8278),r=a.n(n),o=a(7907),i=a(2265);function c(){let e=(0,o.useParams)(),t=(0,o.usePathname)();return(0,i.useCallback)(a=>{let{prefix:n,element:o,name:i,index:c}=a,l=t.split("/").filter(e=>e).map(t=>{var a;return null!==(a=Object.keys(e).find(a=>e[a]===t))&&void 0!==a?a:t});l.unshift("currency");let s=l.join("-"),u=r()(i),d=void 0!==c?"-".concat(function(e){if(Number.isNaN(e)||e<0)throw Error("Incorrect value '".concat(e,"' for the property 'index'. Must be a number and >= 0}"));return e}(c)):"";return"".concat(n?"".concat(n,"-"):"").concat(s,"-").concat(o,"-").concat(u).concat(d)},[e,t])}var l=a(296),s=a(5161);function u(){let[{currency:e,amountCurrency:t},a]=(0,i.useContext)(l.fo),{cities:n,updateCityList:r}=(0,i.useContext)(l.ne);function o(e){n.find(t=>{let{name:a}=t;return e===a})&&a({city:e,metro:void 0,bank:void 0})}function c(e){a({metro:e})}let u=(0,i.useCallback)(n=>{r(n),a({currency:n,amountCurrency:e===t?n:t,currencyPair:[n,s.K5.code],newUsd:!1})},[r,a,e,t]);function d(e){a({amount:e})}function h(e){a({amountCurrency:e,amount:e===s.K5.code?s.EE:l.Er.amount})}function p(e){a({orderType:e})}function y(e){a({newUsd:e})}function m(e){a({zeroFee:e})}function v(e){a({bank:e})}return(0,i.useMemo)(()=>({handleCityChange:o,handleMetroChange:c,handleCurrencyChange:u,handleAmountChange:d,handleAmountCurrencyChange:h,handleOrderTypeChange:p,handleNewUsdChange:y,handleZeroFeeChange:m,handleBankChange:v}),[u])}var d=a(982),h=a(7764);function p(){let e=(0,d.useTranslations)();return[{id:h.mr.Buy,label:e("sc-currency.orderType.buy")},{id:h.mr.Sell,label:e("sc-currency.orderType.sell")}]}function y(){let[,...e]=(0,o.usePathname)().split("/");return e}a(6962);var m=a(9389),v=a(8459);function f(e){let[{amount:t,amountCurrency:a,currencyPair:n}]=(0,i.useContext)(l.fo),r=n.find(e=>e!==a);return"RUB"===a?(0,v.ik)(Math.floor(t/e),{currencyCode:r}):(0,v.ik)(t*e,{currencyCode:r})}function k(e){let[{amount:t,currency:a,amountCurrency:n,orderType:r}]=(0,i.useContext)(l.fo),o=r===h.mr.Buy?"buyPrice":"sellPrice";return e?(Array.isArray(e)?e.reduce((e,r)=>{let i=a===n?t:t/r[o];return i>=e.amountLowerLimit&&i>=r.amountLowerLimit?r:e},e[0]):e)[o]:0}var g=a(2100)},3919:function(e,t,a){"use strict";function n(e,t){return`finkit-widgets-${t}-${e}`}a.d(t,{g:function(){return n}})},7816:function(e,t,a){"use strict";a.d(t,{t:function(){return r}});let n={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sch",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"},r=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in n?n[t]:e}).replaceAll(/[ \u00A0]/g,"_")}}]);