@redneckz/wildless-cms-uni-blocks 0.14.1052 → 0.14.1054
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +11 -3
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/DebitForm/DboClientStatusContent.js +1 -1
- package/dist/retail/components/Fields/SelectField.js +10 -1
- package/dist/retail/components/Fields/SelectField.js.map +1 -1
- package/lib/components/DebitForm/DboClientStatusContent.js +1 -1
- package/lib/retail/components/Fields/SelectField.js +10 -1
- package/lib/retail/components/Fields/SelectField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +11 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/DebitForm/DboClientStatusContent.js +1 -1
- package/mobile/dist/retail/components/Fields/SelectField.js +10 -1
- package/mobile/dist/retail/components/Fields/SelectField.js.map +1 -1
- package/mobile/lib/components/DebitForm/DboClientStatusContent.js +1 -1
- package/mobile/lib/retail/components/Fields/SelectField.js +10 -1
- package/mobile/lib/retail/components/Fields/SelectField.js.map +1 -1
- package/mobile/src/components/DebitForm/DboClientStatusContent.tsx +1 -1
- package/mobile/src/retail/components/Fields/SelectField.tsx +13 -0
- package/package.json +1 -1
- package/src/components/DebitForm/DboClientStatusContent.tsx +1 -1
- package/src/retail/components/Fields/SelectField.tsx +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>p(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),p=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),h={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},h[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(x),x=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const r=v[n]||"h3";return o(r,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:r="text-center",as:l,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const p=S[n],h={marginTop:p.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-normal",r),...p?.title,as:l||p?.title.as,title:a}):null,i?o(C,{size:p.descriptionSize,font:p.descriptionWeight,align:r,...h,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=I,blocksRegistry:l={},ancestors:s=T}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const E=[],D=(e,{key:t,ancestors:n=E,slotName:a=null,extraProps:i,renderProps:r=R,...l})=>{const s=i?(e,t)=>R(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||E,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?D(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function P(){return P._impl()}P._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),P.setup=e=>{P._impl=e};const O=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return O.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),A=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),M=e=>Boolean(e?.startsWith("#")),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:A,isLocalURL:F,isHash:M,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,q=[B.CDN,$],W=e=>(t,n)=>{if(U(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U=e=>!e||A(e)||M(e)||q.some(z(e)),K={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},H={small:"16",medium:"24",large:"48",xl:"78"},Y=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&H[l],height:d=s})=>{const m=P(),p="normal"===r?`${n}.svg`:`sprites.svg#${n}`,h=W(m)(L(B.CDN,"/icons/",p));return"normal"===r?o("img",{className:e,style:G(e,d),src:h,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(J,{className:e,children:c("svg",{className:u(K[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),G=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},J=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(X.SITE_URL);return t&&!A(t)?W(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=P();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" ");function me(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function ue(e,t){return me(e,t),me(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class pe{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}class he{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new pe){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class ge{bus;store=new Map;get size(){return this.store.size}constructor(e=new pe){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const fe={};function ye(e,t=fe){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const xe=new ge;function be(e){return ye(xe,e)}ue(xe,new he(globalThis?.localStorage));const ve=e=>ve._impl(e);function Ne(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}ve._impl=e=>e,ve.setup=e=>{ve._impl=e};const we=new pe,Ce=()=>Ne(we.emitter,"dialog"),Se="/",ke=["/api"];function Ie(){const e=P(),{closeAll:t}=Ce();return n=>{const a=W(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:ve((i=>{n.onClick?.(i);const r=Q(X.SITE_URL);Te(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=Se,t=Se)=>[e,t].some((e=>e===Se))?e:e.replace(t,"")||Se)(a,r)))}))}}}const Te=(e,t,n)=>F(e,t)&&![...ke,...X.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),Re=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ee=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=_e(e)&&"hidden lg:block";return c("div",{className:u(De(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,_e(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),De=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",_e(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},_e=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Pe=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Oe=d((({disabled:e,children:t,method:n="LINK",href:l,id:s,additionalHrefs:c,...d})=>{const[m,u]=a(),p=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:l}),h=be();i((()=>{c&&Fe({linksStore:h,href:l,id:s,additionalHrefs:c});const e=(h.links||[]).find((e=>e.id===s))?.lastLink;u(e??l)}),[c,l]);const g=Ie()({onClick:p,href:m,...d}),f=t??o(Ee,{...g});return o(e?Ae:Be,{...g,children:f})})),Be=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...Re(d),children:m}))),Ae=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Pe({className:e,rounded:a,version:n}),children:i}))),Fe=({linksStore:e,id:t,href:n,additionalHrefs:a})=>{const i=(e.links||[]).find((e=>e.id===t));if(e.links||(e.links=[]),(!i||i.nextDueAt<=Date.now())&&a){const i=((e="",t=[])=>{const n=[e,...t];return n[Math.floor(Math.random()*n.length)]})(n,a),r=e.links?.filter((e=>e.id!==t));r.push({id:t??"",lastLink:i,nextDueAt:Date.now()+6048e5}),e.links=r}};function Me({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Oe,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Le=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},ze={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ve=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ze[n],t),children:e}):null,$e=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:p,isImageAlwaysOnRight:h=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=Le(),v=P(),N=r((()=>v.back()),[]),w=x.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Me({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ve(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[je(p,y),We(_({...x,extraProps:{className:"@container-normal"}})),Ve(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[qe(h)]:l,"col-start-2 self-center":h,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),je=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,qe=e=>u(e?"row-span-2":"@xl:row-span-2"),We=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ue=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ke=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),He=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ye=d((({children:e,className:t,...n})=>o("span",{className:u("font-sans",Object.values(n),t),children:e}))),Ge=(e,t)=>e?o(Ye,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Je=(e,t)=>["label"in e?Ge(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:He(e.description,t)},String(t)):null,"__html"in e?o(Ke,{...e},`rte-${t}`):null],Xe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Ue(n.icon,t):null,o("div",{children:Je(n)})]}))),Qe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Xe,{benefitsVersion:t,...e},String(n))))}):null)),Ze=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Je)}):null)),et=d((({isTabularBenefits:e,...t})=>o(e?Ze:Qe,{...t}))),tt=e=>Boolean(e?.src||e?.icon),nt=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(at(n))}):null,at=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=it(i,l),d=it(r,l);return a||i?.icon?o(Oe,{className:u("basis-full @lg:basis-auto",e),appendLeft:rt({...i,iconVersion:c}),appendRight:rt({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},it=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},rt=e=>tt(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),lt=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),st=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(ot)}):null)),ot=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Ye,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[lt(2)(t)," ",n||"₽"]}):null]},String(a)),ct=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(dt)}):null)),dt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ye,{size:"text-m",font:"font-light",children:e})},String(t)),mt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},ut=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:p,isFullWidthTitle:h,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:S,children:I,...T})=>{const R=x?.src?o(ie,{image:x,imageClassName:C}):null,E=o(k,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o($e,{className:e,padding:t,defaultPadding:n,...h?{title:E}:{insetTitle:E},...yt(R,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:nt(y),backwardButton:S,...T,children:ft(pt(D,{benefitsVersion:s,isTabularBenefits:c}),ht(u,{richVersion:p,isDotted:d,headlineVersion:r}),I,gt(g),xt(f))})})),pt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(et,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,ht=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Ke,{__html:e,richVersion:t,isDotted:n,itemSize:mt[a??"L"]}):null,gt=e=>e?.length?o(st,{priceList:e}):null,ft=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},yt=(e,t)=>t?{rightImage:e}:{leftImage:e},xt=e=>e?.length?o(ct,{tags:e}):null;class bt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof bt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const vt=()=>!0,Nt=(e,t)=>(...n)=>e(...n)&&t(...n),wt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const Ct=e=>Boolean(e&&Array.isArray(e)),St=e=>Boolean(e&&"object"==typeof e&&!Ct(e)),kt=e=>e;function It(e){return e instanceof bt?e._:e}class Tt extends bt{from(e){return this.of(e.map(((e=kt)=>([,t])=>e(t))(It)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(Ct(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class Rt extends bt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class Et extends bt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,It(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class Dt extends bt{proto=wt([e=>Ct(this._)||"number"==typeof e,()=>Tt.prototype],[e=>St(this._)||"string"==typeof e,()=>Et.prototype],[vt,()=>Rt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const _t=e=>e instanceof bt?e:new Dt(e),Pt=e=>{const t=(t,...n)=>It(e(_t(t),...n));return t.fn=e,t},Ot=[],Bt=e=>e instanceof Function?e:t=>e===t,At=e=>(t,n,a=Ot)=>_t(t).entries().reduce(((t,[n,i])=>At(e)(i,t,a.concat(n))),e(n,[a,_t(t)])),Ft=Pt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Ft(e.get(a),[i,n]):n)})),Mt=Pt(((e,t)=>t.reduce(Ft.fn,e))),Lt=e=>At(((e,[t,n])=>zt(n)?[...e,[t,It(n)]]:e))(e,[]),zt=e=>0===e.size();Pt(((e,t=Ot)=>t.reduce(((e,t)=>e.get(t)),e)));const Vt=Pt(((e,[t,...n])=>n.length?e.set(t,Vt(e.get(t),n)):e.filter((([e])=>e!==t)))),$t=(jt=["$ref"]).map(((e,t)=>n=>Bt(e)(n[t+n.length-jt.length]))).reduceRight(Nt,vt);var jt;const qt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Wt,e),Wt=wt([Ct,(e,t)=>e[parseInt(t,10)]],[St,(e,t)=>e[t]],[vt,kt]),Ut=(e,t)=>((e,t={})=>n=>Mt(t,Lt(n).map((t=>e(t)))))((([e,n])=>{return $t(e)?[(a=e,a.slice(0,-1)),qt(t(n),n)]:[e,n];var a}))(e),Kt=e=>Lt(e).filter(((e=kt)=>([t])=>e(t))($t)),Ht=e=>{return t=Kt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Yt(e,t){try{return e?await Gt(e,t):null}catch(e){console.error(e)}return null}const Gt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Jt=e=>[...new Set(e)],Xt={},Qt=["/portal-resources"],Zt=(e,t)=>Ut(e,(e=>t?.[e])),en=(e,t)=>{const n=Ht(e),[r,l]=a({});return i((()=>{tn(n).then(l)}),[n.join()]),n.length?Zt(e,{...t,...r}):e},tn=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Jt(e).filter((e=>!Qt.some((t=>e.startsWith(t))))).map((async e=>(Xt[e]||=await Gt(e),[e,Xt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ht(e)));return i.length?tn(i,a):a}return t};function nn(e,t={}){const n=d((t=>{const n=en((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const an="rshb-query-params";function rn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(an)||"";return e&&globalThis.sessionStorage?.setItem(an,e),e}const ln=(e={},t=[],n="")=>{const{queryParam:a,value:i}=e,r=((e,t)=>new URLSearchParams(t).get(e))(a??"utm_source",rn()),l=t.find((e=>e?.id?.toLowerCase()===r?.toLowerCase()))?.value;return l?n?.replace(String(i),l):n},sn=nn((({className:e,padding:t,defaultPadding:n,dynamicQueryParamText:a={},dynamicTextSource:i,description:r,title:l,...s})=>{const{textType:c}=a,d=ln(a,i?.list,"title"===c?l:r),m={title:"title"===c?d:l,description:"description"===c?d:r};return o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...s,children:o(ut,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...m,...s})})})),on=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>cn(0,t?.length)),[t]),a=t?.[n];return a?o(sn,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),cn=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function dn(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}function mn(){return mn._impl()}mn._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),mn.setup=e=>{mn._impl=e};const un=["https://private-banking.rshb.ru/"],pn=async e=>{const t=e.target?.closest("a"),n=mn();if(A(t?.href)&&!t?.href?.startsWith(n.origin)&&!un.includes(t?.href??"")){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=rn();if(!A(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function hn(){return hn._impl()}hn._impl=()=>({forwardQuery:pn}),hn.setup=e=>{hn._impl=e};const gn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],fn=e=>!e?.length,yn=e=>t=>n=>e(n)?[]:[t],xn={},bn=[];const vn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function Nn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=vn(i,r)?i:r;return!vn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),p=s(wn(e)),[h,{setTrue:g,setFalse:f}]=dn(!1),y=s({}),[x,{isValid:b,errors:v}]=function(e,t){const n=l((()=>t?.(e)??xn),[t,e]),a=l((()=>gn(n)(e)??bn),[n,e]),i=fn(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||y.current?.[String(e)],s=t?.validator??x[e],o=l&&s?s(r):[];return{setFieldRef:t=>{p.current&&(p.current[e]=t)},fieldRef:p.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),S=r((async e=>{if(e.preventDefault(),b)await(d?.(m,e)),t&&C();else{const e=Cn(m,x);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,b,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:S}]}const wn=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),Cn=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},Sn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function kn(e,t={}){const{open:n,close:a,...i}=Ce();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const In=/^[а-яё-]*$/i,Tn=/^(?!\s*$)(?:[\p{Script=Cyrillic}]|\P{L})*$/u,Rn=(e,t)=>{if(!e||isNaN(e.getTime()))return!1;const{minLimit:n,maxLimit:a}=t,i=e.getTime();return En(i,n)&&Dn(i,a)},En=(e,t)=>!(t&&!isNaN(t.getTime()))||e>t.getTime(),Dn=(e,t)=>!(t&&!isNaN(t.getTime()))||e<t.getTime(),_n=yn((e=>null!=e&&""!==e)),Pn="Некорректно заполненное поле",On=e=>_n(e??Pn),Bn=e=>yn((e=>e?.key&&""!==e?.key))(e??"Выберите вариант ответа"),An=e=>yn((e=>"string"==typeof e&&e.length>1&&((e="")=>In.test(e))(e)))(e??Pn),Fn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Mn=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Ln=e=>yn(Fn)(e),zn=yn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Vn=e=>"string"==typeof e&&(10===e.length||12===e.length),$n=e=>/^[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*(?:\s+[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*)+$/.test(e),jn={fullName:(qn="Укажите полное ФИО на кириллице (без сокращений)",yn((e=>"string"==typeof e&&e.length>1&&$n(e)))(qn??Pn)),addressBranch:Bn(),desiredMeetingDate:On(),product:On(),localities:On(),partnerComments:On(),collectionCount:On(),acquiringType:Bn(),serviceType:Bn(),annualRevenue:On(),feedbackMethod:Bn(),serviceDirection:Bn(),secondaryPhone:Ln("Укажите номер телефона"),region:Bn(),situationDescription:On(),sufferedFrom:On(),applierType:On(),surname:An("Укажите свою фамилию на кириллице"),name:An("Укажите своё имя на кириллице (без сокращений)"),middleName:An("Укажите своё отчество на кириллице"),birthday:(e=>yn((e=>Rn(e,{maxLimit:new Date})))(e))("Укажите дату рождения"),phone:Ln("Укажите номер телефона"),email:(e=>yn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),inn:(e=>yn((e=>Vn(e)))(e))("Укажите ИНН"),comment:On(),typeForm:On(),consentToReceiveMaterials:zn,consentDataProcessing:zn,partnerSymbolCode:On("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>yn((e=>Boolean(e?.text)&&Vn(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:On("Укажите наименование организации"),callbackTime:On(),questionProduct:On(),russianPhone:(e=>yn(Mn)(e))("Укажите номер телефона"),cityOfResidence:(e=>yn((e=>"string"==typeof e&&e.length>0&&((e="")=>Tn.test(e))(e)))(e??Pn))("Укажите город проживания на кириллице"),internshipStartDate:On(),internshipEndDate:On(),university:On("Укажите ВУЗ"),fieldOfStudy:On("Укажите направление обучения"),courseYear:On("Укажите курс"),graduationYear:On("Укажите год окончания"),averageGrade:On(),skillsAndKnowledge:On(""),educationLevel:Bn(),motivationForInternship:On(""),workExperience:On(""),internshipDirection:On(),workingHours:Bn()};var qn;const Wn=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...jn,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(Un(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Un(a)).filter(Kn(e)).map((({name:e})=>[e,a[e??""]]))):r},Un=(e={})=>({name:t})=>Boolean(e[t??""]),Kn=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),Hn=()=>{},Yn={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Gn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Jn=u("bg-main-gray text-main-disabled cursor-not-allowed"),Xn=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:p,children:h,wcmsIgnore:g,onClick:f=Hn,testId:y})=>{const x=r("tab"!==c?ve(f):f,[c,f]),b=l((()=>Re(m)),[m]),v="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[Yn[n]]:!s&&!i,[Gn]:i,[Jn]:s},i?"justify-between":"justify-center",i||v?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":v},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":p,"data-wcms-ignore":g,...b,onClick:x,"data-test-id":y,children:h})})),Qn=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(Y,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Zn={sm:"max-w-sm",lg:"max-w-lg",xl:"max-w-xl","4xl":"max-w-4xl",none:"mt-0"},ea={top:"relative mx-auto",center:"relative mx-auto top-1/2 -translate-y-1/2 mt-0",corner:"absolute bottom-0 right-0"},ta=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=Le();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",Zn[t],ea[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Qn,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),na=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(ta,{maxWidth:"lg",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?i:r,headlineVersion:"XS",isEmbedded:!0}),o(Xn,{type:"button",onClick:n,children:"Хорошо"})]})})})),aa=new ge;function ia(){return ye(aa)}ue(aa,new he(globalThis?.sessionStorage));const ra="/api/v1",la=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},sa={lead:{withTypeForm:!0,isNaturalEndpoint:!0},sendcorporatelead:{withTypeForm:!0,isNaturalEndpoint:!1},practice:{withTypeForm:!1,isNaturalEndpoint:!0},internship:{withTypeForm:!1,isNaturalEndpoint:!0},initcorporatelead:{withTypeForm:!0,isNaturalEndpoint:!1},confirmCorporateLead:{withTypeForm:!0,isNaturalEndpoint:!1},callback:{withTypeForm:!1,isNaturalEndpoint:!0}},oa=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},ca=e=>e?.replace(/[^+\d]/g,""),da=({body:e,endpoint:t,router:n})=>{const a=t&&sa[t].isNaturalEndpoint,i=t&&sa[t].withTypeForm,{typeForm:r,region:l,phone:s="",email:o,birthday:c,desiredMeetingDate:d,fullRegion:m,addressBranch:u,secondaryPhone:p="",bankEmpolee:h,applicationDate:g,partnerName:f,russianPhone:y,partnerSymbolCode:x,internshipEndDate:b,internshipStartDate:v,...N}=e;return{...i?{typeForm:r}:{},...pa(l,a),...ha(o,a),...ma(s),...ma(y),...a?ua([[c,"birthday"]]):{birthday:c},...ua([[d,"desiredMeetingDate"],[b,"internshipEndDate"],[v,"internshipStartDate"]]),..."FEEDBACK"===r?{}:{addressBranch:u,bankEmpolee:h,applicationDate:g,...ga(p)},...ya(r,n),...fa(r,{fullRegion:m,partnerName:f,partnerSymbolCode:x}),...xa(r),...N,...ba(e,r)}},ma=e=>e?{phone:ca(e)}:{},ua=e=>Object.fromEntries(e.filter((([e])=>e)).map((([e,t])=>[t,oa(e)]))),pa=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),ha=(e,t=!0)=>({[t?"email":"mail"]:e}),ga=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:ca(e)}:{},fa=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},ya=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{},xa=e=>"CALC"===e?{partnerComments:globalThis?.sessionStorage.getItem("rkoTariffName")??"Неизвестный тариф"}:{},ba=(e,t)=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("utm_mail"),i=n.get("utm_source");return"REF"===t?{name:e.fullName,fullName:void 0,partnerComments:a,partner:i}:{}};function va(){return{send:async function({body:e,router:t,endpoint:n}){const a=n&&Ca(n,e),i=`${ra}/${a}`,r=da({body:e,endpoint:n,router:t});try{const e=await Na(i,r);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...ma(e)}))(e);try{const e=Na(`${ra}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n,router:a,endpoint:i="confirmCorporateLead"}){const r={requestId:e,confimationCode:t,leadRequest:da({body:n,endpoint:i,router:a})};try{const e=await Na(`${ra}/${i}`,r);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t){const n=da({body:e,endpoint:t}),a=wa(n);try{const e=await Na(`${ra}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Na=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),wa=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:la()}},Ca=(e,t)=>{const{serviceDirection:n}=t;return"lead"===e&&"Юридическое лицо / ИП"!==n?"lead":e},Sa=d((()=>c("div",{className:"flex flex-col items-center",children:[o(w,{className:"text-center",headingType:"h5",title:"Спасибо за участие!"}),o(C,{children:"Ваше мнение очень важно для нас"})]}))),ka=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),Ia=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Xn,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(ka,{blur:!0,size:"small"}):null,n]}))),Ta="#C9CACC",Ra="#42AB44",Ea=d((({value:e,hover:t,rating:n,setHover:a,setRating:i})=>o("div",{onClick:()=>e&&i?.(e),onMouseEnter:()=>e&&a?.(e),onMouseLeave:()=>a?.(null),children:o("svg",{"data-rating":e,fill:Da({value:e,hover:t,rating:n}),width:"57",height:"57",viewBox:"0 0 57 57",children:o("path",{d:"M47.7803 18.2879L47.7836 18.2884C50.566 18.7521 53.0867 20.1374 53.9176 22.7226C54.7498 25.3116 53.5025 27.9027 51.4977 29.8954L51.4942 29.8989L45.7132 35.6799C45.5729 35.8202 45.3591 36.1532 45.2186 36.6438C45.0796 37.1295 45.0808 37.5314 45.1257 37.7381L45.1268 37.743L46.78 44.8909C47.4787 47.9228 47.3175 51.2217 44.8924 52.9896C42.4714 54.7546 39.2808 53.9093 36.5999 52.3257L29.6214 48.1946C29.4392 48.0866 29.0426 47.96 28.5087 47.96C27.9816 47.96 27.5736 48.0831 27.3687 48.2004L27.3634 48.2035L20.4041 52.3232L20.4019 52.3246C17.7218 53.9145 14.5351 54.7459 12.1155 52.9803C9.69339 51.213 9.51826 47.9236 10.22 44.8909L11.8731 37.743L11.8743 37.7379C11.9191 37.5311 11.9203 37.1293 11.7813 36.6438C11.6409 36.1532 11.4271 35.8202 11.2867 35.6799L5.50006 29.8932C3.50738 27.9006 2.26429 25.3118 3.08972 22.7269C3.91586 20.1398 6.43161 18.7525 9.21638 18.2884L16.6527 17.0529L16.6552 17.0525C16.8169 17.0243 17.1619 16.8935 17.5523 16.604C17.945 16.3128 18.1668 16.022 18.2378 15.877L18.2462 15.8598L22.3508 7.65087L22.352 7.6485C23.629 5.08222 25.7146 3.01416 28.4796 3.01416C31.2412 3.01416 33.3328 5.07832 34.6215 7.64213L34.6236 7.64649L38.7303 15.8598L38.75 15.9001C38.7884 15.9807 38.8225 16.0591 38.8511 16.1283C38.9197 16.1891 39.0148 16.2702 39.1464 16.3781C39.1829 16.394 39.242 16.4185 39.3288 16.4505C39.5779 16.5424 39.9286 16.6512 40.3732 16.7719C41.2573 17.0121 42.3688 17.2611 43.4823 17.4894C44.5886 17.7163 45.6648 17.9163 46.4667 18.0598C46.8669 18.1315 47.1972 18.1888 47.4266 18.2281L47.6909 18.2729L47.7589 18.2843L47.7803 18.2879Z"})})}))),Da=({value:e,hover:t,rating:n})=>e&&t?e<=t?Ra:Ta:e&&n&&e<=n?Ra:Ta,_a=Array.from("12345",(()=>Ea)),Pa={NPS:"Оцените, пожалуйста, от 1 до 5,\nнасколько вероятно, что вы порекомендуете Россельхозбанк коллегам, друзьям и знакомым?",CSI:"Оцените, пожалуйста, удовлетворённость пользования сайтом"},Oa=d((({currentRating:e,surveyType:t,isSending:n,setCurrentRating:i,onNextStep:r,onSubmit:l})=>{const[s,d]=a(),m=e=>{i(e),e<5&&r()};return c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{className:"text-center whitespace-pre-line",headingType:"h5",title:Pa[t]}),o("div",{className:"flex justify-center",children:_a.map(((t,n)=>o(t,{value:n+1,rating:e,hover:s,setRating:m,setHover:d},n.toString())))}),5===e?o(Ia,{onClick:()=>l(),isLoading:n,children:"Отправить"}):null]})})),Ba=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Aa=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],Fa=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l,name:s})=>{const d=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),m=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ba,{paths:Aa,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",La(a)),"data-test-id":s,onClick:d,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":Va(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:za(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?m:null,Ma(n)]})})})),Ma=e=>e?o("div",{className:"ml-s",children:o(Ye,{size:"text-l",font:"font-light",children:e})}):null,La=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",za=(e=!1)=>e?"radio":"checkbox",Va=(e=!1)=>u("rounded border",{"bg-primary-main":e}),$a={horizontal:"@lg:flex-row",vertical:""},ja=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Ye,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",$a[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Fa,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e,t),disabled:i,name:e},String(e))))})]})));function qa(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Wa(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return qa(globalThis.document,"click",n),t}const Ua=({label:e,required:t=!1})=>e&&t?`${e}*`:e,Ka="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ha=e=>e?Ka:"border-error",Ya=e=>e?o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Ga="w-full border rounded-md text-primary-text outline-none p-m",Ja=d((({key:e,className:t,id:n,name:a,type:l="text",maxLength:d,label:m,placeholder:p,value:h="",valid:g=!0,pattern:f,autoFocus:y=!1,isTextarea:x=!1,disabled:b=!1,children:v,onChange:N,onFocus:w,onBlur:C})=>{const S=s(null),k=r((e=>{const t=(e.target?.value??"").trimStart();N&&N(t)}),[N]);i((()=>{y&&S.current?.focus()}),[y,S]);const I=v?"pr-3xl":"",T=Ha(g),R=m??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ya(m),x?o("textarea",{className:u("block resize-y min-h-24",Ga,T),id:u("textarea",n),value:h,name:a||n,placeholder:p,disabled:b,"aria-label":R,onChange:k,onFocus:w,onBlur:C,maxlength:d},e):o("input",{ref:S,className:u("h-14",Ga,I,T),id:n,type:l,value:h,name:a||n,placeholder:p,pattern:f,disabled:b,"aria-label":R,onChange:k,onFocus:w,onBlur:C,"data-test-id":a},e)]}),v]})})),Xa=e=>o("div",{className:"min-h-6",children:e?o(Ye,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Qa=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:p,isOpen:h,onOpen:g,onClose:f,required:y,onChange:x=Hn,...b})=>{const v=Wa(f),N=r((e=>{const t=m&&e.length>m;!h&&g(),t||x(Za(e,s))}),[h,x]);return c("div",{className:u("shrink-0 w-full",e),ref:v,onBlur:f,onFocus:g,children:[o("div",{ref:p,children:o(Ja,{type:l||"text","aria-label":t,label:Ua({label:t,required:y}),valid:Boolean(!a),onChange:N,placeholder:ei({placeholder:d,errors:i,label:t}),value:n,...b})}),Xa(a)]})})),Za=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,ei=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ti=d((e=>{const[t,{setFalse:n,setTrue:a}]=dn();return o(Qa,{isOpen:t,onOpen:a,onClose:n,...e})})),ni=Array.from("12345",(()=>Ea)),ai=[Oa,d((({currentRating:e,currentReason:t,reasons:n=[],isSending:i,setCurrentReason:r,onSubmit:l})=>{const[s,d]=a();return c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{className:"text-center",headingType:"h5",title:"Что бы мы могли улучшить?"}),o("div",{className:"flex justify-center",children:ni.map(((t,n)=>o(t,{value:n+1,rating:e},n.toString())))}),o(ja,{className:"w-full text-wrap",orientation:"vertical",items:n,value:t?.id,onChange:(e,t)=>{r?.({id:e,text:t})}}),"Другое"===t?.text?o(ti,{className:"w-full",placeholder:"Напишите, пожалуйста, свой вариант ответа",isTextarea:!0,value:s,onChange:d,maxLength:255}):null,t?o(Ia,{onClick:()=>l(s),isLoading:i,children:"Отправить"}):null]})})),Sa],ii=nn((({onClose:e=Hn,isAfterTargetAction:t=!1,reasonsSource:n={},onSkip:i=Hn})=>{const[l,{setTrue:s,setFalse:c}]=dn(!1),[d,m]=a(0),[u,p]=a(),[h,g]=a(0),f=be(),y=si(f.userSurvey?.lastShownType),{reasons:x}=n,b=ai[h],v=r((()=>{g((e=>e+1))}),[]),N=r((async e=>{s(),await(async e=>{try{return await Na(`${ra}/survey`,e)}catch(e){return null}})({rate:d,reason:u?.text,message:ri(u,e),url:globalThis.location.href,type:y,ip:t?"after_target_action":"time_on_site"}),c(),f.userSurvey={lastShownType:y,nextDueAt:li()},g(2)}),[d,u]),w=r((()=>{2!==h&&i(),e()}),[h]);return o(ta,{maxWidth:"xl",onClose:w,children:o(b,{currentRating:d,currentReason:u,reasons:x,surveyType:y,isSending:l,setCurrentReason:p,setCurrentRating:m,onSubmit:N,onNextStep:v})})})),ri=(e,t)=>{if("Другое"===e?.text)return t?.length?t:"Другое. Клиент не оставил комментариев"},li=()=>Date.now()+2592e6,si=e=>e?"NPS"===e?"CSI":"NPS":["NPS","CSI"][Date.now()%2],oi=(e=!1)=>{const t=kn(ii),n=be(),a=ia(),l=a.surveyTimerId,s=a.isSurveySkipped,o=a.surveyTimerStart?Date.now()-Number.parseInt(a.surveyTimerStart):0,c=!s&&!ci&&(!n.userSurvey||n.userSurvey?.nextDueAt<=Date.now()),d=r((()=>{a.isSurveySkipped=!0}),[]),m=r(((e=!1)=>{t.open({reasonsSource:{$ref:"/wcms-resources/user-survey-reasons.json"},isAfterTargetAction:e,onSkip:d})}),[]),u=r((()=>{c&&(l&&clearTimeout(l),m(!0))}),[l,c]);return i((()=>{if(!e&&c){a.surveyTimerStart||(a.surveyTimerStart=Date.now().toString());const e=setTimeout(m,3e5-o);return a.surveyTimerId=e,()=>{clearTimeout(e),a.surveyTimerId=null}}return Hn}),[c]),u},ci=()=>new RegExp("^/(cn|en)($|/.*)").test(globalThis.location.pathname),di=[{key:"ULTRASERVICE",text:"Ультра"}],mi=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ui=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],pi="client",hi=[{key:pi,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],gi=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],fi=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"}],yi=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],xi=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],bi=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],vi=[{key:"Экономика и финансы",text:"Экономика и финансы"},{key:"Аудит",text:"Аудит"},{key:"Юриспруденция",text:"Юриспруденция"},{key:"ИТ",text:"ИТ"},{key:"Маркетинг",text:"Маркетинг"},{key:"HR",text:"HR"},{key:"Аналитика",text:"Аналитика"},{key:"Менеджмент",text:"Менеджмент"},{key:"ГМУ",text:"ГМУ"},{key:"Дизайн",text:"Дизайн"},{key:"Журналистика",text:"Журналистика"},{key:"Контакт-центр",text:"Контакт-центр"},{key:"Другое",text:"Другое"}],Ni=[{key:"20",text:"20"},{key:"30",text:"30"},{key:"40",text:"40"}],wi=[{key:"Бакалавриат",text:"Бакалавриат"},{key:"Специалитет",text:"Специалитет"},{key:"Магистратура",text:"Магистратура"},{key:"Аспирантура",text:"Аспирантура"}],Ci=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},Si=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ti,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),ki=(e,t)=>o(Y,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Ii=e=>e?.text||e?.key||"",Ti=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:Ii(n)||a,Ri=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=Hn,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:p="black",options:h=[]})=>{const g=Ei(l,h,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ti({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":ki(a,p)]})},Ei=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,Di=()=>Ne(we.emitter,"popup"),_i=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pi=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=Oi,query:l,onChangeQuery:s,disableFilterOptions:d})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:_i(t,l,d).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&(s?.(""),i(e))},children:[r(e),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),Oi=e=>o("span",{className:"min-h-6",children:Ii(e)});const Bi=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:p=!1,disabled:h=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=Hn,inputProps:x,disableFilterOptions:b=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:S}]=dn(),[k,I]=a(""),T=h||!p&&0===n.length,R=l((()=>Ci((e=>y(e)),300)),[y]),E=r((()=>{T||S()}),[T]),D=r((()=>{!m&&I(""),C()}),[p]),_=r((e=>{I(e),p&&f?.({key:e,text:e}),R?.(e)}),[p,f,R]),P={query:k,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},O=function({isOpen:e,options:t,value:n,query:a,onChange:l=Hn,onClose:c=Hn,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=Hn,renderOptions:p}){const h=Di(),g=r((()=>{h.close(),c()}),[c]),f=r((e=>{g(),l(e)}),[g,l]),y=s(null),x=Wa(g);return i((()=>{if(!e||!y.current)return;const i=y.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();h.open({popup:o(Pi,{popupRef:x,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:f,onChangeQuery:u,renderOptions:p}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,f]),y}({onChange:f,onClose:D,disableFilterOptions:b,onChangeQuery:I,...P});return c("div",{className:u("space-y-xs",e),children:[Ya(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:O,children:[Ri({isDisabled:T,onClose:D,onOpen:E,isManualInput:p,...P,...N}),m&&w?Si({query:k,isDisabled:T,inputProps:x,onChangeQuery:_}):null]})]})})),Ai=d((({className:e="",label:t,error:n,required:a,...i})=>c("div",{className:e,children:[o(Bi,{...i,valid:!n,label:Ua({label:t,required:a})}),Xa(n)]}))),Fi=d((({field:e,input:t})=>o(Ai,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:gi,...e(t?.name??""),...t}))),Mi=(e="")=>Boolean("trade"===e||"all"===e),Li=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:p,isPremium:h,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,x=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Mi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,b={...y,...ji(o),...$i(c),...d&&{inn:d},...x?{partnerComments:x}:{},...s?{typeForm:s}:{},...Vi(m?.text,u),...zi(p),...qi([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(b)?.map((([e,t])=>[e,t?.key||t])))},zi=e=>e?.key?{isClient:e?.key===pi}:{},Vi=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},$i=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ji=e=>e?{vedTypes:Object.fromEntries(bi.map((({id:t})=>[t,t===e])))}:{},qi=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),Wi={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:gi[0],serviceType:di[0],feedbackMethod:ui[0],serviceDirection:mi[0],vedTypes:bi[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""},fileUpload:"",fileId:""},Ui=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Ki=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},Hi=va(),Yi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Gi={primary:Yn.primary,secondary:Yn.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:Yn.secondary,transparent:"","":""},Ji=d((e=>{const t=Ie(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:p,onClick:h}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Gi[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:h,...Re(m),children:p??Xi(r,l)})})),Xi=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,Qi=d((({text:e,link:t,additionalLink:n})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ye,{children:e}):null,t?o(Ji,{...t,ariaLabel:"условия передачи данных",children:t.text}):null,n?c(Ye,{children:[" и ",o(Ji,{...n,ariaLabel:"условия проведения акции",children:n.text})]}):null]}))),Zi=({consentDataProcessing:e,link:t,additionalLink:n,button:a,typeForm:i,isSending:r=!1})=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Fa,{...e}),o(Qi,{link:t})]}),Xa(Yi(e,zn).error)]}):o(Qi,{text:"PF"===i?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t,additionalLink:n}),o(Ia,{className:"w-full @xl:w-auto",isLoading:r,children:a?.text?a.text:"Отправить заявку"})]}),er=e=>null!=e,tr=new Map,nr=(e,t=tr)=>n=>{const a=ir(n),i=t.get(a);if(a&&er(i))return i;const r=e(...n);return a&&er(r)&&t.set(a,Promise.resolve(r)),r},ar=e=>Boolean(e?.every((e=>Array.isArray(e)?ar(e):!e||"string"==typeof e))),ir=e=>ar(e)?e.toString():"",rr=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function lr(e,t,{fallback:n,cache:r}={}){const s=l((()=>sr(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(er))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await nr(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&rr(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function sr(e){return Array.isArray(e)?e:e instanceof Function?sr(e()):[e]}const or=`${ra}/branches`,cr=[];const dr=async e=>await Yt(e,{method:"GET"})||cr;function mr(e=!1){const{data:t}=lr(`${ra}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Gt);return Array.isArray(t)?t:[]}const ur=(e="")=>"ULTRASERVICE"===e,pr=d((({field:e,input:t,params:n})=>{const a=ur(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?mr(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=lr(e?`${or}?regionCode=${e}`:null,dr);return t||cr}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Ai,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0,...t})})),hr=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},gr=(e,t,n)=>Math.max(t,Math.min(e,n));function fr(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function yr({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:r,onChange:t=>{const n=fr(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const xr=1,br=100,vr=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:xr),max:s=(i.length?i.length-1:br),step:d=1,value:m=i[0]||l,disabled:p=!1,onChange:h}=e,g=hr(e,{normalize:(e=0)=>i.length?Nr(i)(e):gr(e,l,s),format:lt()}),f=r((e=>{h&&h(fr(e.target?.value))}),[h]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Ye,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",Ka,"disabled:border-gray disabled:bg-main-divider"),disabled:p,onChange:f,...g}),yr({list:i,min:l,max:s,step:d,disabled:p,value:m,onChange:h})]}),wr(a)]})})),Nr=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),wr=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ye,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Cr=["От 1 000 ₽","До 1 000 000 000 ₽"],Sr=d((({field:e,input:t})=>o(vr,{title:"Сумма, ₽",items:Cr,min:1e3,max:1e9,...e(t?.name??""),...t}))),kr=d((({field:e,input:t})=>o(ti,{label:"Годовая выручка, ₽",...e(t?.name??""),...t}))),Ir=d((({field:e,input:t})=>o(ti,{label:"Дата и время обращения в Банк",...t,...e(t?.name??"")}))),Tr=d((({field:e,input:t})=>o(Ai,{label:"Тип обратившегося",...t,options:hi,...e("applierType")}))),Rr=d((({field:e,input:t})=>o(ti,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??""),...t}))),Er=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,weekends:s,onDateClick:c})=>{const d=[];let m=1;for(let u=0;u<6;u++){const p=[];for(let d=0;d<7;d++)if(0===u&&d<t)p.push(o("td",{},`empty-${d}`));else if(m>n)p.push(o("td",{},`empty-${d}`));else{const t=new Date(i,a,m),n=Dr(t,e),d=_r(t,r,l),u=Pr(t,s),h=d||u;p.push(o("td",{children:o("div",{className:Or(n,h),onClick:()=>!h&&c(t),children:m})},`day-${m}`)),m++}d.push(o("tr",{children:p},`row-${u}`))}return d},Dr=(e,t)=>t&&e.toDateString()===t.toDateString(),_r=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pr=(e,t)=>{if(!t||0===t.length)return!1;const n=0===e.getDay()?7:e.getDay();return t.includes(n)},Or=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Br=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ar=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,weekends:r,onDateSelect:s=Hn})=>{const{firstDayOfWeek:d,totalDays:m}=l((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Br.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Er({firstDayOfWeek:d,today:e,totalDays:m,currentYear:n,currentMonth:t,min:a,max:i,weekends:r,onDateClick:s})})]})})),Fr=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Mr(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Lr),r=a.map(((e,t)=>Vr(e)?a.slice(0,t).filter(Vr).length:-1)),l=a.map(((e,t)=>zr(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Lr=e=>"_"===e,zr=e=>/\d/.test(e),Vr=e=>Lr(e)||zr(e),$r=1940,jr={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},qr=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m,name:p})=>{const h=s(null),[g,f]=a(r||"");return i((()=>{f(r||"")}),[r]),i((()=>{Ur({inputValue:g,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[g]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none",value:g,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&f(Mr(t,"__.__.____"))},onBlur:()=>{Wr(g)?Ur({inputValue:g,setSelectedMonth:e,setSelectedYear:t,onChange:d}):f(r||"")},disabled:l,"data-test-id":p}),l?null:o(Y,{className:"mr-s",...jr})]})})),Wr=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=$r&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Ur=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Wr(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},Kr=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1,name:s})=>o(qr,{onChange:a,disabled:l,onClick:e,value:t&&oa(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer overflow-hidden hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error"),name:s}),Hr=Fr.map((e=>({key:e}))),Yr=Array.from({length:(new Date).getFullYear()-$r+1},((e,t)=>$r+t)).reverse().map((e=>({key:String(e)}))),Gr=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Jr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Xr={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Qr={className:"min-w-32",iconVersion:"black",isBorder:!1},Zr=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,weekends:p,onChange:h,name:g})=>{const[f,{setValue:y,setFalse:x}]=dn(!1),[b,v]=a(n?.getMonth()||(new Date).getMonth()),[N,w]=a(n?.getFullYear()??(new Date).getFullYear()),C=r((e=>{h?.(e),x()}),[h]),{handlePrevMonth:S,handleNextMonth:k,handleSelectMonth:I,handleSelectYear:T,monthsOptions:R,yearsOptions:E,handleChangeVisibleCalendar:D,ref:_}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Wa(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Fr.indexOf(e));const t=Gr(l,Fr.indexOf(e));Jr({maxDateOfMonth:t,selectedYear:l,selectedMonth:Fr.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Hr,yearsOptions:Yr,ref:c}})({onYearSelect:w,onMonthSelect:v,onShowCalendar:y,selectedYear:N,selectedMonth:b,showCalendar:f,onChange:h,value:n}),P=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(_,370);return c("div",{className:u("space-y-xs",e),ref:_,children:[Ya(t),c("div",{className:"relative",children:[Kr({handleChangeVisibleCalendar:D,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:v,setSelectedYear:w,name:g}),f&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":P}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:S,children:o(Y,{...Xr,className:"-rotate-90 cursor-pointer"})}),o(Bi,{onChange:I,value:{key:Fr[b]},options:R,...Qr}),o(Bi,{onChange:T,value:{key:String(N)},options:E,...Qr}),o("div",{className:"my-auto",onClick:k,children:o(Y,{...Xr,className:"rotate-90 cursor-pointer"})})]}),o(Ar,{today:n,currentMonth:b,currentYear:N,min:s,max:d,weekends:p,onDateSelect:C})]}):null]})]})})),el=d((({className:e,label:t,error:n,required:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zr,{label:Ua({label:t,required:a}),valid:Boolean(!n),...i}),Xa(n)]}))),tl=d((({field:e,input:t})=>{const n=new Date;return o(el,{label:t?.label||"Дата рождения",...e(t?.name??""),maxDate:n,...t})})),nl=d((({field:e,input:t})=>o(Ai,{label:"Когда перезвонить?",...t,options:fi,...e(t?.name??"")}))),al=d((({field:e,input:t})=>o(ti,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??""),...t}))),il=d((({field:e,input:t})=>o(ti,{className:"col-span-2",...e(t?.name??""),placeholder:t?.placeholder??"Ваше сообщение",isTextarea:!0,...t})));function rl(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const ll=e=>({value:e?.value||""}),sl=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=ll,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(s)},ol=async e=>(await sl({url:"suggest/party",query:e}))?.map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),cl={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},dl={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},ml=d((({field:e,input:t={}})=>{const n=t.name??"",i=cl[n].linkedFieldName,r=e(i).value,s=r?.data;rl((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=ul(r),{fullName:a,address:l,inn:s}=t,o=hl(t,i),c=ol(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");rl((async()=>{const e=ol(m);return d(await e),c}),[m]);const p=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[cl[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(Ai,{...dl[n],...t,options:p,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:pl})})),ul=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),pl=e=>c("span",{children:[o(Ye,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(Ye,{size:"text-s",font:"font-light",children:e?.key}),o(Ye,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),hl=(e,t)=>e?.[cl[t].linkedFieldValue],gl=d((({field:e,input:t})=>o(el,{label:"Желаемая дата встречи",...e(t?.name??""),...t}))),fl=d((({field:e,input:t})=>o(ti,{label:"Электронная почта",...e(t?.name??""),...t}))),yl=d((({field:e,input:t})=>o(Ai,{label:"Способ получения ответа",options:ui,...e(t?.name??""),...t}))),xl="Файл не соответствует допустимым расширениям",bl="Ошибка при загрузке файла. Попробуйте загрузить файл позднее",vl="SUCCESS";const Nl=(e,t)=>new Promise((n=>{let a=e;const i=(100-e)/30,r=()=>{a+=i,a>=100?(t(100),n()):(t(a),setTimeout(r,16))};r()})),wl=d((({step:e=10,description:t,showPercentage:n=!0,isOnlyInteger:a=!1})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[a?Math.round(e):e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),Cl={name:"DocIcon",iconVersion:"black",width:"24",height:"24"},Sl=({label:e,inputRef:t,id:n,key:a,type:i,name:r,pattern:l,disabled:s,onChange:d=Hn,onFocus:m,onBlur:p,extensions:h,uploadResponse:g,file:f})=>{const y=e??r??n;return o("div",{children:g?.status===vl?Il(f):c("div",{className:"flex items-center space-x-2",children:[o(Y,{className:"inline-block",...Cl}),Ya(e),o("input",{ref:t,className:u("h-14 hidden"),id:n,type:i,name:r||n,pattern:l,disabled:s,"aria-label":y,onChange:e=>{e?.target?.files&&d(e?.target?.files[0])},onFocus:m,onBlur:p,accept:kl(h)},a)]})})},kl=(e=[])=>e.map((e=>{const t=String(e).trim();return t.startsWith(".")?t:"."+t})).map((e=>e.toLowerCase())).filter(((e,t,n)=>n.indexOf(e)===t)).join(", "),Il=e=>o("span",{children:e?.name}),Tl=(e,t)=>{const n=e?`Поддерживаемые форматы файлов - ${e.join(", ")}. `:"";return o(Ye,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:n+(t?`Максимальный размер файла - ${t}Мб.`:"")})},Rl=({from:e,to:t,onUpdate:n=Hn,minDuration:a=300})=>new Promise((i=>{const r=performance.now(),l=()=>{const s=performance.now()-r,o=Math.min(s/a,1),c=1-Math.pow(1-o,3);n(e+(t-e)*c),o<1?requestAnimationFrame(l):(n(t),i())};requestAnimationFrame(l)})),El={pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},Dl={pdf:"25 50 44 46 2d",docx:"50 4b 03 04",pptx:"50 4b 03 04",xlsx:"50 4b 03 04",doc:"D0 CF 11 E0 A1 B1 1A E1"},_l=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const a=new FileReader;return a.onload=()=>{const e=a.result,n=new Uint8Array(e),i=Array.from(n).map((e=>e.toString(16).padStart(2,"0"))).join(" ");t(i)},a.onerror=n,e&&a.readAsArrayBuffer(e.slice(0,8))})))(e);if(!(t??[]).some((e=>{const t=Dl[e]?.toLowerCase();return console.log(t),console.log(n),t&&n.startsWith(t)})))throw new Error(xl)},Pl=({onUploadError:e=Hn,onFileSelected:t=Hn,extensions:n,maxSizeMB:i,onUploadResponse:r=Hn})=>{const[s,o]=a(0),[c,d]=a(!1),m=l((()=>Ci((e=>d(e)),500)),[d]),u=l((()=>Ci((t=>e(t)),500)),[e]),p=l((()=>Ci((e=>r(e)),500)),[r]);return{verifyFile:async({file:e,onFileChanged:a=Hn})=>{t(e),d(!0);const r=[()=>(async(e,t)=>{const n=e.name.split(".")[1];if(console.log(n,t),!t?.includes(n))throw new Error(xl)})(e,n),()=>(async(e,t)=>{if(t&&e.size>1024*t*1024)throw new Error("Файл превышает допустимый размер");if(0===e.size)throw new Error("Ошибка загрузки файла. Убедитесь, что файл не пустой")})(e,i),()=>_l(e,n),()=>(async(e,t)=>{const n=e?.type??"";if(!(t||[]).map((e=>El[e])).filter((e=>void 0!==e)).includes(n))throw new Error(xl)})(e,n)],l=50/r.length;let s=0;try{for(let e=0;e<r.length;e++){const t=r[e];await t();const n=(e+1)*l;await Rl({from:s,to:n,onUpdate:o,minDuration:300}),s=n}const t=await async function({file:e,onProgress:t=Hn}){return new Promise(((n,a)=>{const i=new FormData;let r;i.append("file",e);const l=new XMLHttpRequest;let s;l.upload.onprogress=e=>{if(e.lengthComputable){const n=e.loaded/e.total*50;t(n)}},l.upload.onload=()=>{let e=50;t(e),r=window.setInterval((()=>{e+=.2,s=e,e<90?t(e):(t(90),window.clearInterval(r))}),100)},l.onload=async()=>{try{const e=JSON.parse(l.responseText);"SUCCESS"===e.status?(window.clearInterval(r),await Nl(s,t),n(e)):a(new Error(e.errorDesc??bl))}catch(e){a(new Error(bl))}},l.onerror=()=>{a(new Error(bl))},l.open("POST",`${ra}/uploadFile`),l.send(i)}))}({file:e,onProgress:o});p(t),a(t?.fileId??""),t?.status===vl&&m?.(!1)}catch(e){const t=e instanceof Error?e.message:bl;u(t),a("")}m?.(!1)},isFileUploading:c,progress:s}},Ol=d((({key:e,className:t,id:n,name:r,type:l="file",label:d,valid:m=!0,pattern:p,autoFocus:h=!1,extensions:g,children:f,onFocus:y,onBlur:x,maxSizeMB:b,error:v,isReset:N,onFileChanged:w=Hn})=>{const C=s(null),[S,k]=a(null),[I,T]=a(""),[R,E]=a(null),{verifyFile:D,isFileUploading:_,progress:P}=Pl({onUploadError:T,onUploadResponse:E,onFileSelected:k,extensions:g,maxSizeMB:b});i((()=>{h&&C.current?.focus()}),[h,C]),i((()=>{N&&O()}),[N]);const O=()=>{k(null),T(""),E(null),w("")},{handleDrag:B,handleLeave:A,handleDrop:F,isDragActive:M}=(({onFileSelected:e,onReset:t,uploadResponse:n,onFileChanged:i})=>{const[r,l]=a(!1);return{handleDrag:e=>{e.preventDefault(),n||l(!0)},handleLeave:()=>l(!1),handleDrop:async a=>{if(a.preventDefault(),n)return;t(),l(!1);const r=a.dataTransfer?.files?.[0];r&&await e({file:r,onFileChanged:i})},isDragActive:r}})({onReset:O,onFileSelected:D,uploadResponse:R,onFileChanged:w}),L=f?"pr-3xl":"",z=Ha(m),V=M?"border-primary-hover":"";return c("div",{className:u("relative",t),onDragEnter:B,onDragOver:B,onDragLeave:A,onDrop:F,children:[o("label",{className:u("h-14 cursor-pointer space-y-xs block",Ga,L,"border-dashed",z,V),children:_?o("div",{children:o(wl,{step:P,isOnlyInteger:!0})}):Sl({label:d,inputRef:C,id:n,key:e,type:l,name:r,pattern:p,disabled:Boolean(R||_),onChange:async e=>{O(),e&&await D({file:e,onFileChanged:w})},onFocus:y,onBlur:x,extensions:g,uploadResponse:R,file:S})}),R?.status===vl?o(Qn,{className:"absolute top-0 right-0 z-10",onClose:O}):null,Tl(g,b),Xa(v||I),f]})})),Bl=d((({label:e,value:t="",error:n,type:a,inputRef:i,required:r,...l})=>o("div",{ref:i,children:o(Ol,{type:a||"file","aria-label":e,label:Ua({label:e,required:r}),valid:Boolean(!n),value:t,error:n,...l})}))),Al=d((({field:e,input:t})=>{const[n,r]=a(""),l=e("fileId");return i((()=>{l?.onChange?.(n)}),[n]),o(Bl,{type:"file",label:t?.name??"",...e(t?.name??""),...t,onFileChanged:r,isReset:!l?.value})})),Fl=d((({field:e,input:t})=>o(ti,{label:"ФИО",...e(t?.name??""),...t}))),Ml=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=mr(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(Ai,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??""),...t})})),Ll=d((({field:e,input:t})=>o(ti,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),zl=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a();i((()=>{r(e("internshipStartDate").value)}),[e("internshipStartDate").value]);return o(el,{label:t?.label||"Дата окончания практики",...e(t?.name??""),...t,value:c,error:e(t?.name??"")?.error||l,errors:[e(t?.name??"")?.error||l],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(Rn(a,{minLimit:n})?"":"Некорректно заполненное поле")},minDate:n})})),Vl=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a(),m=new Date;i((()=>{r(e("internshipEndDate").value)}),[e("internshipEndDate").value]);return o(el,{label:t?.label||"Дата начала практики",...e(t?.name??""),...t,value:c,error:l||e(t?.name??"")?.error,errors:[l??e(t?.name??"")?.error],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(Rn(a,{maxLimit:n})?"":"Некорректно заполненное поле")},minDate:m,maxDate:n})})),$l=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(Fa,{text:t,value:n,disabled:i,onChange:l},a),Xa(r)]}))),jl=d((({field:e,input:t})=>o($l,{...e(t?.name??""),...t,text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ql=`${ra}/outservice`,Wl=[];async function Ul(){const e=await Yt(`${ql}/outserviceregions`);return e&&Array.isArray(e)?e:Wl}const Kl=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=lr("outServiceRegions",Ul),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Ai,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...t,...e(t?.name??""),isSearch:!0})})),Hl=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Yl=d((({field:e,input:t})=>o(ti,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Gl=d((({field:e,input:t})=>o(ti,{label:"Имя",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Jl=d((({field:e,input:t,label:n})=>o(ti,{label:n,type:"number",...e(t?.name??""),...t}))),Xl=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ye,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ql=d((({field:e,input:t})=>Mi(e("acquiringType")?.value?.key)?o(Xl,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??""),...t}):null)),Zl=d((({field:e,input:t})=>o(ti,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),es=nn((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=ts(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ti,{...e(t.name??""),...t,type:"hidden"})})),ts=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",ns=nn((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ti,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),as=e=>"_"===e,is=e=>/\d/.test(e),rs=e=>as(e)||is(e),ls=[..."+7 (___) ___-__-__"],ss=ls.findIndex(as),os=ls.map(((e,t)=>rs(e)?ls.slice(0,t).filter(rs).length:-1));function cs(e){const t=e.replace(/\D/g,""),n=ls.map(((e,n)=>is(e)?e:t.charAt(os[n])||e)),a=os.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(ss,a)):n).join("")}const ds=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(cs(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Ja,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),ms=d((({className:e,label:t,required:n,disabled:a,error:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ds,{"aria-label":t,label:Ua({label:t,required:n}),valid:Boolean(!i),disabled:a,placeholder:"+7 (___) ___-__-__",...r}),Xa(i)]}))),us=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(ms,{label:"Телефон",disabled:Hl(e,t,n),...e(n),...t})})),ps=d((({field:e})=>Mi(e("acquiringType")?.value?.key)?o(Xl,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),hs=nn((({field:e,input:t,source:n})=>o(Ai,{placeholder:"Выберите продукт",label:"Продукт",options:gs(n?.productList),...e(t?.name??""),...t}))),gs=e=>(e??[]).map((e=>({key:e,value:e}))),fs=d((({field:e,input:t})=>o(Ai,{label:"Какой у вас вопрос?",options:yi,...e(t?.name??""),...t}))),ys=`${ra}/regions`,xs=[];function bs(e=ys){const{data:t}=lr(e,Gt);return Array.isArray(t)?t:xs}const vs=`${ra}/outservice/outserviceregions`,Ns=d((({field:e,input:t,params:n})=>{var a;const i=bs((a=n?.typeForm,"OUTSERVICE"===a?vs:void 0));return o(Ai,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??""),...t})})),ws=d((({field:e,input:t})=>o(ti,{label:"ФИО представителя",...t,...e("representativeName")}))),Cs=d((({field:e})=>{const t=e("secondaryPhone");return o(ms,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Yi(t,jn.secondaryPhone):t})})),Ss=d((({field:e,input:t,label:n,options:a})=>o(Ai,{label:n,options:a,...e(t?.name??""),...t}))),ks=d((({field:e,input:t})=>o(Ai,{label:"Направление обслуживания",placeholder:"Выберите направление",options:mi,...e(t?.name??""),...t}))),Is=d((({field:e,input:t})=>o(ti,{label:"Описание ситуации",...t,...e("situationDescription")}))),Ts=d((({field:e,input:t})=>o(Ai,{label:"Пострадал в",...t,options:xi,...e("sufferedFrom")}))),Rs=d((({field:e,input:t})=>o(ti,{label:"Фамилия",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Es=["От 1 мес","До 15 лет"],Ds=d((({field:e})=>o(vr,{title:"Срок, месяцев",items:Es,min:1,max:180,...e("term")}))),_s=d((({field:e,input:t,label:n})=>o(ti,{label:n,maxLength:60,...e(t?.name??""),...t}))),Ps=d((({field:e,input:t})=>o(Ai,{label:"Тип обслуживания",options:di,...e(t?.name??""),...t}))),Os=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(ja,{className:"whitespace-normal",orientation:"horizontal",items:bi,...e(t?.name??"",{onChange:n}),...t})})})),Bs=d((({field:e,input:t})=>o(Fa,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??""),...t}))),As={$ref:"/wcms-resources/outservice-productlist.json"},Fs={$ref:"/wcms-resources/agenty-dlya-rko.json"},Ms={fullName:Fl,addressBranch:pr,desiredMeetingDate:gl,product:e=>o(hs,{...e,source:As}),localities:Kl,isClient:jl,partnerComments:Zl,collectionCount:al,acquiringType:Fi,onlineCheckout:Ql,posTerminal:ps,serviceType:Ps,term:Ds,amount:Sr,annualRevenue:kr,vedTypes:Os,feedbackMethod:yl,serviceDirection:ks,bankEmpolee:Rr,secondaryPhone:Cs,applicationDate:Ir,region:e=>ur(e?.params?.typeForm)?o(Ml,{...e}):o(Ns,{...e}),consentToReceiveMaterials:Bs,sufferedFrom:Ts,situationDescription:Is,representativeName:ws,applierType:Tr,surname:Rs,name:Gl,middleName:Yl,birthday:tl,phone:us,email:fl,inn:Ll,comment:il,fullRegion:Ml,partnerSymbolCode:e=>o(ns,{...e,source:Fs}),partnerName:e=>o(es,{...e,source:Fs}),dadataPartyNameSelect:ml,dadataPartyInnSelect:ml,questionProduct:fs,callbackTime:nl,russianPhone:us,cityOfResidence:e=>o(_s,{...e,label:"Город проживания"}),internshipStartDate:Vl,internshipEndDate:zl,university:e=>o(_s,{...e,label:"ВУЗ"}),courseYear:e=>o(Jl,{...e,label:"Курс"}),graduationYear:e=>o(Jl,{...e,label:"Год окончания"}),fieldOfStudy:e=>o(_s,{...e,label:"Направление обучения"}),educationLevel:e=>o(Ss,{...e,label:"Ступень обучения",options:wi}),averageGrade:e=>o(Jl,{...e,label:"Средний балл обучения"}),skillsAndKnowledge:il,workExperience:il,motivationForInternship:il,internshipDirection:e=>o(Ss,{...e,label:"Направление стажировки",options:vi}),workingHours:e=>o(Ss,{...e,label:"Количество рабочих часов",options:Ni}),fileUpload:Al},Ls=d((({onFieldRef:e=Hn,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const zs=(e,t,n={})=>(a,i)=>{const r={...Ms,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o(Ls,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:{...a,disabled:t?.disabled},params:t})},String(i)):null},Vs=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",$s=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ye,{size:"text-h6",children:e})}):null,js=(e,t,{typeForm:n,additionalParams:a,disabled:i})=>e.map(((e,r)=>c("div",{className:u(Vs(e.columns),"grid"),children:[$s(e.title),(e?.inputs||[])?.map(zs(t,{typeForm:n,disabled:i,...a}))]},`section-${r}`))),qs=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function Ws({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=qs(l,t);return r((e=>{i.current=e,o()}),[])}const Us=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const p=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),h=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:p(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:h(a),className:Ks(a,e,n),"data-test-id":`sms-code-${a}`},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Ks=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${Ha(!n||!a)} rounded-md caret-transparent outline-none`},Hs=d((({disabled:e=!1,onClick:t,text:n})=>o(Xn,{type:"button",onClick:t,disabled:e,testId:"sms-code-submit-button",children:o(Ye,{font:"font-normal",children:n})}))),Ys=d((({className:e,labelColor:t,children:n})=>o("span",{className:u("inline-flex items-center text-start gap-s","white"===t?"text-white":"group-[]/btn-embedded:text-primary-main",e),children:n}))),Gs=d((({className:e,seconds:t})=>o("span",{className:e,children:Js(t)}))),Js=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Xs=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:p})=>o(ta,{maxWidth:"lg",onClose:p,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[Qs(u),o(Us,{values:l,setValues:s,errorText:d,hasError:m}),eo(a,r),e,Zs(n,i),t?o(ka,{blur:!1}):null]})}))),Qs=e=>o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),Zs=(e,t)=>o(Hs,{text:"Далее",disabled:e,onClick:t}),eo=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(Gs,{seconds:e})]}):o(Xn,{embedded:!0,onClick:t,testId:"send-new-code-button",children:o(Ys,{children:"Получить новый код"})}),to=e=>180-Math.floor((Date.now()-e)/1e3),no=va(),ao=va(),io=d((({phone:e,onSuccess:t=Hn,onClose:n=Hn,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:p,errorText:h,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:x,setErrorText:b}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(to(Date.now()),0),s=P(),[o,c]=a(""),[d,{setTrue:m,setFalse:u}]=dn(!1),[p,h]=a(l),g=r((()=>c("")),[]),f=!e.every(Boolean);return{handleSubmit:r((async()=>{try{m();const a=await no.checkCode({code:e.join(""),body:n,reqId:i,router:s});if(a?.errorDesc)return void c(a?.errorDesc);h(0),g(),t?.(a?.reqId)}catch{c("Неверный код")}finally{u()}}),[e]),hasError:Boolean(o),errorText:o,isLoading:d,timeNextReq:p,isSubmitButtonDisabled:f,setTimeNextReq:h,setErrorText:c}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=ca(e),N=Ws({seconds:f,onTick:x}),w=r((async()=>{const e=await ao.sendCode({phone:v});e&&(x(180),N(180),b(""),m(String(e)))}),[v,N,n]);return o(Xs,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:h,hasError:p,onClose:n})})),ro={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l,openUserSurvey:s})=>{const{phone:o}=e,c=i?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.sendCode({phone:String(o)});d?a.open({phone:o,formatData:e,reqId:String(d),onSuccess:d=>{a.close(),n.open({ok:!0,typeForm:t});const m=JSON.stringify({inn:e?.inn,phone:o,id:d});c&&s?.(),Ki({aspectsAttributes:Ui(i,m),aspects:r,ev:l})}}):n.open({ok:Boolean(d),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=Hn,endpoint:s,openUserSurvey:o})=>{const c=t?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.sendPhoneCallRequest(e,s);l(),"success"===d?.status?(r.open({ok:!0,typeForm:i}),c&&o?.(),Ki({aspectsAttributes:t,aspects:n,ev:a})):"error"===d?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(d)}),d&&Ki({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l,withSnowplow:s,openUserSurvey:o})=>{const c=t?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.send({body:e,router:i,endpoint:l}),m=Boolean(d);if(r.open({ok:m}),m){c&&o?.();const{requestId:r}=d,{phone:l}=e,m=i.pathname.split("?")[1],u=JSON.stringify({id:r,phone:String(l),utm:m}),p=s?[...t??[],{aspectName:"snowplowEvent",params:{eventAction:"clickdepapl",eventJSON:u}}]:t;Ki({aspectsAttributes:p,aspects:n,ev:a})}}},lo=nn((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,additionalLink:d,endpoint:m,additionalParams:p,withSnowplow:h,isContacts:g,data:f,onSuccess:y,...x})=>{const b=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),v=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Wi[e.name||""]]))),typeForm:{key:t,text:""}}))(b,n)),[b,n]),N=P(),C=hn(),S=l((()=>Wn(b)),[b]),k=kn(na),I=kn(io),T=oi(!0),[R,{setTrue:E,setFalse:D}]=dn(!1),_=r((async(e,t)=>{E();const a=Li({...e,...p});await so({formatData:a,ev:t,typeForm:n,data:f,aspects:C,router:N,responseTypeDialog:k,verifyPhoneDialog:I,onSuccess:y,withSnowplow:h,openUserSurvey:T},m),D()}),[n]),[,{field:O,onSubmit:B}]=Nn(v,{resetOnSubmit:!0,formValidator:S,onSubmit:_}),A=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(b)?.name,F=A?O("consentDataProcessing"):void 0;return c(Sn,{className:u("container space-y-m",e),title:t,...x,children:[c("form",{onSubmit:B,children:[js(a,O,{typeForm:n,additionalParams:p,disabled:R}),Zi({consentDataProcessing:F,link:s,additionalLink:d,button:i,typeForm:n,isSending:R})]}),g?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),so=async(e,t)=>{const n=t&&ro[t]||ro.default;await n({...e,endpoint:t})},oo={creditCard:"кредитной карты",debitCard:"дебетовой карты",credit:"кредита"},co=d((({attempts:e,productType:t,onClose:n=Hn})=>{const a=mn(),i=e>1,l=r((()=>{a.assign("/natural")}),[]),s=r((()=>{i?l():n()}),[i]);return o(ta,{onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(C,{align:"text-center",children:"Уважаемый клиент!"}),o(C,{align:"text-center",children:`Для получения ${oo[t]} Вам необходимо обратиться в офис Банка`}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(Xn,{type:"button",version:"secondary",onClick:l,children:"Завершить"}),i?null:o(Xn,{type:"button",onClick:n,children:"Продолжить"})]})]})})})),mo=e=>globalThis[e];function uo(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=mo(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(mo(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(mo(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const po=()=>globalThis.location!==globalThis?.top?.location,ho=()=>{const e=po(),t=globalThis.document?.body?.scrollHeight,n=ia(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},go="Некорректно заполненное поле",fo="Укажите регион, город/населенный пункт, улицу, дом",yo=/^[а-яёА-ЯЁ\d]+$/u,xo=/^[\u0400-\u04FF-\s]+$/u,bo=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,vo=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),No=()=>yn(vo)(fo),wo=e=>yn((e=>"string"==typeof e&&e.length>1&&xo.test(e)))(e??go),Co=e=>yn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??go),So=(e,t,n=!1)=>yn((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??go),ko=e=>yn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),Io=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},To=e=>Eo(18,e)("Укажите дату заключения трудового договора"),Ro=e=>Eo(0,e)("Укажите дату регистрации"),Eo=(e,t)=>yn((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),Do=(e=!1)=>yn((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),_o=(e=!1)=>yn((t=>Vn(t)&&Boolean(e)))("Укажите ИНН"),Po={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Oo=e=>ko(Po[e]),Bo={processPersonalDataFlg:zn,consentProviderFlg:zn,consentInformFlg:zn,consentPfrFlg:zn,consentOthersFlg:zn,consentFATCA:zn},Ao={addressCourier:No(),paymentSystem:On("Укажите тип платежной системы"),currency:On("Укажите валюту"),cardCategory:On("Укажите категорию карты"),codeWord:(e=>yn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&yo.test(e)))(e??go))("Необходимо ввести кодовое слово"),confirmationIncome:Bn(),methodObtain:On(),deliveryDate:(e=>yn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},Fo={organization:Bn("Выберите тип организации"),organizationAddress:yn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(fo),organizationPhone:Ln("Укажите номер телефона"),organizationName:On("Укажите наименование организации"),legalForm:On("Укажите ОПФ"),lastJobExperience:Co("Укажите стаж на последнем месте работы"),experience5Years:Co("Укажите общий стаж за последние 5 лет"),jobsNumber:Co("Укажите количество мест работы за последние 5 лет"),addressFact:No(),addressRegistration:No(),addressRetail:Bn("Выберите адрес банка"),addressMatch:On(),sex:On("Укажите свой пол"),birthPlace:On("Укажите место рождения"),education:Bn("Выберите ваше образование"),housing:Bn("Выберите тип жилья"),amountWorkers:Bn("Выберите информацию о количестве сотрудников"),employment:Bn("Выберите информацию о трудоустройстве"),employerActivities:Bn("Выберите вид деятельности организации"),employerOrganization:Bn("Выберите вид организации"),positionOrganization:Bn("Выберите вашу должность"),familyStatus:Bn("Выберите семейное положение"),familyMembers:So(2,"Укажите количество членов семьи"),children:So(2,"Укажите количество детей"),dependents:So(2,"Укажите количество иждивенцев"),snils:(e=>yn(Io)(e))("Некорректный номер СНИЛС"),conscription:On(),armyIdFlg:zn,dulSerie:So(4,"Укажите серию паспорта",!0),dulNumber:So(6,"Укажите номер паспорта",!0),dulSubdivisionCode:So(7,"Укажите код подразделения",!0),dulIssuedBy:On("Укажите организацию, выдавшую паспорт"),retirementIncome:On(),otherIncome:On(),wages:On(),mandatoryPayments:So(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:On(),shareholderFlg:On(),legalEntityName:On(),bankEmployeeCode:On(),partInBusiness:On(),regionRetail:Bn("Выберите регион"),latinSurname:On("Укажите фамилию"),surname:wo("Укажите свою фамилию на кириллице"),name:wo("Укажите своё имя на кириллице"),middleName:wo("Укажите своё отчество на кириллице")},Mo={...Fo,...Ao,...Bo},Lo={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var zo;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(zo||(zo={}));const Vo=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice");return Boolean(e)},$o=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice"),t=globalThis.localStorage?.getItem("productType");return e?'"credit"'===t?"/api/credit-application":"/api/creditcard-application":"/light-api-cash/v1"},jo=async(e,t,n)=>{try{return(await qo(e,t,n)).json()}catch(e){return console.error(e),null}};async function qo(e,t,n){const a=$o(),i=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`${a}${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":i,"X-B3-Traceid":i,...Wo()},credentials:"include",body:n?JSON.stringify(n):null})}const Wo=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Uo=d((({onChangeEsiaStatus:e,productType:t})=>{const n=mn(),a=ia().frameLocation,i=r((async()=>{try{const e=await(async e=>{const t=Vo();return await jo((t?"/external/user-data":"")+"/esia/getLink","POST",e)})({redirectUri:a||globalThis.location.origin+globalThis.location.pathname});e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(zo.Error)}}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?": ":"")}),c("ul","debitCard"===t?{className:"list-disc list-inside",children:[o("li",{children:"значительно сократит время оформления заявки"}),o("li",{children:"доступна курьерская доставка в г. Москва (в пределах МКАД)"})]}:{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Xn,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),Ko={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},Ho={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:Ko,addressFact:Ko,organizationAddress:Ko,addressCourier:Ko},Yo=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const Go=d((({value:e="",onChange:t=Hn,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...p})=>{const[h,{setFalse:g,setTrue:f}]=dn(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),p=s(t),[h,g]=a([]),f=Di(),y=Ho[n],x=r((()=>{p.current=t,f.close()}),[t]),b=r((e=>{x(),p.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await sl({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>Ci(N,300)),[N]);return i((()=>{if(!e||!v.current||p.current===t)return void x();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Yo,{options:h,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,h,t,b]),v}({isOpen:h&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),x=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(Qa,{value:e,onChange:x,inputRef:y,isOpen:h,onOpen:f,onClose:g,name:c,...p})})),Jo=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Xo(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{disabled:Hl(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Xo=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house,...Qo(e)}),Qo=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Zo(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Zo=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",ec=nn((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{n&&(m||d)&&!n.deliveryCities?.includes(m)?(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки")):s("")}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Xo(t))}),[]),p=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:p,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),tc=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(Xo(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),nc=d((({field:e,input:t})=>o($l,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),ac=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:ic({textItems:r,subText:t,children:n,isPhone:a,...i})})),ic=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(Ye,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||rc(n,s),i?o(Ye,{color:a,size:"text-m",children:i}):null]}),rc=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ye,{size:"text-l",children:t?o("a",{href:`tel:${lc(e)}`,children:e.trim()}):e.trim()},String(n)))),lc=e=>e.replace(/\D/g,""),sc=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),oc=d((({isUnfolded:e,...t})=>o(Y,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),cc=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,labelColorStyle:r,...l})=>{const s="white"===r?"":"color";return c(Xn,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(Ys,{labelColor:r,children:a}),o(oc,{isUnfolded:t,iconVersion:i?s:"",className:"flex-grow-0 flex-shrink-0 basis-auto"})]})})),dc=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const mc=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),uc=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(dc,{className:"block sm:hidden",children:[o(mc,{isUnfolded:t,children:e}),o(cc,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),pc=e=>{const t=gc(e);return o(ac,{label:"Режим работы",value:t,className:"max-w-none"})},hc=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",gc=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[hc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),hc({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},fc=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],yc=e=>fc.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),xc=e=>{if(!e)return null;const t=bc(e);return c(sc,{className:"border-none",children:[o(ac,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(vc)})}),o(ac,{label:"Режим работы",className:"max-w-none",children:o(Ye,{children:e})})]})},bc=e=>{const t=fc.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},vc=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Ye,{size:"text-xs",children:e})},String(n)),Nc=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(ac,{label:"Валюта",value:e.currency}):null,t?o(ac,{label:"Купить",value:String(t)}):null,n?o(ac,{label:"Продать",value:String(n)}):null]},String(a)),wc={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Cc=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",wc[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ye,{size:"text-m",color:wc[n].text,children:t})]}))),Sc=(new Date).getDay(),kc=e=>{const[t]=e?.slice(Sc-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Cc,{color:"green",children:i}):null,n&&r?o(Cc,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Cc,{color:"red",children:"Выходной"})},Ic=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Tc=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(ac,{label:e,value:t&&n?n:"",subText:Ic({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),Rc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ec=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Dc=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,_c=(e,t)=>{if(!e.workSchedule)return null;const n=yc(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ye,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:e.address})]}):null]}),kc(n)]}),o(uc,{children:Pc(e)})]},String(t))},Pc=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=yc(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(sc,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(ac,{label:"Факс",value:t,isPhone:!0}),o(ac,{label:"Телефон филиала",value:e,isPhone:!0}),o(ac,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(ac,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(ac,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(ac,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(sc,{children:o(ac,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Tc)})})}):c(sc,{children:[o(ac,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(vc)})}),pc(d)]}),l?.businessScheduleVisibleTag?xc(l?.businessScheduleDescription):null,s?.currencies?.length?o(sc,{className:"flex-wrap",children:s?.currencies?.map(Nc)}):null]})},Oc=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=yc(e),n=e?gc(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Rc(n):Dc(n,a):Ec(n):""})(n)}`;return{header:a,body:r}},Bc={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},Ac={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},Fc={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},Mc=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Fc[t](e)))))},Lc=()=>{},zc=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Lc,getBalloonRemoteWorkplaces:i=Lc})=>{const[r,s,o,c]=l((()=>{const r=Mc(e,n),l=Mc(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Vc=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),$c=d((({children:e})=>Vc?e:null)),jc="/icons/MapMarkerClusterIcon.svg",qc="/icons/MapMarkerClusterYellowIcon.svg";function Wc({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=Uc("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Uc("workplaces",e,i),l=Kc(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Kc(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=Kc(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Uc=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?jc:qc,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Kc=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?jc:qc,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Hc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Yc={...Hc,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Gc=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Yc).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Jc={...Hc,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Xc=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Jc).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:n,width:"20",height:"16"})})})),Qc=[55.753995,37.614069],Zc=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=uo("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?Wc({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:ed(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Wc({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const p="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(ka,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",p),children:[o(Xc,{yandexMaps:l}),o(Xc,{yandexMaps:l,direction:"out"})]}),Gc(l,m,u("right-2 top-80",p))]})})),ed=e=>{const t=[nd(td(e,0)),nd(td(e,1))];return t.every((e=>e))?t:Qc},td=(e,t)=>e.map((e=>e.coords?.[t])),nd=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ad=e=>Number(e.toString().replace(",",".")),id=e=>{const t=Vo(),n=$o(),{data:a,error:i}=lr(`${n}${t?"/external/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(e)}`,rd);return a&&"errorMessage"in a?{error:i}:{data:a,error:i}},rd=async e=>await Yt(e,{method:"POST"})||[],ld=()=>be(),sd=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=id("REGION_RF"),{programId:s}=ld(),d="38"===s,m=e("regionRetail")?.value||{},u=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=Vo(),n=await jo((t?"/external":"")+"/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return n?.offices?.map((e=>({...e,gpsLatitude:ad(e.latitude??Qc[0]),gpsLongitude:ad(e.longitude??Qc[1])})))||[]})(m?.key??"");r(e)})()}),[m.key]);const{points:p}=zc({data:n,filtrationState:{},getBalloon:Oc});return c("div",{children:[o(Ai,{label:"Адрес отделения",placeholder:"Выберите отделение",disabled:d,options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...u,isSearch:!0}),o("div",{className:"h-[600px]",children:o($c,{children:o(Zc,{points:p,isLoad:!l,className:"h-full",selectedAddress:u?.value?.text})})})]})})),od=nn((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,onChange:r,...l})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Ai,{placeholder:a,options:s,...e(n),...l,onChange:r??e(n)?.onChange})})),cd=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",...t})})),dd=d((({field:e,input:t})=>o($l,{text:"Наличие военного билета",...e(t?.name??"")}))),md=d((({className:e,label:t,required:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ja,{label:Ua({label:t,required:n}),...i}),Xa(a)]}))),ud=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],pd=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(md,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:ud,value:n,onChange:l}),"true"===n?o(Go,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),hd=d((({field:e,input:t})=>o($l,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),gd=d((({field:e,input:t})=>o(el,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Hl(e,t),maxDate:new Date}))),fd=d((({field:e,input:t})=>o(Go,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Hl(e,t)})));function yd(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const xd=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:a?o(ie,{image:a,className:"block w-max"}):o(Y,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Ke,{__html:e})})]}))),bd=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=yd("programId"),{productType:m,leadForm:u}=ld(),p="debitCard"===m,h=Boolean(e("esiaAccountTypeCd")?.value?.key),{value:g,onChange:f}=e("cardCategory"),y=e("paymentSystem")?.value?.key,x="office"===u?.methodObtain,b=e("cardCategory")?.value?.text?.toLowerCase()?.includes("неимен"),v=r((e=>0!==e.length?{key:e[0].key,text:e[0].value}:null),[y]),N=r((t=>{f?.(t),e("isMomentDebitCard")?.onChange?.(t?.text?.toLowerCase()?.includes("неимен"))}),[]);i((()=>{y&&d&&(async()=>{const t=await(async(e,t)=>{const n=Vo(),a=n?"/external/public-data/dictionaryFiltered":"/dictionaryFiltered",i=n?{paymentSystemTypeCd:e,dictionaryType:"CARD_TYPE"}:{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}},r=await jo(a,"POST",i);return Array.isArray(r)?r:[]})(y,d),n=!p||h&&!x?t:Nd(t);s(n),vd(n,g)||f?.(v(n)),p&&e("isMomentDebitCard")?.onChange?.(b)})()}),[y,v,b]);const w=l((()=>n?.find((e=>e.key===g?.key))?.description),[n,g]);return c("div",{children:[o(od,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",...t,onChange:N}),w?o(xd,{__html:w}):null]})})),vd=(e,t)=>e.some((e=>e.key===t?.key)),Nd=e=>e.filter((e=>e.value&&e.value.toLowerCase().includes(" именная"))),wd=d((({field:e,input:t})=>o(Go,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),Cd=e=>{const t={q:"й",w:"ц",e:"у",r:"к",t:"е",y:"н",u:"г",i:"ш",o:"щ",p:"з","[":"х","]":"ъ",a:"ф",s:"ы",d:"в",f:"а",g:"п",h:"р",j:"о",k:"л",l:"д",";":"ж","'":"э",z:"я",x:"ч",c:"с",v:"м",b:"и",n:"т",m:"ь",",":"б",".":"ю","`":"ё","{":"Х","}":"Ъ",":":"Ж","~":"Ё",'"':"Э","<":"Б",">":"Ю","\\":"\\","^":"^",_:"_"};return e.replace(/[A-z,`~<.>;:\\'"[{\]}]/g,(e=>e===e.toLowerCase()?t[e]:t[e.toLowerCase()].toUpperCase()))},Sd=d((({field:e,input:t})=>{const n=r((n=>{const a=Cd(n);(yo.test(a)||0===a.length)&&e(t?.name??"")?.onChange?.(a)}),[e,t]);return o(Go,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t,onChange:n})})),kd=d((({field:e,input:t})=>{const{data:n}=id("INCOME_CERT_UNITED"),a=Hl(e,t);return c("div",{className:"space-y-xl",children:[a?o(xd,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(od,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",...t,disabled:a})]})})),Id=d((({field:e,input:t})=>{const{data:n}=id("MILITARY_STATUS");return o(od,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",...t})})),Td=()=>be(),Rd=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Le();return c(ta,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Xn,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Ed=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=dn(!1),{open:l}=kn(Rd),s=Le();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=Vo(),a=await qo(`${n?"/external":""}/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return a?a.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},Dd=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=Ed(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Fa,{...a}),n?c(Xn,{embedded:!0,onClick:i,children:[o(Ys,{children:"Ознакомиться"}),r?o(ka,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),Xa(t)]})})),_d=d((({field:e,input:t})=>{const{productType:n}=Td(),a=Lo[n??""];return t&&t.name?o(Dd,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name),...t}):null})),Pd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Od="flex flex-col justify-between lg:flex-row gap-4xl",Bd="w-full",Ad="flex flex-col lg:w-1/2 gap-2xl",Fd="grid lg:grid-cols-2 grid-cols-1 gap-4xl",Md="flex flex-col gap-y-xl min-w-52",Ld=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Ye,{size:"text-h3",children:"number"==typeof e?[a,lt(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),zd=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Ye,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Ld,{value:n,...i}):o(Ye,{size:"text-h3",children:"-"})]}))),Vd=e=>jd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),$d=(e=[],t=!1,n=[])=>({...jd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),jd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},qd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Wd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(vr,{items:[`От ${Ud(e)}`,`До ${Ud(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Ud=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Kd=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Ye,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(ja,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Hd=e=>Kd({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Yd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(vr,{items:e?[`От ${lt(1)(a.min||0)} ${n}`,`До ${lt(1)(a.max||0)} ${n}`]:[],step:t,...a}),Gd=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(gr(t?.[i],n.minMonths,n.maxMonths))},Jd=Math.round(29.5),Xd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Qd=e=>e,Zd=(e=Qd)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),em=Zd(),tm=(e=Qd)=>Zd((t=>-e(t))),nm=tm(),am=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:im([e,t],a),im=([e,t],n=[])=>({[e]:n.length?nm(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?em(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),rm=(e,[t,n],a)=>e>=a[t]&&e<=a[n],lm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},sm=e=>om({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&om({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&om({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&om({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),om=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],cm=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[lm],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>sm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=am(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=am(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>sm({row:e,userInputParams:t,paramsViewSettings:n})&&rm(a,["minSum","maxSum"],e)&&rm(i,["minMonths","maxMonths"],e)))||lm)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,p=Xd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:p}},dm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),mm=(e,t=0)=>e?.sum?e.sum:t,um=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,pm=e=>({moneyValue:mm(e,2e5),monthsValue:um(e,Jd),monthlyPayment:0,rate:0,isAnnuity:Boolean(e?.isAnnuity),isInsurance:Boolean(e?.isEnableInsurance),isSalaryClient:Boolean(e?.isEnableSalaryClient),isPensionClient:Boolean(e?.isEnablePensionClient),isStateEmployee:Boolean(e?.isEnableStateEmployee)}),hm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},gm=nn((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...p})=>{const h=Vd(n?.rateRows),g=r((e=>{const t=cm(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:h?.rate??0})}),[s,n]),[f,{field:y}]=Nn(pm(d),{onChange:g}),x=cm(f,n,s),b=Hd({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(gr(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(gr(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!dm(d)&&h&&Gd({field:y,defParams:h,calcParams:x,map:hm,monthsValue:"minMonths"})}),[n,d]),o(Pd,{className:e,title:t,...p,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),Wd({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),fm({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Md,"@4xl:w-1/2"),children:[o(zd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(zd,{title:"Ставка от",value:h?.rate,fractionDigits:2,postfix:"%"}),o(zd,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),nt(a,{isVertical:!0}),qd(l)]})]})})})),fm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Fa,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Fa,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Fa,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Fa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),ym="calculator",xm=d((({field:e,params:t})=>{const[n,l]=a(),s=e(ym)?.value,c=r((t=>{e(ym).onChange?.(t)}),[]);return i((()=>{t?.calcData?.defaultParams&&l(s?vm(e(ym).value):t?.calcData?.defaultParams)}),[t?.calcData?.defaultParams]),i((()=>{n&&c(pm(n))}),[n]),n?o(gm,{...t?.calcData,defaultParams:n,padding:"p-0",onChange:c}):o(ka,{})})),bm={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},vm=(e,t=!1)=>{const n=t?Nm(bm):bm;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Nm=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),wm=d((({field:e,input:t})=>{const{data:n}=id("CREDIT_IN_RSHB");return o(od,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Cm={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},Sm=[{id:"810",text:"Рубли"}],km=d((({field:e,input:t})=>{const{data:n}=id("CURRENCY"),{programId:a}=Td(),i=l((()=>!Object.keys(Cm).includes(a||"")||"38"===a),[]),r=l((()=>i?Sm:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(md,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??""),...t})})),Im=(e,t)=>{if(!t)return null;const n=Dm(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Tm=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Rm=(e,t)=>{const n=Dm(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Em=(e,t,n)=>{const a=Dm(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Dm=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,_m={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},Pm=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=Om(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Xo(n.data?.address));const s={amountWorkers:Tm(e?.amountWorkers,n.data?.employee_count),employerActivities:Im(e?.employerActivities??[],a),organization:Em(e?.organization??[],i,r),employerOrganization:Rm(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},Om=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Bm=d((({field:e,input:t})=>{const n=ld(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,p=e?.("esiaAccountTypeCd")?.value,h=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{Pm(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{const n=Vo();await Promise.all(Object.entries(e).map((e=>{const[a,i]=e;jo(`${n?"/external/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(i)}`,"POST").then((e=>{t[a]=e}))})))})(_m,n)})()}),[]),i((()=>{p&&h&&Am(n)&&(async()=>{const t=await(async e=>{const t=await sl({url:"suggest/party",query:e});return t?.[0]})(h);t&&Pm(n,e,t)})()}),[c,d,m,u]);const x=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Go,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:Hl(e,t),onChange:x,error:l||e("inn")?.error})})),Am=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},Fm=new Date(Date.now()+864e5),Mm=d((({field:e,input:t})=>{const{productType:n}=ld(),a="debitCard"===n,i=a?Fm:new Date,{data:r}=id("DAYS_DELIVERY_SETTINGS"),s=l((()=>{const e=r?.find((e=>"WEEKEND"===e.key));return e&&e.value?e.value.split(",").map(Number):[]}),[r]);return o(el,{label:"Дата доставки",...e(t?.name??""),minDate:i,weekends:a?s:[]})})),Lm=d((({field:e,input:t})=>{const{productType:n}=ld(),a="debitCard"===n,{data:i}=id("COURIER_DELIVERY_TIME"),r=["TIME_1","TIME_2","TIME_3"],s=["TIME_4","TIME_5"],c=l((()=>{const e=a?s:r;return(i||[]).filter((t=>t.key&&e.includes(t.key))).map((e=>({id:e.key,text:e.value})))}),[i,a]);return o(md,{label:"Время доставки",className:"flex-row",items:c,...e(t?.name??"")})})),zm=d((({field:e,input:t})=>o(Go,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Vm=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(el,{label:"Дата выдачи",...e(t?.name??""),disabled:Hl(e,t),minDate:a,maxDate:new Date,...t})})),$m=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(Go,{disabled:Hl(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),jm=d((({field:e,input:t})=>o(Go,{disabled:Hl(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??""),...t}))),qm=d((({field:e,input:t})=>o(Go,{disabled:Hl(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??""),...t}))),Wm=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(Mr(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(Go,{disabled:Hl(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Um=d((({field:e,input:t})=>{const{data:n}=id("EDUCATION_LEVEL");return o(od,{field:e,source:n,label:"Образование",fieldName:"education",...t})})),Km=d((({field:e,input:t})=>{const n=r((t=>{(bo.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o(Go,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),Hm=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",...t})})),Ym=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Gm=d((({field:e,input:t})=>{const{data:n}=id("EMPLOYMENT_INFO_UNITED");return o(od,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",...t})})),Jm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(gr(Number(n),0,5)))),[]);return o(Go,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Hl(e,t)})})),Xm=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Go,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,...t,onChange:a})})),Qm=d((({field:e,input:t})=>{const{data:n}=id("MARITAL_STATUS");return o(od,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",...t})})),Zm=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(Go,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Hl(e,t)})})),eu=d((({field:e,input:t})=>{const{data:n}=id("HOUSE_TYPE");return o(od,{field:e,source:n,label:"Тип жилья",fieldName:"housing",...t})})),tu=d((({input:e})=>o(xd,{__html:e?.label}))),nu=d((({field:e,input:t})=>o($l,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),au=d((({field:e,input:t})=>o(Go,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Hl(e,t)}))),iu=d((({field:e,input:t})=>o(Go,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Hl(e,t)}))),ru=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,lu=(e="",t="")=>ru.test(e)&&t.length<20&&e.length+t.length<=20,su={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "},ou=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>su[e.toLowerCase()].toUpperCase()||"")),cu=(e,t)=>{let n=ou(e);const a=ou(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},du=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=cu(a,l);s?.(e)}),[]);const c=r((e=>{(lu(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ti,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),mu=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=cu(a,l);s?.(e)}),[]);const c=r((e=>{(lu(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ti,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),uu=d((({field:e,input:t})=>o(Go,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),pu=d((({field:e,input:t})=>o(Go,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),hu=d((({field:e,input:t})=>o(el,{label:"Дата рождения",...e(t?.name??""),...t,disabled:Hl(e,t)}))),gu=d((({field:e,input:t})=>o(Go,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),fu=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],yu=d((({field:e,input:t})=>o(md,{orientation:"horizontal",items:fu,...e(t?.name??"")}))),xu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("middleName")?.onChange?.(n)}),[e]);return o(Go,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),bu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("name")?.onChange?.(n)}),[e]);return o(Go,{label:"Имя",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),vu=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Nu=d((({field:e,input:t})=>{const n=ld(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{Pm(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Go,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Hl(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),wu=d((({field:e,input:t})=>o(Go,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Cu=d((({field:e,input:t})=>o(el,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date,...t}))),Su=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(gr(Number(n),0,100)))),[]);return o(Go,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),ku=e=>e.map((e=>({key:e.type,text:e.name}))),Iu=e=>e?.key,Tu=[{key:"PAYMENT_SYSTEM_TYPE_3",text:"UnionPay"}],Ru=d((({field:e,input:t})=>{const[n,i]=a([]),r=be(),s=ia();rl((async()=>{const{programId:e}=r,{claimChannelCode:t}=s;if(e){const n=t?Tu:await(async e=>{const t=Vo()?"/external/user-data/getPaymentSystem":"/public-data/creditProgramConditions",n=await jo(t,"POST",{creditProgramId:e});return ku(n?.paymentSystems||[])})(e);i(n??[])}}),[]);const c=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(md,{label:"Платежная система",orientation:"horizontal",items:c,...e(t?.name??"",{format:Iu,parse:e=>n?.find((t=>t.key===e))}),...t})})),Eu=d((({field:e,input:t})=>{const{data:n}=id("POSITION");return o(od,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",...t})})),Du=async()=>{const e=Vo();return await jo((e?"/external":"")+"/public-data/regionsCardDelivery","GET")||void 0},_u={key:"REGION_77",text:"Москва и Московская область"},Pu={key:"3041100",text:"Аэропорт Шереметьево, МО, г.Химки, Шереметьевское шоссе, вл39с1"},Ou={key:"REGION_77",text:"Москва и Московская область"},Bu={key:"3",text:"г. Москва, Пресненская наб., д. 10, стр. 2"},Au=d((({field:e,input:t})=>{const{programId:n,productType:a,leadForm:l}=ld(),s=l?.regionRetail,{data:c}=id("REGION_RF"),{data:d}=lr("regionsDelivery",Du),{data:m}=id(Fu(a)),u=ia(),p="debitCard"===a,h="38"===n,g=Boolean(e("esiaAccountTypeCd")?.value?.key),f=c?.map((({key:e,value:t})=>({key:e,text:t}))),y="true"===m?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,x=e("regionRetail")?.onChange,b=e("addressRetail")?.onChange,v=e("regionHasDelivery")?.onChange,N=e("methodObtain")?.onChange,w=r((e=>(!p||g&&!h)&&y&&d?.find((t=>t.regionCode===e.key))?.deliveryFlg),[y,d]),C=r((e=>{const t=w(e);v?.(t),N?.(t?"courier":"office"),x?.(e),b?.("")}),[d,y,g]);return i((()=>{if(u.claimChannelCode)x?.(_u),b?.(Pu),v?.(w(_u)),N?.("office");else if(h)x?.(Ou),b?.(Bu),N?.("office");else if(s){const e=w(s);v?.(e),N?.(e?"courier":"office"),x?.(s)}}),[w]),o(Ai,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,disabled:h,options:f,...e(t?.name??""),...t,onChange:C})})),Fu=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Mu=d((({field:e,input:t})=>o(Go,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),Lu=["male","female"],zu=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Vu=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await sl({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Lu.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(md,{label:"Пол",orientation:"horizontal",items:zu,...e(t?.name??""),...t})})),$u=d((({field:e,input:t})=>o($l,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),ju=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Mr(e,"___-___-___ __")):t?.(Mr(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Ja,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),qu=d((({className:e,label:t,required:n,value:a,error:i,onChange:r,onBlur:l,...s})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ju,{"aria-label":t,label:Ua({label:t,required:n}),valid:Boolean(!i),value:a,onChange:r,onBlur:l,placeholder:"___-___-___ __",...s}),Xa(i)]}))),Wu=d((({field:e,input:t})=>o(qu,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Uu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("surname")?.onChange?.(n)}),[e]);return o(Go,{label:"Фамилия",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),Ku=d((({field:e,input:t})=>o(Go,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Hl(e,t)}))),Hu={$ref:"/wcms-resources/delivery-cities-data.json"},Yu={limitedBirthday:hu,name:bu,surname:Uu,middleName:xu,email:Km},Gu={processPersonalDataFlg:_d,consentProviderFlg:_d,consentOthersFlg:_d,consentInformFlg:_d,consentPfrFlg:_d,consentFATCA:_d},Ju={organization:vu,organizationAddress:Jo,organizationPhone:us,organizationName:Nu,legalForm:pu,generalSeniority:Zm,lastJobExperience:iu,experience5Years:Jm,jobsNumber:au,beginDate:gd,addressFact:tc,addressRegistration:Jo,addressRetail:sd,addressMatch:nc,sex:Vu,birthPlace:fd,education:Um,housing:eu,amountWorkers:cd,employment:Gm,employerActivities:Hm,employerOrganization:Ym,positionOrganization:Eu,familyStatus:Qm,familyMembers:Xm,children:wd,dependents:zm,snils:Wu,conscription:Id,armyIdFlg:dd,dulSerie:qm,dulNumber:jm,dulIssueDate:Vm,dulSubdivisionCode:Wm,dulIssuedBy:$m,participantDateRegistration:Cu,retirementIncome:Mu,otherIncome:wu,wages:Ku,mandatoryPayments:gu,bankruptcyFlg:hd,initiateBankruptcyFlg:nu,shareholderFlg:$u,legalEntityName:uu,creditInRshbCd:wm,bankEmployeeCode:pd,partInBusiness:Su,regionRetail:Au,infoCard:tu,calculator:xm,confirmationIncome:kd,inn:Bm,...Yu},Xu={addressCourier:e=>o(ec,{...e,source:Hu}),paymentSystem:Ru,currency:km,cardCategory:bd,codeWord:Sd,methodObtain:yu,deliveryDate:Mm,latinName:du,latinSurname:mu,deliveryTime:Lm},Qu="Согласие на все документы",Zu=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Yi(t(e?.name),zn).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(dc,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(Fa,{text:Qu,value:a,onChange:i,name:"all-consents"},n),Xa(s?"Отметьте все обязательные соглашения":"")]}),o(Xn,{embedded:!0,ariaLabel:Qu,onClick:m,children:o(oc,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(mc,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(zs(t,{},Gu))})]})})})),ep=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=tp(t||[],n);return a.length>2?c("div",{children:[i.map(zs(e,{},{...Yu})),o(Zu,{inputs:a,field:e})]}):(t||[])?.map(zs(e,{},{...Yu}))},tp=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(Lo[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(Lo[t]).includes(String(e))))}),np=(e,t=!1)=>o(Ia,{className:"w-full @xl:w-auto",isLoading:t,testId:"LeadSubmitButton",children:e?.text?e.text:"Отправить заявку"}),ap=async e=>{const t=Vo();return await jo((t?"/internal":"")+"/user-data/createDraftTask","POST",e)||{}},ip=async e=>{const t=Vo()?"/internal/entities/getLastStatus":"/user-data/getLastStatus",n=await jo(t,"POST",e);return"DRAFT"===n?.statusCd?n?.taskId:null},rp=async e=>{const t=Vo()?"/internal/entities/getTaskById":"/user-data/getTaskById";return await jo(t,"POST",e)||void 0},lp=e=>qo((Vo()?"/internal":"")+"/referal/saveReferalInfo","POST",e),sp=e=>qo("/user-data/updateUserProfile","PUT",e),op=e=>qo((Vo()?"/internal":"")+"/user-data/updateUserTask","PUT",e),cp={width:"103",height:"21"},dp={"bg-white":"color",transparent:"white"},mp={"bg-white":"text-primary-main",transparent:"text-white"},up=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:dp[e]},className:mp[e],width:n?.width,height:n?.height}),pp={"bg-white":"text-primary-text",transparent:"text-white"},hp=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...Re(s),children:[up(r,n?.image,cp),l?a??o("div",{className:"ml-s",children:o(Ye,{font:"font-medium",color:pp[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),gp=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,p]=a(!1),[h,{setTrue:g,setFalse:f}]=dn(!1),{closeAll:y}=Ce(),x=r((async()=>{g();await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/checkCaptcha","POST",{captchaText:e.captchaText,...t&&{phoneNumber:e?.phoneNumber}}).then((e=>e.text())).then((e=>"ERROR"!==e))})({captchaText:d,phoneNumber:e})?(n?.(),t?.()):p(!0),f()}),[d,t]),b=r((()=>{(async()=>{s(URL.createObjectURL(await(async e=>{const t=Vo();return await qo(`${t?"/external/user-data":""}/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob))})(e)))})()}),[]);return i(b,[]),o(ta,{head:o(hp,{}),onClose:y,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Xn,{className:"w-8",embedded:!0,onClick:b,children:o(Y,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Ja,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(Xn,{version:"secondary",onClick:y,children:"Вернуться"}),o(Ia,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),h?o(ka,{blur:!1}):null]})})})),fp=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},yp=({values:e,phoneNumber:t,onSuccess:n,onFail:l})=>{const s=ia(),o=s.smsCode?.attempts||0,c=Math.max(to(s.smsCode?.sendTime||Date.now()),0),[d,m]=a(""),[u,{setTrue:p,setFalse:h}]=dn(!1),[g,f]=a(c),y=r((()=>m("")),[]),x=Boolean(0===g&&s.smsCode?.sendTime),b=o>2||x||!e.every(Boolean),v=r((async()=>{s.smsCode={...s.smsCode,attempts:o+1},p();const a=await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/checkCode","POST",{smsText:e.smsText,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName,...t&&{phoneNumber:e?.phoneNumber}})})({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"},phoneNumber:t});if(a.ok){const t=await a.json();fp(t),f(0),y(),s.smsCode=null,n?.(e.join(""))}else 403===a.status?m(o>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):l();h()}),[e,o]);return i((()=>{x?m("Код просрочен"):o>2&&m("Исчерпан лимит ввода смс-кода")}),[x]),{handleSubmit:v,hasError:Boolean(d),errorText:d,isLoading:u,timeNextReq:g,isSubmitButtonDisabled:b,setTimeNextReq:f,setErrorText:m}},xp=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=Hn,onClose:s=Hn,onFail:c=Hn})=>{const[d,m]=a(Array(4).fill("")),u=ia(),p=ca(e),{handleSubmit:h,hasError:g,errorText:f,isLoading:y,timeNextReq:x,isSubmitButtonDisabled:b,setTimeNextReq:v,setErrorText:N}=yp({values:d,phoneNumber:p,onSuccess:l,onFail:c}),w=kn(gp),C=Ws({seconds:x,onTick:v}),S=r((async()=>{const e=await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/sendCode","POST",{phoneNumber:e.phoneNumber,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName})})({phoneNumber:p,smsCodesSetName:{key:"AUTHENTICATION"}});e.ok?(v(180),C(180),N(""),u.smsCode=bp(p)):429===e.status?w.open({phoneNumber:p,sendCode:S}):c()}),[p,C]);return i((()=>{u.smsCode?.sendTime&&u.smsCode?.phoneNumber===p||S()}),[]),o(Xs,{isSubmitButtonDisabled:b,onSubmit:h,onSendCode:S,timeNextReq:x,values:d,onChange:m,phone:e,isLoading:y,errorText:f,hasError:g,onClose:s,children:vp(n,t)})})),bp=e=>({sendTime:Date.now(),attempts:0,phoneNumber:e}),vp=(e,t=!1)=>t?c(Ke,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Np={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},wp={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Cp=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Sp=d((({onSubmit:e=Hn,onClose:t=Hn})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=Ed(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),p=l?wp:Np;return o(ta,{onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:p.title})}),o(C,{align:"text-center",children:p.description}),o(ja,{className:"whitespace-normal",orientation:"horizontal",items:Cp,value:n,onChange:u}),o(Xn,{disabled:!n,type:"button",onClick:m,testId:"bki-button",children:"Далее"})]})})})),kp=async e=>{await qo("/internal/camunda/send/message","POST",e)},Ip={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Tp={amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},Rp={amur_card:"14",owner_card:"13",travel_card:"15"},Ep={...Ip,...Rp,...Tp},Dp=d((({title:e,icon:t,description:n,name:a,onClick:i=Hn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:i,"data-test-id":a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(Ye,{font:"font-medium",size:"text-s",children:e}):null,n?o(Ye,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),_p=d((function({createdDate:e,productData:t,isFromLead:n,handleGoToDraft:a,handleGoToNewTask:i,onClose:r}){return c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Dp,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:e?`Черновик от ${oa(new Date(e))}`:"",onClick:a,name:"go-to-draft-button"}),o(Dp,{title:n?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:t.description,onClick:n?r:i,name:"go-to-current-task-button"})]})]})})),Pp={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Op={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Bp={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Ap=e=>Object.entries(e).reduce(((e,[t,n])=>t in Pp?[...e,{contactTypeCd:{key:Pp[t]},value:n}]:e),[]),Fp=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Op){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{...a,addressType:{key:Op[t]}}]}return e}),[]),Mp=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:p,armyIdFlg:h,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:Lp(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in Bp?[...e,{incomeTypeCd:{key:Bp[t]},value:Number(n||0)}]:e),[])),snils:p?.replace(/[-\s]/g,""),armyIdFlg:h,initiateBankruptcyFlg:f};var y},Lp=(e,t)=>(Number(e??0)+Number(t??0)).toString(),zp={WORK:"Работаю",RETIREE:"Пенсионер"},Vp=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Lp(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},$p=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},jp=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},qp=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,Wp=e=>{switch(e){case"debit":return{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"};case"credit":return{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"};default:return{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"}}},Up=d((function({task:e,taskType:t,isDebit:n,isFromLead:a=!1,sendAspects:i=Hn,onClose:l=Hn}){const s=ld(),c=mn(),d=Vo(),{participants:m,participant:u,creditProgram:p,createdDate:h="",id:g}=e,f=Ep[p.code],y=Wp(t??((e,t)=>t||e&&e in Tp?"debit":e?e in Ip?"credit":e in Rp?"card":void 0:void 0)(e.creditProgram.code,n)),x=u||m?.[0],{id:b,profile:v}=x||{},N=r((()=>{const t=(e=>{const t=e.participant||e.participants?.[0];if(!t)throw new Error("Task does not contain participant data");const{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:_,employeesNumberCd:P,opf:O,seniority:B,generalSeniority:A,jobsNumber:F,lastWorkDuration:M,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:W,snils:U,armyIdFlg:K,bankruptcyFlg:H,shareholderFlg:Y,nameLegalEntity:G,creditInRshbCd:J,payrollCardRshbFlg:X,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:qp(i),cardCategory:qp(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:qp(b),participantDateRegistration:v,housing:qp(N),beginDate:k,employment:qp(I,zp),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:qp(E),organization:qp(D),employerOrganization:qp(_),amountWorkers:qp(P),legalForm:O,generalSeniority:B?.toString(),experience5Years:A?.toString(),jobsNumber:F?.toString(),lastJobExperience:M?.toString(),positionOrganization:qp(L),familyStatus:qp(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:qp(q),snils:U,armyIdFlg:K,bankruptcyFlg:H,shareholderFlg:Y,legalEntityName:G,creditInRshbCd:qp(J),calculator:{isInsurance:X,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Vp(W),...$p(S),...jp(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);s.participantId=b??null,s.taskId=g,s.profileId=v?.id??null,s.userId=v?.id??null,s.programId=f,s.leadForm=t,v?.id&&i(v.id,g),c.assign(y.nextStepLink)}),[]),w=r((async()=>{if(d)try{await kp({messageName:"KILL_DRAFT_PROCESS_MESSAGE",taskId:e.id})}catch(e){console.error(e)}c.assign(y.newTaskLink)}),[e.id,y.newTaskLink,d]);return o(ta,{onClose:l,children:o(_p,{createdDate:h,productData:y,isFromLead:a,handleGoToDraft:N,handleGoToNewTask:w,onClose:l})})})),Kp=d((function({taskType:e,isDebit:t,onClose:n=Hn}){const a=mn(),i=Wp(e||(t?"debit":void 0)),l=r((()=>{a.assign(i.newTaskLink)}),[]),s=r((()=>{a.assign("/")}),[]);return o(ta,{onClose:n,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Xn,{type:"button",className:"w-full",onClick:l,children:"Заполнить новую заявку"}),o(Xn,{type:"button",version:"secondary",className:"w-full",onClick:s,children:"Вернуться на главную"})]})})})),Hp=e=>"debitCard"===e?"debit":"creditCard"===e?"card":"credit",Yp=({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i,consents:r})=>{const l=Jp(i?.utm_source),s=Gp({participantId:e,profileId:n,formData:a,consents:r}),{crshbFileIds:o}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:l,id:t,...n?{participants:[s]}:{participant:s},marketingInfo:i},crshbFileIds:o}},Gp=({participantId:e,profileId:t,formData:n,consents:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=n;return{birthDate:s&&oa(s,!0),id:e,midname:l,name:i,surname:r,...t&&{profile:{id:t}},participantContacts:Ap({phone:o&&ca(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"},...a}},Jp=e=>{switch(e){case"banki_ru":return"banki_ru";case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},Xp=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i,isNewMicroservice:l})=>{const[s,{setTrue:o,setFalse:c}]=dn(!1),d=(()=>{const e=Td();return r((({participantId:t,taskId:n,userId:a,profileId:i,programId:r,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=i,e.userId=a,e.programId=r,e.leadForm=l}),[])})(),m=ia(),u=Td(),p=(({data:e})=>{const t=hn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Ki({aspectsAttributes:Ui(e,i),aspects:t,ev:{}})}),[e])})({data:a}),h=mn(),g=r((()=>{h.assign(t)}),[]),f=(e=>{const{open:t}=kn(Sp),n=kn(xp),a=(t,n,a)=>async i=>{try{t?await sp({profile:{id:t,consentBkiFlg:!0,smsConsentBki:i}}):n&&a&&await op({task:{id:n,participant:{id:a,consentBkiFlg:!0,smsConsentBki:i}},sendToBank:!1,taskKind:"SHORT"}),e()}catch(e){console.log(e)}},i=({phone:t,profileId:i,onFail:r,taskId:l,participantId:s})=>async o=>{"SIGNED"===o&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i,l,s),onFail:r}):e()};return{open:({phone:n,profileId:a,onFail:r,taskId:l,participantId:s})=>t({onSubmit:i({phone:n,profileId:a,onFail:r,taskId:l,participantId:s}),onClose:e})}})(g),y=kn(xp),x=(()=>{const{open:e}=kn(Up),{open:t}=kn(Kp);return{open:({task:n,isFromLead:a,taskType:i,isDebit:r,onClose:l,sendAspects:s})=>{n?e({task:n,isFromLead:a,taskType:i,isDebit:r,onClose:l,sendAspects:s}):t({taskType:i,isDebit:r})}}})(),b=()=>{y.close(),i(!1)},v=r((async t=>{try{o();const i=ih(t),r=await(a={profile:{phone:ca(i.phone)}},jo("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{await th({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:s,saveUserData:d,sendAspects:p}),y.close(),"debitCard"===n?g():f.open({phone:i.phone,profileId:r,onFail:b})},h=async()=>{try{const t=await ip({profileId:r,programId:e});if(t){const e=await rp({taskId:t});y.close(),x.open({task:e,isFromLead:!0,taskType:Hp(n),sendAspects:p,onClose:c})}else await c()}catch{b()}},v=eh(i,n);y.open({phone:i.phone,consents:v,onSuccess:h,onFail:b})}catch{b()}finally{c()}var a}),[]),N=r((async t=>{try{o();const i=ih(t),r=await(a={phone:ca(i.phone),email:i.email},jo("/external/public-data/createParticipant","POST",a).then((e=>e||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const{participantId:c,userId:h}=r;if(!c)throw new Error;const g={programId:e,userId:h,productType:n,sendAspects:p,verifyPhoneDialog:y,handleFailSendForm:b},v=Qp({common:g,taskData:{participantId:c,formData:i,referalData:l,marketingInfo:s,saveUserData:d},consentBkiDialog:f}),N=Zp({common:g,draftDialog:x,sendCurrentTask:v}),w=eh(i,n);y.open({phone:i.phone,consents:w,onSuccess:N,onFail:b})}catch{b()}finally{c()}var a}),[]);return{isSending:s,handleSubmit:l?N:v}},Qp=({common:e,taskData:t,consentBkiDialog:n})=>async()=>{const{programId:a,userId:i,productType:r,sendAspects:l,verifyPhoneDialog:s,handleFailSendForm:o}=e,{participantId:c,formData:d,referalData:m,marketingInfo:u,saveUserData:p}=t,h=await nh({programId:a,participantId:c,userId:i,formData:d,referalData:m,productType:r,marketingInfo:u,saveUserData:p,sendAspects:l});s.close(),n.open({phone:d.phone,taskId:h,participantId:c,onFail:o})},Zp=({common:e,draftDialog:t,sendCurrentTask:n})=>async()=>{const{verifyPhoneDialog:a,sendAspects:i,handleFailSendForm:r,userId:l,programId:s,productType:o}=e;try{const e=await ip({userId:l,programId:s});if(e){const r=await rp({taskId:e});a.close(),t.open({task:r,isFromLead:!0,taskType:Hp(o),sendAspects:i,onClose:n})}else await n()}catch{r()}},eh=(e,t)=>{const n=Lo[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},th=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=ah(n,a);await sp(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&oa(l,!0),email:o,phone:ca(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async()=>{const e=await jo("/claim-channel/","GET").then((e=>{const t=globalThis.location.href,n=e?.find((e=>e&&t.includes(e.key)))?.code;return globalThis.sessionStorage.setItem("claimChannelCode",n??""),n})).catch((()=>{}));return e})(),a=await(async e=>await jo("/user-data/createUserTaskDebit","PUT",e)||{})((({formData:e,programId:t,marketingInfo:n,claimChannelCode:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=e;return{task:{taskSource:Jp(n?.utm_source),creditProgram:{code:Cm[t]},participants:[{birthDate:s&&oa(s,!0),midname:l,name:i,surname:r,participantContacts:Ap({phone:o&&ca(o),email:c})}],marketingInfo:n},claimChannelCode:a}})({formData:n,programId:e,marketingInfo:r,claimChannelCode:t}));o=a.taskId,c=a.participantId}else{const a=await ap({profileId:t,programId:e});o=a.taskId,c=a.participantId,await op(Yp({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await lp({taskId:o,...i}),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},nh=async({programId:e,userId:t,participantId:n,formData:a,referalData:i,productType:r,marketingInfo:l,saveUserData:s,sendAspects:o})=>{let c;const d=ah(a,r);try{return c=(await ap({participantId:n,programId:e})).taskId,await op(Yp({participantId:n,taskId:c,formData:a,marketingInfo:l,consents:d})),i?.referalCode&&await lp({taskId:c,...i}),o(t||n,c),s({participantId:n,taskId:c,userId:t,programId:e,formData:a}),c}catch(e){throw console.log(e),new Error}},ah=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentFATCA:s}=e;let o;return o="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentPhotoFlg:!1}:{consentFATCA:s,consentPhotoFlg:n},{...o,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},ih=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),rh=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=Vo(),r=mn();if(!n||!t||!a&&!e)return r.assign("/"),()=>{};const l=async()=>{const e=await qo((i?"/external":"")+"/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&r.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&l();const s=setInterval(l,24e4);return()=>clearInterval(s)},lh={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},sh=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,lh[e.name||""]])))}},oh=async(e,t)=>{const n=new FormData;return n.append("documentCategory",t.category),n.append("file",e,`${t.fileName}.${t.isPDF?"pdf":"xml"}`),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Wo()},credentials:"include",body:n}).then((e=>e.json())))},ch=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=(e,t)=>e?`${t} ${e}`:void 0,u=[t,n,i||r,m(l,"ул"),m(s,"д"),m(c,"к"),m(o,"стр"),m(d,"кв")].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key??a,fullAddress:u}},dh=e=>Math.floor(e/12),mh=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,fileName:"pdfFileWorkbook",category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,fileName:"pdfFilePayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,fileName:"pdfFileSigPayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,fileName:"xmlFilePayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,fileName:"xmlFileSigPayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,fileName:"xmlFileWorkbook",category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>oh(t,e))).then((e=>t.push(e)))}return t},uh=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},ph=(e,t)=>{const{esiaAdditionalDocument:n,crshbFileIds:a}=e,i=[n?.pdfFilePayout,n?.pdfFileWorkbook,n?.pdfFileSigPayout,n?.xmlFilePayout,n?.xmlFileSigPayout,n?.xmlFileWorkbook],r=t?Boolean(a?.length):i.every(Boolean);return[n?.inn,n?.averageMonthlyIncome?.toString(),n?.startWorkDate,n?.workLengthInFiveYears?.toString(),n?.workLength?.toString(),n?.workLengthLastJob?.toString(),n?.jobsNumberInFiveYears?.toString()].every(Boolean)&&r},hh=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a,isNewMicroservice:s})=>{const o=Td(),c=r((e=>{const t=e instanceof Function?e(d[m]):e;null!=t?d[m]=t:delete d[m]}),[d=o,m="leadForm"]);var d,m;const u=ia(),p=globalThis.sessionStorage?.getItem(an);(()=>{const e=Td(),t=hn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});Ki({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const h=l((()=>sh(e,o.leadForm,a)),[e,o.leadForm]),g=r((async(e,a)=>{n(zo.Pending);try{const i=await(async e=>{const t=Vo();return await jo((t?"/external/user-data":"")+"/esia/requestProfile","POST",e).then((e=>(e?.access_token&&e?.refresh_token&&(fp(e),rh(!0)),e)))})({code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0});if(i){const e=await(async(e,t=!1,n=!1)=>{uh(e);const a=!t&&ph(e,n),{profile:i,addInfo:r,document:l,addressRegistration:s,addressFact:o,esiaAdditionalDocument:c,crshbFileIds:d}=e;let m=[];return a&&!n&&(m=await mh(c)),{...{name:i.name,surname:i.surname,middleName:i.midname,limitedBirthday:i.birthDate,phone:cs(i.phone),email:i.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:r.birthPlace,addressRegistration:ch(s),esiaAccountTypeCd:t?i.esiaAccountType:{key:""},...o&&{addressFact:ch(o)}},...a&&{snils:r.snils,inn:c.inn,wages:Math.floor(c.averageMonthlyIncome)?.toString(),beginDate:c.startWorkDate,experience5Years:dh(c.workLengthInFiveYears).toString(),generalSeniority:dh(c.workLength).toString(),lastJobExperience:dh(c.workLengthLastJob).toString(),jobsNumber:c.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:i.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:m,crshbFileIds:d}}})(i,"debitCard"===t,s);c((t=>({...t,...e}))),n(zo.Success)}}catch{n(zo.Error)}}),[]);return i((()=>{o.productType=t,u.marketingInfo=gh(p,u),u.isNewMicroservice=s||null}),[p]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?g(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),h},gh=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},fh=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:p,isNewMicroservice:h=!1,...g})=>{const[f,y]=a(),[x,b]=a(),[v,N]=a(0),w=s(null),C=l((()=>(e=>{const t=Lo[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),S=l((()=>yh(C)),[C]),k=kn(co),I=po();ho();const T=l((()=>xh(m)),[m]),R=l((()=>Wn(S,T)),[S,T]),E=(e=!1)=>{b(e)},D=hh({inputs:S,nextStepLink:r,productType:m,setEsiaStatus:y,esiaAuthSuccess:f===zo.Success,isNewMicroservice:h}),{isSending:_,handleSubmit:P}=Xp({programId:n,nextStepLink:r,productType:m,data:p,changeSubmitFormStatus:E,isNewMicroservice:h}),[,{field:O,onSubmit:B,reset:A}]=Nn(D,{formValidator:R,onSubmit:P}),F=kn(na);return i((()=>{!1===x&&F.open({ok:x,onClose:()=>E(!0)})}),[x]),i((()=>{f&&w?.current&&w.current.scrollIntoView({block:"start"}),f===zo.Success&&A()}),[w?.current,f]),c(Sn,{className:u("container space-y-m",e),title:t,...g,children:[f||I?null:o(Uo,{onChangeEsiaStatus:y,productType:m}),c("form",{onSubmit:e=>{O("processPersonalDataFlg")?.value||(N((e=>e+1)),v>0&&k.open({productType:m,attempts:v})),B?.(e)},className:"space-y-m relative",ref:w,children:[f===zo.Pending?o(ka,{blur:!1}):null,C.map(((e,t)=>c("div",{className:u(Vs(e.columns),"grid gap-x-m"),children:[$s(e.title),ep({field:O,inputs:e?.inputs},m)]},`section-${t}`))),np(d,_),f===zo.Error?o(Ye,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),yh=e=>e?.flatMap((e=>e?.inputs))||[],xh=e=>({...Mo,limitedBirthday:Oo(e)}),bh=d((({title:e,description:t})=>{const n=Le();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),vh=e=>e%2!=0,Nh="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",wh=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=dn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Nh),children:[D(r,{...i.options,parent:n}),vh(r.length)?o(on,{className:"col-span-6",...i}):null]}),c(dc,{children:[c(mc,{className:u(Nh),isUnfolded:s,children:[D(l,{...i.options,parent:n}),vh(l.length)?o(on,{className:"col-span-6",...i}):null]}),o(cc,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Ch=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Sh=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),kh=10;function Ih(e=0){const t=Math.round(e*kh);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Th=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const p=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:Ih(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}(r((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:p,role:"listitem",children:d})})),Rh=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Eh=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:p,children:h,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},x=s([]),b=r(((e,t)=>{const n=[...x.current||[]];n[e]=t,x.current=n,g&&g(n),f&&f(_h(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Dh(c,v):{},...N?Sh(p):{},gap:`${l}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Th,{className:u(m,i?Rh[i-1]:"",{"h-full":N},t),style:w?Dh(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(h)});var S})),Dh=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),_h=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ph={"horizontal-list":"w-6","vertical-list":"h-6"},Oh=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Ph[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Bh=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Ah=e=>t=>e.scrollWidth/t,Fh=e=>(t,n)=>{e.scrollBy({left:n*Ah(e)(t),behavior:"smooth"})},Mh=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[tm()(i),Zd()(i)]:[-1,-1],m=c>0,u=d<e-1,p=r((()=>{var t;n.current&&(m?Fh(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),h=r((()=>{n.current&&(u?Fh(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:p,scrollRight:h,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Lh={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},zh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Le(),[p,h]=Mh({itemCount:s.length}),g=Vh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&p?.current&&h.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Eh,{containerRef:p,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Bh({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Lh[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(Oh({activeIndex:t,onClick:f,listType:a}))}):null})),Vh=(e=!1)=>({behavior:e?"auto":"smooth"}),$h=d((({className:e,name:t,...n})=>o(Xn,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(Y,{name:t,iconVersion:"",size:"small"})}))),jh=d((e=>o($h,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),qh=d((e=>o($h,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Wh="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Uh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Kh(t):null,r?o(jh,{wcmsIgnore:!0,className:u(Hh(i),m?"left-1":"left-0"),onClick:s}):null,l?o(qh,{wcmsIgnore:!0,className:u(Hh(i),m?"right-1":"right-0"),onClick:d}):null]})})),Kh=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Wh,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Wh,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Hh=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Yh=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:p,showDots:h,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=Mh({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(Eh,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Uh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:p,isBottom:Boolean(y?.length)}),o(zh,{className:u(!h&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),Gh=({blocksToRender:e,...t})=>o(Yh,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:D(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Ch(!0)),children:R(e,t)},String(n))})}),Jh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Xh(n,t),o(wh,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Xh(n,t),Gh({...a,blocksToRender:t})]});default:return null}})),Xh=(e,t)=>e&&!t.length?o(bh,{...e}):null,Qh=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Zh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Xl,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),eg=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,Qh(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(tg(a)).filter(Boolean))]}),n?o("div",{children:o(Xn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),tg=e=>([t,n])=>{const a=n?.type;return"array"===a?ng(t,e)(n):null},ng=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Ye,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Zh,{items:a,multiple:!n?.single,...t(e)})]},e)},ag=e=>e;function ig(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const rg=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,lg=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>rg(t[e])||rg(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>rg(t[e])||rg(n[e])||sg(t[e])<=sg(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>rg(t[e])||rg(n[e])||sg(t[e]?.min)>=sg(n[e]?.min)&&sg(t[e]?.min)<=sg(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>rg(t[e])||rg(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>rg(t[e])||rg(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),sg=e=>Number(e||0),og=(e,{block:t,page:n,normalize:a=ag})=>{const i=t?.blocks||[],[r,s]=Nn(e),o=l((()=>ig(i,i.map((e=>Zt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=ag)=>e?.filter((([,e])=>lg(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},cg={},dg={},mg=nn((({className:e,filtrationSchema:t=cg,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=og(dg,{block:i.block,page:i.options?.page}),d=o(Bi,{className:"w-64",label:n?.title,options:ug(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>ug(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(eg,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Xn,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Jh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),ug=e=>ig(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pg=(e=!1)=>e?"text-left":"text-center",hg={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},gg=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",hg[t],e),style:{width:r,height:r},role:"figure",children:o(Y,{name:a,width:"54%",...i})}):null})),fg=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Le();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:pg(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yg)}):null]})})),yg=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(gg,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Ye,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ke,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),xg=(e,t,n)=>{return o(Yh,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Ye,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Ye,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},bg=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(k,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?xg(e,0,t):null]}))),vg={start:"justify-start",center:"justify-center",end:"justify-end"},Ng=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",vg[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:nt(e)})})),wg=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(Ye,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:lt(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Cg=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(Ye,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Sg=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(wg,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(zd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(Cg,{title:e,...l}),kg={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ig={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Tg=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=kg.prefMonthsNum,prefTravelBonusRate:r=kg.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Ig,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},Rg=nn((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=Nn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:p,maxSumOther:h,monthBonus:g,yearBonus:f}=Tg(l,n);return o(Pd,{className:e,title:t,...r,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Yd({title:"Сумма покупок в остальных категориях, ₽",min:p,max:h,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Sg({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Md,children:[f>=0?o(zd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,nt(a,{isVertical:!0}),qd(i)]})]})})})),Eg=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Dg=e=>Kd({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),_g=" (c капитализацией)",Pg=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Md,children:[o(zd,{title:`Доход в конце срока${r?_g:""}`,value:e,postfix:n,prefix:"+"}),o(zd,{title:`Сумма в конце срока${r?_g:""}`,value:t,postfix:n}),nt(a,{isVertical:!0}),i?.map(qd)]}),Og={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Bg={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ag=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Og[e?.rateType]:"",{data:n}=lr(t?`${ra}/depositrates/${t}`:null,Gt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Fg(s,e)&&rm(a,["minSum","maxSum"],e)&&rm(n,["minDays","maxDays"],e)))||Bg,{rate:m}=d,u=Mg(m,e),p=a+u,h=c||[Bg];return{...d,...im(["minSum","maxSum"],h),...im(["minDays","maxDays"],h),...e,isDisabledOperatingDeposit:o,income:u,finalSum:p}},Fg=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Mg=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Lg=nn((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:p}]=Nn({moneyValue:mm(l,1e5),daysValue:um(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),h=Ag(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=h;return o(Pd,{className:e,title:t,...d,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...p("moneyValue"),value:h.moneyValue}),(b={title:"Срок, дней",min:h.minDays,max:h.maxDays,...p("daysValue"),value:h.daysValue},o(vr,{items:[`От ${Eg(b.min||0)}`,`До ${Eg(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[zg(h,p),Dg({...p("isMonthlyInterestPayment")})]})]}),Sg({rate:y,depositeName:x,isShowDepositeName:r}),Pg({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),zg=(e,t)=>c("div",{className:"space-y-s",children:[o(Ye,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Fa,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Fa,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Vg=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},$g={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},jg=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?Ug(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Wg({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Wg({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Wg({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),Wg({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,rm(a,["minSum","maxSum"],t),rm(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||$g,{rate:u}=m,p=e?.extraPercent?.key??0,h=Number(u)+Number(p),g=qg(h,e),f=a+g,y=t||[$g];return{...m,...im(["minSum","maxSum"],y),...im(["minMonths","maxMonths"],y),availableMonths:Vg(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},qg=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Wg=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Ug=(e,t)=>e+Math.round((t-e)/2),Kg=(e="rub")=>"rub"===e,Hg=(e,t)=>{const{minMonths:n,maxMonths:a}=im(["minMonths","maxMonths"],Jg(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:gr(i,n,a)}},Yg=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Gg=e=>{const t=Kg(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Jg=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Xg=(e,t=!1)=>t?Kd({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Qg=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Zg(t("isReplenish"),e,a),ef(t("isWithdrawn"),e,a),tf(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Dg(t("isMonthlyInterestPayment")):null,Xg(t("isRemoteRegistration"),e.isShowRemoteRegistration),nf(t("extraPercent"),n),e.isShowNewClient?o(Fa,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Zg=(e,t,n=!1)=>t.isShowReplenish?Kd({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,ef=(e,t,n=!1)=>t.isShowWithdrawn?Kd({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,tf=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,nf=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Ye,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Bi,{options:t,...e})]}):null,af={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},rf={text:"₽",key:"rub"},lf={text:"Без учета надбавки",key:"0"},sf=nn((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:p}=n??{},h=p?.map((e=>e.currency))??[rf],g=r((e=>t=>e?{...t,...Gg(t),...Hg(t,e),...Yg(t,e)}:t)(p),[p]),[f,{field:y}]=Nn({moneyValue:mm(d,2e4),monthsValue:um(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:rf,extraPercent:d?.extraPercent??lf},{normalizer:g}),x=uf(y),b=Boolean(y?.("isNewClient")?.value),v=p?.find((e=>e?.extraPercents))?.extraPercents,N=Jg(p,x),w=jg(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Gd({field:y,defParams:$d(N,b,v),calcParams:w,monthsValue:"minMonths",map:af})}),[y,p,v]);i((()=>{!dm(d)&&N&&T()}),[d,p]);const R=y?.("extraPercent")?.value?.key,E=mf(C,R),D=C===$d(N,b)?.rate&&R===v?.at(-1)?.key;return o(Pd,{className:e,title:t,...m,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[c("div",{className:"flex gap-m",children:[Yd({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:of(x?.key)}),p&&p?.length>1?o(Ai,{label:"Валюта",options:h,...y("currency")}):null]}),Wd({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Qg({...w,...s},y,v)]}),Sg({rate:E,children:df(T,D)}),Pg({income:S,finalSum:k,buttons:[...a,cf(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),of=(e="")=>Kg(e)?1e3:100,cf=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},df=(e,t=!1)=>t?null:o(Xn,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),mf=(e,t)=>Number(e)+Number(t??0),uf=e=>e?.("currency")?.value??rf,pf=e=>hf({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hf({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hf=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],gf={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},ff=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[gf],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>pf({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=am(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=am(["minMonths","maxMonths"],o,s),p=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>pf({row:e,userInputParams:t,paramsViewSettings:n})&&rm(a+l,["minSum","maxSum"],e)&&rm(r,["minSumOld","maxSumOld"],e)&&rm(l,["minSumExtra","maxSumExtra"],e)&&rm(i,["minMonths","maxMonths"],e)))||gf)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:h}=p,g=Xd(h,e),f=e.oldMonthlyPayment-g;return{...p,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},yf=nn((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=Nn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),p=ff(d,n,r),h=l((()=>Vd(n?.rateRows)?.rate),[n?.rateRows]),g=Hd({...m("isAnnuity")});return o(Pd,{className:e,title:t,...s,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Остаток долга в других банках, ₽ ",step:500,min:p.minSum,max:p.maxSum-p.maxSumExtra,...m("moneyValue"),value:p.moneyValue}),Yd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:p.minSumOld,max:p.maxSumOld,...m("oldMonthlyPayment"),value:p.oldMonthlyPayment}),Wd({title:"Новый срок кредита, месяцев",min:p.minMonths,max:p.maxMonths,...m("monthsValue"),value:p.monthsValue}),xf({...p,...r},m),p.isExtraMoney?Yd({title:"Дополнительная сумма, ₽ ",step:500,min:p.minSumExtra,max:p.maxSumExtra,...m("moneyExtra"),value:p.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Md,"@4xl:w-1/2"),children:[o(zd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(zd,{title:"Ставка от",value:h,fractionDigits:2,postfix:"%"}),o(zd,{title:"Ежемесячный платёж",value:p.monthlyPayment,postfix:"₽"}),p.benefit>0?o(zd,{title:"Выгода в месяц",value:p.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),nt(a,{isVertical:!0}),qd(i)]})]})})})),xf=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Fa,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Fa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Fa,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),bf=({min:e=0,max:t=0,step:n=1,...a})=>o(vr,{items:[`От ${e} шт`,`До ${t} шт`],step:n,min:e,max:t,...a}),vf=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Nf={text:"₽",key:"rub"},wf=[{key:"transferLegalCountCommission",valueKey:"transferLegalCount",minKey:"minTransferLegalCount",maxKey:"maxTransferLegalCount"},{key:"flTransferSumCommission",valueKey:"flTransferSum",minKey:"minFlTransferSum",maxKey:"maxFlTransferSum"},{key:"cashOutSumCommission",valueKey:"cashOutSum",minKey:"minCashOutSum",maxKey:"maxCashOutSum"},{key:"cashInSumCommission",valueKey:"cashInSum",minKey:"minCashInSum",maxKey:"maxCashInSum"}],Cf=[{key:"flTransferSum",title:"Сумма переводов на счета ФЛ в месяц, ₽",step:5e4},{key:"cashInSum",title:"Внесение наличных через кассу в месяц, ₽",step:5e4},{key:"cashOutSum",title:"Снятие наличных в кассе банка в месяц, ₽",step:5e4}],Sf={tariffName:"Название тарифа",accountServiceFee:"Обслуживание счёта",transferLegalCountCommission:"Переводы Юрлицам и ИП",flTransferSumCommission:"Переводы физлицам",cashOutSumCommission:"Снятие наличных",cashInSumCommission:"Внесение наличных",totalCommission:"Итоговая комиссия"},kf=["accountServiceFee","transferLegalCountCommission","flTransferSumCommission","cashOutSumCommission","cashInSumCommission","totalCommission"],If=({params:e,className:t})=>e?c("div",{className:u(t),children:[o("div",{className:"col-span-2",children:o(Ye,{size:"text-xs",font:"font-medium",children:Sf.tariffName})}),e.map(((e,t)=>o("div",{children:o(Ye,{size:"text-xs",font:"font-medium",children:Sf[e]})},t)))]}):null,Tf=(e,t,n)=>c(Ye,{className:n,children:[e?.toLocaleString()," ",(t??Nf).text]}),Rf=(e,t)=>e.map(((e,n)=>o("div",{children:Tf(e,t)},n))),Ef=({commissions:e,currency:t,isUnfolded:n,handleFold:a,commissionTypes:i,isBest:r=!1})=>{const l=i?.at(-1)??"";return c(dc,{className:"py-4",children:[c("div",{className:"w-full space-y-xl",children:[o(mc,{isUnfolded:n,className:"space-y-xl",children:e.map(((n,a)=>a!==e.length-1&&(({commission:e,currency:t,commissionType:n,index:a})=>c("div",{className:"flex justify-between align-center",children:[o(Ye,{children:Sf[n??""]}),Tf(e,t)]},a))({commission:n,currency:t,commissionType:i?.[a],index:a})))}),c("div",{className:"flex justify-between items-center",children:[o(Ye,{font:"font-medium",children:Sf[l]}),Tf(e.at(-1)??0,t,"text-h2")]})]}),o(cc,{className:"mt-m mx-auto",label:n?"Скрыть":"Подробнее",isUnfolded:n,embedded:!0,labelColorStyle:r?"white":"",onClick:a,short:!0})]})},Df=e=>e?o("div",{className:"absolute block rounded-xl min-h-xs flex justify-center align-center bg-orange py-1 px-2 lg:ml-xl top-[-10px]",children:o(Ye,{size:"text-xs",children:"Рекомендуем"})}):null,_f=d((({tariffName:e,tariffDesc:t,className:n,transferLegalCountCommission:a,flTransferSumCommission:i,cashInSumCommission:r,accountServiceFee:l,cashOutSumCommission:s,totalCommission:d,currency:m,isBest:p=!1,commissionTypes:h,openDepositBtnLink:g})=>{const[f,{toggle:y}]=dn(!1),x={accountServiceFee:l,transferLegalCountCommission:a,flTransferSumCommission:i,cashOutSumCommission:s,cashInSumCommission:r,totalCommission:d},b=kf.map((e=>x[e])),v=Le();return c("div",{className:u(n,"rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl lg:mb-m mb-xl",p?"bg-primary-main text-white relative":"bg-white text-primary-text border border-solid border-gray"),children:[c("div",{className:"col-span-2",children:[o(w,{headingType:v?"h2":"h6",title:e}),o(Ye,{size:"text-xs",children:t})]}),v?Ef({commissions:b,currency:m,isUnfolded:f,handleFold:y,commissionTypes:h,isBest:p}):Rf(b,m),o("div",{className:"flex flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto col-span-2",children:o(Oe,{version:p?"secondary":"primary",className:u("basis-full @lg:basis-auto w-full"),text:"Открыть счёт",href:g,onClick:()=>globalThis?.sessionStorage.setItem("rkoTariffName",e)})}),Df(p)]})})),Pf=d((({items:e=[],currency:t=Nf,openDepositBtnLink:n=""})=>{const a=Le(),i=(e=>e&&0!==e.length?kf.filter((t=>t in e[0])):[])(e)??[],r=i.length+4,l=`lg:grid lg:grid-cols-${String(r)} gap-m lg:px-xl px-3xl order-first lg:mb-m mb-xl`;return c("div",{className:"w-full flex flex-col mt-s",children:[a?null:If({params:i,className:l}),e.map(((e,a)=>o("div",{className:e?.isBest?"order-first":"",children:o(_f,{...e,className:l,currency:t,openDepositBtnLink:n,commissionTypes:i})},a)))]})})),Of=(e,t)=>{if(Array.isArray(e))return e.filter((e=>e?.clientType===t));if(e&&"object"==typeof e){const n={};for(const a in e)if(Object.hasOwn(e,a)){const i=e[a];Array.isArray(i)?n[a]=i.filter((e=>e?.clientType===t)):n[a]=i}return n}return e},Bf=({ranges:e=[],value:t=0,minKey:n="min",maxKey:a="max"})=>{const i=Mf(e,n);let r=0,l=0;for(const e of i){if(l=Number(e.minCommission)??0,!Ff({range:e,amount:t,minKey:n,maxKey:a}))continue;const i=Af({range:e,amount:t,minKey:n,maxKey:a});if(r+=Lf({type:e.commissionType,sliceAmount:i,commissionValue:Number(e.commissionValue),context:{min:Number(e[n]),max:Number(e[a]),amount:Number(t)}}),t<=e[a])break}return r<l&&(r=l),Math.round(r)},Af=({range:e,amount:t,minKey:n,maxKey:a})=>{const i=e[n],r=e[a],l=Math.max(Number(i),0);return Math.min(Number(r),t)-l+1},Ff=({range:e,amount:t,minKey:n,maxKey:a})=>{const i=e[n],r=e[a],l=Number(e.commissionValue);if(null==i||null==r||isNaN(l))return!1;if(t<i)return!1;return Math.max(Number(i),0)<=Math.min(Number(r),t)},Mf=(e,t)=>e.filter((e=>null!=e.commissionValue&&null!=e.commissionType)).sort(((e,n)=>Number(e[t])-Number(n[t]))),Lf=({type:e,sliceAmount:t,commissionValue:n,context:a})=>{const{min:i,max:r,amount:l}=a;switch(e){case"fixedSum":return 0===i||l<=r?n:0;case"percent":return t*n/100;case"fixedAmount":return Math.round(t*n);default:return 0}},zf=e=>{const t={};for(const n of e){const{tariff:e}=n;e&&(t[e]||(t[e]=[]),t[e].push(n))}return t},Vf=nn((({className:e="",title:t,calcSource:n,footnote:r,clientType:s="standard",openDepositBtnLink:d,...m})=>{const[p,h]=a([]),[f,{field:y}]=Nn({transferLegalCount:0,flTransferSum:0,cashOutSum:0,cashInSum:0}),{rows:x}=n??{},b=l((()=>Of(x?.[0]?.tariffs,s)),[x]),v=((e,t,n)=>{const a=t?.[0]?.commissions,{minTransferLegalCount:i,maxTransferLegalCount:r}=im(["minTransferLegalCount","maxTransferLegalCount"],a?.transferLegalCountCommission.filter((e=>e.clientType===n))),{minFlTransferSum:l,maxFlTransferSum:s}=im(["minFlTransferSum","maxFlTransferSum"],a?.flTransferSumCommission.filter((e=>e.clientType===n))),{minCashInSum:o,maxCashInSum:c}=im(["minCashInSum","maxCashInSum"],a?.cashInSumCommission.filter((e=>e.clientType===n))),{minCashOutSum:d,maxCashOutSum:m}=im(["minCashOutSum","maxCashOutSum"],a?.cashOutSumCommission.filter((e=>e.clientType===n)));return{...e,minTransferLegalCount:i,maxTransferLegalCount:r,minFlTransferSum:l,maxFlTransferSum:s,minCashInSum:o,maxCashInSum:c,minCashOutSum:d,maxCashOutSum:m}})(f,x,s),N=Of(x?.[0]?.commissions,s);return i((()=>{if(!N){const e=((e=[])=>e.map((e=>({...e,flTransferSumCommission:0,cashOutSumCommission:0,cashInSumCommission:0,transferLegalCountCommission:0,totalCommission:e.accountServiceFee,isBest:!1}))))(b);return void h(e)}const e=wf.reduce(((e,t)=>(e[t.key]=(({ranges:e=[],value:t=0,minKey:n="min",maxKey:a="max"})=>{const i=Number(t);if(isNaN(i)||i<=0)return 0;const r=zf(e),l={};for(const e in r)l[e]=Bf({ranges:r[e],value:i,minKey:n,maxKey:a});return l})({ranges:N?.[t.key],value:f?.[t.valueKey],minKey:t.minKey,maxKey:t.maxKey}),e)),{}),t=((e,t=[])=>{const n=["flTransferSumCommission","cashOutSumCommission","cashInSumCommission","transferLegalCountCommission"];return t.map((t=>{const{tariffName:a,accountServiceFee:i}=t,r=n.reduce(((t,n)=>(t[n]=e[n]?.[a]??0,t)),{}),l=Object.values(r).reduce(((e,t)=>e+t),0)+i;return{...t,...r,isBest:!1,totalCommission:l}}))})(e,b),n=(e=>{if(0===e.length)return e;const t=Math.min(...e.map((e=>e.totalCommission))),n=e.findIndex((e=>e.totalCommission===t));return e.map(((e,t)=>({...e,isBest:t===n})))})(t);h(n)}),[f,b]),c("div",{className:u(e,"bg-white"),children:[o(Pd,{className:e,title:t,...m,children:o("section",{className:u(Bd,e),children:c("div",{className:Fd,children:[bf({title:"Количество внешних переводов на счета ЮЛ и ИП в месяц, шт",step:1,min:v.minTransferLegalCount,max:v.maxTransferLegalCount,...y("transferLegalCount"),value:v.transferLegalCount}),Cf.map(((e,t)=>o("div",{children:Yd({title:e.title,step:e.step,min:v[`min${vf(e.key)}`],max:v[`max${vf(e.key)}`],...y(e.key),value:v[e.key]})},t)))]})})}),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-4xl pt-0",...m,children:[$f(),p?o(Pf,{items:p,currency:Nf,openDepositBtnLink:d}):o(ka,{position:"static"}),o("div",{className:u(Md),children:qd(r)})]})]})})),$f=()=>o(Ye,{size:"text-h6",font:"font-medium",align:"text-center",className:"block lg:mb-xl mb-m",children:"Расчёты за один месяц по введенным выше параметрам"}),jf=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=hr(e,{normalize:(e=i)=>n&&a?String(gr(Number(qf(e)),n,a)):qf(e),format:lt(l)}),d=r((e=>t&&t(qf(e))),[t]);return o(Ja,{onChange:d,...s,...c})})),qf=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Wf=d((e=>o(jf,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ye,{size:"text-xl",font:"font-light",children:"₽"})})}))),Uf={private:"p2p/registerP2P",business:"b2c/registerB2C"},Kf=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(ta,{maxWidth:"lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Hf=e=>{const t=kn(Kf),n=ia(),a=mn(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=mn(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${ra}/payment/${Uf[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:l.formUrl},a.assign(i)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},Yf={amount:1500},Gf=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=Hf(i),[{amount:s},{field:d,onSubmit:m}]=Nn(Yf,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(Wf,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(Ia,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),Jf=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Xf="relative h-full",Qf={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Zf=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(ny),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:ey(n,{someCardsHighlighted:r}),children:[R(n,a,{className:ty(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),ny(n)?Jf({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ey=(e,{someCardsHighlighted:t})=>u(Xf,t&&(ny(e)?"pt-3xl":"pt-16")),ty=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Xf,"min-w-80",Qf[a],t&&(ny(e)?"pt-16":"pt-3xl"),Ch(n),n&&"h-full"),ny=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ay=nn((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Yh,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?iy(s?.block?.blocks):[],hasBlur:!0,children:Zf({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),iy=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],ry={black:"bg-black",white:"bg-white"},ly=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c($e,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:nt([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ye,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(sy)]}):null,i?c(Ye,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),sy=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ry[e]}`},String(t)),oy=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=Ie()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...Re(i),children:r})})),cy=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],dy=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>cy.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=tt(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),p=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},my(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:nt(m,{className:uy(s??!1,i??!1,n),buttonClassName:p})}),l?o(Ye,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),my=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",uy=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),py=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:p,align:h="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:x=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(oy,{href:i,target:m,className:"h-full",data:Ui(v),children:c($e,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:p,description:n,headlineVersion:"XS",isEmbedded:!0,align:h}),...yt(tt(r)?o(ie,{image:r}):null,y),buttons:d.length?o(dy,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(et,{benefits:f}),s?o(Ke,{__html:s,isDotted:l,itemSize:"list-s"}):null,hy(a,h)]})})}))),hy=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,gy=new pe,fy=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Ye,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Ye,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:nt(i)}):null]},String(t))},yy=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:p=[],options:h,data:f,...y})=>{const x=l((()=>p.map(fy)),[p]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[N,C]=a(!1);i((()=>gy.subscribe("fold",(e=>{e&&h?.parent&&e.parent===h?.parent&&C(e.isUnfolded)}))),[h?.parent]);const S=r((()=>{gy.fire("fold",{type:"fold",isUnfolded:!N,parent:h?.parent})}),[N,h?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Oe,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(dc,{children:[c("div",{children:[b,o(mc,{isUnfolded:N,children:v})]}),p.length>=m?o(cc,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),xy=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:lt()(t)})]}))),by=d((({cashbacks:e})=>{const{mounth:t,year:n}=vy(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(w,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Ke,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(xy,{text:"Баллов в месяц",value:t}),o(xy,{text:"Баллов в год",value:n})]})]})})),vy=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),Ny=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],wy=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],Cy=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Sy(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(Bi,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:ky(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(Xn,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(Bi,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(vr,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Sy=e=>e?.[(new Date).getTime().toString().slice(-1)],ky=(e,t)=>e?[]:t?Ny:wy,Iy=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],Ty={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},Ry=["5","10","15"],Ey=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=Ty,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:p,onChangeCashback:h,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=id("CASHBACK_CATEGORY"),[t,n]=a(Iy);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Iy)}})(),x=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(k,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(Cy,{categories:m,cashback:t,showIncreasedPercents:_y(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:h},String(t.id)))),Dy(d.length,p,y),o(by,{cashbacks:d}),o(xd,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(Oe,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),x]})]})})),Dy=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(Xn,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(Xn,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),_y=(e,t)=>Ry.includes(e.percent.key)||!t.some((e=>Ry.includes(e.percent.key))),Py=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(wl,{step:a,showPercentage:!1})]})})}));var Oy;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND",e.clientFound="CLIENT_FOUND",e.newClient="NEW_CLIENT"}(Oy||(Oy={}));const By=e=>{const t=Vo();return jo((t?"/internal":"")+"/user-data/getTaskStatus","POST",e)},Ay=async e=>{const t=await jo("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},Fy=d((({title:e,interval:t=0,onEnd:n=Hn})=>{const[i,r]=a(t);Ws({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(k,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(Gs,{seconds:i})})]})]})})),My=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Hn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(Fy,{interval:s,onEnd:d}):null]}),o(Ly,{title:n,items:a}),o(Ly,{title:i,items:r,countColumns:!0}),l?o(Ji,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Ly=({title:e,items:t,countColumns:n=!1})=>{const a=Le();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ye,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Vs(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:zy(e)},t)))}):null]})]}):null},zy=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ye,{color:"text-secondary-text",size:"text-l",children:e}),o(Ye,{color:"text-primary-text",size:"text-xl",children:t})]}),Vy=d((()=>o(My,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),$y=d((({onExpire:e})=>{const{statusInfo:t}=ld();return o(My,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),jy=d((()=>{const{statusInfo:e}=ld(),t="courier"===e?.methodObtain;return o(My,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),qy=d((()=>{const{statusInfo:e}=ld();return o(My,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Wy(e),buttonText:"Вернуться на главную"})})),Wy=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:oa(e?.deliveryDate)}]):t},Uy=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ky=d((()=>{const[e,t]=a(Oy.process),{taskId:n}=ld();i((()=>{(async()=>{for(const e of Uy)await Ay({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await By({taskId:n});a&&a?.statusCd!==Oy.process&&(e(),t(a.statusCd))}),[n]);qs(l,3e4);const s=r((()=>t(Oy.rework)),[]);return Hy(e,s)})),Hy=(e,t)=>({IN_PROCESS:o($y,{onExpire:t}),CANCELLED:o(Vy,{}),FAILED:o(Vy,{}),DRAFT:o(Vy,{}),APPROVED:o(qy,{}),PRE_DECISION:o(qy,{}),REVISION:o(jy,{})}[e]||o(jy,{})),Yy=e=>t=>t.filter((e=>e)).map((t=>[Gy(t,e),Zy(t,e),Jy(t,e),Xy(t,e),Qy(t,e)].some(Boolean)?{...t,required:!1}:t)),Gy=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Jy=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xy=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Qy=({condition:e},t)=>e?.name&&e?.values?.every((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Zy=({name:e},t)=>"snils"===e&&!t("snils")&&ex(t),ex=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,tx={...Ju,...Xu},nx=({field:e,inputs:t,params:n})=>t.map(zs(e,n,tx)),ax=({sections:e,field:t,params:n})=>e?.map((({inputs:e=[],columns:a,title:i,condition:r},l)=>{const s=Yy(ix(t))(e),c=[Qy({condition:r},ix(t))?null:$s(i),...nx({field:t,inputs:s,params:n})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return c.length?o("div",{className:u(Vs(a),"grid gap-x-m"),children:c},`section-${l}`):null})),ix=e=>t=>e(t)?.value,rx=({formState:e,inputs:t,productType:n})=>{return Wn(Yy((t=>e[t]))(t),{...Mo,limitedBirthday:Oo(n),dulIssueDate:(i=e.limitedBirthday,Eo(14,i)("Укажите дату выдачи паспорта")),generalSeniority:(a=e.lastJobExperience,yn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!a||Number(e)>=Number(a))))("Укажите количество лет стажа")),beginDate:To(e.limitedBirthday),participantDateRegistration:Ro(e.limitedBirthday),organizationName:Do(e.isDadataOrganization),inn:_o(e.isDadataOrganization)})(e);var a,i},lx=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Ia,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),sx=(e,t,n)=>({...n[e],...t,limitedBirthday:ox(t?.limitedBirthday),dulIssueDate:ox(t?.dulIssueDate),participantDateRegistration:ox(t?.participantDateRegistration),beginDate:ox(t?.beginDate),deliveryDate:ox(t?.deliveryDate)}),ox=e=>{try{return e?new Date(e):void 0}catch(e){return}},cx=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",isDadataOrganization:!1,organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],dx=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...cx(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],mx=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},ux=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:p,organizationPhone:h,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return"RETIREE"===n?.key?{employmentTypeCd:n}:{employmentContractDate:oa(t||"",!0),employmentTypeCd:{key:"WORK"},organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:p,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:Ap({organizationPhone:h&&ca(h)}),participantAddresses:Fp({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},px=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:p,addressMatch:h}=e;return{birthDate:oa(t,!0),birthPlace:a,dulIssueDate:oa(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?oa(d,!0):void 0,homeMatchFlg:h,houseTypeCd:m,participantAddresses:Fp({addressRegistration:u,addressFact:h?u:p}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},hx=e=>e?new Date(e).toISOString().split(".")[0]:"",gx=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:hx(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},fx=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},yx=(e,t)=>{switch(e){case 0:default:return{};case 1:return px(t);case 2:return ux(t);case 3:return Mp(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Fp({addressCourier:t})}:{}})(t)}},xx=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=ld(),d=l((()=>sx(e,c.leadForm,dx)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await op((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...fx(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...yx(i,a)}],...mx(a),...gx(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},bx=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ho();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((e=>rx({formState:e,inputs:s,productType:"creditCard"})),[s]),[m,u,p]=xx({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=Nn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ax({sections:t,field:h}),o(lx,{isSending:p,step:e,onPrevStep:n})]})})),vx=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],Nx=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...vx,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"employerActivities",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"generalSeniority",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"lastJobExperience",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"experience5Years",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"positionOrganization",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],wx=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Cx=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(rh,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=Nx[n],[f,{setTrue:y}]=dn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(Py,{stepsTitles:wx,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Ky,{}):o(bx,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:y},String(n))})]})})})),Sx=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(wl,{step:a,showPercentage:!1})]})})})),kx=d((()=>o(My,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Ix=e=>"11"===e?{name:"Потребительский кредит на рефинансирование",description:"Погашение основного долга по кредиту, иные цели и оплату страхования"}:{name:"Кредит на любые цели",description:"На любые цели"},Tx=d((({onExpire:e})=>{const{statusInfo:t,programId:n}=ld(),a=Ix(n);return o(My,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:a.name},{label:"Цель кредита",description:a.description},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Rx=d((()=>{const{statusInfo:e}=ld();return o(My,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ex=d((()=>{const{statusInfo:e,programId:t}=ld(),n=Ix(t);return o(My,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:n.name},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Dx=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],_x=["CREATE_APPLICATION_SHORT_MESSAGE"],Px=d((()=>{const e=Vo(),[t,n]=a(Oy.process),{taskId:l}=ld();i((()=>{(async()=>{if(e)for(const e of _x)await kp({messageName:e,taskId:l});else for(const e of Dx)await Ay({signalType:e,taskId:l})})()}),[l]);const s=r((async e=>{const t=await By({taskId:l});t&&t?.statusCd!==Oy.process&&(e(),n(t.statusCd))}),[l]);qs(s,3e4);const o=r((()=>n(Oy.rework)),[]);return Ox(t,o)})),Ox=(e,t)=>({IN_PROCESS:o(Tx,{onExpire:t}),CANCELLED:o(kx,{}),FAILED:o(kx,{}),DRAFT:o(kx,{}),APPROVED:o(Ex,{}),PRE_DECISION:o(Ex,{}),REVISION:o(Rx,{})}[e]||o(Rx,{})),Bx=B.YANDEX_METRIKA_ID||"92511315",Ax=[[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"credit_calculator"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditSummPeriodNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Сумма и сроки кредита Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_personal_data"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormPassportNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Паспортные данные Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_work"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormEmployerDetailsNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Данные о работодателе Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_income"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormFamilyStatusNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Семейное положение и доход Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_bank_office"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormBankDepartmentChoosingNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Выбор отделения Кнопка Далее"}}]],Fx=e=>Ax[e]||[],Mx=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{version:"secondary",disabled:0===e,onClick:t,testId:"back-button",children:"Назад"}),o(Ia,{isLoading:n,testId:"next-button",data:Fx(e),children:a?"Отправить заявку":"Далее"})]})})),Lx={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},zx=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Lx[a?"annuity":"differential"]}},Vx=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},$x=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return px(t);case 2:return ux(t);case 3:return Mp(t);default:return{}}},jx=[{calculator:void 0},...cx(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],qx=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=4===e,c=ld(),d=l((()=>sx(e,c.leadForm,jx)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i){const t=await op((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>{const r=Vo(),l={id:e,...!r&&{profile:{id:n}},roleCd:{key:"BORROWER",value:"Заемщик"},...$x(i,a)};return{sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,...r?{participant:l}:{participants:[l]},...zx(a),...Vx(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}})({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Wx=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=ld();ho();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),p=r((e=>rx({formState:e,inputs:u,productType:"credit"})),[u]),[h,g,f]=qx({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=Nn(h,{formValidator:p,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[ax({sections:t,field:y,params:{calcData:m}}),o(Mx,{step:e,isSending:f,onPrevStep:a})]})})),Ux=[[{columns:1,inputs:[{name:"calculator"}]}],[...vx,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],Kx=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Hx=nn((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(rh,[]);const p=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),h=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Ux[l],y=0===l,[x,{setTrue:b}]=dn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||x?null:o(Sx,{stepsTitles:Kx,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(Px,{}):o(Wx,{step:l,sections:f,programsSource:t,onNextStep:p,onPrevStep:h,onFinish:b},String(l))})]})})})),Yx=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(wl,{step:a,showPercentage:!1})]})})),Gx=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,isOffice:r,...l})=>c(g,{...l,children:[o("div",{className:"flex flex-col md:flex-row items-center",children:o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"})}),o(Jx,{items:n}),r?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(Xn,{onClick:()=>(e=>{window.location.href=e})("https://online.rshb.ru/rshb-mbfl/webmodules/prelogin-zone"),className:"w-full mt-lg",version:"primary",children:"Узнать статус заявки"}),o(Oe,{href:"/natural",text:"Вернуться на главную",version:"primary",className:"w-full mt-lg"})]}):null,!r&&a?o(Oe,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(Oe,{href:"/natural/debetcards#form",text:"Заказать звонок",version:"primary",className:"w-full mt-lg"}),o(Oe,{href:"https://online.rshb.ru/d?l=dcNqSvOE",text:"Выпустить карту в приложении",version:"primary",className:"w-full mt-lg"})]}):null]}))),Jx=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ye,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:Xx(e)},t)))}):null]})]}):null,Xx=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ye,{color:"text-secondary-text",size:"text-l",children:e}),o(Ye,{color:"text-primary-text",size:"text-xl",children:t})]}),Qx=d((()=>{const{leadForm:e}=ld();return o(Gx,{title:`${e?.name} ${e?.middleName},`,description:"Вам доступно оформление заявки в мобильном приложении банка либо Вы можете обратиться за помощью в контакт-центр Банка по телефону 8 800 100-0-100",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:oa(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),Zx=d((()=>o(Gx,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),eb=d((()=>o(Gx,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),tb=d((()=>o(Gx,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),nb=d((({isOffice:e})=>o(Gx,{title:"Заявка принята",description:e?"Ваша заявка принята. Ожидайте СМС и EMAIL с статусом заявки":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную",isOffice:e}))),ab=d((()=>{const[e,t]=a(Oy.process),{taskId:n,statusInfo:r,programId:l}=ld(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await Ay({signalType:"FIND_PERSON_SIGNAL",taskId:n});await Ay({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Oy.notFound)})()}),[n]),ib(e,o,s)})),ib=(e,t,n)=>({IN_PROCESS:o(eb,{}),NOT_FOUND:o(Zx,{}),CLIENT_NOT_OK:o(Zx,{}),NEW_CLIENT:o(nb,{isOffice:t}),CLIENT_FOUND:o(nb,{isOffice:t}),DBO_CLIENT:o(n?tb:Qx,{}),PRE_DECISION:o(nb,{isOffice:t})}[e]||o(nb,{isOffice:t})),rb=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Ia,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),lb=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},isMomentDebitCard:!0,currency:"810",codeWord:"",latinName:"",latinSurname:""}],sb=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:hx(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},ob=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},cb=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Fp({addressCourier:t})}:{}})(t);case 1:return px(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},db=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=2===e,c=ld(),d=l((()=>sx(e,c.leadForm,lb)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:Cm[a]},...ob(n),participants:[{id:e,residentOtherCountry:!1,...cb(i,n)}],...mx(n),...sb(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),qo("/user-data/updateUserTaskDebit","PUT",r)),o?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},mb=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ho();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((e=>rx({formState:e,inputs:s,productType:"debitCard"})),[s]),[m,u,p]=db({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=Nn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ax({sections:t,field:h}),o(rb,{step:e,isSending:p,onPrevStep:n})]})})),ub=[[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...vx,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг."}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[],condition:{name:"isMomentDebitCard",values:[!1]}},{columns:2,inputs:[{name:"latinName",condition:{name:"isMomentDebitCard",values:[!1]}},{name:"latinSurname",required:!0,condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения.",condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.",condition:{name:"isMomentDebitCard",values:[!1]}}]}]],pb=["","Персональные данные","Платежная система"],hb=nn((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(rh,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=ub[n],f=0===n,[y,{setTrue:x}]=dn(!1),b=r((()=>{x(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(Yx,{stepsTitles:pb,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(ab,{}):o(mb,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:b},String(n))})]})})})),gb=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,fb=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),yb=1e9,xb={sum:{min:1e4,max:yb},period:3},bb=nn((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=og(xb,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:vb(e)})}),p=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),h=Nb(p);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(eg,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Wf,{label:a?.title,min:500,max:yb,...d("sum",{parse:e=>({min:Number(e),max:yb}),format:({min:e})=>String(e)})}),o(vr,{title:i?.title,items:["От 3 мес","До 5 лет"],list:h,...d("period")})]})}),o(Jh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),vb=e=>Jt((e?.paramsSource?.rateRows||[]).filter(gb).flatMap((e=>fb(e.minMonths,e.maxMonths)))),Nb=e=>Jt(e.flatMap((e=>e||[])).filter(gb).flatMap((e=>fb(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],wb=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Cb=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:wb(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Oe,{version:i?.version,text:i?.text,...i}):null]}))),Sb=`${ra}/region`;function kb(e="Москва"){return be().location??{name:e}}function Ib(e="Москва"){const t=be(),n=r((async()=>{if(!t.location){const n=await Yt(Sb);t.location=n??{name:e}}}),[t,e]);return lr(Sb,n),t}var Tb;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Tb||(Tb={}));const Rb=new Intl.NumberFormat("ru",{style:"currency",currency:Tb.RUB}),Eb=e=>e?Rb.format(e):"",Db="text-m font-light text-secondary-text ",_b=`${Db} text-left`,Pb=`${Db} pl-5xl text-center`,Ob=`${Db} pl-5xl text-right`,Bb={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Ab=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:_b,children:o(Ye,{size:"text-m",children:"Валюта"})}),o("th",{className:Pb,children:o(Ye,{size:"text-m",children:"Купить"})}),o("th",{className:Ob,children:o(Ye,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Fb)})]}))),Fb=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:Bb[t]},width:"24",height:"24"}):null,o(Ye,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ye,{size:"text-h6",children:Eb(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ye,{size:"text-h6",children:Eb(e?.buyExchangeRate)})})]},t)},Mb={icon:"GpsIcon"},Lb=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(gg,{...Mb,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),zb=(e,t,n)=>{const a=Number(Vb(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},Vb=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function $b(e){if(!e)throw new Error("Value should be fulfilled");return e}const jb=e=>t=>{const[,n]=$b(e.find((([e])=>e(t))));return n(t)},qb=e=>jb(e.map((([e,t])=>[e,()=>t])));qb.if=e=>new Wb(void 0,e);class Wb{parent;predicate;unit;get entry(){return[$b(this.predicate),$b(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Wb(this,e)}then(e){return new Wb(this.parent,this.predicate,e)}else(e){return jb([...Ub(this),[()=>!0,e]])}}const Ub=e=>[...e?.parent?Ub(e.parent):[],e.entry],Kb=e=>qb([[e=>e.value!==Tb.RUB&&e.oppositeValue!==Tb.RUB,()=>e.handleConvert(e.value,Tb.RUB)],[e=>e.value===Tb.RUB&&e.oppositeValue===Tb.RUB,()=>e.handleConvert(e.value,Tb.USD)],[e=>e.value===Tb.RUB&&e.oppositeValue===Tb.RUB,()=>e.handleConvert(e.value,Tb.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Hb(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Ja,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(Bi,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const Yb=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Tb.RUB,selectBuy:n?.[0]?.currency?.currency||Tb.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Hb({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:Gb(l,d,n),value:l.inputSell,onChange:e=>Xb(d,n)(e,l.selectSell,l.selectBuy)}),Hb({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:Jb(l,d,t),value:l.inputBuy,onChange:e=>Qb(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(Oe,{text:i.text,version:i?.version,...i}):null]})})),Gb=(e,t,n)=>a=>{t({selectSell:a}),Kb({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Xb(t,n)(e.inputSell,a,i)}})},Jb=(e,t,n)=>a=>{t({selectBuy:a}),Kb({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Qb(t,n)(e.inputBuy,a,i)})},Xb=(e,t)=>(n,a,i)=>{e({inputSell:Vb(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(zb(n,r,a===Tb.RUB)||"")})},Qb=(e,t)=>(n,a,i)=>{e({inputBuy:Vb(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(zb(n,r,a===Tb.RUB)||"")})},Zb=`${ra}/exchangerates`;const ev=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=lr(Zb+`?regionCode=${t}`,Gt);return n||{}}(kb()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=tv(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Tb.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Tb.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o($e,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Ab,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Lb,{address:i?.address})]}),o(Yb,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),tv=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],nv=d((({className:e,items:t})=>{const n=Ie();return o("ul",{className:u("w-full",e),children:t?.map(av(n))})})),av=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...Re(t),children:i||null})},String(a)):null},iv=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:rv(e)}))),rv=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(lv,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),lv=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(dc,{className:e,role:"menuitem",children:[c(Xn,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Ys,{children:[o(gg,{className:"shrink-0",...t.icon}),o(Ye,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(oc,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(mc,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(nv,{items:t.items}):null})]})})),sv=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(ov)}):null)),ov=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ye,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(cv)})]},String(t)),cv=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:dv(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),dv=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${mv(t)}`,children:o(Ye,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},mv=e=>e.replaceAll(/\D/g,""),uv=d((({className:e="",index:t,text:n,...a})=>{const i=Ie(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),pv=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ye,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(uv,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),hv=d((({className:e="",index:t,...n})=>{const a=Ie(),{href:i,target:r,text:l,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),gv=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ye,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(hv,{index:t,...e},String(t))))}):null]}))),fv=nn((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:r,contacts:l,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:p,otherLinks:h=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(iv,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(sv,{items:l}),m?o(Oe,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(dy,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),o("div",{className:"flex gap-m xl:gap-xs flex-wrap",children:h.map(((e,t)=>o(Ji,{className:"text-s font-light",...e},`${e.href}_${t}`)))})]})]}),o(pv,{title:d,links:r}),o(gv,{links:i,license:p})]})})),yv=(e=!1)=>e?{}:{padding:"p-0"},xv={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},bv=[1,2,3,4],vv={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},Nv=nn((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...p})=>{const h=(e=>{const[t,n]=a(e.blocks??[]),r=ia(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",xv[n],e),padding:t,version:s,isTheme:c,...p,children:_({...p,block:{...m,blocks:h},renderProps:wv({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>vv,allowRemoveChild:e=>(e?.blocks??[]).length>5}),wv=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>R(n,{...a,blockDecorator:Cv(a.blockDecorator,i)},{className:u("w-full",Ch(t)),...yv(e)}),Cv=(e,t=0)=>(n,a)=>e?.({...n,render:e=>kv(t)({...n,...e},a)},`wrap_${a}`)??kv(t)(n,a),Sv=e=>Number(e)<5?"":"hidden",kv=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return bv.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(oy,{...r.content?.link,className:u(Sv(e),(l=e,bv.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},Iv=nn((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],p=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Ai,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ji,{className:u("w-full @xl:w-auto"),href:p,target:"_blank",version:n?.version??"primary",data:Ui(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Tv={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Rv=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:p="",ref:h})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Tv[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...Ev(p),...Re(s),ref:h,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Ev=e=>e?{"data-test-id":e}:null,Dv=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=dn(!1),d=hn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(Rv,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),_v={text:"Отправить заявку",version:"primary"},Pv={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},Ov=({onClose:e=Hn})=>o(ta,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(lo,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:_v,link:Pv,onSuccess:e})})})}),Bv=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=Fv,handlers:r,onItemClick:l})=>{const s=Le();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},Av=d((({isActive:e,...t})=>{const n=Ie(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...Re(t?.data),children:a})})),Fv=({item:e,i:t,activeItem:n})=>o(Av,{isActive:e===n,...e},e?.text??String(t));const Mv=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:l="large"})=>{const[c,{setFalse:d,toggle:m}]=dn(!1),p=zv(B.QUICK_ACTIONS??[]),h=Vv(),g=Le(),f=function({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=Di();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),p=s(null),h=s(null),g=Wa(u),f=l?h:g;return i((()=>{if(!a||!p.current||!e?.length)return;const n=p.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(Bv,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),p}({items:p,onClose:d,isOpen:c,onHover:!g,renderDropdownItem:Lv,handlers:h});return i((()=>{if(!g)return f.current?.addEventListener("mouseenter",m),f.current?.addEventListener("mouseleave",d),()=>{f.current?.removeEventListener("mouseenter",m),f.current?.removeEventListener("mouseleave",d)}}),[]),o("div",{ref:f,children:o(Rv,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:l,isGrayBg:!0,version:a,className:u(c?"shadow-blue-gray":"",t),onClick:m})})})),Lv=({item:e,handlers:t,closeDropdown:n=Hn})=>{const a={call:{handler:e=>{t?.call(e),n()},text:"Заказать звонок"},chat:{handler:e=>{t?.chat(e),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},zv=e=>e.map((e=>({text:e}))),Vv=()=>{const e=kn(Ov),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=hn();return{call:t,chat:r((e=>{const t=n.openChatBot;t&&e&&t(e).finally()}),[])}},$v={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},jv=d((({version:e,text:t,mobileText:n,...a})=>{const i=Le()?n:t;return i?o(Oe,{className:u("py-s px-lg font-light whitespace-nowrap",$v["transparent"===e?"transparent":"default"]),...a,children:i}):null})),qv=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=P(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:p,...h}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(hp,{className:"my-2xs",bgColor:e,logo:h,data:p,showTitle:!1})}):Wv(g,l),Uv({version:i,iconVersion:m,internetBankButton:a})]})})),Wv=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(Y,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Uv=({version:e,iconVersion:t,internetBankButton:n})=>c("div",{className:"flex gap-lg items-center",children:[B.QUICK_ACTIONS?o(Mv,{version:e,iconVersion:t}):null,B.CHAT_BOT&&!B.QUICK_ACTIONS?o(Dv,{version:e,iconVersion:t,buttonSize:"medium"}):null,o(jv,{version:e,...n})]}),Kv={"bg-white":"primary",transparent:"transparent"},Hv=nn((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Kv[e],portal:a,logo:i={},...r})=>{const{backwardButton:l,logo:s={}}=r.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...r,children:o("div",{className:"container px-lg py-2xs box-border",children:o(qv,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),Yv=nn((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=P();return o(g,{className:u("relative flex flex-col",xv[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",Ch(l)),...yv(a)}})})}),{childrenTypes:[]}),Gv=nn((e=>o(Yv,{...e})),{childrenTypes:[]}),Jv=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",vg[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Xv=["байт","Кб","Мб","Гб","Тб","Пб"],Qv=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...Re(r),children:[e,t?c(Ye,{size:"text-l",font:"font-light",children:[t," ",Zv(d,m),o(Ye,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Zv=(e,t)=>e||t?o("span",{children:", "}):"",eN=(e,t)=>(n,a)=>{const i=W(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Xv[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?nN(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Qv,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:tN(t),data:n?.data}),o(Ke,{__html:n?.__html})]},String(a))},tN=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,nN=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},aN=d((({href:e,__html:t,target:n,onClose:a})=>c(ta,{maxWidth:"lg",onClose:a,children:[t?o(Ke,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ji,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Xn,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),iN=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=kn(aN),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[tN(i),o(Ye,{font:"font-light",children:e})]}):null})),rN={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},lN=nn((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=P();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",rN[l]),role:"list",children:i.map(sN(d,r))}):null]})})),sN=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?oN(t)(n,a):eN(e,t)(n,a)},oN=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(iN,{...a,icon:e,href:cN(t)?t?.href:t?.attachment?.src}),o(Ke,{__html:t?.__html})]},String(n)):null},cN=e=>"href"in e,dN=nn((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:p="Мобильное приложение",version:h="primary",...f})=>{const y="secondary"===h?"p-m min-w-32":"min-w-24",x=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:h,...f,children:c($e,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:p,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:nt(a,{className:"flex-wrap"}),children:[i?o(Ye,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Ke,{__html:l,itemSize:"list-m"}):null,o(Ye,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),mN="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",uN=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],pN=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],hN=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],gN=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(Fa,{text:i[e],...t(e)},e))),[l,s,d]=fN({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(dc,{children:[o("div",{children:o("div",{className:mN,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(cc,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Xn,{embedded:!0,onClick:n,children:[o(Ys,{children:"Очистить фильтр"}),o(Y,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c(mc,{isUnfolded:m,children:[bN("Драгоценные металлы",s),bN("Специальные возможности",d)]})})]})}):null})})),fN=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?yN(t):xN(t),yN=e=>{const t=[],n=[],a=[];for(const i of e)uN.includes(i.key)&&t.push(i),pN.includes(i.key)&&n.push(i),hN.includes(i.key)&&a.push(i);return[t,n,a]},xN=e=>[e.slice(0,6),e.slice(6)],bN=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(Ye,{children:e}),o("div",{className:mN,children:t})]}):null}),vN=(e,t)=>e&&"underlined"!==t?"primary":"secondary",NN=(e,t,n)=>{const a=vN("all"===t),i=vN("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(Xn,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Xn,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},wN=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Ke,{__html:e,richVersion:n}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(CN)}):null]}):null,CN=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(Ye,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),SN=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Ye,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,kN=()=>{},IN=e=>"all"===e?"block":"hidden",TN=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=kN,renderRemoteWorkplaceCard:l=kN,getBalloon:s=kN,initFilterState:d=Bc,getBalloonRemoteWorkplaces:m=kN,descriptionData:p,title:h})=>{const g=h?.includes("Офис"),[f,{field:y,reset:x}]=Nn(d),{filteredItems:b,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=zc({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[SN(h,w),p?wN(p):null,g&&NN(t,C,S),o("div",{className:u("pb-3xl",IN(C)),children:o(gN,{filters:RN([...t,...i]),field:{field:y,reset:x},onlyOffice:g,labels:Ac})})]}),o("div",{className:"h-[600px]",children:o($c,{children:o(Zc,{points:v,isLoad:n,className:"h-full"})})})]}),c($c,{children:[b.map(r),N.map(l)]})]})})),RN=e=>Object.keys(Bc).filter((t=>e.filter((e=>Fc[t](e))).length)),EN=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:vf(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ye,{size:"text-h4",children:vf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Cc,{color:"green",children:vf(s)})})]}),o(uc,{children:o(sc,{className:"flex-wrap",children:m?.map(((e,t)=>o(ac,{...e},String(t))))})})]},String(d))},DN=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${vf(t)} №${n}`,body:e.toUpperCase()}),_N=[];const PN=async e=>{const t=await Yt(e,{method:"GET"});return Array.isArray(t)?t:_N},ON={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},BN=d((({descriptionData:e,className:t})=>{const n=kb(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=lr(`${ra}/atms?regionCode=${e}`,PN);return{data:t||_N,isLoad:!t&&!n}}(a);return o(TN,{className:t,data:i,isLoad:r,initFilterState:ON,renderCard:EN,getBalloon:DN,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),AN=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ye,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:e})]}):null]})}),o(uc,{children:FN(t)})]},String(n)):null,FN=e=>c("div",{children:[c(sc,{className:"flex",children:[o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Оформление и обслуживание банковских карт"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Инвестиционное и накопительное страхование"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ac,{label:"Режим работы",className:"max-w-none",children:o(Ye,{children:e})})]}),MN=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),LN={branches:[],remoteWorkplaces:[]};const zN=async e=>await Yt(e,{method:"GET"})||LN,VN=d((({className:e})=>{const t=kb(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=lr(`${ra}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,zN);return{data:t||LN,isLoad:!t&&!n}}(n);return o(TN,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:_c,renderRemoteWorkplaceCard:AN,getBalloon:Oc,getBalloonRemoteWorkplaces:MN,title:`Офисы филиала ${t?.name}`})})),$N=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(VN,{}):o(BN,{descriptionData:e})})})),jN=`${ra}/rates`,qN=`${ra}/historyrates`,WN=[[{currencyPair:"Валютная пара",buyRate:0,sellRate:0}]];const UN=()=>Date.now()+9e5,KN=(e,t)=>e?!t?.archiveRates||t?.archiveRates.nextUpdate<=Date.now():!t?.rates||t?.rates.nextUpdate<=Date.now(),HN=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),YN=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ye,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,GN=d((({rows:e})=>{return o(Eh,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,r=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Ye,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${HN(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ye,{size:"text-xl",children:e.data}):null,e?.cols?YN(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),JN=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(Ye,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(GN,{rows:t.rowsData})})})]},a)}))}))),XN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),QN=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Ye,{size:"text-xl",font:"font-light",color:XN(t===n),children:e||t+1})},e)))}):null,t?o(Oe,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),ZN=nn((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(QN,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(JN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(Ye,{size:"text-h6",children:"Данных нет"})})})),ew="border-main-divider lg:border-b w-full py-s lg:py-xl",tw=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl",ew),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(ZN,{...t,onClick:n})}):null]}))),nw="grid grid-cols-3 gap-s",aw=nn((({currencyPair:e="",buyRate:t=0,sellRate:n=0})=>c("div",{className:u("mb-s",nw,ew),children:[o("div",{children:iw(e)}),o("div",{children:t}),o("div",{children:n})]}))),iw=e=>e.replace("_TOD",""),rw=({dateString:e,isArchive:t=!1})=>{const n=new Date(String(e)),a=n.toLocaleTimeString("ru-RU",{timeZone:"Europe/Moscow",hour:"2-digit",minute:"2-digit",hour12:!1}),i=n.toLocaleDateString("ru-RU",{timeZone:"Europe/Moscow",day:"numeric",month:"long",year:"numeric"});return t?c("div",{children:[o(C,{color:"text-secondary-text",font:"font-medium",children:i}),c(C,{color:"text-secondary-text",children:[a," (","МСК",")"]})]}):c(Ye,{color:"text-secondary-text",children:["Курсы действительны на ",a," (","МСК","), ",i]})},lw=d((({isArchive:e=!1,isRatesValid:t,list:n=[],infoMessage:a})=>{const i=t?n.map((e=>e.lastUpdatedAt)).reduce(((e,t)=>String(e)>String(t)?e:t)):"";return c("div",{className:"space-y-xl mb-3xl",children:[i&&rw({dateString:i,isArchive:e}),c("div",{className:u(nw),children:[o(Ye,{font:"font-medium",children:"Валюта"}),o(Ye,{font:"font-medium",children:"Покупка"}),o(Ye,{font:"font-medium",children:"Продажа"})]}),n.length>0?n.map(((e,t)=>o(aw,{...e},String(t)))):o(C,{children:"Ошибка получения данных"}),o(C,{color:"text-secondary-text",children:a})]})})),sw=e=>c(C,{children:["Полный архив вы можете посмотреть ",o(Ji,{href:e,children:"здесь"})]}),ow=d((({href:e,className:t="",infoMessage:n,title:a,isArchive:i=!1,...r})=>{const l=function(e){const t=e?qN:jN,n=e?"archiveRates":"rates",a=be(),i=KN(e,a),{data:r}=lr(i?t:"",Gt);if(i&&r){const e=UN();a[n]={rate:r,nextUpdate:e}}const l=a[n]?.rate;return Array.isArray(l)?l:WN}(i),s=l[0].length>0;return c(g,{className:u("p-6xl space-y-xl",t),defaultPadding:"p-0",...r,children:[o(w,{className:"mb-xl",children:a}),i?c("div",{className:"flex justify-start items-end space-x-xl",children:[o(Zr,{label:"Выберите день",maxDate:new Date}),o(Ia,{className:"h-fit",children:"Показать"})]}):null,l.map(((e,t)=>o(lw,{list:e,isRatesValid:s,isArchive:i,infoMessage:n},String(t)))),e?sw(e):null]})})),cw=[{name:"dadataPartyInnSelect",required:!0},{name:"email",required:!0}],dw={icon:"CopyIcon"},mw=d((({className:e,value:t="",copyIcon:n})=>{const a=r((async()=>{try{await globalThis.navigator.clipboard.writeText(t)}catch{console.log("Ошибка копирования")}}),[]);return c("div",{className:u("relative flex items-center max-w-lg m-auto",e),children:[o("input",{className:u("h-14 border-gray text-ellipsis pr-5xl",Ga),type:"text",value:t,disabled:!0}),o("div",{role:"button",className:"absolute right-3",onClick:a,children:o(ie,{image:n??dw,width:"20px"})})]})})),uw=d((({link:e,copyIcon:t})=>c("div",{children:[o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ye,{size:"text-h6",children:"Скопируйте ссылку и отправьте другу"})}),mw({value:e,copyIcon:t})]}))),pw=nn((({title:e,description:t,link:n="",button:i,copyIcon:s,...d})=>{const[m,u]=a(!1),[p,h]=a(""),g=l((()=>Wn(cw)),[cw]),f=r((async e=>{h(`${n}?utm_source=${e.dadataPartyInnSelect?.text}&utm_mail=${e.email}`),u(!0)}),[]),[,{field:y,onSubmit:x}]=Nn({},{resetOnSubmit:!0,formValidator:g,onSubmit:f});return o(Sn,{className:"container space-y-m col-span-12",title:hw(e,m),...d,children:m?o(uw,{link:p,copyIcon:s}):c("form",{onSubmit:x,children:[c("div",{className:"grid @xl:grid-cols-2 gap-x-m",children:[$s(t),cw.map(zs(y))]}),c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[o(Ye,{children:"Нажимая кнопку, вы подтверждаете согласие с "}),o(Ji,{href:"/privacy-policy",target:"_blank",ariaLabel:"условия передачи данных",children:"условиями передачи данных"})]}),o(Ia,{className:"w-full @xl:w-auto mt-xs",children:i?.text??"Получить ссылку"})]})})})),hw=(e="",t=!1)=>t?"Ваша личная ссылка":e,gw=nn((e=>{const{__html:t,dynamicQueryParamText:n={},dynamicTextSource:a,richVersion:i="",...r}=e,l=ln(n,a?.list,t);return o(g,{defaultPadding:"p-0",...r,children:o(Ke,{__html:l,richVersion:i})})})),fw=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",yw=nn((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Le(),[m,{toggle:p}]=dn(t),h=o(mc,{className:u("gap-lg",fw(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(cc,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:p});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:l,...s,children:c(dc,{children:[n?y:h,n?h:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),xw={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},bw=(e,t,n)=>(a,i)=>{const{button:r}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:vw(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Nw(a),r?.text?o(Oe,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},vw=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=ww(e,r),s=r?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",l),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Cw({step:n,iconVersion:i,i:a,stepVersion:t})})})},Nw=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",xw.description),children:e.description}):null,o(Ke,{__html:e.__html})]}),ww=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Cw=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return tt(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?xw.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Sw=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:r="gray",version:l="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:l,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(bw(d,l,r))}):null,nt(i,{isVertical:!0})]})})),kw=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Iw=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("absolute bg-white p-0 rounded-xl bottom-0 top-32 w-full",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Qn,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Tw(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Rw=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return Tw(we.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Ew=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const Dw=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ye,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(_w,{...e},String(t))))})]}):null,_w=d((({icon:e,...t})=>{const n=Ie(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(Ye,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Pw=(e,t)=>n=>n.name?o(oy,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Ui(e,n.name),children:o(Ye,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ow=(e,t)=>([n,a])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ye,{size:"text-h6",children:n})}),a.map(Pw(t,e))]},n),Bw=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(Ka,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Aw=d((({defaultLocation:e})=>{const t=kb(e),n=Ie(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(oy,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Fw=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ib(t?.default),[s,d]=a(""),m=bs(),u=l((()=>zw(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),p=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,Lw)),[u]),h=r((e=>{i.location=e,n?.()}),[i,n]);return c(ta,{maxWidth:"none",head:Mw(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Ew(e.toLowerCase())(s.toLowerCase())>=.8)).map(Pw(t?.dataSelect,h))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(p.entries()).map(Ow(h,t?.dataSelect))}),Dw(e)]})})),Mw=(e,t,n)=>c("div",{children:[o(Ye,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Aw,{defaultLocation:n?.default}),o(Bw,{onSearch:t,searchTerm:e})]}),Lw=e=>e.name?.charAt(0)??"",zw=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Vw=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=kn(Fw,n),{name:s}=kb(),c=e?.current?.getBoundingClientRect(),d=r((()=>{const e=globalThis?.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px";const n=Q(X.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[X.SITE_URL]);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:s},"*")}),[s]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Iw,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:d,src:t?.src,width:c?.width||0})})})})),$w="burgerMenuDialog",jw=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Hn})=>{const{open:i}=kn(Vw),[l]=Rw(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))($w,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:$w})),[e,n,t,a]);return[s,{toggle:s?a:o}]},qw=[],Ww=nn((({sticky:e,...t})=>{const{menuItems:n=qw}=e??{},i=n.find((e=>"Меню"===e.title)),l=n.filter((e=>"Меню"!==e.title)),d=Math.floor(l.length/2),m=l.slice(0,d),u=l.slice(d),[p,h]=a(-1),[f,y]=a(""),{closeAll:x}=Ce(),b=r((()=>{h(-1),y(""),x()}),[x]),v=Wa(b),N=s(null),[C,{toggle:S}]=jw({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=Ce(),c=r((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return r(((r,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();l({id:"left"===d?n[r].title:a[r].title,dialog:o(Iw,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[r].description||m[r].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[r]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=r((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=r(((e,t)=>{y(t),h(e),x(),k(e,t)}),[x,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Uw(T,"left",{activeIndex:p,currentItemPosition:f})),o(kw,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Uw(T,"right",{activeIndex:p,currentItemPosition:f}))]})})})),Uw=(e,t,n)=>(a,i,r)=>o(kw,{item:a,isActive:r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:l=>{r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||l.stopPropagation(),e(i,t)}},a.title||String(i)),Kw={primary:"bg-white/30",secondary:"bg-main-divider"},Hw={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Yw=d((({count:e,version:t="secondary"})=>{const n=Le(),a=n?"bg-main-divider":Kw[t],i=Hw[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Ye,{size:"text-xs",color:i,children:e})})})),Gw=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},Jw={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Xw={default:"text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Qw={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Zw={default:"bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},eC=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:p,...h}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",Jw[a],n?Zw[a]:Qw[a]),"aria-label":"Список табов",onClick:i,...h,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Xw[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Gw({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Yw,{count:m,version:vN(n,a)})}):null]})})})),tC=d((e=>o(e?.item?.href?nC:aC,{...e}))),nC=d((e=>{const t=Ie(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(eC,{...e,tag:"a",item:i,onClick:a})})),aC=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(eC,{item:e,onClick:a,...n})})),iC="hidden sm:flex absolute z-40",rC={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},lC=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=Mh({itemCount:t?.length||0});return i((()=>sC(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Eh,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:rC[r].item,gap:rC[r].gap,children:t.map((d=n,m=a,p=r,(e,t)=>o(tC,{isActive:e===d,onClick:m,type:p,item:e},String(t))))}),s.canScrollLeft?o(jh,{wcmsIgnore:!0,className:u("left-6",iC,rC[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(qh,{wcmsIgnore:!0,className:u("right-6",iC,rC[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,p})),sC=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},oC={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cC=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(oC[t].wrapper,e),children:o(lC,{className:oC[t].component,tabsType:t,...n})}):null,dC="sticky top-1 z-20",mC=nn((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=pC(n||{}),p=P(),h=po(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),x=fC(m),b=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=b.findIndex((e=>Boolean(e?.selected))),N=b.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===x)),w=x?N:v,[C,S]=a(uC(w)),k=b[C],I=gC(b[C],C),T=r((e=>{const t=b.indexOf(e),n=b[t];S(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),p.replace(`${p.pathname}?${y}`,{scroll:!1})})(e,t)}),[b]);return c(g,{className:u({[dC]:[s,f,!h].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[cC({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[dC]:[s,!f,!h].every(Boolean)}),items:hC(t,b),activeItem:k,tabsType:i,onChange:T}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>D(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(gC)?.filter(Boolean)||[]}),uC=e=>e&&-1!==e?e:0,pC=({__id:e,anchor:t})=>t??e??"tabs",hC=(e,t)=>t?.length?t:e,gC=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",fC=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),yC=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(Ye,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),xC={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},bC=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:xC[t],children:e})}))),vC=d((({className:e="",isOpen:t,onClick:n})=>o(cc,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),NC=e=>e?o("div",{children:o(Ye,{size:"text-h6",children:e})}):null,wC=e=>e?o("div",{className:"text-l font-light",children:o(Ye,{color:"text-secondary-text",children:e})}):null,CC=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ke,{__html:e,isDotted:t,itemSize:"list-m"})}):null,SC=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(vC,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[NC(e),wC(t),CC({__html:n,isDotted:a}),nt(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),kC=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(tw,{tableInner:i,...n,children:[yC(e),t?.length?o(bC,{version:"tariff",children:t.map(((e,t)=>o(SC,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),IC=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),TC=nn((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(kC,{row:e,...l},String(t)))),[p,h]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=dn(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(dc,{children:[c(IC,{children:[p,o(mc,{isUnfolded:f,isOverflowVisible:!0,children:h})]}),o(cc,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(IC,{children:m})})]})})),RC=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?EC():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ye,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?DC(n):null,i?o(Ke,{richVersion:r,__html:i}):null]})]}))),EC=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),DC=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),_C={AdTile:on,ApplicationForm:lo,BankAccountFiltration:mg,BenefitsBlock:fg,BonusBenefitsBlock:bg,ButtonsBlock:Ng,CalculatorBonus:Rg,CalculatorBusinessDeposit:Lg,CalculatorCredit:gm,CalculatorDeposit:sf,CalculatorRefinancing:yf,CardTransfer:Gf,Carousel:ay,CarouselCatalogCard:ly,CarouselRecommendationCard:py,CarouselTariffsCard:yy,DepositFiltration:bb,ErrorBlock:Cb,ExchangeRateTile:ev,Footer:fv,GalleryLayout:Nv,GrantSupport:Iv,Header:Hv,Headline:k,HorizontalLayout:Gv,ImgBlock:Jv,LinkDocs:lN,MobileAppTile:dN,OfficesAtmsMap:$N,ProductBlock:sn,RichTextBlock:gw,RollupItem:yw,StepsBlock:Sw,StickyBottomMenu:Ww,TabsLayout:mC,TariffsTable:TC,TextBlock:RC,VerticalLayout:Yv,ApplicationLeadForm:fh,CreditCardForm:Cx,CreditForm:Hx,DebitForm:hb,CashbackCalculator:Ey,CalculatorRko:Vf,RkoTariffCardsTable:Pf,RatesTable:ow,ReferalForm:pw},PC=ve((()=>{i((()=>{rn()}),[]);const e=hn();qa(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Ki({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const OC="cookie",BC=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=dn();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(OC)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(OC,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ke,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Qn,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function AC(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);qa(globalThis.document,"keydown",t)}const FC=d((()=>{const[e,{close:t}]=Rw(),n=Boolean(e.length);return AC(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),MC=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Tw(we.observable,"popup",{open:t,close:n}),AC(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),LC="header",zC="footer",VC="sticky-footer",$C={},jC=d((({className:e,data:t=$C,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=en(s,l),m=po();PC(),Ib(),oi();const p={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[LC]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:D(i?.[LC],{...p,slotName:LC})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[_({block:t,options:p,extraProps:{className:"scroll-mt-12"}}),!m&&D(i?.[zC],{...p,slotName:zC})]})]}),i?.[VC]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:D(i?.[VC],{...p,slotName:VC})}):null,o(FC,{}),o(MC,{}),m?null:o(BC,{__html:d?.cookieContent?.__html})]})}));Object.assign(jC,{childrenTypes:[],slots:()=>[LC,zC,VC]});e.Blocks=_C,e.ContentPage=jC,e.handlerDecorator=ve,e.joinList=Qh,e.locationNavigator=mn,e.packageVersion="0.14.1051",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=P,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>p(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),p=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),h={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},h[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(x),x=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const r=v[n]||"h3";return o(r,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:r="text-center",as:l,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const p=S[n],h={marginTop:p.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-normal",r),...p?.title,as:l||p?.title.as,title:a}):null,i?o(C,{size:p.descriptionSize,font:p.descriptionWeight,align:r,...h,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=I,blocksRegistry:l={},ancestors:s=T}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const E=[],D=(e,{key:t,ancestors:n=E,slotName:a=null,extraProps:i,renderProps:r=R,...l})=>{const s=i?(e,t)=>R(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||E,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?D(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function P(){return P._impl()}P._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),P.setup=e=>{P._impl=e};const O=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return O.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),A=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),M=e=>Boolean(e?.startsWith("#")),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:A,isLocalURL:F,isHash:M,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,q=[B.CDN,$],W=e=>(t,n)=>{if(U(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U=e=>!e||A(e)||M(e)||q.some(z(e)),K={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},H={small:"16",medium:"24",large:"48",xl:"78"},Y=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&H[l],height:d=s})=>{const m=P(),p="normal"===r?`${n}.svg`:`sprites.svg#${n}`,h=W(m)(L(B.CDN,"/icons/",p));return"normal"===r?o("img",{className:e,style:G(e,d),src:h,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(J,{className:e,children:c("svg",{className:u(K[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),G=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},J=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(X.SITE_URL);return t&&!A(t)?W(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=P();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" ");function me(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function ue(e,t){return me(e,t),me(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class pe{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}class he{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new pe){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class ge{bus;store=new Map;get size(){return this.store.size}constructor(e=new pe){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const fe={};function ye(e,t=fe){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const xe=new ge;function be(e){return ye(xe,e)}ue(xe,new he(globalThis?.localStorage));const ve=e=>ve._impl(e);function Ne(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}ve._impl=e=>e,ve.setup=e=>{ve._impl=e};const we=new pe,Ce=()=>Ne(we.emitter,"dialog"),Se="/",ke=["/api"];function Ie(){const e=P(),{closeAll:t}=Ce();return n=>{const a=W(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:ve((i=>{n.onClick?.(i);const r=Q(X.SITE_URL);Te(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=Se,t=Se)=>[e,t].some((e=>e===Se))?e:e.replace(t,"")||Se)(a,r)))}))}}}const Te=(e,t,n)=>F(e,t)&&![...ke,...X.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),Re=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ee=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=_e(e)&&"hidden lg:block";return c("div",{className:u(De(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,_e(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),De=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",_e(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},_e=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Pe=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Oe=d((({disabled:e,children:t,method:n="LINK",href:l,id:s,additionalHrefs:c,...d})=>{const[m,u]=a(),p=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:l}),h=be();i((()=>{c&&Fe({linksStore:h,href:l,id:s,additionalHrefs:c});const e=(h.links||[]).find((e=>e.id===s))?.lastLink;u(e??l)}),[c,l]);const g=Ie()({onClick:p,href:m,...d}),f=t??o(Ee,{...g});return o(e?Ae:Be,{...g,children:f})})),Be=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...Re(d),children:m}))),Ae=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Pe({className:e,rounded:a,version:n}),children:i}))),Fe=({linksStore:e,id:t,href:n,additionalHrefs:a})=>{const i=(e.links||[]).find((e=>e.id===t));if(e.links||(e.links=[]),(!i||i.nextDueAt<=Date.now())&&a){const i=((e="",t=[])=>{const n=[e,...t];return n[Math.floor(Math.random()*n.length)]})(n,a),r=e.links?.filter((e=>e.id!==t));r.push({id:t??"",lastLink:i,nextDueAt:Date.now()+6048e5}),e.links=r}};function Me({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Oe,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Le=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},ze={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ve=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ze[n],t),children:e}):null,$e=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:p,isImageAlwaysOnRight:h=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=Le(),v=P(),N=r((()=>v.back()),[]),w=x.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Me({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ve(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[je(p,y),We(_({...x,extraProps:{className:"@container-normal"}})),Ve(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[qe(h)]:l,"col-start-2 self-center":h,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),je=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,qe=e=>u(e?"row-span-2":"@xl:row-span-2"),We=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ue=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ke=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),He=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ye=d((({children:e,className:t,...n})=>o("span",{className:u("font-sans",Object.values(n),t),children:e}))),Ge=(e,t)=>e?o(Ye,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Je=(e,t)=>["label"in e?Ge(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:He(e.description,t)},String(t)):null,"__html"in e?o(Ke,{...e},`rte-${t}`):null],Xe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Ue(n.icon,t):null,o("div",{children:Je(n)})]}))),Qe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Xe,{benefitsVersion:t,...e},String(n))))}):null)),Ze=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Je)}):null)),et=d((({isTabularBenefits:e,...t})=>o(e?Ze:Qe,{...t}))),tt=e=>Boolean(e?.src||e?.icon),nt=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(at(n))}):null,at=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=it(i,l),d=it(r,l);return a||i?.icon?o(Oe,{className:u("basis-full @lg:basis-auto",e),appendLeft:rt({...i,iconVersion:c}),appendRight:rt({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},it=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},rt=e=>tt(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),lt=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),st=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(ot)}):null)),ot=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Ye,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[lt(2)(t)," ",n||"₽"]}):null]},String(a)),ct=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(dt)}):null)),dt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ye,{size:"text-m",font:"font-light",children:e})},String(t)),mt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},ut=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:p,isFullWidthTitle:h,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:S,children:I,...T})=>{const R=x?.src?o(ie,{image:x,imageClassName:C}):null,E=o(k,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o($e,{className:e,padding:t,defaultPadding:n,...h?{title:E}:{insetTitle:E},...yt(R,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:nt(y),backwardButton:S,...T,children:ft(pt(D,{benefitsVersion:s,isTabularBenefits:c}),ht(u,{richVersion:p,isDotted:d,headlineVersion:r}),I,gt(g),xt(f))})})),pt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(et,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,ht=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Ke,{__html:e,richVersion:t,isDotted:n,itemSize:mt[a??"L"]}):null,gt=e=>e?.length?o(st,{priceList:e}):null,ft=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},yt=(e,t)=>t?{rightImage:e}:{leftImage:e},xt=e=>e?.length?o(ct,{tags:e}):null;class bt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof bt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const vt=()=>!0,Nt=(e,t)=>(...n)=>e(...n)&&t(...n),wt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const Ct=e=>Boolean(e&&Array.isArray(e)),St=e=>Boolean(e&&"object"==typeof e&&!Ct(e)),kt=e=>e;function It(e){return e instanceof bt?e._:e}class Tt extends bt{from(e){return this.of(e.map(((e=kt)=>([,t])=>e(t))(It)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(Ct(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class Rt extends bt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class Et extends bt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,It(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class Dt extends bt{proto=wt([e=>Ct(this._)||"number"==typeof e,()=>Tt.prototype],[e=>St(this._)||"string"==typeof e,()=>Et.prototype],[vt,()=>Rt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const _t=e=>e instanceof bt?e:new Dt(e),Pt=e=>{const t=(t,...n)=>It(e(_t(t),...n));return t.fn=e,t},Ot=[],Bt=e=>e instanceof Function?e:t=>e===t,At=e=>(t,n,a=Ot)=>_t(t).entries().reduce(((t,[n,i])=>At(e)(i,t,a.concat(n))),e(n,[a,_t(t)])),Ft=Pt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Ft(e.get(a),[i,n]):n)})),Mt=Pt(((e,t)=>t.reduce(Ft.fn,e))),Lt=e=>At(((e,[t,n])=>zt(n)?[...e,[t,It(n)]]:e))(e,[]),zt=e=>0===e.size();Pt(((e,t=Ot)=>t.reduce(((e,t)=>e.get(t)),e)));const Vt=Pt(((e,[t,...n])=>n.length?e.set(t,Vt(e.get(t),n)):e.filter((([e])=>e!==t)))),$t=(jt=["$ref"]).map(((e,t)=>n=>Bt(e)(n[t+n.length-jt.length]))).reduceRight(Nt,vt);var jt;const qt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Wt,e),Wt=wt([Ct,(e,t)=>e[parseInt(t,10)]],[St,(e,t)=>e[t]],[vt,kt]),Ut=(e,t)=>((e,t={})=>n=>Mt(t,Lt(n).map((t=>e(t)))))((([e,n])=>{return $t(e)?[(a=e,a.slice(0,-1)),qt(t(n),n)]:[e,n];var a}))(e),Kt=e=>Lt(e).filter(((e=kt)=>([t])=>e(t))($t)),Ht=e=>{return t=Kt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Yt(e,t){try{return e?await Gt(e,t):null}catch(e){console.error(e)}return null}const Gt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Jt=e=>[...new Set(e)],Xt={},Qt=["/portal-resources"],Zt=(e,t)=>Ut(e,(e=>t?.[e])),en=(e,t)=>{const n=Ht(e),[r,l]=a({});return i((()=>{tn(n).then(l)}),[n.join()]),n.length?Zt(e,{...t,...r}):e},tn=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Jt(e).filter((e=>!Qt.some((t=>e.startsWith(t))))).map((async e=>(Xt[e]||=await Gt(e),[e,Xt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ht(e)));return i.length?tn(i,a):a}return t};function nn(e,t={}){const n=d((t=>{const n=en((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const an="rshb-query-params";function rn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(an)||"";return e&&globalThis.sessionStorage?.setItem(an,e),e}const ln=(e={},t=[],n="")=>{const{queryParam:a,value:i}=e,r=((e,t)=>new URLSearchParams(t).get(e))(a??"utm_source",rn()),l=t.find((e=>e?.id?.toLowerCase()===r?.toLowerCase()))?.value;return l?n?.replace(String(i),l):n},sn=nn((({className:e,padding:t,defaultPadding:n,dynamicQueryParamText:a={},dynamicTextSource:i,description:r,title:l,...s})=>{const{textType:c}=a,d=ln(a,i?.list,"title"===c?l:r),m={title:"title"===c?d:l,description:"description"===c?d:r};return o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...s,children:o(ut,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...m,...s})})})),on=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>cn(0,t?.length)),[t]),a=t?.[n];return a?o(sn,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),cn=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function dn(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}function mn(){return mn._impl()}mn._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),mn.setup=e=>{mn._impl=e};const un=["https://private-banking.rshb.ru/"],pn=async e=>{const t=e.target?.closest("a"),n=mn();if(A(t?.href)&&!t?.href?.startsWith(n.origin)&&!un.includes(t?.href??"")){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=rn();if(!A(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function hn(){return hn._impl()}hn._impl=()=>({forwardQuery:pn}),hn.setup=e=>{hn._impl=e};const gn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],fn=e=>!e?.length,yn=e=>t=>n=>e(n)?[]:[t],xn={},bn=[];const vn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function Nn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=vn(i,r)?i:r;return!vn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),p=s(wn(e)),[h,{setTrue:g,setFalse:f}]=dn(!1),y=s({}),[x,{isValid:b,errors:v}]=function(e,t){const n=l((()=>t?.(e)??xn),[t,e]),a=l((()=>gn(n)(e)??bn),[n,e]),i=fn(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||y.current?.[String(e)],s=t?.validator??x[e],o=l&&s?s(r):[];return{setFieldRef:t=>{p.current&&(p.current[e]=t)},fieldRef:p.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),S=r((async e=>{if(e.preventDefault(),b)await(d?.(m,e)),t&&C();else{const e=Cn(m,x);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,b,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:S}]}const wn=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),Cn=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},Sn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function kn(e,t={}){const{open:n,close:a,...i}=Ce();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const In=/^[а-яё-]*$/i,Tn=/^(?!\s*$)(?:[\p{Script=Cyrillic}]|\P{L})*$/u,Rn=(e,t)=>{if(!e||isNaN(e.getTime()))return!1;const{minLimit:n,maxLimit:a}=t,i=e.getTime();return En(i,n)&&Dn(i,a)},En=(e,t)=>!(t&&!isNaN(t.getTime()))||e>t.getTime(),Dn=(e,t)=>!(t&&!isNaN(t.getTime()))||e<t.getTime(),_n=yn((e=>null!=e&&""!==e)),Pn="Некорректно заполненное поле",On=e=>_n(e??Pn),Bn=e=>yn((e=>e?.key&&""!==e?.key))(e??"Выберите вариант ответа"),An=e=>yn((e=>"string"==typeof e&&e.length>1&&((e="")=>In.test(e))(e)))(e??Pn),Fn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Mn=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Ln=e=>yn(Fn)(e),zn=yn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Vn=e=>"string"==typeof e&&(10===e.length||12===e.length),$n=e=>/^[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*(?:\s+[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*)+$/.test(e),jn={fullName:(qn="Укажите полное ФИО на кириллице (без сокращений)",yn((e=>"string"==typeof e&&e.length>1&&$n(e)))(qn??Pn)),addressBranch:Bn(),desiredMeetingDate:On(),product:On(),localities:On(),partnerComments:On(),collectionCount:On(),acquiringType:Bn(),serviceType:Bn(),annualRevenue:On(),feedbackMethod:Bn(),serviceDirection:Bn(),secondaryPhone:Ln("Укажите номер телефона"),region:Bn(),situationDescription:On(),sufferedFrom:On(),applierType:On(),surname:An("Укажите свою фамилию на кириллице"),name:An("Укажите своё имя на кириллице (без сокращений)"),middleName:An("Укажите своё отчество на кириллице"),birthday:(e=>yn((e=>Rn(e,{maxLimit:new Date})))(e))("Укажите дату рождения"),phone:Ln("Укажите номер телефона"),email:(e=>yn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),inn:(e=>yn((e=>Vn(e)))(e))("Укажите ИНН"),comment:On(),typeForm:On(),consentToReceiveMaterials:zn,consentDataProcessing:zn,partnerSymbolCode:On("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>yn((e=>Boolean(e?.text)&&Vn(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:On("Укажите наименование организации"),callbackTime:On(),questionProduct:On(),russianPhone:(e=>yn(Mn)(e))("Укажите номер телефона"),cityOfResidence:(e=>yn((e=>"string"==typeof e&&e.length>0&&((e="")=>Tn.test(e))(e)))(e??Pn))("Укажите город проживания на кириллице"),internshipStartDate:On(),internshipEndDate:On(),university:On("Укажите ВУЗ"),fieldOfStudy:On("Укажите направление обучения"),courseYear:On("Укажите курс"),graduationYear:On("Укажите год окончания"),averageGrade:On(),skillsAndKnowledge:On(""),educationLevel:Bn(),motivationForInternship:On(""),workExperience:On(""),internshipDirection:On(),workingHours:Bn()};var qn;const Wn=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...jn,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(Un(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Un(a)).filter(Kn(e)).map((({name:e})=>[e,a[e??""]]))):r},Un=(e={})=>({name:t})=>Boolean(e[t??""]),Kn=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),Hn=()=>{},Yn={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Gn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Jn=u("bg-main-gray text-main-disabled cursor-not-allowed"),Xn=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:p,children:h,wcmsIgnore:g,onClick:f=Hn,testId:y})=>{const x=r("tab"!==c?ve(f):f,[c,f]),b=l((()=>Re(m)),[m]),v="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[Yn[n]]:!s&&!i,[Gn]:i,[Jn]:s},i?"justify-between":"justify-center",i||v?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":v},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":p,"data-wcms-ignore":g,...b,onClick:x,"data-test-id":y,children:h})})),Qn=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(Y,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Zn={sm:"max-w-sm",lg:"max-w-lg",xl:"max-w-xl","4xl":"max-w-4xl",none:"mt-0"},ea={top:"relative mx-auto",center:"relative mx-auto top-1/2 -translate-y-1/2 mt-0",corner:"absolute bottom-0 right-0"},ta=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=Le();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",Zn[t],ea[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Qn,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),na=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(ta,{maxWidth:"lg",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?i:r,headlineVersion:"XS",isEmbedded:!0}),o(Xn,{type:"button",onClick:n,children:"Хорошо"})]})})})),aa=new ge;function ia(){return ye(aa)}ue(aa,new he(globalThis?.sessionStorage));const ra="/api/v1",la=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},sa={lead:{withTypeForm:!0,isNaturalEndpoint:!0},sendcorporatelead:{withTypeForm:!0,isNaturalEndpoint:!1},practice:{withTypeForm:!1,isNaturalEndpoint:!0},internship:{withTypeForm:!1,isNaturalEndpoint:!0},initcorporatelead:{withTypeForm:!0,isNaturalEndpoint:!1},confirmCorporateLead:{withTypeForm:!0,isNaturalEndpoint:!1},callback:{withTypeForm:!1,isNaturalEndpoint:!0}},oa=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},ca=e=>e?.replace(/[^+\d]/g,""),da=({body:e,endpoint:t,router:n})=>{const a=t&&sa[t].isNaturalEndpoint,i=t&&sa[t].withTypeForm,{typeForm:r,region:l,phone:s="",email:o,birthday:c,desiredMeetingDate:d,fullRegion:m,addressBranch:u,secondaryPhone:p="",bankEmpolee:h,applicationDate:g,partnerName:f,russianPhone:y,partnerSymbolCode:x,internshipEndDate:b,internshipStartDate:v,...N}=e;return{...i?{typeForm:r}:{},...pa(l,a),...ha(o,a),...ma(s),...ma(y),...a?ua([[c,"birthday"]]):{birthday:c},...ua([[d,"desiredMeetingDate"],[b,"internshipEndDate"],[v,"internshipStartDate"]]),..."FEEDBACK"===r?{}:{addressBranch:u,bankEmpolee:h,applicationDate:g,...ga(p)},...ya(r,n),...fa(r,{fullRegion:m,partnerName:f,partnerSymbolCode:x}),...xa(r),...N,...ba(e,r)}},ma=e=>e?{phone:ca(e)}:{},ua=e=>Object.fromEntries(e.filter((([e])=>e)).map((([e,t])=>[t,oa(e)]))),pa=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),ha=(e,t=!0)=>({[t?"email":"mail"]:e}),ga=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:ca(e)}:{},fa=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},ya=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{},xa=e=>"CALC"===e?{partnerComments:globalThis?.sessionStorage.getItem("rkoTariffName")??"Неизвестный тариф"}:{},ba=(e,t)=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("utm_mail"),i=n.get("utm_source");return"REF"===t?{name:e.fullName,fullName:void 0,partnerComments:a,partner:i}:{}};function va(){return{send:async function({body:e,router:t,endpoint:n}){const a=n&&Ca(n,e),i=`${ra}/${a}`,r=da({body:e,endpoint:n,router:t});try{const e=await Na(i,r);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...ma(e)}))(e);try{const e=Na(`${ra}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n,router:a,endpoint:i="confirmCorporateLead"}){const r={requestId:e,confimationCode:t,leadRequest:da({body:n,endpoint:i,router:a})};try{const e=await Na(`${ra}/${i}`,r);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t){const n=da({body:e,endpoint:t}),a=wa(n);try{const e=await Na(`${ra}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Na=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),wa=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:la()}},Ca=(e,t)=>{const{serviceDirection:n}=t;return"lead"===e&&"Юридическое лицо / ИП"!==n?"lead":e},Sa=d((()=>c("div",{className:"flex flex-col items-center",children:[o(w,{className:"text-center",headingType:"h5",title:"Спасибо за участие!"}),o(C,{children:"Ваше мнение очень важно для нас"})]}))),ka=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),Ia=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Xn,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(ka,{blur:!0,size:"small"}):null,n]}))),Ta="#C9CACC",Ra="#42AB44",Ea=d((({value:e,hover:t,rating:n,setHover:a,setRating:i})=>o("div",{onClick:()=>e&&i?.(e),onMouseEnter:()=>e&&a?.(e),onMouseLeave:()=>a?.(null),children:o("svg",{"data-rating":e,fill:Da({value:e,hover:t,rating:n}),width:"57",height:"57",viewBox:"0 0 57 57",children:o("path",{d:"M47.7803 18.2879L47.7836 18.2884C50.566 18.7521 53.0867 20.1374 53.9176 22.7226C54.7498 25.3116 53.5025 27.9027 51.4977 29.8954L51.4942 29.8989L45.7132 35.6799C45.5729 35.8202 45.3591 36.1532 45.2186 36.6438C45.0796 37.1295 45.0808 37.5314 45.1257 37.7381L45.1268 37.743L46.78 44.8909C47.4787 47.9228 47.3175 51.2217 44.8924 52.9896C42.4714 54.7546 39.2808 53.9093 36.5999 52.3257L29.6214 48.1946C29.4392 48.0866 29.0426 47.96 28.5087 47.96C27.9816 47.96 27.5736 48.0831 27.3687 48.2004L27.3634 48.2035L20.4041 52.3232L20.4019 52.3246C17.7218 53.9145 14.5351 54.7459 12.1155 52.9803C9.69339 51.213 9.51826 47.9236 10.22 44.8909L11.8731 37.743L11.8743 37.7379C11.9191 37.5311 11.9203 37.1293 11.7813 36.6438C11.6409 36.1532 11.4271 35.8202 11.2867 35.6799L5.50006 29.8932C3.50738 27.9006 2.26429 25.3118 3.08972 22.7269C3.91586 20.1398 6.43161 18.7525 9.21638 18.2884L16.6527 17.0529L16.6552 17.0525C16.8169 17.0243 17.1619 16.8935 17.5523 16.604C17.945 16.3128 18.1668 16.022 18.2378 15.877L18.2462 15.8598L22.3508 7.65087L22.352 7.6485C23.629 5.08222 25.7146 3.01416 28.4796 3.01416C31.2412 3.01416 33.3328 5.07832 34.6215 7.64213L34.6236 7.64649L38.7303 15.8598L38.75 15.9001C38.7884 15.9807 38.8225 16.0591 38.8511 16.1283C38.9197 16.1891 39.0148 16.2702 39.1464 16.3781C39.1829 16.394 39.242 16.4185 39.3288 16.4505C39.5779 16.5424 39.9286 16.6512 40.3732 16.7719C41.2573 17.0121 42.3688 17.2611 43.4823 17.4894C44.5886 17.7163 45.6648 17.9163 46.4667 18.0598C46.8669 18.1315 47.1972 18.1888 47.4266 18.2281L47.6909 18.2729L47.7589 18.2843L47.7803 18.2879Z"})})}))),Da=({value:e,hover:t,rating:n})=>e&&t?e<=t?Ra:Ta:e&&n&&e<=n?Ra:Ta,_a=Array.from("12345",(()=>Ea)),Pa={NPS:"Оцените, пожалуйста, от 1 до 5,\nнасколько вероятно, что вы порекомендуете Россельхозбанк коллегам, друзьям и знакомым?",CSI:"Оцените, пожалуйста, удовлетворённость пользования сайтом"},Oa=d((({currentRating:e,surveyType:t,isSending:n,setCurrentRating:i,onNextStep:r,onSubmit:l})=>{const[s,d]=a(),m=e=>{i(e),e<5&&r()};return c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{className:"text-center whitespace-pre-line",headingType:"h5",title:Pa[t]}),o("div",{className:"flex justify-center",children:_a.map(((t,n)=>o(t,{value:n+1,rating:e,hover:s,setRating:m,setHover:d},n.toString())))}),5===e?o(Ia,{onClick:()=>l(),isLoading:n,children:"Отправить"}):null]})})),Ba=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Aa=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],Fa=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l,name:s})=>{const d=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),m=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ba,{paths:Aa,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",La(a)),"data-test-id":s,onClick:d,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":Va(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:za(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?m:null,Ma(n)]})})})),Ma=e=>e?o("div",{className:"ml-s",children:o(Ye,{size:"text-l",font:"font-light",children:e})}):null,La=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",za=(e=!1)=>e?"radio":"checkbox",Va=(e=!1)=>u("rounded border",{"bg-primary-main":e}),$a={horizontal:"@lg:flex-row",vertical:""},ja=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Ye,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",$a[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Fa,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e,t),disabled:i,name:e},String(e))))})]})));function qa(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Wa(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return qa(globalThis.document,"click",n),t}const Ua=({label:e,required:t=!1})=>e&&t?`${e}*`:e,Ka="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ha=e=>e?Ka:"border-error",Ya=e=>e?o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Ga="w-full border rounded-md text-primary-text outline-none p-m",Ja=d((({key:e,className:t,id:n,name:a,type:l="text",maxLength:d,label:m,placeholder:p,value:h="",valid:g=!0,pattern:f,autoFocus:y=!1,isTextarea:x=!1,disabled:b=!1,children:v,onChange:N,onFocus:w,onBlur:C})=>{const S=s(null),k=r((e=>{const t=(e.target?.value??"").trimStart();N&&N(t)}),[N]);i((()=>{y&&S.current?.focus()}),[y,S]);const I=v?"pr-3xl":"",T=Ha(g),R=m??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ya(m),x?o("textarea",{className:u("block resize-y min-h-24",Ga,T),id:u("textarea",n),value:h,name:a||n,placeholder:p,disabled:b,"aria-label":R,onChange:k,onFocus:w,onBlur:C,maxlength:d},e):o("input",{ref:S,className:u("h-14",Ga,I,T),id:n,type:l,value:h,name:a||n,placeholder:p,pattern:f,disabled:b,"aria-label":R,onChange:k,onFocus:w,onBlur:C,"data-test-id":a},e)]}),v]})})),Xa=e=>o("div",{className:"min-h-6",children:e?o(Ye,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Qa=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:p,isOpen:h,onOpen:g,onClose:f,required:y,onChange:x=Hn,...b})=>{const v=Wa(f),N=r((e=>{const t=m&&e.length>m;!h&&g(),t||x(Za(e,s))}),[h,x]);return c("div",{className:u("shrink-0 w-full",e),ref:v,onBlur:f,onFocus:g,children:[o("div",{ref:p,children:o(Ja,{type:l||"text","aria-label":t,label:Ua({label:t,required:y}),valid:Boolean(!a),onChange:N,placeholder:ei({placeholder:d,errors:i,label:t}),value:n,...b})}),Xa(a)]})})),Za=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,ei=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ti=d((e=>{const[t,{setFalse:n,setTrue:a}]=dn();return o(Qa,{isOpen:t,onOpen:a,onClose:n,...e})})),ni=Array.from("12345",(()=>Ea)),ai=[Oa,d((({currentRating:e,currentReason:t,reasons:n=[],isSending:i,setCurrentReason:r,onSubmit:l})=>{const[s,d]=a();return c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{className:"text-center",headingType:"h5",title:"Что бы мы могли улучшить?"}),o("div",{className:"flex justify-center",children:ni.map(((t,n)=>o(t,{value:n+1,rating:e},n.toString())))}),o(ja,{className:"w-full text-wrap",orientation:"vertical",items:n,value:t?.id,onChange:(e,t)=>{r?.({id:e,text:t})}}),"Другое"===t?.text?o(ti,{className:"w-full",placeholder:"Напишите, пожалуйста, свой вариант ответа",isTextarea:!0,value:s,onChange:d,maxLength:255}):null,t?o(Ia,{onClick:()=>l(s),isLoading:i,children:"Отправить"}):null]})})),Sa],ii=nn((({onClose:e=Hn,isAfterTargetAction:t=!1,reasonsSource:n={},onSkip:i=Hn})=>{const[l,{setTrue:s,setFalse:c}]=dn(!1),[d,m]=a(0),[u,p]=a(),[h,g]=a(0),f=be(),y=si(f.userSurvey?.lastShownType),{reasons:x}=n,b=ai[h],v=r((()=>{g((e=>e+1))}),[]),N=r((async e=>{s(),await(async e=>{try{return await Na(`${ra}/survey`,e)}catch(e){return null}})({rate:d,reason:u?.text,message:ri(u,e),url:globalThis.location.href,type:y,ip:t?"after_target_action":"time_on_site"}),c(),f.userSurvey={lastShownType:y,nextDueAt:li()},g(2)}),[d,u]),w=r((()=>{2!==h&&i(),e()}),[h]);return o(ta,{maxWidth:"xl",onClose:w,children:o(b,{currentRating:d,currentReason:u,reasons:x,surveyType:y,isSending:l,setCurrentReason:p,setCurrentRating:m,onSubmit:N,onNextStep:v})})})),ri=(e,t)=>{if("Другое"===e?.text)return t?.length?t:"Другое. Клиент не оставил комментариев"},li=()=>Date.now()+2592e6,si=e=>e?"NPS"===e?"CSI":"NPS":["NPS","CSI"][Date.now()%2],oi=(e=!1)=>{const t=kn(ii),n=be(),a=ia(),l=a.surveyTimerId,s=a.isSurveySkipped,o=a.surveyTimerStart?Date.now()-Number.parseInt(a.surveyTimerStart):0,c=!s&&!ci&&(!n.userSurvey||n.userSurvey?.nextDueAt<=Date.now()),d=r((()=>{a.isSurveySkipped=!0}),[]),m=r(((e=!1)=>{t.open({reasonsSource:{$ref:"/wcms-resources/user-survey-reasons.json"},isAfterTargetAction:e,onSkip:d})}),[]),u=r((()=>{c&&(l&&clearTimeout(l),m(!0))}),[l,c]);return i((()=>{if(!e&&c){a.surveyTimerStart||(a.surveyTimerStart=Date.now().toString());const e=setTimeout(m,3e5-o);return a.surveyTimerId=e,()=>{clearTimeout(e),a.surveyTimerId=null}}return Hn}),[c]),u},ci=()=>new RegExp("^/(cn|en)($|/.*)").test(globalThis.location.pathname),di=[{key:"ULTRASERVICE",text:"Ультра"}],mi=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ui=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],pi="client",hi=[{key:pi,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],gi=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],fi=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"}],yi=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],xi=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],bi=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],vi=[{key:"Экономика и финансы",text:"Экономика и финансы"},{key:"Аудит",text:"Аудит"},{key:"Юриспруденция",text:"Юриспруденция"},{key:"ИТ",text:"ИТ"},{key:"Маркетинг",text:"Маркетинг"},{key:"HR",text:"HR"},{key:"Аналитика",text:"Аналитика"},{key:"Менеджмент",text:"Менеджмент"},{key:"ГМУ",text:"ГМУ"},{key:"Дизайн",text:"Дизайн"},{key:"Журналистика",text:"Журналистика"},{key:"Контакт-центр",text:"Контакт-центр"},{key:"Другое",text:"Другое"}],Ni=[{key:"20",text:"20"},{key:"30",text:"30"},{key:"40",text:"40"}],wi=[{key:"Бакалавриат",text:"Бакалавриат"},{key:"Специалитет",text:"Специалитет"},{key:"Магистратура",text:"Магистратура"},{key:"Аспирантура",text:"Аспирантура"}],Ci=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},Si=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ti,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),ki=(e,t)=>o(Y,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Ii=e=>e?.text||e?.key||"",Ti=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:Ii(n)||a,Ri=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=Hn,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:p="black",options:h=[]})=>{const g=Ei(l,h,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ti({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":ki(a,p)]})},Ei=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,Di=()=>Ne(we.emitter,"popup"),_i=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pi=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=Oi,query:l,onChangeQuery:s,disableFilterOptions:d})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:_i(t,l,d).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&(s?.(""),i(e))},children:[r(e),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),Oi=e=>o("span",{className:"min-h-6",children:Ii(e)});const Bi=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:p=!1,disabled:h=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=Hn,inputProps:x,disableFilterOptions:b=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:S}]=dn(),[k,I]=a(""),T=h||!p&&0===n.length,R=l((()=>Ci((e=>y(e)),300)),[y]),E=r((()=>{T||S()}),[T]),D=r((()=>{!m&&I(""),C()}),[p]),_=r((e=>{I(e),p&&f?.({key:e,text:e}),R?.(e)}),[p,f,R]),P={query:k,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},O=function({isOpen:e,options:t,value:n,query:a,onChange:l=Hn,onClose:c=Hn,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=Hn,renderOptions:p}){const h=Di(),g=r((()=>{h.close(),c()}),[c]),f=r((e=>{g(),l(e)}),[g,l]),y=s(null),x=Wa(g);return i((()=>{if(!e||!y.current)return;const i=y.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();h.open({popup:o(Pi,{popupRef:x,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:f,onChangeQuery:u,renderOptions:p}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,f]),y}({onChange:f,onClose:D,disableFilterOptions:b,onChangeQuery:I,...P});return c("div",{className:u("space-y-xs",e),children:[Ya(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:O,children:[Ri({isDisabled:T,onClose:D,onOpen:E,isManualInput:p,...P,...N}),m&&w?Si({query:k,isDisabled:T,inputProps:x,onChangeQuery:_}):null]})]})})),Ai=d((({className:e="",label:t,error:n,required:a,...i})=>c("div",{className:e,children:[o(Bi,{...i,valid:!n,label:Ua({label:t,required:a})}),Xa(n)]}))),Fi=d((({field:e,input:t})=>o(Ai,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:gi,...e(t?.name??""),...t}))),Mi=(e="")=>Boolean("trade"===e||"all"===e),Li=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:p,isPremium:h,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,x=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Mi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,b={...y,...ji(o),...$i(c),...d&&{inn:d},...x?{partnerComments:x}:{},...s?{typeForm:s}:{},...Vi(m?.text,u),...zi(p),...qi([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(b)?.map((([e,t])=>[e,t?.key||t])))},zi=e=>e?.key?{isClient:e?.key===pi}:{},Vi=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},$i=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ji=e=>e?{vedTypes:Object.fromEntries(bi.map((({id:t})=>[t,t===e])))}:{},qi=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),Wi={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:gi[0],serviceType:di[0],feedbackMethod:ui[0],serviceDirection:mi[0],vedTypes:bi[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""},fileUpload:"",fileId:""},Ui=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Ki=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},Hi=va(),Yi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Gi={primary:Yn.primary,secondary:Yn.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:Yn.secondary,transparent:"","":""},Ji=d((e=>{const t=Ie(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:p,onClick:h}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Gi[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:h,...Re(m),children:p??Xi(r,l)})})),Xi=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,Qi=d((({text:e,link:t,additionalLink:n})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ye,{children:e}):null,t?o(Ji,{...t,ariaLabel:"условия передачи данных",children:t.text}):null,n?c(Ye,{children:[" и ",o(Ji,{...n,ariaLabel:"условия проведения акции",children:n.text})]}):null]}))),Zi=({consentDataProcessing:e,link:t,additionalLink:n,button:a,typeForm:i,isSending:r=!1})=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Fa,{...e}),o(Qi,{link:t})]}),Xa(Yi(e,zn).error)]}):o(Qi,{text:"PF"===i?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t,additionalLink:n}),o(Ia,{className:"w-full @xl:w-auto",isLoading:r,children:a?.text?a.text:"Отправить заявку"})]}),er=e=>null!=e,tr=new Map,nr=(e,t=tr)=>n=>{const a=ir(n),i=t.get(a);if(a&&er(i))return i;const r=e(...n);return a&&er(r)&&t.set(a,Promise.resolve(r)),r},ar=e=>Boolean(e?.every((e=>Array.isArray(e)?ar(e):!e||"string"==typeof e))),ir=e=>ar(e)?e.toString():"",rr=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function lr(e,t,{fallback:n,cache:r}={}){const s=l((()=>sr(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(er))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await nr(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&rr(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function sr(e){return Array.isArray(e)?e:e instanceof Function?sr(e()):[e]}const or=`${ra}/branches`,cr=[];const dr=async e=>await Yt(e,{method:"GET"})||cr;function mr(e=!1){const{data:t}=lr(`${ra}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Gt);return Array.isArray(t)?t:[]}const ur=(e="")=>"ULTRASERVICE"===e,pr=d((({field:e,input:t,params:n})=>{const a=ur(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?mr(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=lr(e?`${or}?regionCode=${e}`:null,dr);return t||cr}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Ai,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0,...t})})),hr=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},gr=(e,t,n)=>Math.max(t,Math.min(e,n));function fr(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function yr({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:r,onChange:t=>{const n=fr(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const xr=1,br=100,vr=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:xr),max:s=(i.length?i.length-1:br),step:d=1,value:m=i[0]||l,disabled:p=!1,onChange:h}=e,g=hr(e,{normalize:(e=0)=>i.length?Nr(i)(e):gr(e,l,s),format:lt()}),f=r((e=>{h&&h(fr(e.target?.value))}),[h]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Ye,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",Ka,"disabled:border-gray disabled:bg-main-divider"),disabled:p,onChange:f,...g}),yr({list:i,min:l,max:s,step:d,disabled:p,value:m,onChange:h})]}),wr(a)]})})),Nr=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),wr=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ye,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Cr=["От 1 000 ₽","До 1 000 000 000 ₽"],Sr=d((({field:e,input:t})=>o(vr,{title:"Сумма, ₽",items:Cr,min:1e3,max:1e9,...e(t?.name??""),...t}))),kr=d((({field:e,input:t})=>o(ti,{label:"Годовая выручка, ₽",...e(t?.name??""),...t}))),Ir=d((({field:e,input:t})=>o(ti,{label:"Дата и время обращения в Банк",...t,...e(t?.name??"")}))),Tr=d((({field:e,input:t})=>o(Ai,{label:"Тип обратившегося",...t,options:hi,...e("applierType")}))),Rr=d((({field:e,input:t})=>o(ti,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??""),...t}))),Er=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,weekends:s,onDateClick:c})=>{const d=[];let m=1;for(let u=0;u<6;u++){const p=[];for(let d=0;d<7;d++)if(0===u&&d<t)p.push(o("td",{},`empty-${d}`));else if(m>n)p.push(o("td",{},`empty-${d}`));else{const t=new Date(i,a,m),n=Dr(t,e),d=_r(t,r,l),u=Pr(t,s),h=d||u;p.push(o("td",{children:o("div",{className:Or(n,h),onClick:()=>!h&&c(t),children:m})},`day-${m}`)),m++}d.push(o("tr",{children:p},`row-${u}`))}return d},Dr=(e,t)=>t&&e.toDateString()===t.toDateString(),_r=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pr=(e,t)=>{if(!t||0===t.length)return!1;const n=0===e.getDay()?7:e.getDay();return t.includes(n)},Or=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Br=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ar=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,weekends:r,onDateSelect:s=Hn})=>{const{firstDayOfWeek:d,totalDays:m}=l((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Br.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Er({firstDayOfWeek:d,today:e,totalDays:m,currentYear:n,currentMonth:t,min:a,max:i,weekends:r,onDateClick:s})})]})})),Fr=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Mr(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Lr),r=a.map(((e,t)=>Vr(e)?a.slice(0,t).filter(Vr).length:-1)),l=a.map(((e,t)=>zr(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Lr=e=>"_"===e,zr=e=>/\d/.test(e),Vr=e=>Lr(e)||zr(e),$r=1940,jr={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},qr=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m,name:p})=>{const h=s(null),[g,f]=a(r||"");return i((()=>{f(r||"")}),[r]),i((()=>{Ur({inputValue:g,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[g]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none",value:g,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&f(Mr(t,"__.__.____"))},onBlur:()=>{Wr(g)?Ur({inputValue:g,setSelectedMonth:e,setSelectedYear:t,onChange:d}):f(r||"")},disabled:l,"data-test-id":p}),l?null:o(Y,{className:"mr-s",...jr})]})})),Wr=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=$r&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Ur=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Wr(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},Kr=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1,name:s})=>o(qr,{onChange:a,disabled:l,onClick:e,value:t&&oa(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer overflow-hidden hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error"),name:s}),Hr=Fr.map((e=>({key:e}))),Yr=Array.from({length:(new Date).getFullYear()-$r+1},((e,t)=>$r+t)).reverse().map((e=>({key:String(e)}))),Gr=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Jr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Xr={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Qr={className:"min-w-32",iconVersion:"black",isBorder:!1},Zr=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,weekends:p,onChange:h,name:g})=>{const[f,{setValue:y,setFalse:x}]=dn(!1),[b,v]=a(n?.getMonth()||(new Date).getMonth()),[N,w]=a(n?.getFullYear()??(new Date).getFullYear()),C=r((e=>{h?.(e),x()}),[h]),{handlePrevMonth:S,handleNextMonth:k,handleSelectMonth:I,handleSelectYear:T,monthsOptions:R,yearsOptions:E,handleChangeVisibleCalendar:D,ref:_}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Wa(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Fr.indexOf(e));const t=Gr(l,Fr.indexOf(e));Jr({maxDateOfMonth:t,selectedYear:l,selectedMonth:Fr.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Hr,yearsOptions:Yr,ref:c}})({onYearSelect:w,onMonthSelect:v,onShowCalendar:y,selectedYear:N,selectedMonth:b,showCalendar:f,onChange:h,value:n}),P=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(_,370);return c("div",{className:u("space-y-xs",e),ref:_,children:[Ya(t),c("div",{className:"relative",children:[Kr({handleChangeVisibleCalendar:D,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:v,setSelectedYear:w,name:g}),f&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":P}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:S,children:o(Y,{...Xr,className:"-rotate-90 cursor-pointer"})}),o(Bi,{onChange:I,value:{key:Fr[b]},options:R,...Qr}),o(Bi,{onChange:T,value:{key:String(N)},options:E,...Qr}),o("div",{className:"my-auto",onClick:k,children:o(Y,{...Xr,className:"rotate-90 cursor-pointer"})})]}),o(Ar,{today:n,currentMonth:b,currentYear:N,min:s,max:d,weekends:p,onDateSelect:C})]}):null]})]})})),el=d((({className:e,label:t,error:n,required:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zr,{label:Ua({label:t,required:a}),valid:Boolean(!n),...i}),Xa(n)]}))),tl=d((({field:e,input:t})=>{const n=new Date;return o(el,{label:t?.label||"Дата рождения",...e(t?.name??""),maxDate:n,...t})})),nl=d((({field:e,input:t})=>o(Ai,{label:"Когда перезвонить?",...t,options:fi,...e(t?.name??"")}))),al=d((({field:e,input:t})=>o(ti,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??""),...t}))),il=d((({field:e,input:t})=>o(ti,{className:"col-span-2",...e(t?.name??""),placeholder:t?.placeholder??"Ваше сообщение",isTextarea:!0,...t})));function rl(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const ll=e=>({value:e?.value||""}),sl=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=ll,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(s)},ol=async e=>(await sl({url:"suggest/party",query:e}))?.map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),cl={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},dl={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},ml=d((({field:e,input:t={}})=>{const n=t.name??"",i=cl[n].linkedFieldName,r=e(i).value,s=r?.data;rl((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=ul(r),{fullName:a,address:l,inn:s}=t,o=hl(t,i),c=ol(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");rl((async()=>{const e=ol(m);return d(await e),c}),[m]);const p=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[cl[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(Ai,{...dl[n],...t,options:p,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:pl})})),ul=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),pl=e=>c("span",{children:[o(Ye,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(Ye,{size:"text-s",font:"font-light",children:e?.key}),o(Ye,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),hl=(e,t)=>e?.[cl[t].linkedFieldValue],gl=d((({field:e,input:t})=>o(el,{label:"Желаемая дата встречи",...e(t?.name??""),...t}))),fl=d((({field:e,input:t})=>o(ti,{label:"Электронная почта",...e(t?.name??""),...t}))),yl=d((({field:e,input:t})=>o(Ai,{label:"Способ получения ответа",options:ui,...e(t?.name??""),...t}))),xl="Файл не соответствует допустимым расширениям",bl="Ошибка при загрузке файла. Попробуйте загрузить файл позднее",vl="SUCCESS";const Nl=(e,t)=>new Promise((n=>{let a=e;const i=(100-e)/30,r=()=>{a+=i,a>=100?(t(100),n()):(t(a),setTimeout(r,16))};r()})),wl=d((({step:e=10,description:t,showPercentage:n=!0,isOnlyInteger:a=!1})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[a?Math.round(e):e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),Cl={name:"DocIcon",iconVersion:"black",width:"24",height:"24"},Sl=({label:e,inputRef:t,id:n,key:a,type:i,name:r,pattern:l,disabled:s,onChange:d=Hn,onFocus:m,onBlur:p,extensions:h,uploadResponse:g,file:f})=>{const y=e??r??n;return o("div",{children:g?.status===vl?Il(f):c("div",{className:"flex items-center space-x-2",children:[o(Y,{className:"inline-block",...Cl}),Ya(e),o("input",{ref:t,className:u("h-14 hidden"),id:n,type:i,name:r||n,pattern:l,disabled:s,"aria-label":y,onChange:e=>{e?.target?.files&&d(e?.target?.files[0])},onFocus:m,onBlur:p,accept:kl(h)},a)]})})},kl=(e=[])=>e.map((e=>{const t=String(e).trim();return t.startsWith(".")?t:"."+t})).map((e=>e.toLowerCase())).filter(((e,t,n)=>n.indexOf(e)===t)).join(", "),Il=e=>o("span",{children:e?.name}),Tl=(e,t)=>{const n=e?`Поддерживаемые форматы файлов - ${e.join(", ")}. `:"";return o(Ye,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:n+(t?`Максимальный размер файла - ${t}Мб.`:"")})},Rl=({from:e,to:t,onUpdate:n=Hn,minDuration:a=300})=>new Promise((i=>{const r=performance.now(),l=()=>{const s=performance.now()-r,o=Math.min(s/a,1),c=1-Math.pow(1-o,3);n(e+(t-e)*c),o<1?requestAnimationFrame(l):(n(t),i())};requestAnimationFrame(l)})),El={pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},Dl={pdf:"25 50 44 46 2d",docx:"50 4b 03 04",pptx:"50 4b 03 04",xlsx:"50 4b 03 04",doc:"D0 CF 11 E0 A1 B1 1A E1"},_l=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const a=new FileReader;return a.onload=()=>{const e=a.result,n=new Uint8Array(e),i=Array.from(n).map((e=>e.toString(16).padStart(2,"0"))).join(" ");t(i)},a.onerror=n,e&&a.readAsArrayBuffer(e.slice(0,8))})))(e);if(!(t??[]).some((e=>{const t=Dl[e]?.toLowerCase();return console.log(t),console.log(n),t&&n.startsWith(t)})))throw new Error(xl)},Pl=({onUploadError:e=Hn,onFileSelected:t=Hn,extensions:n,maxSizeMB:i,onUploadResponse:r=Hn})=>{const[s,o]=a(0),[c,d]=a(!1),m=l((()=>Ci((e=>d(e)),500)),[d]),u=l((()=>Ci((t=>e(t)),500)),[e]),p=l((()=>Ci((e=>r(e)),500)),[r]);return{verifyFile:async({file:e,onFileChanged:a=Hn})=>{t(e),d(!0);const r=[()=>(async(e,t)=>{const n=e.name.split(".")[1];if(console.log(n,t),!t?.includes(n))throw new Error(xl)})(e,n),()=>(async(e,t)=>{if(t&&e.size>1024*t*1024)throw new Error("Файл превышает допустимый размер");if(0===e.size)throw new Error("Ошибка загрузки файла. Убедитесь, что файл не пустой")})(e,i),()=>_l(e,n),()=>(async(e,t)=>{const n=e?.type??"";if(!(t||[]).map((e=>El[e])).filter((e=>void 0!==e)).includes(n))throw new Error(xl)})(e,n)],l=50/r.length;let s=0;try{for(let e=0;e<r.length;e++){const t=r[e];await t();const n=(e+1)*l;await Rl({from:s,to:n,onUpdate:o,minDuration:300}),s=n}const t=await async function({file:e,onProgress:t=Hn}){return new Promise(((n,a)=>{const i=new FormData;let r;i.append("file",e);const l=new XMLHttpRequest;let s;l.upload.onprogress=e=>{if(e.lengthComputable){const n=e.loaded/e.total*50;t(n)}},l.upload.onload=()=>{let e=50;t(e),r=window.setInterval((()=>{e+=.2,s=e,e<90?t(e):(t(90),window.clearInterval(r))}),100)},l.onload=async()=>{try{const e=JSON.parse(l.responseText);"SUCCESS"===e.status?(window.clearInterval(r),await Nl(s,t),n(e)):a(new Error(e.errorDesc??bl))}catch(e){a(new Error(bl))}},l.onerror=()=>{a(new Error(bl))},l.open("POST",`${ra}/uploadFile`),l.send(i)}))}({file:e,onProgress:o});p(t),a(t?.fileId??""),t?.status===vl&&m?.(!1)}catch(e){const t=e instanceof Error?e.message:bl;u(t),a("")}m?.(!1)},isFileUploading:c,progress:s}},Ol=d((({key:e,className:t,id:n,name:r,type:l="file",label:d,valid:m=!0,pattern:p,autoFocus:h=!1,extensions:g,children:f,onFocus:y,onBlur:x,maxSizeMB:b,error:v,isReset:N,onFileChanged:w=Hn})=>{const C=s(null),[S,k]=a(null),[I,T]=a(""),[R,E]=a(null),{verifyFile:D,isFileUploading:_,progress:P}=Pl({onUploadError:T,onUploadResponse:E,onFileSelected:k,extensions:g,maxSizeMB:b});i((()=>{h&&C.current?.focus()}),[h,C]),i((()=>{N&&O()}),[N]);const O=()=>{k(null),T(""),E(null),w("")},{handleDrag:B,handleLeave:A,handleDrop:F,isDragActive:M}=(({onFileSelected:e,onReset:t,uploadResponse:n,onFileChanged:i})=>{const[r,l]=a(!1);return{handleDrag:e=>{e.preventDefault(),n||l(!0)},handleLeave:()=>l(!1),handleDrop:async a=>{if(a.preventDefault(),n)return;t(),l(!1);const r=a.dataTransfer?.files?.[0];r&&await e({file:r,onFileChanged:i})},isDragActive:r}})({onReset:O,onFileSelected:D,uploadResponse:R,onFileChanged:w}),L=f?"pr-3xl":"",z=Ha(m),V=M?"border-primary-hover":"";return c("div",{className:u("relative",t),onDragEnter:B,onDragOver:B,onDragLeave:A,onDrop:F,children:[o("label",{className:u("h-14 cursor-pointer space-y-xs block",Ga,L,"border-dashed",z,V),children:_?o("div",{children:o(wl,{step:P,isOnlyInteger:!0})}):Sl({label:d,inputRef:C,id:n,key:e,type:l,name:r,pattern:p,disabled:Boolean(R||_),onChange:async e=>{O(),e&&await D({file:e,onFileChanged:w})},onFocus:y,onBlur:x,extensions:g,uploadResponse:R,file:S})}),R?.status===vl?o(Qn,{className:"absolute top-0 right-0 z-10",onClose:O}):null,Tl(g,b),Xa(v||I),f]})})),Bl=d((({label:e,value:t="",error:n,type:a,inputRef:i,required:r,...l})=>o("div",{ref:i,children:o(Ol,{type:a||"file","aria-label":e,label:Ua({label:e,required:r}),valid:Boolean(!n),value:t,error:n,...l})}))),Al=d((({field:e,input:t})=>{const[n,r]=a(""),l=e("fileId");return i((()=>{l?.onChange?.(n)}),[n]),o(Bl,{type:"file",label:t?.name??"",...e(t?.name??""),...t,onFileChanged:r,isReset:!l?.value})})),Fl=d((({field:e,input:t})=>o(ti,{label:"ФИО",...e(t?.name??""),...t}))),Ml=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=mr(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(Ai,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??""),...t})})),Ll=d((({field:e,input:t})=>o(ti,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),zl=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a();i((()=>{r(e("internshipStartDate").value)}),[e("internshipStartDate").value]);return o(el,{label:t?.label||"Дата окончания практики",...e(t?.name??""),...t,value:c,error:e(t?.name??"")?.error||l,errors:[e(t?.name??"")?.error||l],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(Rn(a,{minLimit:n})?"":"Некорректно заполненное поле")},minDate:n})})),Vl=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a(),m=new Date;i((()=>{r(e("internshipEndDate").value)}),[e("internshipEndDate").value]);return o(el,{label:t?.label||"Дата начала практики",...e(t?.name??""),...t,value:c,error:l||e(t?.name??"")?.error,errors:[l??e(t?.name??"")?.error],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(Rn(a,{maxLimit:n})?"":"Некорректно заполненное поле")},minDate:m,maxDate:n})})),$l=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(Fa,{text:t,value:n,disabled:i,onChange:l},a),Xa(r)]}))),jl=d((({field:e,input:t})=>o($l,{...e(t?.name??""),...t,text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ql=`${ra}/outservice`,Wl=[];async function Ul(){const e=await Yt(`${ql}/outserviceregions`);return e&&Array.isArray(e)?e:Wl}const Kl=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=lr("outServiceRegions",Ul),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Ai,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...t,...e(t?.name??""),isSearch:!0})})),Hl=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Yl=d((({field:e,input:t})=>o(ti,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Gl=d((({field:e,input:t})=>o(ti,{label:"Имя",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Jl=d((({field:e,input:t,label:n})=>o(ti,{label:n,type:"number",...e(t?.name??""),...t}))),Xl=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ye,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ql=d((({field:e,input:t})=>Mi(e("acquiringType")?.value?.key)?o(Xl,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??""),...t}):null)),Zl=d((({field:e,input:t})=>o(ti,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),es=nn((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=ts(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ti,{...e(t.name??""),...t,type:"hidden"})})),ts=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",ns=nn((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ti,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),as=e=>"_"===e,is=e=>/\d/.test(e),rs=e=>as(e)||is(e),ls=[..."+7 (___) ___-__-__"],ss=ls.findIndex(as),os=ls.map(((e,t)=>rs(e)?ls.slice(0,t).filter(rs).length:-1));function cs(e){const t=e.replace(/\D/g,""),n=ls.map(((e,n)=>is(e)?e:t.charAt(os[n])||e)),a=os.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(ss,a)):n).join("")}const ds=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(cs(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Ja,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),ms=d((({className:e,label:t,required:n,disabled:a,error:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ds,{"aria-label":t,label:Ua({label:t,required:n}),valid:Boolean(!i),disabled:a,placeholder:"+7 (___) ___-__-__",...r}),Xa(i)]}))),us=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(ms,{label:"Телефон",disabled:Hl(e,t,n),...e(n),...t})})),ps=d((({field:e})=>Mi(e("acquiringType")?.value?.key)?o(Xl,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),hs=nn((({field:e,input:t,source:n})=>o(Ai,{placeholder:"Выберите продукт",label:"Продукт",options:gs(n?.productList),...e(t?.name??""),...t}))),gs=e=>(e??[]).map((e=>({key:e,value:e}))),fs=d((({field:e,input:t})=>o(Ai,{label:"Какой у вас вопрос?",options:yi,...e(t?.name??""),...t}))),ys=`${ra}/regions`,xs=[];function bs(e=ys){const{data:t}=lr(e,Gt);return Array.isArray(t)?t:xs}const vs=`${ra}/outservice/outserviceregions`,Ns=d((({field:e,input:t,params:n})=>{var a;const i=bs((a=n?.typeForm,"OUTSERVICE"===a?vs:void 0));return o(Ai,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??""),...t})})),ws=d((({field:e,input:t})=>o(ti,{label:"ФИО представителя",...t,...e("representativeName")}))),Cs=d((({field:e})=>{const t=e("secondaryPhone");return o(ms,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Yi(t,jn.secondaryPhone):t})})),Ss=d((({field:e,input:t,label:n,options:a})=>o(Ai,{label:n,options:a,...e(t?.name??""),...t}))),ks=d((({field:e,input:t})=>o(Ai,{label:"Направление обслуживания",placeholder:"Выберите направление",options:mi,...e(t?.name??""),...t}))),Is=d((({field:e,input:t})=>o(ti,{label:"Описание ситуации",...t,...e("situationDescription")}))),Ts=d((({field:e,input:t})=>o(Ai,{label:"Пострадал в",...t,options:xi,...e("sufferedFrom")}))),Rs=d((({field:e,input:t})=>o(ti,{label:"Фамилия",maxLength:60,disabled:Hl(e,t),...e(t?.name??""),...t}))),Es=["От 1 мес","До 15 лет"],Ds=d((({field:e})=>o(vr,{title:"Срок, месяцев",items:Es,min:1,max:180,...e("term")}))),_s=d((({field:e,input:t,label:n})=>o(ti,{label:n,maxLength:60,...e(t?.name??""),...t}))),Ps=d((({field:e,input:t})=>o(Ai,{label:"Тип обслуживания",options:di,...e(t?.name??""),...t}))),Os=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(ja,{className:"whitespace-normal",orientation:"horizontal",items:bi,...e(t?.name??"",{onChange:n}),...t})})})),Bs=d((({field:e,input:t})=>o(Fa,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??""),...t}))),As={$ref:"/wcms-resources/outservice-productlist.json"},Fs={$ref:"/wcms-resources/agenty-dlya-rko.json"},Ms={fullName:Fl,addressBranch:pr,desiredMeetingDate:gl,product:e=>o(hs,{...e,source:As}),localities:Kl,isClient:jl,partnerComments:Zl,collectionCount:al,acquiringType:Fi,onlineCheckout:Ql,posTerminal:ps,serviceType:Ps,term:Ds,amount:Sr,annualRevenue:kr,vedTypes:Os,feedbackMethod:yl,serviceDirection:ks,bankEmpolee:Rr,secondaryPhone:Cs,applicationDate:Ir,region:e=>ur(e?.params?.typeForm)?o(Ml,{...e}):o(Ns,{...e}),consentToReceiveMaterials:Bs,sufferedFrom:Ts,situationDescription:Is,representativeName:ws,applierType:Tr,surname:Rs,name:Gl,middleName:Yl,birthday:tl,phone:us,email:fl,inn:Ll,comment:il,fullRegion:Ml,partnerSymbolCode:e=>o(ns,{...e,source:Fs}),partnerName:e=>o(es,{...e,source:Fs}),dadataPartyNameSelect:ml,dadataPartyInnSelect:ml,questionProduct:fs,callbackTime:nl,russianPhone:us,cityOfResidence:e=>o(_s,{...e,label:"Город проживания"}),internshipStartDate:Vl,internshipEndDate:zl,university:e=>o(_s,{...e,label:"ВУЗ"}),courseYear:e=>o(Jl,{...e,label:"Курс"}),graduationYear:e=>o(Jl,{...e,label:"Год окончания"}),fieldOfStudy:e=>o(_s,{...e,label:"Направление обучения"}),educationLevel:e=>o(Ss,{...e,label:"Ступень обучения",options:wi}),averageGrade:e=>o(Jl,{...e,label:"Средний балл обучения"}),skillsAndKnowledge:il,workExperience:il,motivationForInternship:il,internshipDirection:e=>o(Ss,{...e,label:"Направление стажировки",options:vi}),workingHours:e=>o(Ss,{...e,label:"Количество рабочих часов",options:Ni}),fileUpload:Al},Ls=d((({onFieldRef:e=Hn,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const zs=(e,t,n={})=>(a,i)=>{const r={...Ms,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o(Ls,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:{...a,disabled:t?.disabled},params:t})},String(i)):null},Vs=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",$s=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ye,{size:"text-h6",children:e})}):null,js=(e,t,{typeForm:n,additionalParams:a,disabled:i})=>e.map(((e,r)=>c("div",{className:u(Vs(e.columns),"grid"),children:[$s(e.title),(e?.inputs||[])?.map(zs(t,{typeForm:n,disabled:i,...a}))]},`section-${r}`))),qs=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function Ws({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=qs(l,t);return r((e=>{i.current=e,o()}),[])}const Us=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const p=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),h=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:p(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:h(a),className:Ks(a,e,n),"data-test-id":`sms-code-${a}`},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Ks=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${Ha(!n||!a)} rounded-md caret-transparent outline-none`},Hs=d((({disabled:e=!1,onClick:t,text:n})=>o(Xn,{type:"button",onClick:t,disabled:e,testId:"sms-code-submit-button",children:o(Ye,{font:"font-normal",children:n})}))),Ys=d((({className:e,labelColor:t,children:n})=>o("span",{className:u("inline-flex items-center text-start gap-s","white"===t?"text-white":"group-[]/btn-embedded:text-primary-main",e),children:n}))),Gs=d((({className:e,seconds:t})=>o("span",{className:e,children:Js(t)}))),Js=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Xs=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:p})=>o(ta,{maxWidth:"lg",onClose:p,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[Qs(u),o(Us,{values:l,setValues:s,errorText:d,hasError:m}),eo(a,r),e,Zs(n,i),t?o(ka,{blur:!1}):null]})}))),Qs=e=>o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),Zs=(e,t)=>o(Hs,{text:"Далее",disabled:e,onClick:t}),eo=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(Gs,{seconds:e})]}):o(Xn,{embedded:!0,onClick:t,testId:"send-new-code-button",children:o(Ys,{children:"Получить новый код"})}),to=e=>180-Math.floor((Date.now()-e)/1e3),no=va(),ao=va(),io=d((({phone:e,onSuccess:t=Hn,onClose:n=Hn,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:p,errorText:h,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:x,setErrorText:b}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(to(Date.now()),0),s=P(),[o,c]=a(""),[d,{setTrue:m,setFalse:u}]=dn(!1),[p,h]=a(l),g=r((()=>c("")),[]),f=!e.every(Boolean);return{handleSubmit:r((async()=>{try{m();const a=await no.checkCode({code:e.join(""),body:n,reqId:i,router:s});if(a?.errorDesc)return void c(a?.errorDesc);h(0),g(),t?.(a?.reqId)}catch{c("Неверный код")}finally{u()}}),[e]),hasError:Boolean(o),errorText:o,isLoading:d,timeNextReq:p,isSubmitButtonDisabled:f,setTimeNextReq:h,setErrorText:c}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=ca(e),N=Ws({seconds:f,onTick:x}),w=r((async()=>{const e=await ao.sendCode({phone:v});e&&(x(180),N(180),b(""),m(String(e)))}),[v,N,n]);return o(Xs,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:h,hasError:p,onClose:n})})),ro={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l,openUserSurvey:s})=>{const{phone:o}=e,c=i?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.sendCode({phone:String(o)});d?a.open({phone:o,formatData:e,reqId:String(d),onSuccess:d=>{a.close(),n.open({ok:!0,typeForm:t});const m=JSON.stringify({inn:e?.inn,phone:o,id:d});c&&s?.(),Ki({aspectsAttributes:Ui(i,m),aspects:r,ev:l})}}):n.open({ok:Boolean(d),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=Hn,endpoint:s,openUserSurvey:o})=>{const c=t?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.sendPhoneCallRequest(e,s);l(),"success"===d?.status?(r.open({ok:!0,typeForm:i}),c&&o?.(),Ki({aspectsAttributes:t,aspects:n,ev:a})):"error"===d?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(d)}),d&&Ki({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l,withSnowplow:s,openUserSurvey:o})=>{const c=t?.find((e=>"openUserSurvey"===e.aspectName)),d=await Hi.send({body:e,router:i,endpoint:l}),m=Boolean(d);if(r.open({ok:m}),m){c&&o?.();const{requestId:r}=d,{phone:l}=e,m=i.pathname.split("?")[1],u=JSON.stringify({id:r,phone:String(l),utm:m}),p=s?[...t??[],{aspectName:"snowplowEvent",params:{eventAction:"clickdepapl",eventJSON:u}}]:t;Ki({aspectsAttributes:p,aspects:n,ev:a})}}},lo=nn((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,additionalLink:d,endpoint:m,additionalParams:p,withSnowplow:h,isContacts:g,data:f,onSuccess:y,...x})=>{const b=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),v=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Wi[e.name||""]]))),typeForm:{key:t,text:""}}))(b,n)),[b,n]),N=P(),C=hn(),S=l((()=>Wn(b)),[b]),k=kn(na),I=kn(io),T=oi(!0),[R,{setTrue:E,setFalse:D}]=dn(!1),_=r((async(e,t)=>{E();const a=Li({...e,...p});await so({formatData:a,ev:t,typeForm:n,data:f,aspects:C,router:N,responseTypeDialog:k,verifyPhoneDialog:I,onSuccess:y,withSnowplow:h,openUserSurvey:T},m),D()}),[n]),[,{field:O,onSubmit:B}]=Nn(v,{resetOnSubmit:!0,formValidator:S,onSubmit:_}),A=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(b)?.name,F=A?O("consentDataProcessing"):void 0;return c(Sn,{className:u("container space-y-m",e),title:t,...x,children:[c("form",{onSubmit:B,children:[js(a,O,{typeForm:n,additionalParams:p,disabled:R}),Zi({consentDataProcessing:F,link:s,additionalLink:d,button:i,typeForm:n,isSending:R})]}),g?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),so=async(e,t)=>{const n=t&&ro[t]||ro.default;await n({...e,endpoint:t})},oo={creditCard:"кредитной карты",debitCard:"дебетовой карты",credit:"кредита"},co=d((({attempts:e,productType:t,onClose:n=Hn})=>{const a=mn(),i=e>1,l=r((()=>{a.assign("/natural")}),[]),s=r((()=>{i?l():n()}),[i]);return o(ta,{onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(C,{align:"text-center",children:"Уважаемый клиент!"}),o(C,{align:"text-center",children:`Для получения ${oo[t]} Вам необходимо обратиться в офис Банка`}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(Xn,{type:"button",version:"secondary",onClick:l,children:"Завершить"}),i?null:o(Xn,{type:"button",onClick:n,children:"Продолжить"})]})]})})})),mo=e=>globalThis[e];function uo(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=mo(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(mo(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(mo(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const po=()=>globalThis.location!==globalThis?.top?.location,ho=()=>{const e=po(),t=globalThis.document?.body?.scrollHeight,n=ia(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},go="Некорректно заполненное поле",fo="Укажите регион, город/населенный пункт, улицу, дом",yo=/^[а-яёА-ЯЁ\d]+$/u,xo=/^[\u0400-\u04FF-\s]+$/u,bo=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,vo=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),No=()=>yn(vo)(fo),wo=e=>yn((e=>"string"==typeof e&&e.length>1&&xo.test(e)))(e??go),Co=e=>yn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??go),So=(e,t,n=!1)=>yn((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??go),ko=e=>yn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),Io=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},To=e=>Eo(18,e)("Укажите дату заключения трудового договора"),Ro=e=>Eo(0,e)("Укажите дату регистрации"),Eo=(e,t)=>yn((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),Do=(e=!1)=>yn((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),_o=(e=!1)=>yn((t=>Vn(t)&&Boolean(e)))("Укажите ИНН"),Po={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Oo=e=>ko(Po[e]),Bo={processPersonalDataFlg:zn,consentProviderFlg:zn,consentInformFlg:zn,consentPfrFlg:zn,consentOthersFlg:zn,consentFATCA:zn},Ao={addressCourier:No(),paymentSystem:On("Укажите тип платежной системы"),currency:On("Укажите валюту"),cardCategory:On("Укажите категорию карты"),codeWord:(e=>yn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&yo.test(e)))(e??go))("Необходимо ввести кодовое слово"),confirmationIncome:Bn(),methodObtain:On(),deliveryDate:(e=>yn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},Fo={organization:Bn("Выберите тип организации"),organizationAddress:yn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(fo),organizationPhone:Ln("Укажите номер телефона"),organizationName:On("Укажите наименование организации"),legalForm:On("Укажите ОПФ"),lastJobExperience:Co("Укажите стаж на последнем месте работы"),experience5Years:Co("Укажите общий стаж за последние 5 лет"),jobsNumber:Co("Укажите количество мест работы за последние 5 лет"),addressFact:No(),addressRegistration:No(),addressRetail:Bn("Выберите адрес банка"),addressMatch:On(),sex:On("Укажите свой пол"),birthPlace:On("Укажите место рождения"),education:Bn("Выберите ваше образование"),housing:Bn("Выберите тип жилья"),amountWorkers:Bn("Выберите информацию о количестве сотрудников"),employment:Bn("Выберите информацию о трудоустройстве"),employerActivities:Bn("Выберите вид деятельности организации"),employerOrganization:Bn("Выберите вид организации"),positionOrganization:Bn("Выберите вашу должность"),familyStatus:Bn("Выберите семейное положение"),familyMembers:So(2,"Укажите количество членов семьи"),children:So(2,"Укажите количество детей"),dependents:So(2,"Укажите количество иждивенцев"),snils:(e=>yn(Io)(e))("Некорректный номер СНИЛС"),conscription:On(),armyIdFlg:zn,dulSerie:So(4,"Укажите серию паспорта",!0),dulNumber:So(6,"Укажите номер паспорта",!0),dulSubdivisionCode:So(7,"Укажите код подразделения",!0),dulIssuedBy:On("Укажите организацию, выдавшую паспорт"),retirementIncome:On(),otherIncome:On(),wages:On(),mandatoryPayments:So(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:On(),shareholderFlg:On(),legalEntityName:On(),bankEmployeeCode:On(),partInBusiness:On(),regionRetail:Bn("Выберите регион"),latinSurname:On("Укажите фамилию"),surname:wo("Укажите свою фамилию на кириллице"),name:wo("Укажите своё имя на кириллице"),middleName:wo("Укажите своё отчество на кириллице")},Mo={...Fo,...Ao,...Bo},Lo={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var zo;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(zo||(zo={}));const Vo=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice");return Boolean(e)},$o=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice"),t=globalThis.localStorage?.getItem("productType");return e?'"credit"'===t?"/api/credit-application":"/api/creditcard-application":"/light-api-cash/v1"},jo=async(e,t,n)=>{try{return(await qo(e,t,n)).json()}catch(e){return console.error(e),null}};async function qo(e,t,n){const a=$o(),i=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`${a}${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":i,"X-B3-Traceid":i,...Wo()},credentials:"include",body:n?JSON.stringify(n):null})}const Wo=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Uo=d((({onChangeEsiaStatus:e,productType:t})=>{const n=mn(),a=ia().frameLocation,i=r((async()=>{try{const e=await(async e=>{const t=Vo();return await jo((t?"/external/user-data":"")+"/esia/getLink","POST",e)})({redirectUri:a||globalThis.location.origin+globalThis.location.pathname});e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(zo.Error)}}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?": ":"")}),c("ul","debitCard"===t?{className:"list-disc list-inside",children:[o("li",{children:"значительно сократит время оформления заявки"}),o("li",{children:"доступна курьерская доставка в г. Москва (в пределах МКАД)"})]}:{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Xn,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),Ko={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},Ho={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:Ko,addressFact:Ko,organizationAddress:Ko,addressCourier:Ko},Yo=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const Go=d((({value:e="",onChange:t=Hn,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...p})=>{const[h,{setFalse:g,setTrue:f}]=dn(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),p=s(t),[h,g]=a([]),f=Di(),y=Ho[n],x=r((()=>{p.current=t,f.close()}),[t]),b=r((e=>{x(),p.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await sl({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>Ci(N,300)),[N]);return i((()=>{if(!e||!v.current||p.current===t)return void x();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Yo,{options:h,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,h,t,b]),v}({isOpen:h&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),x=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(Qa,{value:e,onChange:x,inputRef:y,isOpen:h,onOpen:f,onClose:g,name:c,...p})})),Jo=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Xo(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{disabled:Hl(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Xo=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house,...Qo(e)}),Qo=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Zo(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Zo=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",ec=nn((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{n&&(m||d)&&!n.deliveryCities?.includes(m)?(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки")):s("")}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Xo(t))}),[]),p=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:p,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),tc=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(Xo(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Go,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),nc=d((({field:e,input:t})=>o($l,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),ac=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:ic({textItems:r,subText:t,children:n,isPhone:a,...i})})),ic=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(Ye,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||rc(n,s),i?o(Ye,{color:a,size:"text-m",children:i}):null]}),rc=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ye,{size:"text-l",children:t?o("a",{href:`tel:${lc(e)}`,children:e.trim()}):e.trim()},String(n)))),lc=e=>e.replace(/\D/g,""),sc=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),oc=d((({isUnfolded:e,...t})=>o(Y,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),cc=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,labelColorStyle:r,...l})=>{const s="white"===r?"":"color";return c(Xn,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(Ys,{labelColor:r,children:a}),o(oc,{isUnfolded:t,iconVersion:i?s:"",className:"flex-grow-0 flex-shrink-0 basis-auto"})]})})),dc=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const mc=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),uc=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(dc,{className:"block sm:hidden",children:[o(mc,{isUnfolded:t,children:e}),o(cc,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),pc=e=>{const t=gc(e);return o(ac,{label:"Режим работы",value:t,className:"max-w-none"})},hc=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",gc=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[hc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),hc({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},fc=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],yc=e=>fc.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),xc=e=>{if(!e)return null;const t=bc(e);return c(sc,{className:"border-none",children:[o(ac,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(vc)})}),o(ac,{label:"Режим работы",className:"max-w-none",children:o(Ye,{children:e})})]})},bc=e=>{const t=fc.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},vc=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Ye,{size:"text-xs",children:e})},String(n)),Nc=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(ac,{label:"Валюта",value:e.currency}):null,t?o(ac,{label:"Купить",value:String(t)}):null,n?o(ac,{label:"Продать",value:String(n)}):null]},String(a)),wc={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Cc=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",wc[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ye,{size:"text-m",color:wc[n].text,children:t})]}))),Sc=(new Date).getDay(),kc=e=>{const[t]=e?.slice(Sc-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Cc,{color:"green",children:i}):null,n&&r?o(Cc,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Cc,{color:"red",children:"Выходной"})},Ic=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Tc=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(ac,{label:e,value:t&&n?n:"",subText:Ic({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),Rc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ec=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Dc=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,_c=(e,t)=>{if(!e.workSchedule)return null;const n=yc(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ye,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:e.address})]}):null]}),kc(n)]}),o(uc,{children:Pc(e)})]},String(t))},Pc=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=yc(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(sc,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(ac,{label:"Факс",value:t,isPhone:!0}),o(ac,{label:"Телефон филиала",value:e,isPhone:!0}),o(ac,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(ac,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(ac,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(ac,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(sc,{children:o(ac,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Tc)})})}):c(sc,{children:[o(ac,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(vc)})}),pc(d)]}),l?.businessScheduleVisibleTag?xc(l?.businessScheduleDescription):null,s?.currencies?.length?o(sc,{className:"flex-wrap",children:s?.currencies?.map(Nc)}):null]})},Oc=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=yc(e),n=e?gc(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Rc(n):Dc(n,a):Ec(n):""})(n)}`;return{header:a,body:r}},Bc={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},Ac={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},Fc={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},Mc=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Fc[t](e)))))},Lc=()=>{},zc=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Lc,getBalloonRemoteWorkplaces:i=Lc})=>{const[r,s,o,c]=l((()=>{const r=Mc(e,n),l=Mc(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Vc=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),$c=d((({children:e})=>Vc?e:null)),jc="/icons/MapMarkerClusterIcon.svg",qc="/icons/MapMarkerClusterYellowIcon.svg";function Wc({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=Uc("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Uc("workplaces",e,i),l=Kc(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Kc(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=Kc(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Uc=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?jc:qc,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Kc=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?jc:qc,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Hc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Yc={...Hc,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Gc=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Yc).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Jc={...Hc,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Xc=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Jc).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:n,width:"20",height:"16"})})})),Qc=[55.753995,37.614069],Zc=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=uo("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?Wc({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:ed(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Wc({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const p="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(ka,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",p),children:[o(Xc,{yandexMaps:l}),o(Xc,{yandexMaps:l,direction:"out"})]}),Gc(l,m,u("right-2 top-80",p))]})})),ed=e=>{const t=[nd(td(e,0)),nd(td(e,1))];return t.every((e=>e))?t:Qc},td=(e,t)=>e.map((e=>e.coords?.[t])),nd=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ad=e=>Number(e.toString().replace(",",".")),id=e=>{const t=Vo(),n=$o(),{data:a,error:i}=lr(`${n}${t?"/external/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(e)}`,rd);return a&&"errorMessage"in a?{error:i}:{data:a,error:i}},rd=async e=>await Yt(e,{method:"POST"})||[],ld=()=>be(),sd=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=id("REGION_RF"),{programId:s}=ld(),d="38"===s,m=e("regionRetail")?.value||{},u=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=Vo(),n=await jo((t?"/external":"")+"/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return n?.offices?.map((e=>({...e,gpsLatitude:ad(e.latitude??Qc[0]),gpsLongitude:ad(e.longitude??Qc[1])})))||[]})(m?.key??"");r(e)})()}),[m.key]);const{points:p}=zc({data:n,filtrationState:{},getBalloon:Oc});return c("div",{children:[o(Ai,{label:"Адрес отделения",placeholder:"Выберите отделение",disabled:d,options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...u,isSearch:!0}),o("div",{className:"h-[600px]",children:o($c,{children:o(Zc,{points:p,isLoad:!l,className:"h-full",selectedAddress:u?.value?.text})})})]})})),od=nn((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,onChange:r,...s})=>{const c=t?.map((e=>({key:e.key||"",text:e.value})))||[],d=e(n),m=d?.value,u=l((()=>m?.key&&!m?.text?c.find((e=>e.key===m.key))??m:m),[m,c]);return o(Ai,{placeholder:a,options:c,...e(n),value:u,...s,onChange:r??e(n)?.onChange})})),cd=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",...t})})),dd=d((({field:e,input:t})=>o($l,{text:"Наличие военного билета",...e(t?.name??"")}))),md=d((({className:e,label:t,required:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ja,{label:Ua({label:t,required:n}),...i}),Xa(a)]}))),ud=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],pd=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(md,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:ud,value:n,onChange:l}),"true"===n?o(Go,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),hd=d((({field:e,input:t})=>o($l,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),gd=d((({field:e,input:t})=>o(el,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Hl(e,t),maxDate:new Date}))),fd=d((({field:e,input:t})=>o(Go,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Hl(e,t)})));function yd(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const xd=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:a?o(ie,{image:a,className:"block w-max"}):o(Y,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Ke,{__html:e})})]}))),bd=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=yd("programId"),{productType:m,leadForm:u}=ld(),p="debitCard"===m,h=Boolean(e("esiaAccountTypeCd")?.value?.key),{value:g,onChange:f}=e("cardCategory"),y=e("paymentSystem")?.value?.key,x="office"===u?.methodObtain,b=e("cardCategory")?.value?.text?.toLowerCase()?.includes("неимен"),v=r((e=>0!==e.length?{key:e[0].key,text:e[0].value}:null),[y]),N=r((t=>{f?.(t),e("isMomentDebitCard")?.onChange?.(t?.text?.toLowerCase()?.includes("неимен"))}),[]);i((()=>{y&&d&&(async()=>{const t=await(async(e,t)=>{const n=Vo(),a=n?"/external/public-data/dictionaryFiltered":"/dictionaryFiltered",i=n?{paymentSystemTypeCd:e,dictionaryType:"CARD_TYPE"}:{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}},r=await jo(a,"POST",i);return Array.isArray(r)?r:[]})(y,d),n=!p||h&&!x?t:Nd(t);s(n),vd(n,g)||f?.(v(n)),p&&e("isMomentDebitCard")?.onChange?.(b)})()}),[y,v,b]);const w=l((()=>n?.find((e=>e.key===g?.key))?.description),[n,g]);return c("div",{children:[o(od,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",...t,onChange:N}),w?o(xd,{__html:w}):null]})})),vd=(e,t)=>e.some((e=>e.key===t?.key)),Nd=e=>e.filter((e=>e.value&&e.value.toLowerCase().includes(" именная"))),wd=d((({field:e,input:t})=>o(Go,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),Cd=e=>{const t={q:"й",w:"ц",e:"у",r:"к",t:"е",y:"н",u:"г",i:"ш",o:"щ",p:"з","[":"х","]":"ъ",a:"ф",s:"ы",d:"в",f:"а",g:"п",h:"р",j:"о",k:"л",l:"д",";":"ж","'":"э",z:"я",x:"ч",c:"с",v:"м",b:"и",n:"т",m:"ь",",":"б",".":"ю","`":"ё","{":"Х","}":"Ъ",":":"Ж","~":"Ё",'"':"Э","<":"Б",">":"Ю","\\":"\\","^":"^",_:"_"};return e.replace(/[A-z,`~<.>;:\\'"[{\]}]/g,(e=>e===e.toLowerCase()?t[e]:t[e.toLowerCase()].toUpperCase()))},Sd=d((({field:e,input:t})=>{const n=r((n=>{const a=Cd(n);(yo.test(a)||0===a.length)&&e(t?.name??"")?.onChange?.(a)}),[e,t]);return o(Go,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t,onChange:n})})),kd=d((({field:e,input:t})=>{const{data:n}=id("INCOME_CERT_UNITED"),a=Hl(e,t);return c("div",{className:"space-y-xl",children:[a?o(xd,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(od,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",...t,disabled:a})]})})),Id=d((({field:e,input:t})=>{const{data:n}=id("MILITARY_STATUS");return o(od,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",...t})})),Td=()=>be(),Rd=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Le();return c(ta,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Xn,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Ed=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=dn(!1),{open:l}=kn(Rd),s=Le();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=Vo(),a=await qo(`${n?"/external":""}/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return a?a.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},Dd=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=Ed(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Fa,{...a}),n?c(Xn,{embedded:!0,onClick:i,children:[o(Ys,{children:"Ознакомиться"}),r?o(ka,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),Xa(t)]})})),_d=d((({field:e,input:t})=>{const{productType:n}=Td(),a=Lo[n??""];return t&&t.name?o(Dd,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name),...t}):null})),Pd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Od="flex flex-col justify-between lg:flex-row gap-4xl",Bd="w-full",Ad="flex flex-col lg:w-1/2 gap-2xl",Fd="grid lg:grid-cols-2 grid-cols-1 gap-4xl",Md="flex flex-col gap-y-xl min-w-52",Ld=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Ye,{size:"text-h3",children:"number"==typeof e?[a,lt(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),zd=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Ye,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Ld,{value:n,...i}):o(Ye,{size:"text-h3",children:"-"})]}))),Vd=e=>jd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),$d=(e=[],t=!1,n=[])=>({...jd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),jd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},qd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Wd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(vr,{items:[`От ${Ud(e)}`,`До ${Ud(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Ud=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Kd=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Ye,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(ja,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Hd=e=>Kd({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Yd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(vr,{items:e?[`От ${lt(1)(a.min||0)} ${n}`,`До ${lt(1)(a.max||0)} ${n}`]:[],step:t,...a}),Gd=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(gr(t?.[i],n.minMonths,n.maxMonths))},Jd=Math.round(29.5),Xd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Qd=e=>e,Zd=(e=Qd)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),em=Zd(),tm=(e=Qd)=>Zd((t=>-e(t))),nm=tm(),am=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:im([e,t],a),im=([e,t],n=[])=>({[e]:n.length?nm(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?em(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),rm=(e,[t,n],a)=>e>=a[t]&&e<=a[n],lm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},sm=e=>om({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&om({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&om({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&om({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),om=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],cm=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[lm],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>sm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=am(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=am(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>sm({row:e,userInputParams:t,paramsViewSettings:n})&&rm(a,["minSum","maxSum"],e)&&rm(i,["minMonths","maxMonths"],e)))||lm)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,p=Xd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:p}},dm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),mm=(e,t=0)=>e?.sum?e.sum:t,um=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,pm=e=>({moneyValue:mm(e,2e5),monthsValue:um(e,Jd),monthlyPayment:0,rate:0,isAnnuity:Boolean(e?.isAnnuity),isInsurance:Boolean(e?.isEnableInsurance),isSalaryClient:Boolean(e?.isEnableSalaryClient),isPensionClient:Boolean(e?.isEnablePensionClient),isStateEmployee:Boolean(e?.isEnableStateEmployee)}),hm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},gm=nn((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...p})=>{const h=Vd(n?.rateRows),g=r((e=>{const t=cm(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:h?.rate??0})}),[s,n]),[f,{field:y}]=Nn(pm(d),{onChange:g}),x=cm(f,n,s),b=Hd({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(gr(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(gr(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!dm(d)&&h&&Gd({field:y,defParams:h,calcParams:x,map:hm,monthsValue:"minMonths"})}),[n,d]),o(Pd,{className:e,title:t,...p,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),Wd({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),fm({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Md,"@4xl:w-1/2"),children:[o(zd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(zd,{title:"Ставка от",value:h?.rate,fractionDigits:2,postfix:"%"}),o(zd,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),nt(a,{isVertical:!0}),qd(l)]})]})})})),fm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Fa,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Fa,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Fa,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Fa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),ym="calculator",xm=d((({field:e,params:t})=>{const[n,l]=a(),s=e(ym)?.value,c=r((t=>{e(ym).onChange?.(t)}),[]);return i((()=>{t?.calcData?.defaultParams&&l(s?vm(e(ym).value):t?.calcData?.defaultParams)}),[t?.calcData?.defaultParams]),i((()=>{n&&c(pm(n))}),[n]),n?o(gm,{...t?.calcData,defaultParams:n,padding:"p-0",onChange:c}):o(ka,{})})),bm={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},vm=(e,t=!1)=>{const n=t?Nm(bm):bm;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Nm=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),wm=d((({field:e,input:t})=>{const{data:n}=id("CREDIT_IN_RSHB");return o(od,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Cm={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},Sm=[{id:"810",text:"Рубли"}],km=d((({field:e,input:t})=>{const{data:n}=id("CURRENCY"),{programId:a}=Td(),i=l((()=>!Object.keys(Cm).includes(a||"")||"38"===a),[]),r=l((()=>i?Sm:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(md,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??""),...t})})),Im=(e,t)=>{if(!t)return null;const n=Dm(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Tm=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Rm=(e,t)=>{const n=Dm(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Em=(e,t,n)=>{const a=Dm(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Dm=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,_m={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},Pm=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=Om(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Xo(n.data?.address));const s={amountWorkers:Tm(e?.amountWorkers,n.data?.employee_count),employerActivities:Im(e?.employerActivities??[],a),organization:Em(e?.organization??[],i,r),employerOrganization:Rm(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},Om=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Bm=d((({field:e,input:t})=>{const n=ld(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,p=e?.("esiaAccountTypeCd")?.value,h=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{Pm(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{const n=Vo();await Promise.all(Object.entries(e).map((e=>{const[a,i]=e;jo(`${n?"/external/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(i)}`,"POST").then((e=>{t[a]=e}))})))})(_m,n)})()}),[]),i((()=>{p&&h&&Am(n)&&(async()=>{const t=await(async e=>{const t=await sl({url:"suggest/party",query:e});return t?.[0]})(h);t&&Pm(n,e,t)})()}),[c,d,m,u]);const x=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Go,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:Hl(e,t),onChange:x,error:l||e("inn")?.error})})),Am=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},Fm=new Date(Date.now()+864e5),Mm=d((({field:e,input:t})=>{const{productType:n}=ld(),a="debitCard"===n,i=a?Fm:new Date,{data:r}=id("DAYS_DELIVERY_SETTINGS"),s=l((()=>{const e=r?.find((e=>"WEEKEND"===e.key));return e&&e.value?e.value.split(",").map(Number):[]}),[r]);return o(el,{label:"Дата доставки",...e(t?.name??""),minDate:i,weekends:a?s:[]})})),Lm=d((({field:e,input:t})=>{const{productType:n}=ld(),a="debitCard"===n,{data:i}=id("COURIER_DELIVERY_TIME"),r=["TIME_1","TIME_2","TIME_3"],s=["TIME_4","TIME_5"],c=l((()=>{const e=a?s:r;return(i||[]).filter((t=>t.key&&e.includes(t.key))).map((e=>({id:e.key,text:e.value})))}),[i,a]);return o(md,{label:"Время доставки",className:"flex-row",items:c,...e(t?.name??"")})})),zm=d((({field:e,input:t})=>o(Go,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Vm=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(el,{label:"Дата выдачи",...e(t?.name??""),disabled:Hl(e,t),minDate:a,maxDate:new Date,...t})})),$m=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(Go,{disabled:Hl(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),jm=d((({field:e,input:t})=>o(Go,{disabled:Hl(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??""),...t}))),qm=d((({field:e,input:t})=>o(Go,{disabled:Hl(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??""),...t}))),Wm=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(Mr(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(Go,{disabled:Hl(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Um=d((({field:e,input:t})=>{const{data:n}=id("EDUCATION_LEVEL");return o(od,{field:e,source:n,label:"Образование",fieldName:"education",...t})})),Km=d((({field:e,input:t})=>{const n=r((t=>{(bo.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o(Go,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),Hm=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",...t})})),Ym=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Gm=d((({field:e,input:t})=>{const{data:n}=id("EMPLOYMENT_INFO_UNITED");return o(od,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",...t})})),Jm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(gr(Number(n),0,5)))),[]);return o(Go,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Hl(e,t)})})),Xm=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Go,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,...t,onChange:a})})),Qm=d((({field:e,input:t})=>{const{data:n}=id("MARITAL_STATUS");return o(od,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",...t})})),Zm=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(Go,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Hl(e,t)})})),eu=d((({field:e,input:t})=>{const{data:n}=id("HOUSE_TYPE");return o(od,{field:e,source:n,label:"Тип жилья",fieldName:"housing",...t})})),tu=d((({input:e})=>o(xd,{__html:e?.label}))),nu=d((({field:e,input:t})=>o($l,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),au=d((({field:e,input:t})=>o(Go,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Hl(e,t)}))),iu=d((({field:e,input:t})=>o(Go,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Hl(e,t)}))),ru=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,lu=(e="",t="")=>ru.test(e)&&t.length<20&&e.length+t.length<=20,su={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "},ou=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>su[e.toLowerCase()].toUpperCase()||"")),cu=(e,t)=>{let n=ou(e);const a=ou(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},du=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=cu(a,l);s?.(e)}),[]);const c=r((e=>{(lu(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ti,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),mu=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=cu(a,l);s?.(e)}),[]);const c=r((e=>{(lu(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ti,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),uu=d((({field:e,input:t})=>o(Go,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),pu=d((({field:e,input:t})=>o(Go,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),hu=d((({field:e,input:t})=>o(el,{label:"Дата рождения",...e(t?.name??""),...t,disabled:Hl(e,t)}))),gu=d((({field:e,input:t})=>o(Go,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),fu=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],yu=d((({field:e,input:t})=>o(md,{orientation:"horizontal",items:fu,...e(t?.name??"")}))),xu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("middleName")?.onChange?.(n)}),[e]);return o(Go,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),bu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("name")?.onChange?.(n)}),[e]);return o(Go,{label:"Имя",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),vu=d((({field:e,input:t})=>{const n=ld();return o(od,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Nu=d((({field:e,input:t})=>{const n=ld(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{Pm(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Go,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Hl(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),wu=d((({field:e,input:t})=>o(Go,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Cu=d((({field:e,input:t})=>o(el,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date,...t}))),Su=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(gr(Number(n),0,100)))),[]);return o(Go,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),ku=e=>e.map((e=>({key:e.type,text:e.name}))),Iu=e=>e?.key,Tu=[{key:"PAYMENT_SYSTEM_TYPE_3",text:"UnionPay"}],Ru=d((({field:e,input:t})=>{const[n,i]=a([]),r=be(),s=ia();rl((async()=>{const{programId:e}=r,{claimChannelCode:t}=s;if(e){const n=t?Tu:await(async e=>{const t=Vo()?"/external/user-data/getPaymentSystem":"/public-data/creditProgramConditions",n=await jo(t,"POST",{creditProgramId:e});return ku(n?.paymentSystems||[])})(e);i(n??[])}}),[]);const c=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(md,{label:"Платежная система",orientation:"horizontal",items:c,...e(t?.name??"",{format:Iu,parse:e=>n?.find((t=>t.key===e))}),...t})})),Eu=d((({field:e,input:t})=>{const{data:n}=id("POSITION");return o(od,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",...t})})),Du=async()=>{const e=Vo();return await jo((e?"/external":"")+"/public-data/regionsCardDelivery","GET")||void 0},_u={key:"REGION_77",text:"Москва и Московская область"},Pu={key:"3041100",text:"Аэропорт Шереметьево, МО, г.Химки, Шереметьевское шоссе, вл39с1"},Ou={key:"REGION_77",text:"Москва и Московская область"},Bu={key:"3",text:"г. Москва, Пресненская наб., д. 10, стр. 2"},Au=d((({field:e,input:t})=>{const{programId:n,productType:a,leadForm:l}=ld(),s=l?.regionRetail,{data:c}=id("REGION_RF"),{data:d}=lr("regionsDelivery",Du),{data:m}=id(Fu(a)),u=ia(),p="debitCard"===a,h="38"===n,g=Boolean(e("esiaAccountTypeCd")?.value?.key),f=c?.map((({key:e,value:t})=>({key:e,text:t}))),y="true"===m?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,x=e("regionRetail")?.onChange,b=e("addressRetail")?.onChange,v=e("regionHasDelivery")?.onChange,N=e("methodObtain")?.onChange,w=r((e=>(!p||g&&!h)&&y&&d?.find((t=>t.regionCode===e.key))?.deliveryFlg),[y,d]),C=r((e=>{const t=w(e);v?.(t),N?.(t?"courier":"office"),x?.(e),b?.("")}),[d,y,g]);return i((()=>{if(u.claimChannelCode)x?.(_u),b?.(Pu),v?.(w(_u)),N?.("office");else if(h)x?.(Ou),b?.(Bu),N?.("office");else if(s){const e=w(s);v?.(e),N?.(e?"courier":"office"),x?.(s)}}),[w]),o(Ai,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,disabled:h,options:f,...e(t?.name??""),...t,onChange:C})})),Fu=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Mu=d((({field:e,input:t})=>o(Go,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),Lu=["male","female"],zu=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Vu=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await sl({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Lu.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(md,{label:"Пол",orientation:"horizontal",items:zu,...e(t?.name??""),...t})})),$u=d((({field:e,input:t})=>o($l,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),ju=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Mr(e,"___-___-___ __")):t?.(Mr(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Ja,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),qu=d((({className:e,label:t,required:n,value:a,error:i,onChange:r,onBlur:l,...s})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ju,{"aria-label":t,label:Ua({label:t,required:n}),valid:Boolean(!i),value:a,onChange:r,onBlur:l,placeholder:"___-___-___ __",...s}),Xa(i)]}))),Wu=d((({field:e,input:t})=>o(qu,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Uu=d((({field:e,input:t})=>{const n=r((t=>{const n=Cd(t);(xo.test(n)||0===n.length)&&e("surname")?.onChange?.(n)}),[e]);return o(Go,{label:"Фамилия",maxLength:40,disabled:Hl(e,t),...e(t?.name??""),...t,onChange:n})})),Ku=d((({field:e,input:t})=>o(Go,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Hl(e,t)}))),Hu={$ref:"/wcms-resources/delivery-cities-data.json"},Yu={limitedBirthday:hu,name:bu,surname:Uu,middleName:xu,email:Km},Gu={processPersonalDataFlg:_d,consentProviderFlg:_d,consentOthersFlg:_d,consentInformFlg:_d,consentPfrFlg:_d,consentFATCA:_d},Ju={organization:vu,organizationAddress:Jo,organizationPhone:us,organizationName:Nu,legalForm:pu,generalSeniority:Zm,lastJobExperience:iu,experience5Years:Jm,jobsNumber:au,beginDate:gd,addressFact:tc,addressRegistration:Jo,addressRetail:sd,addressMatch:nc,sex:Vu,birthPlace:fd,education:Um,housing:eu,amountWorkers:cd,employment:Gm,employerActivities:Hm,employerOrganization:Ym,positionOrganization:Eu,familyStatus:Qm,familyMembers:Xm,children:wd,dependents:zm,snils:Wu,conscription:Id,armyIdFlg:dd,dulSerie:qm,dulNumber:jm,dulIssueDate:Vm,dulSubdivisionCode:Wm,dulIssuedBy:$m,participantDateRegistration:Cu,retirementIncome:Mu,otherIncome:wu,wages:Ku,mandatoryPayments:gu,bankruptcyFlg:hd,initiateBankruptcyFlg:nu,shareholderFlg:$u,legalEntityName:uu,creditInRshbCd:wm,bankEmployeeCode:pd,partInBusiness:Su,regionRetail:Au,infoCard:tu,calculator:xm,confirmationIncome:kd,inn:Bm,...Yu},Xu={addressCourier:e=>o(ec,{...e,source:Hu}),paymentSystem:Ru,currency:km,cardCategory:bd,codeWord:Sd,methodObtain:yu,deliveryDate:Mm,latinName:du,latinSurname:mu,deliveryTime:Lm},Qu="Согласие на все документы",Zu=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Yi(t(e?.name),zn).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(dc,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(Fa,{text:Qu,value:a,onChange:i,name:"all-consents"},n),Xa(s?"Отметьте все обязательные соглашения":"")]}),o(Xn,{embedded:!0,ariaLabel:Qu,onClick:m,children:o(oc,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(mc,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(zs(t,{},Gu))})]})})})),ep=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=tp(t||[],n);return a.length>2?c("div",{children:[i.map(zs(e,{},{...Yu})),o(Zu,{inputs:a,field:e})]}):(t||[])?.map(zs(e,{},{...Yu}))},tp=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(Lo[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(Lo[t]).includes(String(e))))}),np=(e,t=!1)=>o(Ia,{className:"w-full @xl:w-auto",isLoading:t,testId:"LeadSubmitButton",children:e?.text?e.text:"Отправить заявку"}),ap=async e=>{const t=Vo();return await jo((t?"/internal":"")+"/user-data/createDraftTask","POST",e)||{}},ip=async e=>{const t=Vo()?"/internal/entities/getLastStatus":"/user-data/getLastStatus",n=await jo(t,"POST",e);return"DRAFT"===n?.statusCd?n?.taskId:null},rp=async e=>{const t=Vo()?"/internal/entities/getTaskById":"/user-data/getTaskById";return await jo(t,"POST",e)||void 0},lp=e=>qo((Vo()?"/internal":"")+"/referal/saveReferalInfo","POST",e),sp=e=>qo("/user-data/updateUserProfile","PUT",e),op=e=>qo((Vo()?"/internal":"")+"/user-data/updateUserTask","PUT",e),cp={width:"103",height:"21"},dp={"bg-white":"color",transparent:"white"},mp={"bg-white":"text-primary-main",transparent:"text-white"},up=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:dp[e]},className:mp[e],width:n?.width,height:n?.height}),pp={"bg-white":"text-primary-text",transparent:"text-white"},hp=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...Re(s),children:[up(r,n?.image,cp),l?a??o("div",{className:"ml-s",children:o(Ye,{font:"font-medium",color:pp[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),gp=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,p]=a(!1),[h,{setTrue:g,setFalse:f}]=dn(!1),{closeAll:y}=Ce(),x=r((async()=>{g();await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/checkCaptcha","POST",{captchaText:e.captchaText,...t&&{phoneNumber:e?.phoneNumber}}).then((e=>e.text())).then((e=>"ERROR"!==e))})({captchaText:d,phoneNumber:e})?(n?.(),t?.()):p(!0),f()}),[d,t]),b=r((()=>{(async()=>{s(URL.createObjectURL(await(async e=>{const t=Vo();return await qo(`${t?"/external/user-data":""}/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob))})(e)))})()}),[]);return i(b,[]),o(ta,{head:o(hp,{}),onClose:y,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Xn,{className:"w-8",embedded:!0,onClick:b,children:o(Y,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Ja,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(Xn,{version:"secondary",onClick:y,children:"Вернуться"}),o(Ia,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),h?o(ka,{blur:!1}):null]})})})),fp=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},yp=({values:e,phoneNumber:t,onSuccess:n,onFail:l})=>{const s=ia(),o=s.smsCode?.attempts||0,c=Math.max(to(s.smsCode?.sendTime||Date.now()),0),[d,m]=a(""),[u,{setTrue:p,setFalse:h}]=dn(!1),[g,f]=a(c),y=r((()=>m("")),[]),x=Boolean(0===g&&s.smsCode?.sendTime),b=o>2||x||!e.every(Boolean),v=r((async()=>{s.smsCode={...s.smsCode,attempts:o+1},p();const a=await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/checkCode","POST",{smsText:e.smsText,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName,...t&&{phoneNumber:e?.phoneNumber}})})({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"},phoneNumber:t});if(a.ok){const t=await a.json();fp(t),f(0),y(),s.smsCode=null,n?.(e.join(""))}else 403===a.status?m(o>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):l();h()}),[e,o]);return i((()=>{x?m("Код просрочен"):o>2&&m("Исчерпан лимит ввода смс-кода")}),[x]),{handleSubmit:v,hasError:Boolean(d),errorText:d,isLoading:u,timeNextReq:g,isSubmitButtonDisabled:b,setTimeNextReq:f,setErrorText:m}},xp=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=Hn,onClose:s=Hn,onFail:c=Hn})=>{const[d,m]=a(Array(4).fill("")),u=ia(),p=ca(e),{handleSubmit:h,hasError:g,errorText:f,isLoading:y,timeNextReq:x,isSubmitButtonDisabled:b,setTimeNextReq:v,setErrorText:N}=yp({values:d,phoneNumber:p,onSuccess:l,onFail:c}),w=kn(gp),C=Ws({seconds:x,onTick:v}),S=r((async()=>{const e=await(async e=>{const t=Vo();return await qo((t?"/external/user-data":"")+"/sms/sendCode","POST",{phoneNumber:e.phoneNumber,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName})})({phoneNumber:p,smsCodesSetName:{key:"AUTHENTICATION"}});e.ok?(v(180),C(180),N(""),u.smsCode=bp(p)):429===e.status?w.open({phoneNumber:p,sendCode:S}):c()}),[p,C]);return i((()=>{u.smsCode?.sendTime&&u.smsCode?.phoneNumber===p||S()}),[]),o(Xs,{isSubmitButtonDisabled:b,onSubmit:h,onSendCode:S,timeNextReq:x,values:d,onChange:m,phone:e,isLoading:y,errorText:f,hasError:g,onClose:s,children:vp(n,t)})})),bp=e=>({sendTime:Date.now(),attempts:0,phoneNumber:e}),vp=(e,t=!1)=>t?c(Ke,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Np={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},wp={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Cp=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Sp=d((({onSubmit:e=Hn,onClose:t=Hn})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=Ed(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),p=l?wp:Np;return o(ta,{onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:p.title})}),o(C,{align:"text-center",children:p.description}),o(ja,{className:"whitespace-normal",orientation:"horizontal",items:Cp,value:n,onChange:u}),o(Xn,{disabled:!n,type:"button",onClick:m,testId:"bki-button",children:"Далее"})]})})})),kp=async e=>{await qo("/internal/camunda/send/message","POST",e)},Ip={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Tp={amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},Rp={amur_card:"14",owner_card:"13",travel_card:"15"},Ep={...Ip,...Rp,...Tp},Dp=d((({title:e,icon:t,description:n,name:a,onClick:i=Hn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:i,"data-test-id":a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(Ye,{font:"font-medium",size:"text-s",children:e}):null,n?o(Ye,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),_p=d((function({createdDate:e,productData:t,isFromLead:n,handleGoToDraft:a,handleGoToNewTask:i,onClose:r}){return c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Dp,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:e?`Черновик от ${oa(new Date(e))}`:"",onClick:a,name:"go-to-draft-button"}),o(Dp,{title:n?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:t.description,onClick:n?r:i,name:"go-to-current-task-button"})]})]})})),Pp={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Op={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Bp={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Ap=e=>Object.entries(e).reduce(((e,[t,n])=>t in Pp?[...e,{contactTypeCd:{key:Pp[t]},value:n}]:e),[]),Fp=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Op){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{...a,addressType:{key:Op[t]}}]}return e}),[]),Mp=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:p,armyIdFlg:h,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:Lp(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in Bp?[...e,{incomeTypeCd:{key:Bp[t]},value:Number(n||0)}]:e),[])),snils:p?.replace(/[-\s]/g,""),armyIdFlg:h,initiateBankruptcyFlg:f};var y},Lp=(e,t)=>(Number(e??0)+Number(t??0)).toString(),zp={WORK:"Работаю",RETIREE:"Пенсионер"},Vp=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Lp(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},$p=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},jp=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},qp=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,Wp=e=>{switch(e){case"debit":return{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"};case"credit":return{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"};default:return{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"}}},Up=d((function({task:e,taskType:t,isDebit:n,isFromLead:a=!1,sendAspects:i=Hn,onClose:l=Hn}){const s=ld(),c=mn(),d=Vo(),{participants:m,participant:u,creditProgram:p,createdDate:h="",id:g}=e,f=Ep[p.code],y=Wp(t??((e,t)=>t||e&&e in Tp?"debit":e?e in Ip?"credit":e in Rp?"card":void 0:void 0)(e.creditProgram.code,n)),x=u||m?.[0],{id:b,profile:v}=x||{},N=r((()=>{const t=(e=>{const t=e.participant||e.participants?.[0];if(!t)throw new Error("Task does not contain participant data");const{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:_,employeesNumberCd:P,opf:O,seniority:B,generalSeniority:A,jobsNumber:F,lastWorkDuration:M,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:W,snils:U,armyIdFlg:K,bankruptcyFlg:H,shareholderFlg:Y,nameLegalEntity:G,creditInRshbCd:J,payrollCardRshbFlg:X,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:qp(i),cardCategory:qp(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:qp(b),participantDateRegistration:v,housing:qp(N),beginDate:k,employment:qp(I,zp),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:qp(E),organization:qp(D),employerOrganization:qp(_),amountWorkers:qp(P),legalForm:O,generalSeniority:B?.toString(),experience5Years:A?.toString(),jobsNumber:F?.toString(),lastJobExperience:M?.toString(),positionOrganization:qp(L),familyStatus:qp(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:qp(q),snils:U,armyIdFlg:K,bankruptcyFlg:H,shareholderFlg:Y,legalEntityName:G,creditInRshbCd:qp(J),calculator:{isInsurance:X,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Vp(W),...$p(S),...jp(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);s.participantId=b??null,s.taskId=g,s.profileId=v?.id??null,s.userId=v?.id??null,s.programId=f,s.leadForm=t,v?.id&&i(v.id,g),c.assign(y.nextStepLink)}),[]),w=r((async()=>{if(d)try{await kp({messageName:"KILL_DRAFT_PROCESS_MESSAGE",taskId:e.id})}catch(e){console.error(e)}c.assign(y.newTaskLink)}),[e.id,y.newTaskLink,d]);return o(ta,{onClose:l,children:o(_p,{createdDate:h,productData:y,isFromLead:a,handleGoToDraft:N,handleGoToNewTask:w,onClose:l})})})),Kp=d((function({taskType:e,isDebit:t,onClose:n=Hn}){const a=mn(),i=Wp(e||(t?"debit":void 0)),l=r((()=>{a.assign(i.newTaskLink)}),[]),s=r((()=>{a.assign("/")}),[]);return o(ta,{onClose:n,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Xn,{type:"button",className:"w-full",onClick:l,children:"Заполнить новую заявку"}),o(Xn,{type:"button",version:"secondary",className:"w-full",onClick:s,children:"Вернуться на главную"})]})})})),Hp=e=>"debitCard"===e?"debit":"creditCard"===e?"card":"credit",Yp=({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i,consents:r})=>{const l=Jp(i?.utm_source),s=Gp({participantId:e,profileId:n,formData:a,consents:r}),{crshbFileIds:o}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:l,id:t,...n?{participants:[s]}:{participant:s},marketingInfo:i},crshbFileIds:o}},Gp=({participantId:e,profileId:t,formData:n,consents:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=n;return{birthDate:s&&oa(s,!0),id:e,midname:l,name:i,surname:r,...t&&{profile:{id:t}},participantContacts:Ap({phone:o&&ca(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"},...a}},Jp=e=>{switch(e){case"banki_ru":return"banki_ru";case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},Xp=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i,isNewMicroservice:l})=>{const[s,{setTrue:o,setFalse:c}]=dn(!1),d=(()=>{const e=Td();return r((({participantId:t,taskId:n,userId:a,profileId:i,programId:r,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=i,e.userId=a,e.programId=r,e.leadForm=l}),[])})(),m=ia(),u=Td(),p=(({data:e})=>{const t=hn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Ki({aspectsAttributes:Ui(e,i),aspects:t,ev:{}})}),[e])})({data:a}),h=mn(),g=r((()=>{h.assign(t)}),[]),f=(e=>{const{open:t}=kn(Sp),n=kn(xp),a=(t,n,a)=>async i=>{try{t?await sp({profile:{id:t,consentBkiFlg:!0,smsConsentBki:i}}):n&&a&&await op({task:{id:n,participant:{id:a,consentBkiFlg:!0,smsConsentBki:i}},sendToBank:!1,taskKind:"SHORT"}),e()}catch(e){console.log(e)}},i=({phone:t,profileId:i,onFail:r,taskId:l,participantId:s})=>async o=>{"SIGNED"===o&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i,l,s),onFail:r}):e()};return{open:({phone:n,profileId:a,onFail:r,taskId:l,participantId:s})=>t({onSubmit:i({phone:n,profileId:a,onFail:r,taskId:l,participantId:s}),onClose:e})}})(g),y=kn(xp),x=(()=>{const{open:e}=kn(Up),{open:t}=kn(Kp);return{open:({task:n,isFromLead:a,taskType:i,isDebit:r,onClose:l,sendAspects:s})=>{n?e({task:n,isFromLead:a,taskType:i,isDebit:r,onClose:l,sendAspects:s}):t({taskType:i,isDebit:r})}}})(),b=()=>{y.close(),i(!1)},v=r((async t=>{try{o();const i=ih(t),r=await(a={profile:{phone:ca(i.phone)}},jo("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{await th({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:s,saveUserData:d,sendAspects:p}),y.close(),"debitCard"===n?g():f.open({phone:i.phone,profileId:r,onFail:b})},h=async()=>{try{const t=await ip({profileId:r,programId:e});if(t){const e=await rp({taskId:t});y.close(),x.open({task:e,isFromLead:!0,taskType:Hp(n),sendAspects:p,onClose:c})}else await c()}catch{b()}},v=eh(i,n);y.open({phone:i.phone,consents:v,onSuccess:h,onFail:b})}catch{b()}finally{c()}var a}),[]),N=r((async t=>{try{o();const i=ih(t),r=await(a={phone:ca(i.phone),email:i.email},jo("/external/public-data/createParticipant","POST",a).then((e=>e||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const{participantId:c,userId:h}=r;if(!c)throw new Error;const g={programId:e,userId:h,productType:n,sendAspects:p,verifyPhoneDialog:y,handleFailSendForm:b},v=Qp({common:g,taskData:{participantId:c,formData:i,referalData:l,marketingInfo:s,saveUserData:d},consentBkiDialog:f}),N=Zp({common:g,draftDialog:x,sendCurrentTask:v}),w=eh(i,n);y.open({phone:i.phone,consents:w,onSuccess:N,onFail:b})}catch{b()}finally{c()}var a}),[]);return{isSending:s,handleSubmit:l?N:v}},Qp=({common:e,taskData:t,consentBkiDialog:n})=>async()=>{const{programId:a,userId:i,productType:r,sendAspects:l,verifyPhoneDialog:s,handleFailSendForm:o}=e,{participantId:c,formData:d,referalData:m,marketingInfo:u,saveUserData:p}=t,h=await nh({programId:a,participantId:c,userId:i,formData:d,referalData:m,productType:r,marketingInfo:u,saveUserData:p,sendAspects:l});s.close(),n.open({phone:d.phone,taskId:h,participantId:c,onFail:o})},Zp=({common:e,draftDialog:t,sendCurrentTask:n})=>async()=>{const{verifyPhoneDialog:a,sendAspects:i,handleFailSendForm:r,userId:l,programId:s,productType:o}=e;try{const e=await ip({userId:l,programId:s});if(e){const r=await rp({taskId:e});a.close(),t.open({task:r,isFromLead:!0,taskType:Hp(o),sendAspects:i,onClose:n})}else await n()}catch{r()}},eh=(e,t)=>{const n=Lo[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},th=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=ah(n,a);await sp(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&oa(l,!0),email:o,phone:ca(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async()=>{const e=await jo("/claim-channel/","GET").then((e=>{const t=globalThis.location.href,n=e?.find((e=>e&&t.includes(e.key)))?.code;return globalThis.sessionStorage.setItem("claimChannelCode",n??""),n})).catch((()=>{}));return e})(),a=await(async e=>await jo("/user-data/createUserTaskDebit","PUT",e)||{})((({formData:e,programId:t,marketingInfo:n,claimChannelCode:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=e;return{task:{taskSource:Jp(n?.utm_source),creditProgram:{code:Cm[t]},participants:[{birthDate:s&&oa(s,!0),midname:l,name:i,surname:r,participantContacts:Ap({phone:o&&ca(o),email:c})}],marketingInfo:n},claimChannelCode:a}})({formData:n,programId:e,marketingInfo:r,claimChannelCode:t}));o=a.taskId,c=a.participantId}else{const a=await ap({profileId:t,programId:e});o=a.taskId,c=a.participantId,await op(Yp({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await lp({taskId:o,...i}),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},nh=async({programId:e,userId:t,participantId:n,formData:a,referalData:i,productType:r,marketingInfo:l,saveUserData:s,sendAspects:o})=>{let c;const d=ah(a,r);try{return c=(await ap({participantId:n,programId:e})).taskId,await op(Yp({participantId:n,taskId:c,formData:a,marketingInfo:l,consents:d})),i?.referalCode&&await lp({taskId:c,...i}),o(t||n,c),s({participantId:n,taskId:c,userId:t,programId:e,formData:a}),c}catch(e){throw console.log(e),new Error}},ah=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentFATCA:s}=e;let o;return o="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentPhotoFlg:!1}:{consentFATCA:s,consentPhotoFlg:n},{...o,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},ih=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),rh=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=Vo(),r=mn();if(!n||!t||!a&&!e)return r.assign("/"),()=>{};const l=async()=>{const e=await qo((i?"/external":"")+"/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&r.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&l();const s=setInterval(l,24e4);return()=>clearInterval(s)},lh={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},sh=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,lh[e.name||""]])))}},oh=async(e,t)=>{const n=new FormData;return n.append("documentCategory",t.category),n.append("file",e,`${t.fileName}.${t.isPDF?"pdf":"xml"}`),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Wo()},credentials:"include",body:n}).then((e=>e.json())))},ch=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=(e,t)=>e?`${t} ${e}`:void 0,u=[t,n,i||r,m(l,"ул"),m(s,"д"),m(c,"к"),m(o,"стр"),m(d,"кв")].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key??a,fullAddress:u}},dh=e=>Math.floor(e/12),mh=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,fileName:"pdfFileWorkbook",category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,fileName:"pdfFilePayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,fileName:"pdfFileSigPayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,fileName:"xmlFilePayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,fileName:"xmlFileSigPayout",category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,fileName:"xmlFileWorkbook",category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>oh(t,e))).then((e=>t.push(e)))}return t},uh=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},ph=(e,t)=>{const{esiaAdditionalDocument:n,crshbFileIds:a}=e,i=[n?.pdfFilePayout,n?.pdfFileWorkbook,n?.pdfFileSigPayout,n?.xmlFilePayout,n?.xmlFileSigPayout,n?.xmlFileWorkbook],r=t?Boolean(a?.length):i.every(Boolean);return[n?.inn,n?.averageMonthlyIncome?.toString(),n?.startWorkDate,n?.workLengthInFiveYears?.toString(),n?.workLength?.toString(),n?.workLengthLastJob?.toString(),n?.jobsNumberInFiveYears?.toString()].every(Boolean)&&r},hh=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a,isNewMicroservice:s})=>{const o=Td(),c=r((e=>{const t=e instanceof Function?e(d[m]):e;null!=t?d[m]=t:delete d[m]}),[d=o,m="leadForm"]);var d,m;const u=ia(),p=globalThis.sessionStorage?.getItem(an);(()=>{const e=Td(),t=hn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});Ki({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const h=l((()=>sh(e,o.leadForm,a)),[e,o.leadForm]),g=r((async(e,a)=>{n(zo.Pending);try{const i=await(async e=>{const t=Vo();return await jo((t?"/external/user-data":"")+"/esia/requestProfile","POST",e).then((e=>(e?.access_token&&e?.refresh_token&&(fp(e),rh(!0)),e)))})({code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0});if(i){const e=await(async(e,t=!1,n=!1)=>{uh(e);const a=!t&&ph(e,n),{profile:i,addInfo:r,document:l,addressRegistration:s,addressFact:o,esiaAdditionalDocument:c,crshbFileIds:d}=e;let m=[];return a&&!n&&(m=await mh(c)),{...{name:i.name,surname:i.surname,middleName:i.midname,limitedBirthday:i.birthDate,phone:cs(i.phone),email:i.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:r.birthPlace,addressRegistration:ch(s),esiaAccountTypeCd:t?i.esiaAccountType:{key:""},...o&&{addressFact:ch(o)}},...a&&{snils:r.snils,inn:c.inn,wages:Math.floor(c.averageMonthlyIncome)?.toString(),beginDate:c.startWorkDate,experience5Years:dh(c.workLengthInFiveYears).toString(),generalSeniority:dh(c.workLength).toString(),lastJobExperience:dh(c.workLengthLastJob).toString(),jobsNumber:c.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:i.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:m,crshbFileIds:d}}})(i,"debitCard"===t,s);c((t=>({...t,...e}))),n(zo.Success)}}catch{n(zo.Error)}}),[]);return i((()=>{o.productType=t,u.marketingInfo=gh(p,u),u.isNewMicroservice=s||null}),[p]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?g(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),h},gh=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},fh=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:p,isNewMicroservice:h=!1,...g})=>{const[f,y]=a(),[x,b]=a(),[v,N]=a(0),w=s(null),C=l((()=>(e=>{const t=Lo[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),S=l((()=>yh(C)),[C]),k=kn(co),I=po();ho();const T=l((()=>xh(m)),[m]),R=l((()=>Wn(S,T)),[S,T]),E=(e=!1)=>{b(e)},D=hh({inputs:S,nextStepLink:r,productType:m,setEsiaStatus:y,esiaAuthSuccess:f===zo.Success,isNewMicroservice:h}),{isSending:_,handleSubmit:P}=Xp({programId:n,nextStepLink:r,productType:m,data:p,changeSubmitFormStatus:E,isNewMicroservice:h}),[,{field:O,onSubmit:B,reset:A}]=Nn(D,{formValidator:R,onSubmit:P}),F=kn(na);return i((()=>{!1===x&&F.open({ok:x,onClose:()=>E(!0)})}),[x]),i((()=>{f&&w?.current&&w.current.scrollIntoView({block:"start"}),f===zo.Success&&A()}),[w?.current,f]),c(Sn,{className:u("container space-y-m",e),title:t,...g,children:[f||I?null:o(Uo,{onChangeEsiaStatus:y,productType:m}),c("form",{onSubmit:e=>{O("processPersonalDataFlg")?.value||(N((e=>e+1)),v>0&&k.open({productType:m,attempts:v})),B?.(e)},className:"space-y-m relative",ref:w,children:[f===zo.Pending?o(ka,{blur:!1}):null,C.map(((e,t)=>c("div",{className:u(Vs(e.columns),"grid gap-x-m"),children:[$s(e.title),ep({field:O,inputs:e?.inputs},m)]},`section-${t}`))),np(d,_),f===zo.Error?o(Ye,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),yh=e=>e?.flatMap((e=>e?.inputs))||[],xh=e=>({...Mo,limitedBirthday:Oo(e)}),bh=d((({title:e,description:t})=>{const n=Le();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),vh=e=>e%2!=0,Nh="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",wh=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=dn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Nh),children:[D(r,{...i.options,parent:n}),vh(r.length)?o(on,{className:"col-span-6",...i}):null]}),c(dc,{children:[c(mc,{className:u(Nh),isUnfolded:s,children:[D(l,{...i.options,parent:n}),vh(l.length)?o(on,{className:"col-span-6",...i}):null]}),o(cc,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Ch=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Sh=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),kh=10;function Ih(e=0){const t=Math.round(e*kh);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Th=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const p=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:Ih(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}(r((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:p,role:"listitem",children:d})})),Rh=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Eh=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:p,children:h,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},x=s([]),b=r(((e,t)=>{const n=[...x.current||[]];n[e]=t,x.current=n,g&&g(n),f&&f(_h(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Dh(c,v):{},...N?Sh(p):{},gap:`${l}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Th,{className:u(m,i?Rh[i-1]:"",{"h-full":N},t),style:w?Dh(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(h)});var S})),Dh=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),_h=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ph={"horizontal-list":"w-6","vertical-list":"h-6"},Oh=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Ph[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Bh=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Ah=e=>t=>e.scrollWidth/t,Fh=e=>(t,n)=>{e.scrollBy({left:n*Ah(e)(t),behavior:"smooth"})},Mh=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[tm()(i),Zd()(i)]:[-1,-1],m=c>0,u=d<e-1,p=r((()=>{var t;n.current&&(m?Fh(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),h=r((()=>{n.current&&(u?Fh(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:p,scrollRight:h,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Lh={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},zh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Le(),[p,h]=Mh({itemCount:s.length}),g=Vh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&p?.current&&h.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Eh,{containerRef:p,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Bh({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Lh[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(Oh({activeIndex:t,onClick:f,listType:a}))}):null})),Vh=(e=!1)=>({behavior:e?"auto":"smooth"}),$h=d((({className:e,name:t,...n})=>o(Xn,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(Y,{name:t,iconVersion:"",size:"small"})}))),jh=d((e=>o($h,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),qh=d((e=>o($h,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Wh="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Uh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Kh(t):null,r?o(jh,{wcmsIgnore:!0,className:u(Hh(i),m?"left-1":"left-0"),onClick:s}):null,l?o(qh,{wcmsIgnore:!0,className:u(Hh(i),m?"right-1":"right-0"),onClick:d}):null]})})),Kh=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Wh,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Wh,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Hh=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Yh=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:p,showDots:h,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=Mh({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(Eh,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Uh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:p,isBottom:Boolean(y?.length)}),o(zh,{className:u(!h&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),Gh=({blocksToRender:e,...t})=>o(Yh,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:D(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Ch(!0)),children:R(e,t)},String(n))})}),Jh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Xh(n,t),o(wh,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Xh(n,t),Gh({...a,blocksToRender:t})]});default:return null}})),Xh=(e,t)=>e&&!t.length?o(bh,{...e}):null,Qh=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Zh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Xl,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),eg=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,Qh(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(tg(a)).filter(Boolean))]}),n?o("div",{children:o(Xn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),tg=e=>([t,n])=>{const a=n?.type;return"array"===a?ng(t,e)(n):null},ng=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Ye,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Zh,{items:a,multiple:!n?.single,...t(e)})]},e)},ag=e=>e;function ig(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const rg=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,lg=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>rg(t[e])||rg(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>rg(t[e])||rg(n[e])||sg(t[e])<=sg(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>rg(t[e])||rg(n[e])||sg(t[e]?.min)>=sg(n[e]?.min)&&sg(t[e]?.min)<=sg(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>rg(t[e])||rg(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>rg(t[e])||rg(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),sg=e=>Number(e||0),og=(e,{block:t,page:n,normalize:a=ag})=>{const i=t?.blocks||[],[r,s]=Nn(e),o=l((()=>ig(i,i.map((e=>Zt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=ag)=>e?.filter((([,e])=>lg(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},cg={},dg={},mg=nn((({className:e,filtrationSchema:t=cg,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=og(dg,{block:i.block,page:i.options?.page}),d=o(Bi,{className:"w-64",label:n?.title,options:ug(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>ug(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(eg,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Xn,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Jh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),ug=e=>ig(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pg=(e=!1)=>e?"text-left":"text-center",hg={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},gg=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",hg[t],e),style:{width:r,height:r},role:"figure",children:o(Y,{name:a,width:"54%",...i})}):null})),fg=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Le();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:pg(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yg)}):null]})})),yg=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(gg,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Ye,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ke,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),xg=(e,t,n)=>{return o(Yh,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Ye,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Ye,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},bg=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(k,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?xg(e,0,t):null]}))),vg={start:"justify-start",center:"justify-center",end:"justify-end"},Ng=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",vg[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:nt(e)})})),wg=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(Ye,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:lt(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Cg=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(Ye,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Sg=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(wg,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(zd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(Cg,{title:e,...l}),kg={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ig={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Tg=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=kg.prefMonthsNum,prefTravelBonusRate:r=kg.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Ig,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},Rg=nn((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=Nn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:p,maxSumOther:h,monthBonus:g,yearBonus:f}=Tg(l,n);return o(Pd,{className:e,title:t,...r,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Yd({title:"Сумма покупок в остальных категориях, ₽",min:p,max:h,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Sg({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Md,children:[f>=0?o(zd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,nt(a,{isVertical:!0}),qd(i)]})]})})})),Eg=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Dg=e=>Kd({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),_g=" (c капитализацией)",Pg=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Md,children:[o(zd,{title:`Доход в конце срока${r?_g:""}`,value:e,postfix:n,prefix:"+"}),o(zd,{title:`Сумма в конце срока${r?_g:""}`,value:t,postfix:n}),nt(a,{isVertical:!0}),i?.map(qd)]}),Og={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Bg={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ag=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Og[e?.rateType]:"",{data:n}=lr(t?`${ra}/depositrates/${t}`:null,Gt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Fg(s,e)&&rm(a,["minSum","maxSum"],e)&&rm(n,["minDays","maxDays"],e)))||Bg,{rate:m}=d,u=Mg(m,e),p=a+u,h=c||[Bg];return{...d,...im(["minSum","maxSum"],h),...im(["minDays","maxDays"],h),...e,isDisabledOperatingDeposit:o,income:u,finalSum:p}},Fg=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Mg=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Lg=nn((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:p}]=Nn({moneyValue:mm(l,1e5),daysValue:um(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),h=Ag(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=h;return o(Pd,{className:e,title:t,...d,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...p("moneyValue"),value:h.moneyValue}),(b={title:"Срок, дней",min:h.minDays,max:h.maxDays,...p("daysValue"),value:h.daysValue},o(vr,{items:[`От ${Eg(b.min||0)}`,`До ${Eg(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[zg(h,p),Dg({...p("isMonthlyInterestPayment")})]})]}),Sg({rate:y,depositeName:x,isShowDepositeName:r}),Pg({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),zg=(e,t)=>c("div",{className:"space-y-s",children:[o(Ye,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Fa,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Fa,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Vg=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},$g={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},jg=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?Ug(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Wg({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Wg({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Wg({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),Wg({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,rm(a,["minSum","maxSum"],t),rm(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||$g,{rate:u}=m,p=e?.extraPercent?.key??0,h=Number(u)+Number(p),g=qg(h,e),f=a+g,y=t||[$g];return{...m,...im(["minSum","maxSum"],y),...im(["minMonths","maxMonths"],y),availableMonths:Vg(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},qg=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Wg=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Ug=(e,t)=>e+Math.round((t-e)/2),Kg=(e="rub")=>"rub"===e,Hg=(e,t)=>{const{minMonths:n,maxMonths:a}=im(["minMonths","maxMonths"],Jg(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:gr(i,n,a)}},Yg=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Gg=e=>{const t=Kg(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Jg=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Xg=(e,t=!1)=>t?Kd({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Qg=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Zg(t("isReplenish"),e,a),ef(t("isWithdrawn"),e,a),tf(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Dg(t("isMonthlyInterestPayment")):null,Xg(t("isRemoteRegistration"),e.isShowRemoteRegistration),nf(t("extraPercent"),n),e.isShowNewClient?o(Fa,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Zg=(e,t,n=!1)=>t.isShowReplenish?Kd({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,ef=(e,t,n=!1)=>t.isShowWithdrawn?Kd({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,tf=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,nf=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Ye,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Bi,{options:t,...e})]}):null,af={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},rf={text:"₽",key:"rub"},lf={text:"Без учета надбавки",key:"0"},sf=nn((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:p}=n??{},h=p?.map((e=>e.currency))??[rf],g=r((e=>t=>e?{...t,...Gg(t),...Hg(t,e),...Yg(t,e)}:t)(p),[p]),[f,{field:y}]=Nn({moneyValue:mm(d,2e4),monthsValue:um(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:rf,extraPercent:d?.extraPercent??lf},{normalizer:g}),x=uf(y),b=Boolean(y?.("isNewClient")?.value),v=p?.find((e=>e?.extraPercents))?.extraPercents,N=Jg(p,x),w=jg(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Gd({field:y,defParams:$d(N,b,v),calcParams:w,monthsValue:"minMonths",map:af})}),[y,p,v]);i((()=>{!dm(d)&&N&&T()}),[d,p]);const R=y?.("extraPercent")?.value?.key,E=mf(C,R),D=C===$d(N,b)?.rate&&R===v?.at(-1)?.key;return o(Pd,{className:e,title:t,...m,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[c("div",{className:"flex gap-m",children:[Yd({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:of(x?.key)}),p&&p?.length>1?o(Ai,{label:"Валюта",options:h,...y("currency")}):null]}),Wd({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Qg({...w,...s},y,v)]}),Sg({rate:E,children:df(T,D)}),Pg({income:S,finalSum:k,buttons:[...a,cf(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),of=(e="")=>Kg(e)?1e3:100,cf=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},df=(e,t=!1)=>t?null:o(Xn,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),mf=(e,t)=>Number(e)+Number(t??0),uf=e=>e?.("currency")?.value??rf,pf=e=>hf({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hf({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hf=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],gf={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},ff=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[gf],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>pf({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=am(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=am(["minMonths","maxMonths"],o,s),p=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>pf({row:e,userInputParams:t,paramsViewSettings:n})&&rm(a+l,["minSum","maxSum"],e)&&rm(r,["minSumOld","maxSumOld"],e)&&rm(l,["minSumExtra","maxSumExtra"],e)&&rm(i,["minMonths","maxMonths"],e)))||gf)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:h}=p,g=Xd(h,e),f=e.oldMonthlyPayment-g;return{...p,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},yf=nn((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=Nn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),p=ff(d,n,r),h=l((()=>Vd(n?.rateRows)?.rate),[n?.rateRows]),g=Hd({...m("isAnnuity")});return o(Pd,{className:e,title:t,...s,children:c("section",{className:u(Od,e),children:[c("div",{className:Ad,children:[Yd({title:"Остаток долга в других банках, ₽ ",step:500,min:p.minSum,max:p.maxSum-p.maxSumExtra,...m("moneyValue"),value:p.moneyValue}),Yd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:p.minSumOld,max:p.maxSumOld,...m("oldMonthlyPayment"),value:p.oldMonthlyPayment}),Wd({title:"Новый срок кредита, месяцев",min:p.minMonths,max:p.maxMonths,...m("monthsValue"),value:p.monthsValue}),xf({...p,...r},m),p.isExtraMoney?Yd({title:"Дополнительная сумма, ₽ ",step:500,min:p.minSumExtra,max:p.maxSumExtra,...m("moneyExtra"),value:p.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Md,"@4xl:w-1/2"),children:[o(zd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(zd,{title:"Ставка от",value:h,fractionDigits:2,postfix:"%"}),o(zd,{title:"Ежемесячный платёж",value:p.monthlyPayment,postfix:"₽"}),p.benefit>0?o(zd,{title:"Выгода в месяц",value:p.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),nt(a,{isVertical:!0}),qd(i)]})]})})})),xf=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Fa,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Fa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Fa,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),bf=({min:e=0,max:t=0,step:n=1,...a})=>o(vr,{items:[`От ${e} шт`,`До ${t} шт`],step:n,min:e,max:t,...a}),vf=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Nf={text:"₽",key:"rub"},wf=[{key:"transferLegalCountCommission",valueKey:"transferLegalCount",minKey:"minTransferLegalCount",maxKey:"maxTransferLegalCount"},{key:"flTransferSumCommission",valueKey:"flTransferSum",minKey:"minFlTransferSum",maxKey:"maxFlTransferSum"},{key:"cashOutSumCommission",valueKey:"cashOutSum",minKey:"minCashOutSum",maxKey:"maxCashOutSum"},{key:"cashInSumCommission",valueKey:"cashInSum",minKey:"minCashInSum",maxKey:"maxCashInSum"}],Cf=[{key:"flTransferSum",title:"Сумма переводов на счета ФЛ в месяц, ₽",step:5e4},{key:"cashInSum",title:"Внесение наличных через кассу в месяц, ₽",step:5e4},{key:"cashOutSum",title:"Снятие наличных в кассе банка в месяц, ₽",step:5e4}],Sf={tariffName:"Название тарифа",accountServiceFee:"Обслуживание счёта",transferLegalCountCommission:"Переводы Юрлицам и ИП",flTransferSumCommission:"Переводы физлицам",cashOutSumCommission:"Снятие наличных",cashInSumCommission:"Внесение наличных",totalCommission:"Итоговая комиссия"},kf=["accountServiceFee","transferLegalCountCommission","flTransferSumCommission","cashOutSumCommission","cashInSumCommission","totalCommission"],If=({params:e,className:t})=>e?c("div",{className:u(t),children:[o("div",{className:"col-span-2",children:o(Ye,{size:"text-xs",font:"font-medium",children:Sf.tariffName})}),e.map(((e,t)=>o("div",{children:o(Ye,{size:"text-xs",font:"font-medium",children:Sf[e]})},t)))]}):null,Tf=(e,t,n)=>c(Ye,{className:n,children:[e?.toLocaleString()," ",(t??Nf).text]}),Rf=(e,t)=>e.map(((e,n)=>o("div",{children:Tf(e,t)},n))),Ef=({commissions:e,currency:t,isUnfolded:n,handleFold:a,commissionTypes:i,isBest:r=!1})=>{const l=i?.at(-1)??"";return c(dc,{className:"py-4",children:[c("div",{className:"w-full space-y-xl",children:[o(mc,{isUnfolded:n,className:"space-y-xl",children:e.map(((n,a)=>a!==e.length-1&&(({commission:e,currency:t,commissionType:n,index:a})=>c("div",{className:"flex justify-between align-center",children:[o(Ye,{children:Sf[n??""]}),Tf(e,t)]},a))({commission:n,currency:t,commissionType:i?.[a],index:a})))}),c("div",{className:"flex justify-between items-center",children:[o(Ye,{font:"font-medium",children:Sf[l]}),Tf(e.at(-1)??0,t,"text-h2")]})]}),o(cc,{className:"mt-m mx-auto",label:n?"Скрыть":"Подробнее",isUnfolded:n,embedded:!0,labelColorStyle:r?"white":"",onClick:a,short:!0})]})},Df=e=>e?o("div",{className:"absolute block rounded-xl min-h-xs flex justify-center align-center bg-orange py-1 px-2 lg:ml-xl top-[-10px]",children:o(Ye,{size:"text-xs",children:"Рекомендуем"})}):null,_f=d((({tariffName:e,tariffDesc:t,className:n,transferLegalCountCommission:a,flTransferSumCommission:i,cashInSumCommission:r,accountServiceFee:l,cashOutSumCommission:s,totalCommission:d,currency:m,isBest:p=!1,commissionTypes:h,openDepositBtnLink:g})=>{const[f,{toggle:y}]=dn(!1),x={accountServiceFee:l,transferLegalCountCommission:a,flTransferSumCommission:i,cashOutSumCommission:s,cashInSumCommission:r,totalCommission:d},b=kf.map((e=>x[e])),v=Le();return c("div",{className:u(n,"rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl lg:mb-m mb-xl",p?"bg-primary-main text-white relative":"bg-white text-primary-text border border-solid border-gray"),children:[c("div",{className:"col-span-2",children:[o(w,{headingType:v?"h2":"h6",title:e}),o(Ye,{size:"text-xs",children:t})]}),v?Ef({commissions:b,currency:m,isUnfolded:f,handleFold:y,commissionTypes:h,isBest:p}):Rf(b,m),o("div",{className:"flex flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto col-span-2",children:o(Oe,{version:p?"secondary":"primary",className:u("basis-full @lg:basis-auto w-full"),text:"Открыть счёт",href:g,onClick:()=>globalThis?.sessionStorage.setItem("rkoTariffName",e)})}),Df(p)]})})),Pf=d((({items:e=[],currency:t=Nf,openDepositBtnLink:n=""})=>{const a=Le(),i=(e=>e&&0!==e.length?kf.filter((t=>t in e[0])):[])(e)??[],r=i.length+4,l=`lg:grid lg:grid-cols-${String(r)} gap-m lg:px-xl px-3xl order-first lg:mb-m mb-xl`;return c("div",{className:"w-full flex flex-col mt-s",children:[a?null:If({params:i,className:l}),e.map(((e,a)=>o("div",{className:e?.isBest?"order-first":"",children:o(_f,{...e,className:l,currency:t,openDepositBtnLink:n,commissionTypes:i})},a)))]})})),Of=(e,t)=>{if(Array.isArray(e))return e.filter((e=>e?.clientType===t));if(e&&"object"==typeof e){const n={};for(const a in e)if(Object.hasOwn(e,a)){const i=e[a];Array.isArray(i)?n[a]=i.filter((e=>e?.clientType===t)):n[a]=i}return n}return e},Bf=({ranges:e=[],value:t=0,minKey:n="min",maxKey:a="max"})=>{const i=Mf(e,n);let r=0,l=0;for(const e of i){if(l=Number(e.minCommission)??0,!Ff({range:e,amount:t,minKey:n,maxKey:a}))continue;const i=Af({range:e,amount:t,minKey:n,maxKey:a});if(r+=Lf({type:e.commissionType,sliceAmount:i,commissionValue:Number(e.commissionValue),context:{min:Number(e[n]),max:Number(e[a]),amount:Number(t)}}),t<=e[a])break}return r<l&&(r=l),Math.round(r)},Af=({range:e,amount:t,minKey:n,maxKey:a})=>{const i=e[n],r=e[a],l=Math.max(Number(i),0);return Math.min(Number(r),t)-l+1},Ff=({range:e,amount:t,minKey:n,maxKey:a})=>{const i=e[n],r=e[a],l=Number(e.commissionValue);if(null==i||null==r||isNaN(l))return!1;if(t<i)return!1;return Math.max(Number(i),0)<=Math.min(Number(r),t)},Mf=(e,t)=>e.filter((e=>null!=e.commissionValue&&null!=e.commissionType)).sort(((e,n)=>Number(e[t])-Number(n[t]))),Lf=({type:e,sliceAmount:t,commissionValue:n,context:a})=>{const{min:i,max:r,amount:l}=a;switch(e){case"fixedSum":return 0===i||l<=r?n:0;case"percent":return t*n/100;case"fixedAmount":return Math.round(t*n);default:return 0}},zf=e=>{const t={};for(const n of e){const{tariff:e}=n;e&&(t[e]||(t[e]=[]),t[e].push(n))}return t},Vf=nn((({className:e="",title:t,calcSource:n,footnote:r,clientType:s="standard",openDepositBtnLink:d,...m})=>{const[p,h]=a([]),[f,{field:y}]=Nn({transferLegalCount:0,flTransferSum:0,cashOutSum:0,cashInSum:0}),{rows:x}=n??{},b=l((()=>Of(x?.[0]?.tariffs,s)),[x]),v=((e,t,n)=>{const a=t?.[0]?.commissions,{minTransferLegalCount:i,maxTransferLegalCount:r}=im(["minTransferLegalCount","maxTransferLegalCount"],a?.transferLegalCountCommission.filter((e=>e.clientType===n))),{minFlTransferSum:l,maxFlTransferSum:s}=im(["minFlTransferSum","maxFlTransferSum"],a?.flTransferSumCommission.filter((e=>e.clientType===n))),{minCashInSum:o,maxCashInSum:c}=im(["minCashInSum","maxCashInSum"],a?.cashInSumCommission.filter((e=>e.clientType===n))),{minCashOutSum:d,maxCashOutSum:m}=im(["minCashOutSum","maxCashOutSum"],a?.cashOutSumCommission.filter((e=>e.clientType===n)));return{...e,minTransferLegalCount:i,maxTransferLegalCount:r,minFlTransferSum:l,maxFlTransferSum:s,minCashInSum:o,maxCashInSum:c,minCashOutSum:d,maxCashOutSum:m}})(f,x,s),N=Of(x?.[0]?.commissions,s);return i((()=>{if(!N){const e=((e=[])=>e.map((e=>({...e,flTransferSumCommission:0,cashOutSumCommission:0,cashInSumCommission:0,transferLegalCountCommission:0,totalCommission:e.accountServiceFee,isBest:!1}))))(b);return void h(e)}const e=wf.reduce(((e,t)=>(e[t.key]=(({ranges:e=[],value:t=0,minKey:n="min",maxKey:a="max"})=>{const i=Number(t);if(isNaN(i)||i<=0)return 0;const r=zf(e),l={};for(const e in r)l[e]=Bf({ranges:r[e],value:i,minKey:n,maxKey:a});return l})({ranges:N?.[t.key],value:f?.[t.valueKey],minKey:t.minKey,maxKey:t.maxKey}),e)),{}),t=((e,t=[])=>{const n=["flTransferSumCommission","cashOutSumCommission","cashInSumCommission","transferLegalCountCommission"];return t.map((t=>{const{tariffName:a,accountServiceFee:i}=t,r=n.reduce(((t,n)=>(t[n]=e[n]?.[a]??0,t)),{}),l=Object.values(r).reduce(((e,t)=>e+t),0)+i;return{...t,...r,isBest:!1,totalCommission:l}}))})(e,b),n=(e=>{if(0===e.length)return e;const t=Math.min(...e.map((e=>e.totalCommission))),n=e.findIndex((e=>e.totalCommission===t));return e.map(((e,t)=>({...e,isBest:t===n})))})(t);h(n)}),[f,b]),c("div",{className:u(e,"bg-white"),children:[o(Pd,{className:e,title:t,...m,children:o("section",{className:u(Bd,e),children:c("div",{className:Fd,children:[bf({title:"Количество внешних переводов на счета ЮЛ и ИП в месяц, шт",step:1,min:v.minTransferLegalCount,max:v.maxTransferLegalCount,...y("transferLegalCount"),value:v.transferLegalCount}),Cf.map(((e,t)=>o("div",{children:Yd({title:e.title,step:e.step,min:v[`min${vf(e.key)}`],max:v[`max${vf(e.key)}`],...y(e.key),value:v[e.key]})},t)))]})})}),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-4xl pt-0",...m,children:[$f(),p?o(Pf,{items:p,currency:Nf,openDepositBtnLink:d}):o(ka,{position:"static"}),o("div",{className:u(Md),children:qd(r)})]})]})})),$f=()=>o(Ye,{size:"text-h6",font:"font-medium",align:"text-center",className:"block lg:mb-xl mb-m",children:"Расчёты за один месяц по введенным выше параметрам"}),jf=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=hr(e,{normalize:(e=i)=>n&&a?String(gr(Number(qf(e)),n,a)):qf(e),format:lt(l)}),d=r((e=>t&&t(qf(e))),[t]);return o(Ja,{onChange:d,...s,...c})})),qf=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Wf=d((e=>o(jf,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ye,{size:"text-xl",font:"font-light",children:"₽"})})}))),Uf={private:"p2p/registerP2P",business:"b2c/registerB2C"},Kf=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(ta,{maxWidth:"lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Hf=e=>{const t=kn(Kf),n=ia(),a=mn(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=mn(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${ra}/payment/${Uf[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:l.formUrl},a.assign(i)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},Yf={amount:1500},Gf=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=Hf(i),[{amount:s},{field:d,onSubmit:m}]=Nn(Yf,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(Wf,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(Ia,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),Jf=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Xf="relative h-full",Qf={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Zf=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(ny),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:ey(n,{someCardsHighlighted:r}),children:[R(n,a,{className:ty(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),ny(n)?Jf({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ey=(e,{someCardsHighlighted:t})=>u(Xf,t&&(ny(e)?"pt-3xl":"pt-16")),ty=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Xf,"min-w-80",Qf[a],t&&(ny(e)?"pt-16":"pt-3xl"),Ch(n),n&&"h-full"),ny=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ay=nn((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Yh,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?iy(s?.block?.blocks):[],hasBlur:!0,children:Zf({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),iy=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],ry={black:"bg-black",white:"bg-white"},ly=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c($e,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:nt([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ye,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(sy)]}):null,i?c(Ye,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),sy=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ry[e]}`},String(t)),oy=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=Ie()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...Re(i),children:r})})),cy=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],dy=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>cy.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=tt(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),p=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},my(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:nt(m,{className:uy(s??!1,i??!1,n),buttonClassName:p})}),l?o(Ye,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),my=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",uy=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),py=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:p,align:h="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:x=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(oy,{href:i,target:m,className:"h-full",data:Ui(v),children:c($e,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:p,description:n,headlineVersion:"XS",isEmbedded:!0,align:h}),...yt(tt(r)?o(ie,{image:r}):null,y),buttons:d.length?o(dy,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(et,{benefits:f}),s?o(Ke,{__html:s,isDotted:l,itemSize:"list-s"}):null,hy(a,h)]})})}))),hy=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,gy=new pe,fy=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Ye,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Ye,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:nt(i)}):null]},String(t))},yy=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:p=[],options:h,data:f,...y})=>{const x=l((()=>p.map(fy)),[p]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[N,C]=a(!1);i((()=>gy.subscribe("fold",(e=>{e&&h?.parent&&e.parent===h?.parent&&C(e.isUnfolded)}))),[h?.parent]);const S=r((()=>{gy.fire("fold",{type:"fold",isUnfolded:!N,parent:h?.parent})}),[N,h?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Oe,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(dc,{children:[c("div",{children:[b,o(mc,{isUnfolded:N,children:v})]}),p.length>=m?o(cc,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),xy=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:lt()(t)})]}))),by=d((({cashbacks:e})=>{const{mounth:t,year:n}=vy(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(w,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Ke,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(xy,{text:"Баллов в месяц",value:t}),o(xy,{text:"Баллов в год",value:n})]})]})})),vy=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),Ny=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],wy=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],Cy=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Sy(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(Ye,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(Bi,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:ky(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(Xn,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(Bi,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(vr,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Sy=e=>e?.[(new Date).getTime().toString().slice(-1)],ky=(e,t)=>e?[]:t?Ny:wy,Iy=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],Ty={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},Ry=["5","10","15"],Ey=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=Ty,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:p,onChangeCashback:h,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=id("CASHBACK_CATEGORY"),[t,n]=a(Iy);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Iy)}})(),x=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(k,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(Cy,{categories:m,cashback:t,showIncreasedPercents:_y(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:h},String(t.id)))),Dy(d.length,p,y),o(by,{cashbacks:d}),o(xd,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(Oe,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),x]})]})})),Dy=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(Xn,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(Xn,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),_y=(e,t)=>Ry.includes(e.percent.key)||!t.some((e=>Ry.includes(e.percent.key))),Py=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(wl,{step:a,showPercentage:!1})]})})}));var Oy;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND",e.clientFound="CLIENT_FOUND",e.newClient="NEW_CLIENT"}(Oy||(Oy={}));const By=e=>{const t=Vo();return jo((t?"/internal":"")+"/user-data/getTaskStatus","POST",e)},Ay=async e=>{const t=await jo("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},Fy=d((({title:e,interval:t=0,onEnd:n=Hn})=>{const[i,r]=a(t);Ws({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(k,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(Gs,{seconds:i})})]})]})})),My=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Hn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(Fy,{interval:s,onEnd:d}):null]}),o(Ly,{title:n,items:a}),o(Ly,{title:i,items:r,countColumns:!0}),l?o(Ji,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Ly=({title:e,items:t,countColumns:n=!1})=>{const a=Le();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ye,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Vs(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:zy(e)},t)))}):null]})]}):null},zy=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ye,{color:"text-secondary-text",size:"text-l",children:e}),o(Ye,{color:"text-primary-text",size:"text-xl",children:t})]}),Vy=d((()=>o(My,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),$y=d((({onExpire:e})=>{const{statusInfo:t}=ld();return o(My,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),jy=d((()=>{const{statusInfo:e}=ld(),t="courier"===e?.methodObtain;return o(My,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),qy=d((()=>{const{statusInfo:e}=ld();return o(My,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Wy(e),buttonText:"Вернуться на главную"})})),Wy=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:oa(e?.deliveryDate)}]):t},Uy=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ky=d((()=>{const[e,t]=a(Oy.process),{taskId:n}=ld();i((()=>{(async()=>{for(const e of Uy)await Ay({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await By({taskId:n});a&&a?.statusCd!==Oy.process&&(e(),t(a.statusCd))}),[n]);qs(l,3e4);const s=r((()=>t(Oy.rework)),[]);return Hy(e,s)})),Hy=(e,t)=>({IN_PROCESS:o($y,{onExpire:t}),CANCELLED:o(Vy,{}),FAILED:o(Vy,{}),DRAFT:o(Vy,{}),APPROVED:o(qy,{}),PRE_DECISION:o(qy,{}),REVISION:o(jy,{})}[e]||o(jy,{})),Yy=e=>t=>t.filter((e=>e)).map((t=>[Gy(t,e),Zy(t,e),Jy(t,e),Xy(t,e),Qy(t,e)].some(Boolean)?{...t,required:!1}:t)),Gy=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Jy=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xy=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Qy=({condition:e},t)=>e?.name&&e?.values?.every((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Zy=({name:e},t)=>"snils"===e&&!t("snils")&&ex(t),ex=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,tx={...Ju,...Xu},nx=({field:e,inputs:t,params:n})=>t.map(zs(e,n,tx)),ax=({sections:e,field:t,params:n})=>e?.map((({inputs:e=[],columns:a,title:i,condition:r},l)=>{const s=Yy(ix(t))(e),c=[Qy({condition:r},ix(t))?null:$s(i),...nx({field:t,inputs:s,params:n})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return c.length?o("div",{className:u(Vs(a),"grid gap-x-m"),children:c},`section-${l}`):null})),ix=e=>t=>e(t)?.value,rx=({formState:e,inputs:t,productType:n})=>{return Wn(Yy((t=>e[t]))(t),{...Mo,limitedBirthday:Oo(n),dulIssueDate:(i=e.limitedBirthday,Eo(14,i)("Укажите дату выдачи паспорта")),generalSeniority:(a=e.lastJobExperience,yn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!a||Number(e)>=Number(a))))("Укажите количество лет стажа")),beginDate:To(e.limitedBirthday),participantDateRegistration:Ro(e.limitedBirthday),organizationName:Do(e.isDadataOrganization),inn:_o(e.isDadataOrganization)})(e);var a,i},lx=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Ia,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),sx=(e,t,n)=>({...n[e],...t,limitedBirthday:ox(t?.limitedBirthday),dulIssueDate:ox(t?.dulIssueDate),participantDateRegistration:ox(t?.participantDateRegistration),beginDate:ox(t?.beginDate),deliveryDate:ox(t?.deliveryDate)}),ox=e=>{try{return e?new Date(e):void 0}catch(e){return}},cx=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",isDadataOrganization:!1,organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],dx=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...cx(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],mx=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},ux=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:p,organizationPhone:h,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return"RETIREE"===n?.key?{employmentTypeCd:n}:{employmentContractDate:oa(t||"",!0),employmentTypeCd:{key:"WORK"},organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:p,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:Ap({organizationPhone:h&&ca(h)}),participantAddresses:Fp({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},px=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:p,addressMatch:h}=e;return{birthDate:oa(t,!0),birthPlace:a,dulIssueDate:oa(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?oa(d,!0):void 0,homeMatchFlg:h,houseTypeCd:m,participantAddresses:Fp({addressRegistration:u,addressFact:h?u:p}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},hx=e=>e?new Date(e).toISOString().split(".")[0]:"",gx=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:hx(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},fx=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},yx=(e,t)=>{switch(e){case 0:default:return{};case 1:return px(t);case 2:return ux(t);case 3:return Mp(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Fp({addressCourier:t})}:{}})(t)}},xx=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=ld(),d=l((()=>sx(e,c.leadForm,dx)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await op((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...fx(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...yx(i,a)}],...mx(a),...gx(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},bx=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ho();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((e=>rx({formState:e,inputs:s,productType:"creditCard"})),[s]),[m,u,p]=xx({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=Nn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ax({sections:t,field:h}),o(lx,{isSending:p,step:e,onPrevStep:n})]})})),vx=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],Nx=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...vx,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"employerActivities",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"generalSeniority",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"lastJobExperience",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"experience5Years",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"positionOrganization",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],wx=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Cx=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(rh,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=Nx[n],[f,{setTrue:y}]=dn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(Py,{stepsTitles:wx,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Ky,{}):o(bx,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:y},String(n))})]})})})),Sx=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(wl,{step:a,showPercentage:!1})]})})})),kx=d((()=>o(My,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Ix=e=>"11"===e?{name:"Потребительский кредит на рефинансирование",description:"Погашение основного долга по кредиту, иные цели и оплату страхования"}:{name:"Кредит на любые цели",description:"На любые цели"},Tx=d((({onExpire:e})=>{const{statusInfo:t,programId:n}=ld(),a=Ix(n);return o(My,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:a.name},{label:"Цель кредита",description:a.description},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Rx=d((()=>{const{statusInfo:e}=ld();return o(My,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ex=d((()=>{const{statusInfo:e,programId:t}=ld(),n=Ix(t);return o(My,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:n.name},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Dx=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],_x=["CREATE_APPLICATION_SHORT_MESSAGE"],Px=d((()=>{const e=Vo(),[t,n]=a(Oy.process),{taskId:l}=ld();i((()=>{(async()=>{if(e)for(const e of _x)await kp({messageName:e,taskId:l});else for(const e of Dx)await Ay({signalType:e,taskId:l})})()}),[l]);const s=r((async e=>{const t=await By({taskId:l});t&&t?.statusCd!==Oy.process&&(e(),n(t.statusCd))}),[l]);qs(s,3e4);const o=r((()=>n(Oy.rework)),[]);return Ox(t,o)})),Ox=(e,t)=>({IN_PROCESS:o(Tx,{onExpire:t}),CANCELLED:o(kx,{}),FAILED:o(kx,{}),DRAFT:o(kx,{}),APPROVED:o(Ex,{}),PRE_DECISION:o(Ex,{}),REVISION:o(Rx,{})}[e]||o(Rx,{})),Bx=B.YANDEX_METRIKA_ID||"92511315",Ax=[[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"credit_calculator"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditSummPeriodNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Сумма и сроки кредита Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_personal_data"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormPassportNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Паспортные данные Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_work"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormEmployerDetailsNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Данные о работодателе Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_income"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormFamilyStatusNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Семейное положение и доход Кнопка Далее"}}],[{aspectName:"ymReachGoal",params:{yandexId:Bx,targetName:"app_bank_office"}},{aspectName:"snowplowEvent",params:{eventAction:"naturalCreditsReducedPaymentCreditFormBankDepartmentChoosingNext",eventCategory:"naturalCredits",eventValueText:"Кредит со сниженным платежом Выбор отделения Кнопка Далее"}}]],Fx=e=>Ax[e]||[],Mx=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{version:"secondary",disabled:0===e,onClick:t,testId:"back-button",children:"Назад"}),o(Ia,{isLoading:n,testId:"next-button",data:Fx(e),children:a?"Отправить заявку":"Далее"})]})})),Lx={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},zx=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Lx[a?"annuity":"differential"]}},Vx=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},$x=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return px(t);case 2:return ux(t);case 3:return Mp(t);default:return{}}},jx=[{calculator:void 0},...cx(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],qx=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=4===e,c=ld(),d=l((()=>sx(e,c.leadForm,jx)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i){const t=await op((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>{const r=Vo(),l={id:e,...!r&&{profile:{id:n}},roleCd:{key:"BORROWER",value:"Заемщик"},...$x(i,a)};return{sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,...r?{participant:l}:{participants:[l]},...zx(a),...Vx(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}})({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Wx=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=ld();ho();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),p=r((e=>rx({formState:e,inputs:u,productType:"credit"})),[u]),[h,g,f]=qx({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=Nn(h,{formValidator:p,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[ax({sections:t,field:y,params:{calcData:m}}),o(Mx,{step:e,isSending:f,onPrevStep:a})]})})),Ux=[[{columns:1,inputs:[{name:"calculator"}]}],[...vx,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],Kx=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Hx=nn((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(rh,[]);const p=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),h=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Ux[l],y=0===l,[x,{setTrue:b}]=dn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||x?null:o(Sx,{stepsTitles:Kx,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(Px,{}):o(Wx,{step:l,sections:f,programsSource:t,onNextStep:p,onPrevStep:h,onFinish:b},String(l))})]})})})),Yx=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(wl,{step:a,showPercentage:!1})]})})),Gx=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,isOffice:r,...l})=>c(g,{...l,children:[o("div",{className:"flex flex-col md:flex-row items-center",children:o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"})}),o(Jx,{items:n}),r?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(Xn,{onClick:()=>(e=>{window.location.href=e})("https://online.rshb.ru/rshb-mbfl/webmodules/prelogin-zone"),className:"w-full mt-lg",version:"primary",children:"Узнать статус заявки"}),o(Oe,{href:"/natural",text:"Вернуться на главную",version:"primary",className:"w-full mt-lg"})]}):null,!r&&a?o(Oe,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(Oe,{href:"/natural/debetcards#form",text:"Заказать звонок",version:"primary",className:"w-full mt-lg"}),o(Oe,{href:"https://online.rshb.ru/d?l=dcNqSvOE",text:"Выпустить карту в приложении",version:"primary",className:"w-full mt-lg"})]}):null]}))),Jx=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ye,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:Xx(e)},t)))}):null]})]}):null,Xx=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ye,{color:"text-secondary-text",size:"text-l",children:e}),o(Ye,{color:"text-primary-text",size:"text-xl",children:t})]}),Qx=d((()=>{const{leadForm:e}=ld();return o(Gx,{title:`${e?.name} ${e?.middleName}!`,description:"Вам доступно оформление заявки в мобильном приложении банка либо Вы можете обратиться за помощью в контакт-центр Банка по телефону 8 800 100-0-100",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:oa(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),Zx=d((()=>o(Gx,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),eb=d((()=>o(Gx,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),tb=d((()=>o(Gx,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),nb=d((({isOffice:e})=>o(Gx,{title:"Заявка принята",description:e?"Ваша заявка принята. Ожидайте СМС и EMAIL с статусом заявки":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную",isOffice:e}))),ab=d((()=>{const[e,t]=a(Oy.process),{taskId:n,statusInfo:r,programId:l}=ld(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await Ay({signalType:"FIND_PERSON_SIGNAL",taskId:n});await Ay({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Oy.notFound)})()}),[n]),ib(e,o,s)})),ib=(e,t,n)=>({IN_PROCESS:o(eb,{}),NOT_FOUND:o(Zx,{}),CLIENT_NOT_OK:o(Zx,{}),NEW_CLIENT:o(nb,{isOffice:t}),CLIENT_FOUND:o(nb,{isOffice:t}),DBO_CLIENT:o(n?tb:Qx,{}),PRE_DECISION:o(nb,{isOffice:t})}[e]||o(nb,{isOffice:t})),rb=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xn,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Ia,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),lb=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},isMomentDebitCard:!0,currency:"810",codeWord:"",latinName:"",latinSurname:""}],sb=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:hx(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},ob=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},cb=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Fp({addressCourier:t})}:{}})(t);case 1:return px(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},db=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=2===e,c=ld(),d=l((()=>sx(e,c.leadForm,lb)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:Cm[a]},...ob(n),participants:[{id:e,residentOtherCountry:!1,...cb(i,n)}],...mx(n),...sb(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),qo("/user-data/updateUserTaskDebit","PUT",r)),o?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},mb=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ho();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((e=>rx({formState:e,inputs:s,productType:"debitCard"})),[s]),[m,u,p]=db({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=Nn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ax({sections:t,field:h}),o(rb,{step:e,isSending:p,onPrevStep:n})]})})),ub=[[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...vx,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг."}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[],condition:{name:"isMomentDebitCard",values:[!1]}},{columns:2,inputs:[{name:"latinName",condition:{name:"isMomentDebitCard",values:[!1]}},{name:"latinSurname",required:!0,condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения.",condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.",condition:{name:"isMomentDebitCard",values:[!1]}}]}]],pb=["","Персональные данные","Платежная система"],hb=nn((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(rh,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=ub[n],f=0===n,[y,{setTrue:x}]=dn(!1),b=r((()=>{x(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(Yx,{stepsTitles:pb,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(ab,{}):o(mb,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:b},String(n))})]})})})),gb=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,fb=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),yb=1e9,xb={sum:{min:1e4,max:yb},period:3},bb=nn((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=og(xb,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:vb(e)})}),p=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),h=Nb(p);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(eg,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Wf,{label:a?.title,min:500,max:yb,...d("sum",{parse:e=>({min:Number(e),max:yb}),format:({min:e})=>String(e)})}),o(vr,{title:i?.title,items:["От 3 мес","До 5 лет"],list:h,...d("period")})]})}),o(Jh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),vb=e=>Jt((e?.paramsSource?.rateRows||[]).filter(gb).flatMap((e=>fb(e.minMonths,e.maxMonths)))),Nb=e=>Jt(e.flatMap((e=>e||[])).filter(gb).flatMap((e=>fb(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],wb=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Cb=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:wb(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Oe,{version:i?.version,text:i?.text,...i}):null]}))),Sb=`${ra}/region`;function kb(e="Москва"){return be().location??{name:e}}function Ib(e="Москва"){const t=be(),n=r((async()=>{if(!t.location){const n=await Yt(Sb);t.location=n??{name:e}}}),[t,e]);return lr(Sb,n),t}var Tb;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Tb||(Tb={}));const Rb=new Intl.NumberFormat("ru",{style:"currency",currency:Tb.RUB}),Eb=e=>e?Rb.format(e):"",Db="text-m font-light text-secondary-text ",_b=`${Db} text-left`,Pb=`${Db} pl-5xl text-center`,Ob=`${Db} pl-5xl text-right`,Bb={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Ab=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:_b,children:o(Ye,{size:"text-m",children:"Валюта"})}),o("th",{className:Pb,children:o(Ye,{size:"text-m",children:"Купить"})}),o("th",{className:Ob,children:o(Ye,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Fb)})]}))),Fb=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:Bb[t]},width:"24",height:"24"}):null,o(Ye,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ye,{size:"text-h6",children:Eb(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ye,{size:"text-h6",children:Eb(e?.buyExchangeRate)})})]},t)},Mb={icon:"GpsIcon"},Lb=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(gg,{...Mb,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),zb=(e,t,n)=>{const a=Number(Vb(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},Vb=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function $b(e){if(!e)throw new Error("Value should be fulfilled");return e}const jb=e=>t=>{const[,n]=$b(e.find((([e])=>e(t))));return n(t)},qb=e=>jb(e.map((([e,t])=>[e,()=>t])));qb.if=e=>new Wb(void 0,e);class Wb{parent;predicate;unit;get entry(){return[$b(this.predicate),$b(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Wb(this,e)}then(e){return new Wb(this.parent,this.predicate,e)}else(e){return jb([...Ub(this),[()=>!0,e]])}}const Ub=e=>[...e?.parent?Ub(e.parent):[],e.entry],Kb=e=>qb([[e=>e.value!==Tb.RUB&&e.oppositeValue!==Tb.RUB,()=>e.handleConvert(e.value,Tb.RUB)],[e=>e.value===Tb.RUB&&e.oppositeValue===Tb.RUB,()=>e.handleConvert(e.value,Tb.USD)],[e=>e.value===Tb.RUB&&e.oppositeValue===Tb.RUB,()=>e.handleConvert(e.value,Tb.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Hb(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Ja,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(Bi,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const Yb=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Tb.RUB,selectBuy:n?.[0]?.currency?.currency||Tb.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Hb({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:Gb(l,d,n),value:l.inputSell,onChange:e=>Xb(d,n)(e,l.selectSell,l.selectBuy)}),Hb({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:Jb(l,d,t),value:l.inputBuy,onChange:e=>Qb(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(Oe,{text:i.text,version:i?.version,...i}):null]})})),Gb=(e,t,n)=>a=>{t({selectSell:a}),Kb({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Xb(t,n)(e.inputSell,a,i)}})},Jb=(e,t,n)=>a=>{t({selectBuy:a}),Kb({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Qb(t,n)(e.inputBuy,a,i)})},Xb=(e,t)=>(n,a,i)=>{e({inputSell:Vb(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(zb(n,r,a===Tb.RUB)||"")})},Qb=(e,t)=>(n,a,i)=>{e({inputBuy:Vb(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(zb(n,r,a===Tb.RUB)||"")})},Zb=`${ra}/exchangerates`;const ev=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=lr(Zb+`?regionCode=${t}`,Gt);return n||{}}(kb()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=tv(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Tb.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Tb.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o($e,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Ab,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Lb,{address:i?.address})]}),o(Yb,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),tv=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],nv=d((({className:e,items:t})=>{const n=Ie();return o("ul",{className:u("w-full",e),children:t?.map(av(n))})})),av=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...Re(t),children:i||null})},String(a)):null},iv=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:rv(e)}))),rv=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(lv,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),lv=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(dc,{className:e,role:"menuitem",children:[c(Xn,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Ys,{children:[o(gg,{className:"shrink-0",...t.icon}),o(Ye,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(oc,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(mc,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(nv,{items:t.items}):null})]})})),sv=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(ov)}):null)),ov=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ye,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(cv)})]},String(t)),cv=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:dv(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),dv=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${mv(t)}`,children:o(Ye,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},mv=e=>e.replaceAll(/\D/g,""),uv=d((({className:e="",index:t,text:n,...a})=>{const i=Ie(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),pv=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ye,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(uv,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),hv=d((({className:e="",index:t,...n})=>{const a=Ie(),{href:i,target:r,text:l,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),gv=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ye,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(hv,{index:t,...e},String(t))))}):null]}))),fv=nn((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:r,contacts:l,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:p,otherLinks:h=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(iv,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(sv,{items:l}),m?o(Oe,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(dy,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),o("div",{className:"flex gap-m xl:gap-xs flex-wrap",children:h.map(((e,t)=>o(Ji,{className:"text-s font-light",...e},`${e.href}_${t}`)))})]})]}),o(pv,{title:d,links:r}),o(gv,{links:i,license:p})]})})),yv=(e=!1)=>e?{}:{padding:"p-0"},xv={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},bv=[1,2,3,4],vv={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},Nv=nn((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...p})=>{const h=(e=>{const[t,n]=a(e.blocks??[]),r=ia(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",xv[n],e),padding:t,version:s,isTheme:c,...p,children:_({...p,block:{...m,blocks:h},renderProps:wv({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>vv,allowRemoveChild:e=>(e?.blocks??[]).length>5}),wv=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>R(n,{...a,blockDecorator:Cv(a.blockDecorator,i)},{className:u("w-full",Ch(t)),...yv(e)}),Cv=(e,t=0)=>(n,a)=>e?.({...n,render:e=>kv(t)({...n,...e},a)},`wrap_${a}`)??kv(t)(n,a),Sv=e=>Number(e)<5?"":"hidden",kv=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return bv.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(oy,{...r.content?.link,className:u(Sv(e),(l=e,bv.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},Iv=nn((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],p=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Ai,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ji,{className:u("w-full @xl:w-auto"),href:p,target:"_blank",version:n?.version??"primary",data:Ui(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Tv={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Rv=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:p="",ref:h})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Tv[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...Ev(p),...Re(s),ref:h,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Ev=e=>e?{"data-test-id":e}:null,Dv=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=dn(!1),d=hn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(Rv,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),_v={text:"Отправить заявку",version:"primary"},Pv={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},Ov=({onClose:e=Hn})=>o(ta,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(lo,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:_v,link:Pv,onSuccess:e})})})}),Bv=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=Fv,handlers:r,onItemClick:l})=>{const s=Le();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},Av=d((({isActive:e,...t})=>{const n=Ie(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...Re(t?.data),children:a})})),Fv=({item:e,i:t,activeItem:n})=>o(Av,{isActive:e===n,...e},e?.text??String(t));const Mv=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:l="large"})=>{const[c,{setFalse:d,toggle:m}]=dn(!1),p=zv(B.QUICK_ACTIONS??[]),h=Vv(),g=Le(),f=function({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=Di();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),p=s(null),h=s(null),g=Wa(u),f=l?h:g;return i((()=>{if(!a||!p.current||!e?.length)return;const n=p.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(Bv,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),p}({items:p,onClose:d,isOpen:c,onHover:!g,renderDropdownItem:Lv,handlers:h});return i((()=>{if(!g)return f.current?.addEventListener("mouseenter",m),f.current?.addEventListener("mouseleave",d),()=>{f.current?.removeEventListener("mouseenter",m),f.current?.removeEventListener("mouseleave",d)}}),[]),o("div",{ref:f,children:o(Rv,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:l,isGrayBg:!0,version:a,className:u(c?"shadow-blue-gray":"",t),onClick:m})})})),Lv=({item:e,handlers:t,closeDropdown:n=Hn})=>{const a={call:{handler:e=>{t?.call(e),n()},text:"Заказать звонок"},chat:{handler:e=>{t?.chat(e),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},zv=e=>e.map((e=>({text:e}))),Vv=()=>{const e=kn(Ov),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=hn();return{call:t,chat:r((e=>{const t=n.openChatBot;t&&e&&t(e).finally()}),[])}},$v={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},jv=d((({version:e,text:t,mobileText:n,...a})=>{const i=Le()?n:t;return i?o(Oe,{className:u("py-s px-lg font-light whitespace-nowrap",$v["transparent"===e?"transparent":"default"]),...a,children:i}):null})),qv=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=P(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:p,...h}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(hp,{className:"my-2xs",bgColor:e,logo:h,data:p,showTitle:!1})}):Wv(g,l),Uv({version:i,iconVersion:m,internetBankButton:a})]})})),Wv=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(Y,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Uv=({version:e,iconVersion:t,internetBankButton:n})=>c("div",{className:"flex gap-lg items-center",children:[B.QUICK_ACTIONS?o(Mv,{version:e,iconVersion:t}):null,B.CHAT_BOT&&!B.QUICK_ACTIONS?o(Dv,{version:e,iconVersion:t,buttonSize:"medium"}):null,o(jv,{version:e,...n})]}),Kv={"bg-white":"primary",transparent:"transparent"},Hv=nn((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Kv[e],portal:a,logo:i={},...r})=>{const{backwardButton:l,logo:s={}}=r.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...r,children:o("div",{className:"container px-lg py-2xs box-border",children:o(qv,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),Yv=nn((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=P();return o(g,{className:u("relative flex flex-col",xv[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",Ch(l)),...yv(a)}})})}),{childrenTypes:[]}),Gv=nn((e=>o(Yv,{...e})),{childrenTypes:[]}),Jv=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",vg[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Xv=["байт","Кб","Мб","Гб","Тб","Пб"],Qv=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...Re(r),children:[e,t?c(Ye,{size:"text-l",font:"font-light",children:[t," ",Zv(d,m),o(Ye,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Zv=(e,t)=>e||t?o("span",{children:", "}):"",eN=(e,t)=>(n,a)=>{const i=W(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Xv[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?nN(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Qv,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:tN(t),data:n?.data}),o(Ke,{__html:n?.__html})]},String(a))},tN=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,nN=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},aN=d((({href:e,__html:t,target:n,onClose:a})=>c(ta,{maxWidth:"lg",onClose:a,children:[t?o(Ke,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ji,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Xn,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),iN=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=kn(aN),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[tN(i),o(Ye,{font:"font-light",children:e})]}):null})),rN={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},lN=nn((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=P();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",rN[l]),role:"list",children:i.map(sN(d,r))}):null]})})),sN=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?oN(t)(n,a):eN(e,t)(n,a)},oN=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(iN,{...a,icon:e,href:cN(t)?t?.href:t?.attachment?.src}),o(Ke,{__html:t?.__html})]},String(n)):null},cN=e=>"href"in e,dN=nn((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:p="Мобильное приложение",version:h="primary",...f})=>{const y="secondary"===h?"p-m min-w-32":"min-w-24",x=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:h,...f,children:c($e,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:p,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:nt(a,{className:"flex-wrap"}),children:[i?o(Ye,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Ke,{__html:l,itemSize:"list-m"}):null,o(Ye,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),mN="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",uN=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],pN=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],hN=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],gN=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(Fa,{text:i[e],...t(e)},e))),[l,s,d]=fN({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(dc,{children:[o("div",{children:o("div",{className:mN,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(cc,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Xn,{embedded:!0,onClick:n,children:[o(Ys,{children:"Очистить фильтр"}),o(Y,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c(mc,{isUnfolded:m,children:[bN("Драгоценные металлы",s),bN("Специальные возможности",d)]})})]})}):null})})),fN=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?yN(t):xN(t),yN=e=>{const t=[],n=[],a=[];for(const i of e)uN.includes(i.key)&&t.push(i),pN.includes(i.key)&&n.push(i),hN.includes(i.key)&&a.push(i);return[t,n,a]},xN=e=>[e.slice(0,6),e.slice(6)],bN=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(Ye,{children:e}),o("div",{className:mN,children:t})]}):null}),vN=(e,t)=>e&&"underlined"!==t?"primary":"secondary",NN=(e,t,n)=>{const a=vN("all"===t),i=vN("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(Xn,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Xn,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},wN=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Ke,{__html:e,richVersion:n}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(CN)}):null]}):null,CN=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(Ye,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),SN=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Ye,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,kN=()=>{},IN=e=>"all"===e?"block":"hidden",TN=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=kN,renderRemoteWorkplaceCard:l=kN,getBalloon:s=kN,initFilterState:d=Bc,getBalloonRemoteWorkplaces:m=kN,descriptionData:p,title:h})=>{const g=h?.includes("Офис"),[f,{field:y,reset:x}]=Nn(d),{filteredItems:b,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=zc({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[SN(h,w),p?wN(p):null,g&&NN(t,C,S),o("div",{className:u("pb-3xl",IN(C)),children:o(gN,{filters:RN([...t,...i]),field:{field:y,reset:x},onlyOffice:g,labels:Ac})})]}),o("div",{className:"h-[600px]",children:o($c,{children:o(Zc,{points:v,isLoad:n,className:"h-full"})})})]}),c($c,{children:[b.map(r),N.map(l)]})]})})),RN=e=>Object.keys(Bc).filter((t=>e.filter((e=>Fc[t](e))).length)),EN=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:vf(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ye,{size:"text-h4",children:vf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Cc,{color:"green",children:vf(s)})})]}),o(uc,{children:o(sc,{className:"flex-wrap",children:m?.map(((e,t)=>o(ac,{...e},String(t))))})})]},String(d))},DN=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${vf(t)} №${n}`,body:e.toUpperCase()}),_N=[];const PN=async e=>{const t=await Yt(e,{method:"GET"});return Array.isArray(t)?t:_N},ON={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},BN=d((({descriptionData:e,className:t})=>{const n=kb(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=lr(`${ra}/atms?regionCode=${e}`,PN);return{data:t||_N,isLoad:!t&&!n}}(a);return o(TN,{className:t,data:i,isLoad:r,initFilterState:ON,renderCard:EN,getBalloon:DN,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),AN=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ye,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ye,{size:"text-l",children:e})]}):null]})}),o(uc,{children:FN(t)})]},String(n)):null,FN=e=>c("div",{children:[c(sc,{className:"flex",children:[o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Оформление и обслуживание банковских карт"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Инвестиционное и накопительное страхование"})}),o(ac,{label:"Операции для физических лиц",children:o(Ye,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ac,{label:"Режим работы",className:"max-w-none",children:o(Ye,{children:e})})]}),MN=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),LN={branches:[],remoteWorkplaces:[]};const zN=async e=>await Yt(e,{method:"GET"})||LN,VN=d((({className:e})=>{const t=kb(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=lr(`${ra}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,zN);return{data:t||LN,isLoad:!t&&!n}}(n);return o(TN,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:_c,renderRemoteWorkplaceCard:AN,getBalloon:Oc,getBalloonRemoteWorkplaces:MN,title:`Офисы филиала ${t?.name}`})})),$N=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(VN,{}):o(BN,{descriptionData:e})})})),jN=`${ra}/rates`,qN=`${ra}/historyrates`,WN=[[{currencyPair:"Валютная пара",buyRate:0,sellRate:0}]];const UN=()=>Date.now()+9e5,KN=(e,t)=>e?!t?.archiveRates||t?.archiveRates.nextUpdate<=Date.now():!t?.rates||t?.rates.nextUpdate<=Date.now(),HN=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),YN=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ye,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,GN=d((({rows:e})=>{return o(Eh,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,r=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Ye,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${HN(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ye,{size:"text-xl",children:e.data}):null,e?.cols?YN(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),JN=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(Ye,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(GN,{rows:t.rowsData})})})]},a)}))}))),XN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),QN=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Ye,{size:"text-xl",font:"font-light",color:XN(t===n),children:e||t+1})},e)))}):null,t?o(Oe,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),ZN=nn((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(QN,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(JN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(Ye,{size:"text-h6",children:"Данных нет"})})})),ew="border-main-divider lg:border-b w-full py-s lg:py-xl",tw=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl",ew),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(ZN,{...t,onClick:n})}):null]}))),nw="grid grid-cols-3 gap-s",aw=nn((({currencyPair:e="",buyRate:t=0,sellRate:n=0})=>c("div",{className:u("mb-s",nw,ew),children:[o("div",{children:iw(e)}),o("div",{children:t}),o("div",{children:n})]}))),iw=e=>e.replace("_TOD",""),rw=({dateString:e,isArchive:t=!1})=>{const n=new Date(String(e)),a=n.toLocaleTimeString("ru-RU",{timeZone:"Europe/Moscow",hour:"2-digit",minute:"2-digit",hour12:!1}),i=n.toLocaleDateString("ru-RU",{timeZone:"Europe/Moscow",day:"numeric",month:"long",year:"numeric"});return t?c("div",{children:[o(C,{color:"text-secondary-text",font:"font-medium",children:i}),c(C,{color:"text-secondary-text",children:[a," (","МСК",")"]})]}):c(Ye,{color:"text-secondary-text",children:["Курсы действительны на ",a," (","МСК","), ",i]})},lw=d((({isArchive:e=!1,isRatesValid:t,list:n=[],infoMessage:a})=>{const i=t?n.map((e=>e.lastUpdatedAt)).reduce(((e,t)=>String(e)>String(t)?e:t)):"";return c("div",{className:"space-y-xl mb-3xl",children:[i&&rw({dateString:i,isArchive:e}),c("div",{className:u(nw),children:[o(Ye,{font:"font-medium",children:"Валюта"}),o(Ye,{font:"font-medium",children:"Покупка"}),o(Ye,{font:"font-medium",children:"Продажа"})]}),n.length>0?n.map(((e,t)=>o(aw,{...e},String(t)))):o(C,{children:"Ошибка получения данных"}),o(C,{color:"text-secondary-text",children:a})]})})),sw=e=>c(C,{children:["Полный архив вы можете посмотреть ",o(Ji,{href:e,children:"здесь"})]}),ow=d((({href:e,className:t="",infoMessage:n,title:a,isArchive:i=!1,...r})=>{const l=function(e){const t=e?qN:jN,n=e?"archiveRates":"rates",a=be(),i=KN(e,a),{data:r}=lr(i?t:"",Gt);if(i&&r){const e=UN();a[n]={rate:r,nextUpdate:e}}const l=a[n]?.rate;return Array.isArray(l)?l:WN}(i),s=l[0].length>0;return c(g,{className:u("p-6xl space-y-xl",t),defaultPadding:"p-0",...r,children:[o(w,{className:"mb-xl",children:a}),i?c("div",{className:"flex justify-start items-end space-x-xl",children:[o(Zr,{label:"Выберите день",maxDate:new Date}),o(Ia,{className:"h-fit",children:"Показать"})]}):null,l.map(((e,t)=>o(lw,{list:e,isRatesValid:s,isArchive:i,infoMessage:n},String(t)))),e?sw(e):null]})})),cw=[{name:"dadataPartyInnSelect",required:!0},{name:"email",required:!0}],dw={icon:"CopyIcon"},mw=d((({className:e,value:t="",copyIcon:n})=>{const a=r((async()=>{try{await globalThis.navigator.clipboard.writeText(t)}catch{console.log("Ошибка копирования")}}),[]);return c("div",{className:u("relative flex items-center max-w-lg m-auto",e),children:[o("input",{className:u("h-14 border-gray text-ellipsis pr-5xl",Ga),type:"text",value:t,disabled:!0}),o("div",{role:"button",className:"absolute right-3",onClick:a,children:o(ie,{image:n??dw,width:"20px"})})]})})),uw=d((({link:e,copyIcon:t})=>c("div",{children:[o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ye,{size:"text-h6",children:"Скопируйте ссылку и отправьте другу"})}),mw({value:e,copyIcon:t})]}))),pw=nn((({title:e,description:t,link:n="",button:i,copyIcon:s,...d})=>{const[m,u]=a(!1),[p,h]=a(""),g=l((()=>Wn(cw)),[cw]),f=r((async e=>{h(`${n}?utm_source=${e.dadataPartyInnSelect?.text}&utm_mail=${e.email}`),u(!0)}),[]),[,{field:y,onSubmit:x}]=Nn({},{resetOnSubmit:!0,formValidator:g,onSubmit:f});return o(Sn,{className:"container space-y-m col-span-12",title:hw(e,m),...d,children:m?o(uw,{link:p,copyIcon:s}):c("form",{onSubmit:x,children:[c("div",{className:"grid @xl:grid-cols-2 gap-x-m",children:[$s(t),cw.map(zs(y))]}),c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[o(Ye,{children:"Нажимая кнопку, вы подтверждаете согласие с "}),o(Ji,{href:"/privacy-policy",target:"_blank",ariaLabel:"условия передачи данных",children:"условиями передачи данных"})]}),o(Ia,{className:"w-full @xl:w-auto mt-xs",children:i?.text??"Получить ссылку"})]})})})),hw=(e="",t=!1)=>t?"Ваша личная ссылка":e,gw=nn((e=>{const{__html:t,dynamicQueryParamText:n={},dynamicTextSource:a,richVersion:i="",...r}=e,l=ln(n,a?.list,t);return o(g,{defaultPadding:"p-0",...r,children:o(Ke,{__html:l,richVersion:i})})})),fw=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",yw=nn((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Le(),[m,{toggle:p}]=dn(t),h=o(mc,{className:u("gap-lg",fw(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(cc,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:p});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:l,...s,children:c(dc,{children:[n?y:h,n?h:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),xw={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},bw=(e,t,n)=>(a,i)=>{const{button:r}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:vw(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Nw(a),r?.text?o(Oe,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},vw=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=ww(e,r),s=r?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",l),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Cw({step:n,iconVersion:i,i:a,stepVersion:t})})})},Nw=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",xw.description),children:e.description}):null,o(Ke,{__html:e.__html})]}),ww=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Cw=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return tt(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?xw.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Sw=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:r="gray",version:l="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:l,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(bw(d,l,r))}):null,nt(i,{isVertical:!0})]})})),kw=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Iw=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("absolute bg-white p-0 rounded-xl bottom-0 top-32 w-full",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Qn,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Tw(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Rw=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return Tw(we.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Ew=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const Dw=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ye,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(_w,{...e},String(t))))})]}):null,_w=d((({icon:e,...t})=>{const n=Ie(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(Ye,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Pw=(e,t)=>n=>n.name?o(oy,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Ui(e,n.name),children:o(Ye,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ow=(e,t)=>([n,a])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ye,{size:"text-h6",children:n})}),a.map(Pw(t,e))]},n),Bw=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(Ka,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Aw=d((({defaultLocation:e})=>{const t=kb(e),n=Ie(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(oy,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Fw=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ib(t?.default),[s,d]=a(""),m=bs(),u=l((()=>zw(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),p=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,Lw)),[u]),h=r((e=>{i.location=e,n?.()}),[i,n]);return c(ta,{maxWidth:"none",head:Mw(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Ew(e.toLowerCase())(s.toLowerCase())>=.8)).map(Pw(t?.dataSelect,h))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(p.entries()).map(Ow(h,t?.dataSelect))}),Dw(e)]})})),Mw=(e,t,n)=>c("div",{children:[o(Ye,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Aw,{defaultLocation:n?.default}),o(Bw,{onSearch:t,searchTerm:e})]}),Lw=e=>e.name?.charAt(0)??"",zw=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Vw=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=kn(Fw,n),{name:s}=kb(),c=e?.current?.getBoundingClientRect(),d=r((()=>{const e=globalThis?.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px";const n=Q(X.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[X.SITE_URL]);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:s},"*")}),[s]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Iw,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:d,src:t?.src,width:c?.width||0})})})})),$w="burgerMenuDialog",jw=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Hn})=>{const{open:i}=kn(Vw),[l]=Rw(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))($w,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:$w})),[e,n,t,a]);return[s,{toggle:s?a:o}]},qw=[],Ww=nn((({sticky:e,...t})=>{const{menuItems:n=qw}=e??{},i=n.find((e=>"Меню"===e.title)),l=n.filter((e=>"Меню"!==e.title)),d=Math.floor(l.length/2),m=l.slice(0,d),u=l.slice(d),[p,h]=a(-1),[f,y]=a(""),{closeAll:x}=Ce(),b=r((()=>{h(-1),y(""),x()}),[x]),v=Wa(b),N=s(null),[C,{toggle:S}]=jw({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=Ce(),c=r((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return r(((r,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();l({id:"left"===d?n[r].title:a[r].title,dialog:o(Iw,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[r].description||m[r].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[r]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=r((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=r(((e,t)=>{y(t),h(e),x(),k(e,t)}),[x,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Uw(T,"left",{activeIndex:p,currentItemPosition:f})),o(kw,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Uw(T,"right",{activeIndex:p,currentItemPosition:f}))]})})})),Uw=(e,t,n)=>(a,i,r)=>o(kw,{item:a,isActive:r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:l=>{r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||l.stopPropagation(),e(i,t)}},a.title||String(i)),Kw={primary:"bg-white/30",secondary:"bg-main-divider"},Hw={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Yw=d((({count:e,version:t="secondary"})=>{const n=Le(),a=n?"bg-main-divider":Kw[t],i=Hw[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Ye,{size:"text-xs",color:i,children:e})})})),Gw=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},Jw={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Xw={default:"text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Qw={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Zw={default:"bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},eC=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:p,...h}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",Jw[a],n?Zw[a]:Qw[a]),"aria-label":"Список табов",onClick:i,...h,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Xw[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Gw({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Yw,{count:m,version:vN(n,a)})}):null]})})})),tC=d((e=>o(e?.item?.href?nC:aC,{...e}))),nC=d((e=>{const t=Ie(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(eC,{...e,tag:"a",item:i,onClick:a})})),aC=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(eC,{item:e,onClick:a,...n})})),iC="hidden sm:flex absolute z-40",rC={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},lC=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=Mh({itemCount:t?.length||0});return i((()=>sC(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Eh,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:rC[r].item,gap:rC[r].gap,children:t.map((d=n,m=a,p=r,(e,t)=>o(tC,{isActive:e===d,onClick:m,type:p,item:e},String(t))))}),s.canScrollLeft?o(jh,{wcmsIgnore:!0,className:u("left-6",iC,rC[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(qh,{wcmsIgnore:!0,className:u("right-6",iC,rC[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,p})),sC=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},oC={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cC=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(oC[t].wrapper,e),children:o(lC,{className:oC[t].component,tabsType:t,...n})}):null,dC="sticky top-1 z-20",mC=nn((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=pC(n||{}),p=P(),h=po(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),x=fC(m),b=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=b.findIndex((e=>Boolean(e?.selected))),N=b.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===x)),w=x?N:v,[C,S]=a(uC(w)),k=b[C],I=gC(b[C],C),T=r((e=>{const t=b.indexOf(e),n=b[t];S(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),p.replace(`${p.pathname}?${y}`,{scroll:!1})})(e,t)}),[b]);return c(g,{className:u({[dC]:[s,f,!h].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[cC({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[dC]:[s,!f,!h].every(Boolean)}),items:hC(t,b),activeItem:k,tabsType:i,onChange:T}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>D(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(gC)?.filter(Boolean)||[]}),uC=e=>e&&-1!==e?e:0,pC=({__id:e,anchor:t})=>t??e??"tabs",hC=(e,t)=>t?.length?t:e,gC=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",fC=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),yC=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(Ye,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),xC={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},bC=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:xC[t],children:e})}))),vC=d((({className:e="",isOpen:t,onClick:n})=>o(cc,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),NC=e=>e?o("div",{children:o(Ye,{size:"text-h6",children:e})}):null,wC=e=>e?o("div",{className:"text-l font-light",children:o(Ye,{color:"text-secondary-text",children:e})}):null,CC=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ke,{__html:e,isDotted:t,itemSize:"list-m"})}):null,SC=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(vC,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[NC(e),wC(t),CC({__html:n,isDotted:a}),nt(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),kC=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(tw,{tableInner:i,...n,children:[yC(e),t?.length?o(bC,{version:"tariff",children:t.map(((e,t)=>o(SC,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),IC=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),TC=nn((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(kC,{row:e,...l},String(t)))),[p,h]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=dn(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(dc,{children:[c(IC,{children:[p,o(mc,{isUnfolded:f,isOverflowVisible:!0,children:h})]}),o(cc,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(IC,{children:m})})]})})),RC=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?EC():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ye,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?DC(n):null,i?o(Ke,{richVersion:r,__html:i}):null]})]}))),EC=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),DC=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),_C={AdTile:on,ApplicationForm:lo,BankAccountFiltration:mg,BenefitsBlock:fg,BonusBenefitsBlock:bg,ButtonsBlock:Ng,CalculatorBonus:Rg,CalculatorBusinessDeposit:Lg,CalculatorCredit:gm,CalculatorDeposit:sf,CalculatorRefinancing:yf,CardTransfer:Gf,Carousel:ay,CarouselCatalogCard:ly,CarouselRecommendationCard:py,CarouselTariffsCard:yy,DepositFiltration:bb,ErrorBlock:Cb,ExchangeRateTile:ev,Footer:fv,GalleryLayout:Nv,GrantSupport:Iv,Header:Hv,Headline:k,HorizontalLayout:Gv,ImgBlock:Jv,LinkDocs:lN,MobileAppTile:dN,OfficesAtmsMap:$N,ProductBlock:sn,RichTextBlock:gw,RollupItem:yw,StepsBlock:Sw,StickyBottomMenu:Ww,TabsLayout:mC,TariffsTable:TC,TextBlock:RC,VerticalLayout:Yv,ApplicationLeadForm:fh,CreditCardForm:Cx,CreditForm:Hx,DebitForm:hb,CashbackCalculator:Ey,CalculatorRko:Vf,RkoTariffCardsTable:Pf,RatesTable:ow,ReferalForm:pw},PC=ve((()=>{i((()=>{rn()}),[]);const e=hn();qa(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Ki({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const OC="cookie",BC=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=dn();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(OC)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(OC,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ke,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Qn,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function AC(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);qa(globalThis.document,"keydown",t)}const FC=d((()=>{const[e,{close:t}]=Rw(),n=Boolean(e.length);return AC(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),MC=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Tw(we.observable,"popup",{open:t,close:n}),AC(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),LC="header",zC="footer",VC="sticky-footer",$C={},jC=d((({className:e,data:t=$C,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=en(s,l),m=po();PC(),Ib(),oi();const p={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[LC]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:D(i?.[LC],{...p,slotName:LC})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[_({block:t,options:p,extraProps:{className:"scroll-mt-12"}}),!m&&D(i?.[zC],{...p,slotName:zC})]})]}),i?.[VC]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:D(i?.[VC],{...p,slotName:VC})}):null,o(FC,{}),o(MC,{}),m?null:o(BC,{__html:d?.cookieContent?.__html})]})}));Object.assign(jC,{childrenTypes:[],slots:()=>[LC,zC,VC]});e.Blocks=_C,e.ContentPage=jC,e.handlerDecorator=ve,e.joinList=Qh,e.locationNavigator=mn,e.packageVersion="0.14.1053",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=P,Object.defineProperty(e,"__esModule",{value:!0})}));
|