@redneckz/wildless-cms-uni-blocks 0.16.2-credit → 0.16.3-credit

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.
@@ -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=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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},p[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}))),k={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"}},S=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 h=k[n],p={marginTop:h.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-pre-wrap",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function P(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 R=[],E=(e,{key:t,ancestors:n=R,slotName:a=null,extraProps:i,renderProps:r=P,...l})=>{const s=i?(e,t)=>P(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||R,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?E(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const A=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:F,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:z,hasPrefix:V});const $="/api/",j=`${$}v1/storage`,q=[B.CDN,$],U=e=>(t,n)=>{if(W(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 z(V(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||F(e)||q.some(V(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&Y[l],height:d=s})=>{const m=D(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=U(m)(z(B.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[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:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?U(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=D();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:Q(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:Q(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(G,{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(" "),me=e=>me._impl(e);function ue(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])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{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})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=D(),{closeAll:t}=ge();return n=>{const a=U(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Z(J.SITE_URL);ye(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,r)))}))}}}const ye=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(V(e))&&V(e)(n||"/"),xe=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ne(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]})})),ve=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",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({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:a}),s=fe()({onClick:l,href:a,...i}),c=t??o(be,{...s});return o(e?Se:ke,{...s,children:c})})),ke=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,...xe(d),children:m}))),Se=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({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(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{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},Pe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Re=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Pe[n],t),children:e}):null,Ee=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=Te(),v=D(),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&&Ie({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:[Re(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:[_e(h,y),Ae(_({...x,extraProps:{className:"@container-normal"}})),Re(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[De(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),_e=(e,t)=>e||t?c("div",{className:"grow space-y-lg min-w-fit",children:[e,t]}):null,De=e=>u(e?"row-span-2":"@xl:row-span-2"),Ae=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Be=(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,Me=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)),Oe=(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,Fe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Fe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ve=(e,t)=>["label"in e?ze(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Oe(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Le=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?Be(n.icon,t):null,o("div",{children:Ve(n)})]}))),$e=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(Le,{benefitsVersion:t,...e},String(n))))}):null)),je=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(Ve)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?je:$e,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),We=(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(He(n))}):null,He=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ye(i,l),d=Ye(r,l);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ge({...i,iconVersion:c}),appendRight:Ge({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ge=e=>Ue(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ke=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Xe=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(Je)}):null)),Je=({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 sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Fe,{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:[Ke(2)(t)," ",n||"₽"]}):null]},String(a)),Ze=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Qe)}):null)),Qe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Fe,{size:"text-m",font:"font-light",children:e})},String(t)),et={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},tt=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:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const P=x?.src?o(ie,{image:x,imageClassName:C}):null,R=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),E=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ee,{className:e,padding:t,defaultPadding:n,...p?{title:R}:{insetTitle:R},...lt(P,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:We(y),backwardButton:k,...T,children:rt(nt(E,{benefitsVersion:s,isTabularBenefits:c}),at(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,it(g),st(f))})})),nt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(qe,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,at=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Me,{__html:e,richVersion:t,isDotted:n,itemSize:et[a??"L"]}):null,it=e=>e?.length?o(Xe,{priceList:e}):null,rt=(...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},lt=(e,t)=>t?{rightImage:e}:{leftImage:e},st=e=>e?.length?o(Ze,{tags:e}):null;class ot{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof ot?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 ct=()=>!0,dt=(e,t)=>(...n)=>e(...n)&&t(...n),mt=(...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 ut=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&"object"==typeof e&&!ut(e)),pt=e=>e;function gt(e){return e instanceof ot?e._:e}class ft extends ot{from(e){return this.of(e.map(((e=pt)=>([,t])=>e(t))(gt)))}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(ut(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 yt extends ot{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 xt extends ot{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,gt(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 bt extends ot{proto=mt([e=>ut(this._)||"number"==typeof e,()=>ft.prototype],[e=>ht(this._)||"string"==typeof e,()=>xt.prototype],[ct,()=>yt.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 vt=e=>e instanceof ot?e:new bt(e),Nt=e=>{const t=(t,...n)=>gt(e(vt(t),...n));return t.fn=e,t},wt=[],Ct=e=>e instanceof Function?e:t=>e===t,kt=e=>(t,n,a=wt)=>vt(t).entries().reduce(((t,[n,i])=>kt(e)(i,t,a.concat(n))),e(n,[a,vt(t)])),St=Nt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?St(e.get(a),[i,n]):n)})),It=Nt(((e,t)=>t.reduce(St.fn,e))),Tt=e=>kt(((e,[t,n])=>Pt(n)?[...e,[t,gt(n)]]:e))(e,[]),Pt=e=>0===e.size();Nt(((e,t=wt)=>t.reduce(((e,t)=>e.get(t)),e)));const Rt=Nt(((e,[t,...n])=>n.length?e.set(t,Rt(e.get(t),n)):e.filter((([e])=>e!==t)))),Et=(_t=["$ref"]).map(((e,t)=>n=>Ct(e)(n[t+n.length-_t.length]))).reduceRight(dt,ct);var _t;const Dt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(At,e),At=mt([ut,(e,t)=>e[parseInt(t,10)]],[ht,(e,t)=>e[t]],[ct,pt]),Bt=(e,t)=>((e,t={})=>n=>It(t,Tt(n).map((t=>e(t)))))((([e,n])=>{return Et(e)?[(a=e,a.slice(0,-1)),Dt(t(n),n)]:[e,n];var a}))(e),Mt=e=>Tt(e).filter(((e=pt)=>([t])=>e(t))(Et)),Ot=e=>{return t=Mt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Ft(e,t){try{return e?await zt(e,t):null}catch(e){console.error(e)}return null}const zt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Vt=e=>[...new Set(e)],Lt={},$t=["/portal-resources"],jt=(e,t)=>Bt(e,(e=>t?.[e])),qt=(e,t)=>{const n=Ot(e),[r,l]=a({});return i((()=>{Ut(n).then(l)}),[n.join()]),n.length?jt(e,{...t,...r}):e},Ut=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Vt(e).filter((e=>!$t.some((t=>e.startsWith(t))))).map((async e=>[e,Lt[e]||=await zt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ot(e)));return i.length?Ut(i,a):a}return t};function Wt(e,t={}){const n=d((t=>{const n=qt((({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 Ht=Wt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(tt,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Yt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Gt(0,t?.length)),[t]),a=t?.[n];return a?o(Ht,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Gt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Kt=(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}`}},Xt=e=>e?.replace(/[^+\d]/g,""),Jt="/api/v1";const Zt=e=>e?{phone:Xt(e)}:{},Qt=(e,t="birthday")=>e?{[t]:Kt(e)}:{},en=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),tn=(e,t=!0)=>({[t?"email":"mail"]:e}),nn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Xt(e)}:{},an=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function rn(){return rn._impl()}rn._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),rn.setup=e=>{rn._impl=e};const ln="rshb-query-params";function sn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(ln)||"";return e&&globalThis.sessionStorage?.setItem(ln,e),e}const on=e=>{const t=e.target?.closest("a"),n=rn();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=sn();if(!M(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 cn(){return cn._impl()}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}]}cn._impl=()=>({forwardQuery:on}),cn.setup=e=>{cn._impl=e};const mn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],un=e=>!e?.length,hn=e=>t=>n=>e(n)?[]:[t],pn={},gn=[];const fn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function yn(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=fn(i,r)?i:r;return!fn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=dn(!1),f=s({}),[y,{isValid:x,errors:b}]=function(e,t){const n=l((()=>t?.(e)??pn),[t,e]),a=l((()=>mn(n)(e)??gn),[n,e]),i=un(a);return[n,{isValid:i,errors:a}]}(m,n),v=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||f.current?.[String(e)],s=t?.validator??y[e],o=l&&s?s(r):[];return{value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,y,u]),N=r((e=>{f.current=e,u(e)}),[u]),w=r((()=>{f.current={},g(),u(e)}),[e,u]),C=r((e=>{e.preventDefault(),x?(t&&w(),d?.(m,e)):p()}),[t,m,x,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const xn=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 bn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}function vn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Nn(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return vn(globalThis.document,"click",n),t}const wn=({label:e,errors:t})=>e&&t?`${e}*`:e,Cn=()=>{},kn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Sn=e=>e?kn:"border-error",In=e=>e?o(Fe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Tn=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:x=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),k=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const S=b?"pr-3xl":"",I=Sn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[In(d),y?o("textarea",{className:u("block resize-y min-h-24",Pn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:x,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Pn,S,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:x,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e)]}),b]})})),Pn="w-full border rounded-md text-primary-text outline-none p-m",Rn=e=>o("div",{className:"h-6",children:e?o(Fe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),En=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=Cn,...x})=>{const b=Nn(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(_n(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:b,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(Tn,{type:l||"text","aria-label":t,label:wn({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:Dn({placeholder:d,errors:i,label:t}),value:n,...x})}),Rn(a)]})})),_n=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,Dn=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,An=d((e=>{const[t,{setFalse:n,setTrue:a}]=dn();return o(En,{isOpen:t,onOpen:a,onClose:n,...e})})),Bn=e=>e?.text||e?.key||"",Mn=()=>ue(pe.emitter,"popup"),On=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Fn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:r})=>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:On(t,a).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&&i(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const zn=d((({className:e,label:t,options:n=[],value:l,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:y})=>{const[x,{setFalse:b,setTrue:v}]=dn(),[N,w]=a(""),C=$n(g,n.length),k=x&&!C,S=r((()=>{C||v()}),[C]),I=r((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:l,onClose:c,iconVersion:d}){const m=Mn(),u=r((()=>{m.close(),c&&c()}),[c]),h=r((e=>{u(),l&&l(e)}),[u,l]),p=s(null),g=Nn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(Fn,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,h]),p}({isOpen:x,options:n,value:l,query:N,onChange:y,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[In(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Ln(m,d,C)),onClick:k?I:S,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(l)||h}),Vn(k,f)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Tn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Vn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Ln=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),$n=(e,t)=>e||0===t,jn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(zn,{...i,valid:!n,label:wn({label:t,errors:a})}),Rn(n)]}))),qn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Un=d((({field:e,input:t})=>o(jn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:qn,...e(t?.name??"")}))),Wn=(e="")=>Boolean("trade"===e||"all"===e),Hn=e=>null!=e,Yn=new Map,Gn=(e,t=Yn)=>n=>{const a=Xn(n),i=t.get(a);if(a&&Hn(i))return i;const r=e(...n);return a&&Hn(r)&&t.set(a,Promise.resolve(r)),r},Kn=e=>Boolean(e?.every((e=>Array.isArray(e)?Kn(e):!e||"string"==typeof e))),Xn=e=>Kn(e)?e.toString():"",Jn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Zn(e,t,{fallback:n,cache:r}={}){const s=l((()=>Qn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Hn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Gn(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&Jn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Qn(e){return Array.isArray(e)?e:e instanceof Function?Qn(e()):[e]}const ea=`${Jt}/branches`,ta=[];const na=async e=>await Ft(e,{method:"GET"})||ta;function aa(e=!1){const{data:t}=Zn(`${Jt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,zt);return Array.isArray(t)?t:[]}const ia=(e="")=>"ULTRASERVICE"===e,ra=d((({field:e,input:t,params:n})=>{const a=ia(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?aa(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Zn(e?`${ea}?regionCode=${e}`:null,na);return t||ta}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(jn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),la=(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}},sa=(e,t,n)=>Math.max(t,Math.min(e,n));function oa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ca({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=oa(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const da=1,ma=100,ua=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:da),max:s=(i.length?i.length-1:ma),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=la(e,{normalize:(e=0)=>i.length?ha(i)(e):sa(e,l,s),format:Ke()}),f=r((e=>{p&&p(oa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Fe,{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",kn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),ca({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),pa(a)]})})),ha=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ga=["От 1 000 ₽","До 1 000 000 000 ₽"],fa=d((({field:e,input:t})=>o(ua,{title:"Сумма, ₽",items:ga,min:1e3,max:1e9,...e(t?.name??"")}))),ya=d((({field:e,input:t})=>o(An,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),xa="client",ba=[{key:xa,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],va=d((({field:e,input:t})=>o(jn,{label:"Тип обратившегося",...t,options:ba,...e("applierType")}))),Na=d((({field:e,input:t})=>o(An,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),wa=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=Ca(t,e),c=ka(t,r,l);u.push(o("td",{children:o("div",{className:Sa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ca=(e,t)=>t&&e.toDateString()===t.toDateString(),ka=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Sa=(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"),Ia=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ta=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=Cn})=>{const{firstDayOfWeek:s,totalDays:d}=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:Ia.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:wa({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),Pa=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ra(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ea),r=a.map(((e,t)=>Da(e)?a.slice(0,t).filter(Da).length:-1)),l=a.map(((e,t)=>_a(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Ea=e=>"_"===e,_a=e=>/\d/.test(e),Da=e=>Ea(e)||_a(e),Aa=1940,Ba={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ma=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{Fa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),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",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ra(t,"__.__.____"))},onBlur:()=>{Oa(p)?Fa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(G,{className:"mr-s",...Ba})]})})),Oa=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Aa&&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},Fa=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Oa(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))}},za=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(Ma,{onChange:a,disabled:l,onClick:e,value:t&&Kt(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Va=Pa.map((e=>({key:e}))),La=Array.from({length:(new Date).getFullYear()-Aa+1},((e,t)=>Aa+t)).reverse().map((e=>({key:String(e)}))),$a=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},ja=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},qa={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ua={className:"min-w-32",iconVersion:"black",isBorder:!1},Wa=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=dn(!1),[y,x]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:k,handleSelectYear:S,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:P,ref:R}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Nn(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(Pa.indexOf(e));const t=$a(l,Pa.indexOf(e));ja({maxDateOfMonth:t,selectedYear:l,selectedMonth:Pa.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:Va,yearsOptions:La,ref:c}})({onYearSelect:v,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:y,showCalendar:p,onChange:h,value:n}),E=((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})(R,370);return c("div",{className:u("space-y-xs",e),ref:R,children:[In(t),c("div",{className:"relative",children:[za({handleChangeVisibleCalendar:P,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":E}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...qa,className:"-rotate-90 cursor-pointer"})}),o(zn,{onChange:k,value:{key:Pa[y]},options:I,...Ua}),o(zn,{onChange:S,value:{key:String(b)},options:T,...Ua}),o("div",{className:"my-auto",onClick:C,children:o(G,{...qa,className:"rotate-90 cursor-pointer"})})]}),o(Ta,{today:n,currentMonth:y,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),Ha=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Wa,{label:wn({label:t,errors:a}),valid:Boolean(!n),...i}),Rn(n)]}))),Ya=d((({field:e,input:t})=>o(Ha,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),Ga=d((({field:e,input:t})=>o(An,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ka=d((({field:e,input:t})=>o(An,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),Xa=d((({field:e,input:t})=>o(Ha,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Ja=d((({field:e,input:t})=>o(An,{label:"Электронная почта",...e(t?.name??""),...t}))),Za=[{key:"ULTRASERVICE",text:"Ультра"}],Qa=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ei=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ti=d((({field:e,input:t})=>o(jn,{label:"Способ получения ответа",options:ei,...e(t?.name??"")}))),ni=d((({field:e,input:t})=>o(An,{label:"ФИО",...e(t?.name??""),...t}))),ai=d((({field:e,input:t})=>o(An,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),ii=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)}))}))),ri=[{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"}],li=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(ii,{paths:ri,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",oi(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":di(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ci(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,si(n)]})})})),si=e=>e?o("div",{className:"ml-s",children:o(Fe,{size:"text-l",font:"font-light",children:e})}):null,oi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ci=(e=!1)=>e?"radio":"checkbox",di=(e=!1)=>u("rounded border",{"bg-primary-main":e}),mi=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(li,{text:t,value:n,disabled:i,onChange:l},a),Rn(r)]}))),ui=d((({field:e,input:t})=>o(mi,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),hi=`${Jt}/outservice`,pi=[];async function gi(){const e=await Ft(`${hi}/outserviceregions`);return e&&Array.isArray(e)?e:pi}const fi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=Zn("outServiceRegions",gi),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(jn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),yi=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,xi=d((({field:e,input:t})=>o(An,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),bi=d((({field:e,input:t})=>o(An,{label:"Имя",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),vi=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(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ni=d((({field:e,input:t})=>Wn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),wi=d((({field:e,input:t})=>o(An,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Ci=e=>"_"===e,ki=e=>/\d/.test(e),Si=e=>Ci(e)||ki(e),Ii=[..."+7 (___) ___-__-__"],Ti=Ii.findIndex(Ci),Pi=Ii.map(((e,t)=>Si(e)?Ii.slice(0,t).filter(Si).length:-1));function Ri(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>ki(e)?e:t.charAt(Pi[n])||e)),a=Pi.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Ti,a)):n).join("")}const Ei=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Ri(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Tn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),_i=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ei,{"aria-label":t,label:wn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Rn(a)]}))),Di=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(_i,{label:"Телефон",disabled:yi(e,t,n),...e(n),...t})})),Ai=d((({field:e})=>Wn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Bi=Wt((({field:e,input:t,source:n})=>o(jn,{placeholder:"Выберите продукт",label:"Продукт",options:Mi(n?.productList),...e(t?.name??"")}))),Mi=e=>(e??[]).map((e=>({key:e,value:e}))),Oi=`${Jt}/regions`,Fi=[];function zi(e=Oi){const{data:t}=Zn(e,zt);return Array.isArray(t)?t:Fi}const Vi=`${Jt}/outservice/outserviceregions`,Li=d((({field:e,input:t,params:n})=>{var a;const i=zi((a=n?.typeForm,"OUTSERVICE"===a?Vi:void 0));return o(jn,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),$i=d((({field:e,input:t})=>{const n=aa(!0),a=l((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(jn,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),ji=d((({field:e,input:t})=>o(An,{label:"ФИО представителя",...t,...e("representativeName")}))),qi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Ui=/^[а-яё-]*$/i,Wi=(e="")=>Ui.test(e),Hi=hn((e=>null!=e&&""!==e)),Yi="Некорректно заполненное поле",Gi=e=>Hi(e??Yi),Ki=e=>hn((e=>e?.key&&""!==e?.key))(e??Yi),Xi=e=>hn((e=>"string"==typeof e&&e.length>1&&Wi(e)))(e??Yi),Ji=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Zi=e=>hn(Ji)(e),Qi=hn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),er={fullName:Gi(),addressBranch:Ki(),desiredMeetingDate:Gi(),product:Gi(),localities:Gi(),partnerComments:Gi(),collectionCount:Gi(),acquiringType:Ki(),serviceType:Ki(),annualRevenue:Gi(),feedbackMethod:Ki(),serviceDirection:Ki(),secondaryPhone:Zi("Укажите номер телефона"),region:Ki(),situationDescription:Gi(),sufferedFrom:Gi(),applierType:Gi(),surname:Xi("Укажите свою фамилию на кириллице"),name:Xi("Укажите своё имя на кириллице (без сокращений)"),middleName:Xi("Укажите своё отчество на кириллице"),birthday:Gi("Укажите дату рождения"),phone:Zi("Укажите номер телефона"),email:(tr="Укажите электронную почту",hn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(tr)),inn:(e=>hn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Gi(),typeForm:Gi(),consentToReceiveMaterials:Qi,consentDataProcessing:Qi};var tr;const nr=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...er,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(ar(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(ar(a)).filter(ir(e)).map((({name:e})=>[e,a[e??""]]))):r},ar=(e={})=>({name:t})=>Boolean(e[t??""]),ir=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),rr=d((({field:e})=>{const t=e("secondaryPhone");return o(_i,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?qi(t,er.secondaryPhone):t})})),lr=d((({field:e,input:t})=>o(jn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Qa,...e(t?.name??"")}))),sr=d((({field:e,input:t})=>o(An,{label:"Описание ситуации",...t,...e("situationDescription")}))),or=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],cr=d((({field:e,input:t})=>o(jn,{label:"Пострадал в",...t,options:or,...e("sufferedFrom")}))),dr=d((({field:e,input:t})=>o(An,{label:"Фамилия",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),mr=["От 1 мес","До 15 лет"],ur=d((({field:e})=>o(ua,{title:"Срок, месяцев",items:mr,min:1,max:180,...e("term")}))),hr=d((({field:e,input:t})=>o(jn,{label:"Тип обслуживания",options:Za,...e(t?.name??"")}))),pr={horizontal:"@lg:flex-row",vertical:""},gr=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(Fe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",pr[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(li,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),fr=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],yr=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(gr,{className:"whitespace-normal",orientation:"horizontal",items:fr,...e(t?.name??"",{onChange:n})})})})),xr=d((({field:e,input:t})=>o(li,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const br={$ref:"/wcms-resources/outservice-productlist.json"},vr={fullName:ni,addressBranch:ra,desiredMeetingDate:Xa,product:e=>o(Bi,{...e,source:br}),localities:fi,isClient:ui,partnerComments:wi,collectionCount:Ga,acquiringType:Un,onlineCheckout:Ni,posTerminal:Ai,serviceType:hr,term:ur,amount:fa,annualRevenue:ya,vedTypes:yr,feedbackMethod:ti,serviceDirection:lr,bankEmpolee:Na,secondaryPhone:rr,applicationDate:e=>o(An,{label:"Дата и время обращения в Банк",...e}),region:e=>ia(e?.params?.typeForm)?o($i,{...e}):o(Li,{...e}),consentToReceiveMaterials:xr,sufferedFrom:cr,situationDescription:sr,representativeName:ji,applierType:va,surname:dr,name:bi,middleName:xi,birthday:Ya,phone:Di,email:Ja,inn:ai,comment:Ka},Nr=(e,t,n={})=>(a,i)=>{const r={...vr,...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("div",{children:o(r,{field:e,input:a,params:t})},i):null},wr=e=>2===e?"@xl:grid-cols-2":"",Cr=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Fe,{size:"text-h6",children:e})}):null,kr={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")},Sr=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Ir=u("bg-main-gray text-main-disabled cursor-not-allowed"),Tr=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Cn})=>{const y=r("tab"!==c?me(f):f,[c,f]),x=l((()=>xe(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[kr[n]]:!s&&!i,[Sr]:i,[Ir]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...x,onClick:y,children:p})})),Pr=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(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Rr=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Pr,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Er=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",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(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Tr,{type:"button",onClick:n,children:"Хорошо"})]})})})),_r=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:h,...p}=e,g=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Wn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,f={...p,...Mr(o),...Br(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Ar(m?.text,u),...Dr(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Dr=e=>e?.key?{isClient:e?.key===xa}:{},Ar=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Br=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Mr=e=>e?{vedTypes:Object.fromEntries(fr.map((({id:t})=>[t,t===e])))}:{},Or={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:qn[0],serviceType:Za[0],feedbackMethod:ei[0],serviceDirection:Qa[0],vedTypes:fr[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Fr=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","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),zr=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Tr,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(Fr,{blur:!0,size:"small"}):null,n]}))),Vr={primary:kr.primary,secondary:kr.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:kr.secondary,transparent:"","":""},Lr=d((e=>{const t=fe(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=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",{[Vr[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:p,...xe(m),children:h??$r(r,l)})})),$r=(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,jr=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Fe,{children:e}):null,t?o(Lr,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),qr=(e,t,n)=>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(li,{...e}),o(jr,{link:t})]}),Rn(qi(e,Qi).error)]}):o(jr,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(zr,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Ur={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:r,birthday:l,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Jt}${g?"/lead":"/sendcorporatelead"}`,y={typeForm:n,...en(a,g),...tn(r,g),...Zt(i),...Qt(s,"desiredMeetingDate"),...g?Qt(l):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...nn(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(y)});return e?.ok?await e.json():null}catch(e){return null}}},Wr=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),y=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Or[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),x=l((()=>nr(f)),[f]),b=bn(Er),v=cn(),N=r((async(e,t)=>{const a=_r({...e,...m}),i=Boolean(await Ur.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&an({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:k}]=yn(y,{resetOnSubmit:!0,formValidator:x,onSubmit:N}),S=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(xn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:k,children:[a.map(((e,t)=>c("div",{className:u(wr(e.columns),"grid gap-x-m"),children:[Cr(e.title),(e?.inputs||[])?.map(Nr(C,{typeForm:n}))]},`section-${t}`))),qr(S?C("consentDataProcessing"):void 0,s,i)]}),h?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]})})),Hr="Некорректно заполненное поле",Yr="Укажите регион, город/населенный пункт, улицу, дом",Gr=/^[\u0400-\u04FF-\s]+$/u,Kr=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),Xr=()=>hn(Kr)(Yr),Jr=e=>hn((e=>"string"==typeof e&&e.length>1&&Gr.test(e)))(e??Hr),Zr=e=>hn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Hr),Qr=(e,t)=>hn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Hr),el=e=>hn((({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),tl=e=>hn((e=>"string"==typeof e&&6===e.length))(e),nl=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){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},al={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,errorMessage:"Допустимый возраст заёмщика - от 21 года"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},il=e=>el(al[e]),rl={processPersonalDataFlg:Qi,consentProviderFlg:Qi,consentInformFlg:Qi,consentPfrFlg:Qi,consentOthersFlg:Qi,consentFATCA:Qi},ll={addressCourier:Xr(),paymentSystem:Gi("Укажите тип платежной системы"),currency:Gi("Укажите валюту"),cardCategory:Gi("Укажите категорию карты"),codeWord:(e=>hn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Wi(e)))(e??Hr))("Необходимо ввести кодовое слово"),confirmationIncome:Ki(),methodObtain:Gi(),deliveryDate:(e=>hn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},sl={organization:Ki("Выберите тип организации"),organizationAddress:hn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(Yr),organizationPhone:Zi("Укажите номер телефона"),organizationName:Gi("Укажите наименование организации"),legalForm:Gi("Укажите ОПФ"),generalSeniority:Zr("Укажите количество лет стажа"),lastJobExperience:Zr("Укажите стаж на последнем месте работы"),experience5Years:Zr("Укажите общий стаж за последние 5 лет"),jobsNumber:Zr("Укажите количество мест работы за последние 5 лет"),beginDate:Gi("Укажите дату заключения трудового договора"),addressFact:Xr(),addressRegistration:Xr(),addressRetail:Ki("Выберите адрес банка"),addressMatch:Gi(),sex:Gi("Укажите свой пол"),birthPlace:Gi("Укажите место рождения"),education:Ki("Выберите ваше образование"),housing:Ki("Выберите тип жилья"),amountWorkers:Ki("Выберите информацию о количестве сотрудников"),employment:Ki("Выберите информацию о трудоустройстве"),employerActivities:Ki("Выберите вид деятельности организации"),employerOrganization:Ki("Выберите вид организации"),positionOrganization:Ki("Выберите вашу должность"),familyStatus:Ki("Выберите семейное положение"),familyMembers:Qr(2,"Укажите количество членов семьи"),children:Qr(2,"Укажите количество детей"),dependents:Qr(2,"Укажите количество иждивенцев"),totalIncome:Qr(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Qr(10,"Укажите сумму обязательных выплат"),snils:(e=>hn(nl)(e))("Некорректный номер СНИЛС"),conscription:Gi(),armyIdFlg:Qi,dulSerie:(e=>hn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:tl("Укажите номер паспорта"),dulSubdivisionCode:tl("Укажите код подразделения"),dulIssuedBy:Gi("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Gi("Укажите дату регистрации"),retirementIncome:Gi(),otherIncome:Gi(),wages:Gi(),mandatoryPayments:Gi(),bankruptcyFlg:Gi(),shareholderFlg:Gi(),legalEntityName:Gi(),bankEmployeeCode:Gi(),partInBusiness:Gi(),regionRetail:Ki("Выберите регион"),latinSurname:Gi("Укажите фамилию"),surname:Jr("Укажите свою фамилию на кириллице"),name:Jr("Укажите своё имя на кириллице"),middleName:Jr("Укажите своё отчество на кириллице")},ol={...sl,...ll,...rl},cl={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var dl;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(dl||(dl={}));const ml=async(e,t,n)=>{try{return(await ul(e,t,n)).json()}catch(e){return console.error(e),null}};async function ul(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...hl()},credentials:"include",body:n?JSON.stringify(n):null})}const hl=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},pl=d((({onChangeEsiaStatus:e})=>{const t=rn(),n=r((async()=>{try{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},ml("/esia/getLink","POST",n));e?.link&&t.assign(e.link)}catch{e(dl.Error)}var n}),[]);return c("div",{className:"flex gap-lg items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex flex-col justify-around w-full",children:[o("p",{className:"mb-m text-xl",children:"Заполните данные через Госуслуги"}),c("ul",{className:"list-disc list-inside mb-4xl",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block mb-xl self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Tr,{type:"button",onClick:n,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),gl=e=>e?.value||"",fl=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=gl}=e,l=(s=r,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=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(l);return c},yl={url:"suggest/address"},xl={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=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:yl,addressFact:yl,organizationAddress:yl,addressCourier:yl},bl=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)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function vl({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Mn(),y=xl[n],x=r((()=>{h.current=t,f.close()}),[t]),b=r((e=>{x(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await fl({url:y.url,responseItemHandler:y.responseItemHandler,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.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(bl,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,b]),v}const Nl=d((({value:e="",onChange:t=Cn,onDaDataChange:n,name:a="",daDataQueryPrefix:i,dadata:r=!1,...l})=>{const[s,{setFalse:c,setTrue:d}]=dn(),m=vl({isOpen:s&&r,name:a,value:e,daDataQueryPrefix:i,onChange:t,onDaDataChange:n});return o(En,{value:e,onChange:t,inputRef:m,isOpen:s,onOpen:d,onClose:c,...l})})),wl=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Cl(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(Nl,{disabled:yi(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Cl=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}),kl=Wt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Cl(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Nl,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Sl=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?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Nl,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Il=d((({field:e,input:t})=>o(mi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Tl=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:Pl({textItems:r,subText:t,children:n,isPhone:a,...i})})),Pl=({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(Fe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Rl(n,s),i?o(Fe,{color:a,size:"text-m",children:i}):null]}),Rl=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Fe,{size:"text-l",children:t?o("a",{href:`tel:${El(e)}`,children:e.trim()}):e.trim()},String(n)))),El=e=>e.replace(/\D/g,""),_l=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}))),Dl=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Al=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Bl=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(Tr,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Dl,{children:a}),o(Al,{isUnfolded:t,iconVersion:i?"color":""})]}))),Ml=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Ol=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),r=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=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:r,children:n})})})),Fl=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Ml,{className:"block sm:hidden",children:[o(Ol,{isUnfolded:t,children:e}),o(Bl,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),zl=e=>{const t=Ll(e);return o(Tl,{label:"Режим работы",value:t,className:"max-w-none"})},Vl=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Ll=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[Vl({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Vl({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},$l=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],jl=e=>$l.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??"")}}))),ql=e=>{if(!e)return null;const t=Ul(e);return c(_l,{className:"border-none",children:[o(Tl,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Wl)})}),o(Tl,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]})},Ul=e=>{const t=$l.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},Wl=({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(Fe,{size:"text-xs",children:e})},String(n)),Hl=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Tl,{label:"Валюта",value:e.currency}):null,t?o(Tl,{label:"Купить",value:String(t)}):null,n?o(Tl,{label:"Продать",value:String(n)}):null]},String(a)),Yl={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"}},Gl=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",Yl[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(Fe,{size:"text-m",color:Yl[n].text,children:t})]}))),Kl=(new Date).getDay(),Xl=e=>{const[t]=e?.slice(Kl-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(Gl,{color:"green",children:i}):null,n&&r?o(Gl,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Gl,{color:"red",children:"Выходной"})},Jl=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Zl=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Tl,{label:e,value:t&&n?n:"",subText:Jl({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),Ql=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,es=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ts=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ns=(e,t)=>{if(!e.workSchedule)return null;const n=jl(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(Fe,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e.address})]}):null]}),Xl(n)]}),o(Fl,{children:as(e)})]},String(t))},as=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=jl(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(_l,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Tl,{label:"Факс",value:t,isPhone:!0}),o(Tl,{label:"Телефон филиала",value:e,isPhone:!0}),o(Tl,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Tl,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Tl,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Tl,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(_l,{children:o(Tl,{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(Zl)})})}):c(_l,{children:[o(Tl,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Wl)})}),zl(d)]}),l?.businessScheduleVisibleTag?ql(l?.businessScheduleDescription):null,s?.currencies?.length?o(_l,{className:"flex-wrap",children:s?.currencies?.map(Hl)}):null]})},is=({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=jl(e),n=e?Ll(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ql(n):ts(n,a):es(n):""})(n)}`;return{header:a,body:r}},rs={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},ls={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ss={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)},os=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ss[t](e)))))},cs=()=>{},ds=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=cs,getBalloonRemoteWorkplaces:i=cs})=>{const[r,s,o,c]=l((()=>{const r=os(e,n),l=os(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}},ms=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),us=d((({children:e})=>ms?e:null)),hs="/icons/MapMarkerClusterIcon.svg",ps="/icons/MapMarkerClusterYellowIcon.svg";function gs({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=fs("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=fs("workplaces",e,i),l=ys(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ys(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=ys(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 fs=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?hs:ps,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ys=(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?hs:ps,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),xs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},bs={...xs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},vs=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(bs).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Ns=e=>globalThis[e],ws=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=Ns(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(Ns(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(Ns(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))};const Cs=()=>function(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return ws(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}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ks={...xs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ss=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(ks).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Is=[55.753995,37.614069],Ts=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=Cs();if(i((()=>{l.current?gs({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Ps(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),gs({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 h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(Fr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ss,{yandexMaps:l}),o(Ss,{yandexMaps:l,direction:"out"})]}),vs(l,m,u("right-2 top-80",h))]})})),Ps=e=>{const t=[Es(Rs(e,0)),Es(Rs(e,1))];return t.every((e=>e))?t:Is},Rs=(e,t)=>e.map((e=>e.coords?.[t])),Es=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,_s=e=>Number(e.toString().replace(",",".")),Ds=e=>{const{data:t,error:n}=Zn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,As);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},As=async e=>await Ft(e,{method:"POST"})||[],Bs=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Ds("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await ml("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:_s(e.latitude??Is[0]),gpsLongitude:_s(e.longitude??Is[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=ds({data:n,filtrationState:{},getBalloon:is});return c("div",{children:[o(jn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(us,{children:o(Ts,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Ms(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Os(e,t){return Ms(e,t),Ms(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Fs{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){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 zs{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){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 Vs={};function Ls(e,t=Vs){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 $s=new zs;function js(e){return Ls($s,e)}Os($s,new Fs(globalThis?.localStorage));const qs=()=>js(),Us=Wt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(jn,{placeholder:a,options:l,...e(n),...r})})),Ws=d((({field:e,input:t})=>{const{data:n}=Ds("EMPLOYEES_NUMBER"),a=qs();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Us,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Hs=d((({field:e,input:t})=>o(mi,{text:"Наличие военного билета",...e(t?.name??"")}))),Ys=d((({field:e,input:t})=>o(Nl,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Gs=d((({field:e,input:t})=>o(mi,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ks=d((({field:e,input:t})=>o(Ha,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:yi(e,t)}))),Xs=d((({field:e,input:t})=>o(Nl,{label:"Место рождения",...e(t?.name??""),...t,disabled:yi(e,t)})));function Js(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 Zs=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>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:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Me,{__html:e})})]}))),Qs=d((({field:e,input:t})=>{const[n,r]=a([]),[s]=Js("programId"),{value:d,onChange:m}=e("cardCategory"),u=e("paymentSystem")?.value?.key;i((()=>{u&&s&&(async()=>{const e=await(async(e,t)=>{const n=await ml("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(u,s);r(e),eo(e,d)||m&&m(null)})()}),[u]);const h=l((()=>n?.find((e=>e.key===d?.key))?.description),[n,d]);return c("div",{children:[o(Us,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),h?o(Zs,{__html:h}):null]})})),eo=(e,t)=>e.some((e=>e.key===t?.key)),to=d((({field:e,input:t})=>o(Nl,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),no=d((({field:e,input:t})=>o(Nl,{label:"Кодовое слово",...e(t?.name??""),...t}))),ao=d((({field:e,input:t})=>{const{data:n}=Ds("INCOME_CERT_UNITED"),a=yi(e,t);return c("div",{className:"space-y-xl",children:[a?o(Zs,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(Us,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),io=d((({field:e,input:t})=>{const{data:n}=Ds("MILITARY_STATUS");return o(Us,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ro=()=>js(),lo=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Rr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Tr,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),so=(e,t)=>{const{open:n}=bn(lo),a=Te();return r((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ul(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},oo=d((({className:e,error:t,docId:n,...a})=>{const i=so(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(li,{...a}),n?o(Tr,{embedded:!0,onClick:i,children:o(Dl,{children:"Ознакомиться"})}):null]}),Rn(t)]})})),co=d((({field:e,input:t})=>{const{productType:n}=ro(),a=cl[n??""];return t&&t.name?o(oo,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),mo=Math.round(29.5),uo=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]}))),ho="flex flex-col justify-between lg:flex-row gap-4xl",po="flex flex-col lg:w-1/2 gap-2xl",go="flex flex-col gap-y-xl min-w-52",fo=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Fe,{size:"text-h3",children:"number"==typeof e?[a,Ke(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),yo=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(Fe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(fo,{value:n,...i}):o(Fe,{size:"text-h3",children:"-"})]}))),xo=e=>vo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),bo=(e=[],t=!1,n=[])=>({...vo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),vo=(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]},No=(e,t=0)=>e?.sum?e.sum:t,wo=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Co=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ko=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ua,{items:[`От ${So(e)}`,`До ${So(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),So=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Io=({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(Fe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(gr,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),To=e=>Io({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Po=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ua,{items:e?[`От ${Ke(1)(a.min||0)} ${n}`,`До ${Ke(1)(a.max||0)} ${n}`]:[],step:t,...a}),Ro=({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?.(sa(t?.[i],n.minMonths,n.maxMonths))},Eo=(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)},_o=e=>e,Do=(e=_o)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ao=Do(),Bo=(e=_o)=>Do((t=>-e(t))),Mo=Bo(),Oo=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Fo([e,t],a),Fo=([e,t],n=[])=>({[e]:n.length?Mo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ao(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),zo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Vo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Lo=e=>$o({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$o({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&$o({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&$o({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$o=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],jo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[Vo],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Lo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Oo(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Oo(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Lo({row:e,userInputParams:t,paramsViewSettings:n})&&zo(a,["minSum","maxSum"],e)&&zo(i,["minMonths","maxMonths"],e)))||Vo)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Eo(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},qo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Uo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Wo=Wt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=xo(n?.rateRows),g=r((e=>{const t=jo(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=yn({moneyValue:No(d,2e5),monthsValue:wo(d,mo),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),x=jo(f,n,s),b=To({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(sa(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(sa(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!qo(d)&&p&&Ro({field:y,defParams:p,calcParams:x,map:Uo,monthsValue:"minMonths"})}),[n,d]),o(uo,{className:e,title:t,...h,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),ko({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),Ho({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(go,"@4xl:w-1/2"),children:[o(yo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yo,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(yo,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),We(a,{isVertical:!0}),Co(l)]})]})})})),Ho=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(li,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(li,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(li,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(li,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Yo="calculator",Go=d((({field:e,params:t})=>{const n=r((t=>{e(Yo).onChange?.(t)}),[]);return o(Wo,{...t?.calcData,padding:"p-0",defaultParams:Xo(e(Yo).value),onChange:n})})),Ko={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Xo=(e,t=!1)=>{const n=t?Jo(Ko):Ko;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Jo=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Zo=d((({field:e,input:t})=>{const{data:n}=Ds("CREDIT_IN_RSHB");return o(Us,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Qo={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"},ec=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gr,{label:wn({label:t,errors:a?.errors}),...a}),Rn(n)]}))),tc=[{id:"810",text:"Рубли"}],nc=d((({field:e,input:t})=>{const{data:n}=Ds("CURRENCY"),{programId:a}=ro(),i=l((()=>!Object.keys(Qo).includes(a||"")||"38"===a),[]),r=l((()=>i?tc:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(ec,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),ac=(e,t)=>{if(!t)return null;const n=sc(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")}},ic=(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},rc=(e,t)=>{const n=sc(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},lc=(e,t,n)=>{const a=sc(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},sc=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,oc=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=cc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Cl(n.data?.address));const s={amountWorkers:ic(e?.amountWorkers,n.data?.employee_count),employerActivities:ac(e?.employerActivities??[],a),organization:lc(e?.organization??[],i,r),employerOrganization:rc(e?.employerOrganization??[],i),organizationName:l};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},cc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),dc=d((({field:e,input:t})=>{const n=qs(),{employerActivities:a,employerOrganization:l,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=r((t=>{oc(n,e,t)}),[]);return i((()=>{d&&m&&a&&l&&s&&c&&(async()=>{const t=await(async e=>{const t=await fl({url:"suggest/party",query:e});return t?.[0]})(m);t&&oc(n,e,t)})()}),[a,l,s,c]),o(Nl,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u,disabled:yi(e,t)})})),mc=d((({field:e,input:t})=>o(Ha,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),uc=d((({field:e,input:t})=>{const{data:n}=Ds("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(ec,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),hc=d((({field:e,input:t})=>o(Nl,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),pc=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(Ha,{label:"Дата выдачи",...e(t?.name??""),disabled:yi(e,t),minDate:a})})),gc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(Nl,{disabled:yi(e,t),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),fc=d((({field:e,input:t})=>o(Nl,{disabled:yi(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),yc=d((({field:e,input:t})=>o(Nl,{disabled:yi(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),xc=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Nl,{disabled:yi(e,t),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),bc=d((({field:e,input:t})=>{const{data:n}=Ds("EDUCATION_LEVEL");return o(Us,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),vc=d((({field:e,input:t})=>o(Nl,{label:"Электронная почта",...e(t?.name??""),...t}))),Nc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_ACTIVITY_TYPE"),a=qs();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Us,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),wc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_KIND"),a=qs();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Us,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Cc=d((({field:e,input:t})=>{const{data:n}=Ds("EMPLOYMENT_INFO_UNITED");return o(Us,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),kc=d((({field:e,input:t})=>o(Nl,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Sc=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(sa(Number(n),0,5)))),[]);return o(Nl,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:yi(e,t)})})),Ic=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),c=Number(e("dependents")?.value),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Nl,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),Tc=d((({field:e,input:t})=>{const{data:n}=Ds("MARITAL_STATUS");return o(Us,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Pc=d((({field:e,input:t})=>o(Nl,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t,disabled:yi(e,t)}))),Rc=d((({field:e,input:t})=>{const{data:n}=Ds("HOUSE_TYPE");return o(Us,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ec=d((({input:e})=>o(Zs,{__html:e?.label}))),_c=d((({field:e,input:t})=>o(mi,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Dc=d((({field:e,input:t})=>o(Nl,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:yi(e,t)}))),Ac=d((({field:e,input:t})=>o(Nl,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t,disabled:yi(e,t)}))),Bc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Mc=(e="")=>Bc.test(e),Oc=e=>{const t={"А":"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",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},Fc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("latinName")?.onChange;i((()=>{l?.(Oc(a))}),[]);const s=r((e=>{(Mc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(An,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),zc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,l=e("latinSurname")?.onChange;i((()=>{l?.(Oc(a))}),[]);const s=r((e=>{(Mc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(An,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Vc=d((({field:e,input:t})=>o(Nl,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Lc=d((({field:e,input:t})=>o(Nl,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),$c=d((({field:e,input:t})=>o(Ha,{label:"Дата рождения",...e(t?.name??""),disabled:yi(e,t)}))),jc=d((({field:e,input:t})=>o(Nl,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),qc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Uc=d((({field:e,input:t})=>o(ec,{orientation:"horizontal",items:qc,...e(t?.name??"")}))),Wc=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(Nl,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),Hc=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(Nl,{label:"Имя",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),Yc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_TYPE"),a=qs();return i((()=>{n&&(a.organization=n)}),[n]),o(Us,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Gc=d((({field:e,input:t})=>{const n=qs(),a=r((t=>{e?.("inn")?.onChange?.(t.data?.inn),oc(n,e,t)}),[]);return o(Nl,{label:"Наименование организации",...t,...e(t?.name??""),disabled:yi(e,t),onDaDataChange:a})})),Kc=d((({field:e,input:t})=>o(Nl,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Xc=d((({field:e,input:t})=>o(Ha,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),Jc=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(sa(Number(n),0,100)))),[]);return o(Nl,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const Zc=e=>e.map((e=>({key:e.type,text:e.name}))),Qc=e=>e?.key,ed=d((({field:e,input:t})=>{const[n,r]=a([]),s=js();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await ml("/public-data/creditProgramConditions","POST",{creditProgramId:e});return Zc(t?.paymentSystems||[])})(e);r(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(ec,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Qc,parse:e=>n?.find((t=>t.key===e))})})})),td=d((({field:e,input:t})=>{const{data:n}=Ds("POSITION");return o(Us,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),nd=async()=>await ml("/public-data/regionsCardDelivery","GET")||void 0,ad=d((({field:e,input:t})=>{const{programId:n,productType:a}=qs(),{data:i}=Ds("REGION_RF"),{data:l}=Zn("regionsDelivery",nd),{data:s}=Ds(id(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(jn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),id=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",rd=d((({field:e,input:t})=>o(Nl,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),ld=["male","female"],sd=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],od=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 fl({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return ld.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(ec,{label:"Пол",orientation:"horizontal",items:sd,...e(t?.name??"")})})),cd=d((({field:e,input:t})=>o(mi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),dd=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Ra(e,"___-___-___ __")):t?.(Ra(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Tn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),md=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(dd,{"aria-label":t,label:wn({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),Rn(a)]}))),ud=d((({field:e,input:t})=>o(md,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),hd=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(Nl,{label:"Фамилия",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),pd=d((({field:e,input:t})=>o(Nl,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),gd=d((({field:e,input:t})=>o(Nl,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t,disabled:yi(e,t)}))),fd={$ref:"/wcms-resources/delivery-cities-data.json"},yd={limitedBirthday:$c,name:Hc,surname:hd,middleName:Wc,email:vc},xd={processPersonalDataFlg:co,consentProviderFlg:co,consentOthersFlg:co,consentInformFlg:co,consentPfrFlg:co,consentInformMaterialsFlg:co,consentPhotoFlg:co,consentFATCA:co},bd={organization:Yc,organizationAddress:wl,organizationPhone:Di,organizationName:Gc,legalForm:Lc,generalSeniority:Pc,lastJobExperience:Ac,experience5Years:Sc,jobsNumber:Dc,beginDate:Ks,addressFact:Sl,addressRegistration:wl,addressRetail:Bs,addressMatch:Il,sex:od,birthPlace:Xs,education:bc,housing:Rc,amountWorkers:Ws,employment:Cc,employerActivities:Nc,employerOrganization:wc,positionOrganization:td,familyStatus:Tc,familyMembers:Ic,children:to,dependents:hc,totalIncome:pd,expenses:kc,snils:ud,conscription:io,armyIdFlg:Hs,dulSerie:yc,dulNumber:fc,dulIssueDate:pc,dulSubdivisionCode:xc,dulIssuedBy:gc,participantDateRegistration:Xc,retirementIncome:rd,otherIncome:Kc,wages:gd,mandatoryPayments:jc,bankruptcyFlg:Gs,initiateBankruptcyFlg:_c,shareholderFlg:cd,legalEntityName:Vc,creditInRshbCd:Zo,bankEmployeeCode:Ys,partInBusiness:Jc,regionRetail:ad,infoCard:Ec,calculator:Go,confirmationIncome:ao,inn:dc,...yd},vd={addressCourier:e=>o(kl,{...e,source:fd}),paymentSystem:ed,currency:nc,cardCategory:Qs,codeWord:no,methodObtain:Uc,deliveryDate:mc,latinName:Fc,latinSurname:zc,deliveryTime:uc},Nd="Согласие на все документы",wd=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(qi(t(e?.name),Qi).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(Ml,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(li,{text:Nd,value:a,onChange:i},n),Rn(s?"Отметьте все обязательные соглашения":"")]}),o(Tr,{embedded:!0,ariaLabel:Nd,onClick:m,children:o(Al,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Ol,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Nr(t,{},xd))})]})})})),Cd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=kd(t||[],n);return a.length>2?c("div",{children:[i.map(Nr(e,{},{...yd})),o(wd,{inputs:a,field:e})]}):(t||[])?.map(Nr(e,{},{...yd}))},kd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(cl[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(cl[t]).includes(String(e))))}),Sd=(e,t=!1)=>o(zr,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Id=e=>ul("/user-data/updateUserProfile","PUT",e),Td=e=>ul("/user-data/updateUserTask","PUT",e),Pd=d((({className:e,seconds:t})=>o("span",{className:e,children:Rd(t)}))),Rd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Ed=(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 _d({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}=Ed(l,t);return r((e=>{i.current=e,o()}),[])}const Dd={width:"103",height:"21"},Ad={"bg-white":"color",transparent:"white"},Bd={"bg-white":"text-primary-main",transparent:"text-white"},Md=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Ad[e]},className:Bd[e],width:n?.width,height:n?.height}),Od={"bg-white":"text-primary-text",transparent:"text-white"},Fd=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??"Россельхозбанк",...xe(s),children:[Md(r,n?.image,Dd),l?a??o("div",{className:"ml-s",children:o(Fe,{font:"font-medium",color:Od[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),zd=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=dn(!1),y=r((async()=>{g();var e;await(e={captchaText:d},ul("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(e=>ul(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(x,[]),o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Fd,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Tr,{className:"w-8",embedded:!0,onClick:x,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Tn,{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(Tr,{version:"secondary",onClick:close,children:"Вернуться"}),o(zr,{version:"secondary",disabled:!d,onClick:y,children:"Отправить"})]}),p?o(Fr,{blur:!1}):null]})})})),Vd=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=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]),p=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:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Ld(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Ld=(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 ${Sn(!n||!a)} rounded-md caret-transparent outline-none`},$d=d((({disabled:e=!1,onClick:t,text:n})=>o(Tr,{type:"button",onClick:t,disabled:e,children:o(Fe,{font:"font-normal",children:n})}))),jd=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},qd=({values:e,onSuccess:t})=>{const[n,l]=a(""),[s,{setTrue:o,setFalse:c}]=dn(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=r((()=>l("")),[]),y=Boolean(0===d&&u),x=p>2||y||!e.every(Boolean),b=r((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>ml("/sms/checkCode","POST",e).then(jd))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{l(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{l(y?"Код просрочен":"")}),[y]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:x,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Ud=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:l=4,consents:s,onSuccess:d=Cn,onClose:m=Cn})=>{const[u,h]=a(Array(l).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:y,timeNextReq:x,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=qd({values:u,onSuccess:d}),C=bn(zd),k=Xt(e),I=_d({seconds:x,onTick:v}),T=r((async()=>{var e;await(e={phoneNumber:k,smsCodesSetName:{key:"AUTHENTICATION"}},ul("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:k,sendCode:T})}),[k,I,m]);return i((()=>{T()}),[]),o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Vd,{values:u,setValues:h,errorText:f,hasError:g}):null,Hd(x,T),n?c(Me,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Wd(b,p),y?o(Fr,{blur:!1}):null]})})})),Wd=(e,t)=>o($d,{text:"Далее",disabled:e,onClick:t}),Hd=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Pd,{className:"pl-2xs",seconds:e})]}):o(Tr,{embedded:!0,onClick:t,children:o(Dl,{children:"Получить новый код"})}),Yd={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Gd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Kd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Xd=d((({onSubmit:e=Cn,onClose:t=Cn})=>{const[n,i]=a(""),[l,s]=a(!1),d=so(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?Gd:Yd;return o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",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:h.title})}),o(C,{align:"text-center",children:h.description}),o(gr,{className:"whitespace-normal",orientation:"horizontal",items:Kd,value:n,onChange:u}),o(Tr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Jd=d((({title:e,icon:t,description:n,onClick:a=Cn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick: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:[o(Fe,{font:"font-medium",size:"text-s",children:e}),n?o(Fe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),Zd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Qd={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},em={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},tm=e=>Object.entries(e).reduce(((e,[t,n])=>t in Zd?[...e,{contactTypeCd:{key:Zd[t]},value:n}]:e),[]),nm=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Qd){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Qd[t]},...a}]}return e}),[]),am=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:h,armyIdFlg:p,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:im(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in em?[...e,{incomeTypeCd:{key:em[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},im=(e,t)=>(Number(e??0)+Number(t??0)).toString(),rm={WORK:"Работаю",RETIREE:"Пенсионер"},lm={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},sm={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"},om={...sm,amur_card:"14",owner_card:"13",travel_card:"15"},cm=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:im(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},dm=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}},mm=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}},um=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,hm=d((function({task:e,isFromLead:t=!1,sendAspects:n=Cn,onClose:a=Cn}){const i=qs(),l=rn(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=om[d.code],p=Boolean(sm[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:y}=s[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{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:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:k=[],employmentContractDate:S,employmentTypeCd:I,organizationName:T,organizationInn:P,organizationActivityTypeCd:R,organizationTypeCd:E,organizationKindCd:_,employeesNumberCd:D,opf:A,seniority:B,generalSeniority:M,jobsNumber:O,lastWorkDuration:F,positionCd:z,maritalStatusCd:V,childrenDependents:L,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q,profile:ee}=t;return{currency:r?.key,paymentSystem:um(i),cardCategory:um(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:um(b),participantDateRegistration:v,housing:um(N),beginDate:S,employment:um(I,rm),organizationName:T,inn:P,employerActivities:um(R),organization:um(E),employerOrganization:um(_),amountWorkers:um(D),legalForm:A,generalSeniority:B?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:F?.toString(),positionOrganization:um(z),familyStatus:um(V),children:L?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:um(q),confirmationIncome:um(Q,lm),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:um(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},esiaAccountTypeCd:ee?.esiaAccountTypeCd,...cm(U),...dm(k),...mm(C),...(te=w,te?.key?{sex:"MAN"===te.key?"male":"female"}:null)};var te})(e);i.participantId=f??null,i.taskId=u,i.profileId=y?.id??null,i.programId=h,i.leadForm=t,y?.id&&n(y.id,u),l.assign(g)}),[]),b=r((()=>{l.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Rr,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children: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(Jd,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${Kt(new Date(m))}`:"",onClick:x}),o(Jd,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),pm=d((function({onClose:e=Cn}){const t=rn(),n=r((()=>{t.assign("/natural/loans/all-goals")}),[]),a=r((()=>{t.assign("/")}),[]);return o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,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(Tr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Tr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),gm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},fm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),ym=({programId:e,nextStepLink:t,productType:n,data:i})=>{const[l,{setTrue:s,setFalse:o}]=dn(!1),[c,d]=a(),m=(()=>{const e=ro();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),u=(({data:e})=>{const t=cn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});an({aspectsAttributes:fm(e,i),aspects:t,ev:{}})}),[e])})({data:i}),h=rn(),p=r((()=>{h.assign(t)}),[]),g=(e=>{const{open:t}=bn(Xd),n=bn(Ud),a=t=>async n=>{try{t&&await Id({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async r=>{"SIGNED"===r&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(p),f=bn(Ud),y=(()=>{const{open:e}=bn(hm),{open:t}=bn(pm);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:r})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:r}):t({})}}})();return{isSending:l,ok:c,handleSubmit:r((async t=>{try{s();const i=Nm(t),r=await(a={profile:{phone:Xt(i.phone)}},ml("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null)));if(!r)throw new Error;const l=async()=>{await bm({programId:e,profileId:r,formData:i,productType:n,saveUserData:m,sendAspects:u}),f.close(),"debitCard"===n?p():g.open(i.phone,r)},o=async()=>{try{const t=await(async e=>{const t=await ml("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await ml("/user-data/getTaskById","POST",e)||void 0)({taskId:t});f.close(),y.open({task:e,isFromLead:!0,sendAspects:u,onClose:l})}else await l()}catch{d(!1)}},c=xm(i,n);f.open({phone:i.phone,consents:c,onSuccess:o})}catch{d(!1)}finally{o()}var a}),[])}},xm=(e,t)=>{const n=cl[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},bm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:r})=>{let l,s;const o=vm(n,a);await Id(((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&&Kt(l,!0),email:o,phone:Xt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await ml("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:r,phone:l,email:s}=e;return{task:{taskSource:rn().origin,creditProgram:{code:Qo[t]},participants:[{birthDate:r&&Kt(r,!0),midname:i,name:n,surname:a,participantContacts:tm({phone:l&&Xt(l),email:s})}]}}})(n,e));l=t.taskId,s=t.participantId}else{const a=await(async e=>await ml("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});l=a.taskId,s=a.participantId,await Td((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:rn().origin,id:t,participants:[{birthDate:s&&Kt(s,!0),id:e,midname:l,name:i,surname:r,profile:{id:n},participantContacts:tm({phone:o&&Xt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:gm()}}})({participantId:s,taskId:l,profileId:t,formData:n}))}r(t,l),i({participantId:s,taskId:l,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},vm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Nm=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),wm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},Cm=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,wm[e.name||""]])))}},km=async(e,t,n=!1)=>{const a=new FormData;a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml"));return await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...hl()},credentials:"include",body:a}).then((e=>e.json())))},Sm=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},Im=e=>Math.floor(e/12),Tm=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.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=>km(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Pm=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},Rm=e=>{const{esiaAdditionalDocument:t}=e;return[t?.inn,t?.averageMonthlyIncome?.toString(),t?.startWorkDate,t?.workLengthInFiveYears?.toString(),t?.workLength?.toString(),t?.workLengthLastJob?.toString(),t?.jobsNumberInFiveYears?.toString(),t?.pdfFilePayout,t?.pdfFileWorkbook,t?.pdfFileSigPayout,t?.xmlFilePayout,t?.xmlFileSigPayout,t?.xmlFileWorkbook].every(Boolean)},Em=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=ro(),o=r((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=l((()=>Cm(e,s.leadForm,a)),[e,s.leadForm]),u=r((async(e,a)=>{n(dl.Pending);try{const r=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},ml("/esia/requestProfile","POST",i).then((e=>(jd(e),e))));if(r){const e=await(async(e,t)=>{Pm(e);const n=!t&&Rm(e),{profile:a,addInfo:i,document:r,addressRegistration:l,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Tm(o)),{...{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Ri(a.phone),email:a.email,dulIssueDate:r.dulIssueDate,dulIssuedBy:r.dulIssuedBy,dulNumber:r.dulNumber,dulSerie:r.dulSerie,dulSubdivisionCode:r.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:Sm(l),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...s&&{addressFact:Sm(s)}},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:Im(o.workLengthInFiveYears).toString(),generalSeniority:Im(o.workLength).toString(),lastJobExperience:Im(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(r,"debitCard"===t);o((t=>({...t,...e}))),n(dl.Success)}}catch{n(dl.Error)}var i}),[]);return i((()=>{s.productType=t;const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=e.get("code"),a=e.get("state");n&&a?u(n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),m},_m=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),y=s(null),x=l((()=>(e=>{const t=cl[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:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),b=l((()=>Dm(x)),[x]),v=l((()=>Am(m)),[m]),N=l((()=>nr(b,v)),[b,v]),w=Em({inputs:b,nextStepLink:r,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===dl.Success}),{isSending:C,ok:k,handleSubmit:S}=ym({programId:n,nextStepLink:r,productType:m,data:h}),[,{field:I,onSubmit:T,reset:P}]=yn(w,{formValidator:N,onSubmit:S}),R=bn(Er);return i((()=>{void 0!==k&&R.open({ok:k})}),[k]),i((()=>{g&&y?.current&&y.current.scrollIntoView({block:"start"}),g===dl.Success&&P()}),[y?.current,g]),c(xn,{className:u("container space-y-m",e),title:t,...p,children:[g?null:o(pl,{onChangeEsiaStatus:f}),c("form",{onSubmit:T,className:"space-y-m relative",ref:y,children:[g===dl.Pending?o(Fr,{blur:!1}):null,x.map(((e,t)=>c("div",{className:u(wr(e.columns),"grid gap-x-m"),children:[Cr(e.title),Cd({field:I,inputs:e?.inputs},m)]},`section-${t}`))),Sd(d,C),g===dl.Error?o(Fe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Dm=e=>e?.flatMap((e=>e?.inputs))||[],Am=e=>({...ol,limitedBirthday:il(e)}),Bm=d((({title:e,description:t})=>{const n=Te();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(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Mm=e=>e%2!=0,Om="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Fm=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(Om),children:[E(r,{...i.options,parent:n}),Mm(r.length)?o(Yt,{className:"col-span-6",...i}):null]}),c(Ml,{children:[c(Ol,{className:u(Om),isUnfolded:s,children:[E(l,{...i.options,parent:n}),Mm(l.length)?o(Yt,{className:"col-span-6",...i}):null]}),o(Bl,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),zm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Vm=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Lm=10;function $m(e=0){const t=Math.round(e*Lm);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const jm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:$m(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:h,role:"listitem",children:d})})),qm=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Um=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:h,children:p,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(Hm(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Wm(c,v):{},...N?Vm(h):{},gap:`${l}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(jm,{className:u(m,i?qm[i-1]:"",{"h-full":N},t),style:w?Wm(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Wm=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Hm=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ym={"horizontal-list":"w-6","vertical-list":"h-6"},Gm=({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?Ym[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Km=({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))},Xm=e=>t=>e.scrollWidth/t,Jm=e=>(t,n)=>{e.scrollBy({left:n*Xm(e)(t),behavior:"smooth"})},Zm=({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?[Bo()(i),Do()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?Jm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?Jm(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:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Qm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},eu=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Zm({itemCount:s.length}),g=tu(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Um,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Km({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Qm[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(Gm({activeIndex:t,onClick:f,listType:a}))}):null})),tu=(e=!1)=>({behavior:e?"auto":"smooth"}),nu=d((({className:e,name:t,...n})=>o(Tr,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),au=d((e=>o(nu,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),iu=d((e=>o(nu,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),ru="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lu=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?su(t):null,r?o(au,{wcmsIgnore:!0,className:u(ou(i),m?"left-1":"left-0"),onClick:s}):null,l?o(iu,{wcmsIgnore:!0,className:u(ou(i),m?"right-1":"right-0"),onClick:d}):null]})})),su=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(ru,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(ru,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ou=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),cu=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:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=Zm({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(Um,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(lu,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(eu,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),du=({blocksToRender:e,...t})=>o(cu,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:E(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",zm(!0)),children:P(e,t)},String(n))})}),mu=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[uu(n,t),o(Fm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[uu(n,t),du({...a,blocksToRender:t})]});default:return null}})),uu=(e,t)=>e&&!t.length?o(Bm,{...e}):null,hu=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),pu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(vi,{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))))),gu=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,hu(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(fu(a)).filter(Boolean))]}),n?o("div",{children:o(Tr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),fu=e=>([t,n])=>{const a=n?.type;return"array"===a?yu(t,e)(n):null},yu=(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(Fe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(pu,{items:a,multiple:!n?.single,...t(e)})]},e)},xu=e=>e;function bu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const vu=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Nu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>vu(t[e])||vu(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>vu(t[e])||vu(n[e])||wu(t[e])<=wu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>vu(t[e])||vu(n[e])||wu(t[e]?.min)>=wu(n[e]?.min)&&wu(t[e]?.min)<=wu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>vu(t[e])||vu(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>vu(t[e])||vu(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),wu=e=>Number(e||0),Cu=(e,{block:t,page:n,normalize:a=xu})=>{const i=t?.blocks||[],[r,s]=yn(e),o=l((()=>bu(i,i.map((e=>jt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=xu)=>e?.filter((([,e])=>Nu(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},ku={},Su={},Iu=Wt((({className:e,filtrationSchema:t=ku,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Cu(Su,{block:i.block,page:i.options?.page}),d=o(zn,{className:"w-64",label:n?.title,options:Tu(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Tu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(gu,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Tr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(mu,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Tu=e=>bu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Pu=(e=!1)=>e?"text-left":"text-center",Ru={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Eu=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",Ru[t],e),style:{width:r,height:r},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),_u=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:Pu(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(Du)}):null]})})),Du=({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(Eu,{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(Fe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),Au=(e,t,n)=>{return o(cu,{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(Fe,{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(Fe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Bu=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(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?Au(e,0,t):null]}))),Mu={start:"justify-start",center:"justify-center",end:"justify-end"},Ou=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Mu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:We(e)})})),Fu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(Fe,{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:Ke(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]})]}))),zu=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Fe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Vu=({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(Fu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(yo,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(zu,{title:e,...l}),Lu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},$u={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},ju=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Lu.prefMonthsNum,prefTravelBonusRate:r=Lu.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||$u,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},qu=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=yn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=ju(l,n);return o(uo,{className:e,title:t,...r,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Po({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Vu({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:go,children:[f>=0?o(yo,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,We(a,{isVertical:!0}),Co(i)]})]})})})),Uu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Wu=e=>Io({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Hu=" (c капитализацией)",Yu=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:go,children:[o(yo,{title:`Доход в конце срока${r?Hu:""}`,value:e,postfix:n,prefix:"+"}),o(yo,{title:`Сумма в конце срока${r?Hu:""}`,value:t,postfix:n}),We(a,{isVertical:!0}),i?.map(Co)]}),Gu={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Ku={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Xu=(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?Gu[e?.rateType]:"",{data:n}=Zn(t?`${Jt}/depositrates/${t}`:null,zt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Ju(s,e)&&zo(a,["minSum","maxSum"],e)&&zo(n,["minDays","maxDays"],e)))||Ku,{rate:m}=d,u=Zu(m,e),h=a+u,p=c||[Ku];return{...d,...Fo(["minSum","maxSum"],p),...Fo(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Ju=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Zu=(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)},Qu=Wt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=yn({moneyValue:No(l,1e5),daysValue:wo(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=Xu(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=p;return o(uo,{className:e,title:t,...d,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ua,{items:[`От ${Uu(b.min||0)}`,`До ${Uu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[eh(p,h),Wu({...h("isMonthlyInterestPayment")})]})]}),Vu({rate:y,depositeName:x,isShowDepositeName:r}),Yu({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),eh=(e,t)=>c("div",{className:"space-y-s",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(li,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(li,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),th=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},nh={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},ah=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?lh(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=>[rh({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),rh({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),rh({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),rh({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,zo(a,["minSum","maxSum"],t),zo(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||nh,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=ih(p,e),f=a+g,y=t||[nh];return{...m,...Fo(["minSum","maxSum"],y),...Fo(["minMonths","maxMonths"],y),availableMonths:th(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}},ih=(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)},rh=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],lh=(e,t)=>e+Math.round((t-e)/2),sh=(e="rub")=>"rub"===e,oh=(e,t)=>{const{minMonths:n,maxMonths:a}=Fo(["minMonths","maxMonths"],uh(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:sa(i,n,a)}},ch=(e,t)=>{const{minSum:n,maxSum:a}=Fo(["minSum","maxSum"],uh(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:sa(i,n,a)}},dh=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),mh=e=>{const t=sh(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},uh=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},hh=(e,t=!1)=>t?Io({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,ph=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[gh(t("isReplenish"),e,a),fh(t("isWithdrawn"),e,a),yh(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Wu(t("isMonthlyInterestPayment")):null,hh(t("isRemoteRegistration"),e.isShowRemoteRegistration),xh(t("extraPercent"),n),e.isShowNewClient?o(li,{text:"Новый сберегатель",...t("isNewClient")}):null]})},gh=(e,t,n=!1)=>t.isShowReplenish?Io({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,fh=(e,t,n=!1)=>t.isShowWithdrawn?Io({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,yh=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,xh=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(zn,{options:t,...e})]}):null,bh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},vh={text:"₽",key:"rub"},Nh={text:"Без учета надбавки",key:"0"},wh=Wt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[vh],g=r((e=>t=>e?{...t,...mh(t),...ch(t,e),...oh(t,e),...dh(t,e)}:t)(h),[h]),[f,{field:y}]=yn({moneyValue:No(d,2e4),monthsValue:wo(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:vh,extraPercent:d?.extraPercent??Nh},{normalizer:g}),x=Th(y),b=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=uh(h,x),w=ah(f,N,s),{rate:C,income:k,finalSum:S,type:I=""}=w,T=r((()=>{Ro({field:y,defParams:bo(N,b,v),calcParams:w,monthsValue:"minMonths",map:bh})}),[y,h,v]);i((()=>{!qo(d)&&N&&T()}),[d,h]);const P=y?.("extraPercent")?.value?.key,R=Ih(C,P),E=C===bo(N,b)?.rate&&P===v?.at(-1)?.key;return o(uo,{className:e,title:t,...m,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[c("div",{className:"flex gap-m",children:[Po({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:Ch(x?.key)}),h&&h?.length>1?o(jn,{label:"Валюта",options:p,...y("currency")}):null]}),ko({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),ph({...w,...s},y,v)]}),Vu({rate:R,children:Sh(T,E)}),Yu({income:k,finalSum:S,buttons:[...a,kh(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Ch=(e="")=>sh(e)?1e3:100,kh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Sh=(e,t=!1)=>t?null:o(Tr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Ih=(e,t)=>Number(e)+Number(t??0),Th=e=>e?.("currency")?.value??vh,Ph=e=>Rh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Rh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Rh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Eh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},_h=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[Eh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ph({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Oo(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Oo(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Ph({row:e,userInputParams:t,paramsViewSettings:n})&&zo(a+l,["minSum","maxSum"],e)&&zo(r,["minSumOld","maxSumOld"],e)&&zo(l,["minSumExtra","maxSumExtra"],e)&&zo(i,["minMonths","maxMonths"],e)))||Eh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Eo(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Dh=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=yn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=_h(d,n,r),p=l((()=>xo(n?.rateRows)?.rate),[n?.rateRows]),g=To({...m("isAnnuity")});return o(uo,{className:e,title:t,...s,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),Po({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),ko({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Ah({...h,...r},m),h.isExtraMoney?Po({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(go,"@4xl:w-1/2"),children:[o(yo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yo,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(yo,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(yo,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),We(a,{isVertical:!0}),Co(i)]})]})})})),Ah=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(li,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(li,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(li,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Bh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=la(e,{normalize:(e=i)=>n&&a?String(sa(Number(Mh(e)),n,a)):Mh(e),format:Ke(l)}),d=r((e=>t&&t(Mh(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Mh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Oh=d((e=>o(Bh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Fe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Fh=new zs;function zh(){return Ls(Fh)}Os(Fh,new Fs(globalThis?.sessionStorage));const Vh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Lh=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",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(S,{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]})})},$h=e=>{const t=bn(Lh),n=zh(),a=rn(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=rn(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Jt}/payment/${Vh[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:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},jh={amount:1500},qh=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=$h(i),[{amount:s},{field:d,onSubmit:m}]=yn(jh,{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(Oh,{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(zr,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),Uh=({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(G,{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})]}),Wh="relative h-full",Hh={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Yh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(Xh),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:Gh(n,{someCardsHighlighted:r}),children:[P(n,a,{className:Kh(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),Xh(n)?Uh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Gh=(e,{someCardsHighlighted:t})=>u(Wh,t&&(Xh(e)?"pt-3xl":"pt-16")),Kh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Wh,"min-w-80",Hh[a],t&&(Xh(e)?"pt-16":"pt-3xl"),zm(n),n&&"h-full"),Xh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Jh=Wt((({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(cu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?Zh(s?.block?.blocks):[],hasBlur:!0,children:Yh({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Zh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Qh={black:"bg-black",white:"bg-white"},ep=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(Ee,{className:"h-full",padding:d,title:o(S,{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:We([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(Fe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(tp)]}):null,i?c(Fe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),tp=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Qh[e]}`},String(t)),np=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...xe(i),children:r})})),ap=[{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"}}],ip=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=>ap.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ue(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}})),h=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},rp(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:We(m,{className:lp(s??!1,i??!1,n),buttonClassName:h})}),l?o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),rp=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",lp=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),sp=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="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(np,{href:i,target:m,className:"h-full",data:fm(v),children:c(Ee,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...lt(Ue(r)?o(ie,{image:r}):null,y),buttons:d.length?o(ip,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(qe,{benefits:f}),s?o(Me,{__html:s,isDotted:l,itemSize:"list-s"}):null,op(a,p)]})})}))),op=(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,cp=new he,dp=(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(Fe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Fe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:We(i)}):null]},String(t))},mp=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const x=l((()=>h.map(dp)),[h]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[N,C]=a(!1);i((()=>cp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const k=r((()=>{cp.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.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(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Ml,{children:[c("div",{children:[b,o(Ol,{isUnfolded:N,children:v})]}),h.length>=m?o(Bl,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:k}):null]}):o("div",{children:b})]})})),up=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=rn();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await ul("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const r=setInterval(i,24e4);return()=>clearInterval(r)},hp=d((({step:e=10,description:t,showPercentage:n=!0})=>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:[e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),pp=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(hp,{step:a,showPercentage:!1})]})})}));var gp;!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"}(gp||(gp={}));const fp=e=>ml("/user-data/getTaskStatus","POST",e),yp=async e=>{const t=await ml("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},xp=d((({title:e,interval:t=0,onEnd:n=Cn})=>{const[i,r]=a(t);_d({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(S,{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(Pd,{seconds:i})})]})]})})),bp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Cn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(xp,{interval:s,onEnd:d}):null]}),o(vp,{title:n,items:a}),o(vp,{title:i,items:r,countColumns:!0}),l?o(Lr,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),vp=({title:e,items:t,countColumns:n=!1})=>{const a=Te();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(Fe,{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",wr(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Np(e)},t)))}):null]})]}):null},Np=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Fe,{color:"text-secondary-text",size:"text-l",children:e}),o(Fe,{color:"text-primary-text",size:"text-xl",children:t})]}),wp=d((()=>o(bp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Cp=d((({onExpire:e})=>{const{statusInfo:t}=qs();return o(bp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),kp=d((()=>{const{statusInfo:e}=qs(),t="courier"===e?.methodObtain;return o(bp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Sp=d((()=>{const{statusInfo:e}=qs();return o(bp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Ip(e),buttonText:"Вернуться на главную"})})),Ip=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Kt(e?.deliveryDate)}]):t},Tp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Pp=d((()=>{const[e,t]=a(gp.process),{taskId:n}=qs();i((()=>{(async()=>{for(const e of Tp)await yp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await fp({taskId:n});a&&a?.statusCd!==gp.process&&(e(),t(a.statusCd))}),[n]);Ed(l,3e4);const s=r((()=>t(gp.rework)),[]);return Rp(e,s)})),Rp=(e,t)=>({IN_PROCESS:o(Cp,{onExpire:t}),CANCELLED:o(wp,{}),FAILED:o(wp,{}),DRAFT:o(wp,{}),APPROVED:o(Sp,{}),PRE_DECISION:o(Sp,{}),REVISION:o(kp,{})}[e]||o(kp,{})),Ep=e=>(t,n)=>t.filter((e=>e)).map((t=>[_p(n,e),Dp(t,e),Ap(t,e),Fp(t,e),Bp(t,e),Mp(t,e),Op(t,e)].some(Boolean)?{...t,required:!1}:t)),_p=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Dp=({name:e},t)=>"wages"===e&&"RETIREE"===t("employment")?.key&&!t("inn"),Ap=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Bp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Mp=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Op=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Fp=({name:e},t)=>"snils"===e&&zp(t),zp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Vp={...bd,...vd},Lp=({field:e,inputs:t,params:n})=>t.map(Nr(e,n,Vp)),$p=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:r,condition:l},s)=>{const c=Ep(jp(t))(e,n),d=[Op({condition:l},jp(t))?null:Cr(r),...Lp({field:t,inputs:c,params:a})].filter(Boolean);return d.length?o("div",{className:u(wr(i),"grid gap-x-m"),children:d},`section-${s}`):null})),jp=e=>t=>e(t)?.value,qp=({formState:e,inputs:t,step:n,productType:a})=>{return nr(Ep((t=>e[t]))(t,n),{...ol,limitedBirthday:il(a),dulIssueDate:(i=e.limitedBirthday,hn((e=>!(!e||!i)&&e.getTime()>=new Date(i?.getFullYear()+14,i?.getMonth(),i?.getDate()).getTime()))("Укажите дату выдачи паспорта"))})(e);var i},Up=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tr,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(zr,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Wp=(e,t,n)=>({...n[e],...t,limitedBirthday:Hp(t?.limitedBirthday),dulIssueDate:Hp(t?.dulIssueDate),participantDateRegistration:Hp(t?.participantDateRegistration),beginDate:Hp(t?.beginDate),deliveryDate:Hp(t?.deliveryDate)}),Hp=e=>{try{return e?new Date(e):void 0}catch(e){return}},Yp=(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:"",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},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Gp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...Yp(),{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Kp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Xp=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:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return{employmentContractDate:Kt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:tm({organizationPhone:p&&Xt(p)}),participantAddresses:nm({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},Jp=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:r="",email:l,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g,housing:f,addressRegistration:y,addressFact:x,addressMatch:b}=e;return{birthDate:Kt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Kt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:g?Kt(g,!0):void 0,homeMatchFlg:b,houseTypeCd:f,participantContacts:tm({phone:Xt(r),email:l}),participantAddresses:nm({addressRegistration:y,addressFact:x}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Zp=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(l=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),l?new Date(l).toISOString().split(".")[0]:""),office:{id:"3"},...r}:{};var l},Qp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},eg=(e,t)=>{switch(e){case 0:default:return{};case 1:return Jp(t);case 2:return Xp(t);case 3:return am(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:nm({addressCourier:t})}:{}})(t)}},tg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=qs(),d=l((()=>Wp(e,c.leadForm,Gp)),[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 Td((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:rn().origin,id:t,...Qp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...eg(i,a)}],...Kp(a),...Zp(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]},ng=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((t=>qp({formState:t,inputs:s,step:e,productType:"creditCard"})),[s]),[m,u,h]=tg({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=yn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[$p({sections:t,field:p,step:e}),o(Up,{isSending:h,step:e,onPrevStep:n})]})})),ag=[{title:"Персональные данные",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:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!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}]}],ig=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...ag,{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 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{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:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["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"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],rg=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],lg=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(up,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=ig[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(pp,{stepsTitles:rg,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Pp,{}):o(ng,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),sg=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(hp,{step:a,showPercentage:!1})]})})})),og=d((()=>o(bp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),cg=d((({onExpire:e})=>{const{statusInfo:t}=qs();return o(bp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),dg=d((()=>{const{statusInfo:e}=qs();return o(bp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),mg=d((()=>{const{statusInfo:e}=qs();return o(bp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{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:"Вернуться на главную"})})),ug=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],hg=d((()=>{const[e,t]=a(gp.process),{taskId:n}=qs();i((()=>{(async()=>{for(const e of ug)await yp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await fp({taskId:n});a&&a?.statusCd!==gp.process&&(e(),t(a.statusCd))}),[n]);Ed(l,3e4);const s=r((()=>t(gp.rework)),[]);return pg(e,s)})),pg=(e,t)=>({IN_PROCESS:o(cg,{onExpire:t}),CANCELLED:o(og,{}),FAILED:o(og,{}),DRAFT:o(og,{}),APPROVED:o(mg,{}),PRE_DECISION:o(mg,{}),REVISION:o(dg,{})}[e]||o(dg,{})),gg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tr,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(zr,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),fg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},yg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:fg[a?"annuity":"differential"]}},xg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},bg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Jp(t);case 2:return Xp(t);case 3:return am(t);default:return{}}},vg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...Yp(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Ng=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=4===e,c=qs(),d=l((()=>Wp(e,c.leadForm,vg)),[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&&r&&l){const t=await Td((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:rn().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...bg(i,a)}],...yg(a),...xg(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]},wg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=qs(),m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((t=>qp({formState:t,inputs:u,step:e,productType:"credit"})),[u]),[p,g,f]=Ng({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=yn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[$p({sections:t,field:y,step:e,params:{calcData:m}}),o(gg,{step:e,isSending:f,onPrevStep:a})]})})),Cg=[[{columns:1,inputs:[{name:"calculator"}]}],[...ag,{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 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerOrganization",required:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{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:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["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:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],kg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Sg=Wt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(up,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Cg[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(sg,{stepsTitles:kg,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(hg,{}):o(wg,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(l))})]})})})),Ig=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Tg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Pg=1e9,Rg={sum:{min:1e4,max:Pg},period:3},Eg=Wt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Cu(Rg,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:_g(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Dg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(gu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Oh,{label:a?.title,min:500,max:Pg,...d("sum",{parse:e=>({min:Number(e),max:Pg}),format:({min:e})=>String(e)})}),o(ua,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(mu,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),_g=e=>Vt((e?.paramsSource?.rateRows||[]).filter(Ig).flatMap((e=>Tg(e.minMonths,e.maxMonths)))),Dg=e=>Vt(e.flatMap((e=>e||[])).filter(Ig).flatMap((e=>Tg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Ag=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,Bg=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:Ag(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),Mg=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Og(n))})})),Og=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,...xe(t),children:i||null})},String(a)):null},Fg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:zg(e)}))),zg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Vg,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Vg=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(Ml,{className:e,role:"menuitem",children:[c(Tr,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Dl,{children:[o(Eu,{className:"shrink-0",...t.icon}),o(Fe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Al,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Ol,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Mg,{items:t.items}):null})]})})),Lg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map($g)}):null)),$g=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Fe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(jg)})]},String(t)),jg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:qg(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),qg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ug(t)}`,children:o(Fe,{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})}},Ug=e=>e.replaceAll(/\D/g,""),Wg=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{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}`})})),Hg=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(Fe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Wg,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),Yg=d((({className:e="",index:t,...n})=>{const a=fe(),{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}`})})),Gg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Fe,{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(Yg,{index:t,...e},String(t))))}):null]}))),Kg=Wt((({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:h,otherLinks:p=[]}=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(Fg,{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(Lg,{items:l}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(ip,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Lr,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Hg,{title:d,links:r}),o(Gg,{links:i,license:h})]})})),Xg=(e=!1)=>e?{}:{padding:"p-0"},Jg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Zg=[1,2,3,4],Qg={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},ef=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=((e={})=>{const[t,n]=a(e.blocks??[]),r=zh(),s=r?.offerIds||[],o=l((()=>{const n=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>n.get(e))).filter((e=>Boolean(e))),...t.filter((({__id:e=""})=>!s.includes(e)))]}),[t,s]);return i((()=>n(o)),[]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",Jg[n],e),padding:t,version:s,isTheme:c,...h,children:_({...h,block:{...m,blocks:p},renderProps:tf({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>Qg,allowRemoveChild:e=>(e?.blocks??[]).length>5}),tf=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>P(n,{...a,blockDecorator:nf(a.blockDecorator,i)},{className:u("w-full",zm(t)),...Xg(e)}),nf=(e,t=0)=>(n,a)=>e?.({...n,render:e=>rf(t)({...n,...e},a)},`wrap_${a}`)??rf(t)(n,a),af=e=>Number(e)<5?"":"hidden",rf=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return Zg.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(np,{...r.content?.link,className:u(af(e),(l=e,Zg.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},lf=Wt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=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(jn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Lr,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:fm(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),sf={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},of=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: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":`${sf[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...cf(h),...xe(s),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"})}))),cf=e=>e?{"data-test-id":e}:null,df="chatbot",mf="text-page__btn-chat",uf="webchat-js-container:webchat_rshb",hf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},pf=async(e,t)=>{const n=e.target;n?.classList.contains(mf)||n?.classList.add(mf);globalThis.document.getElementById(uf)||await ws(df,t)},gf=async e=>{const t=await ws(df,`${e}/bundle.js`,!0);((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)}})(`${e}/bundle.css`);globalThis.document.getElementById(uf)?t?.chatOpen?.():(ff(),t?.render?.(uf,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},ff=()=>{const e=globalThis.document.createElement("div");e.id=uf,globalThis.document.body.appendChild(e)},yf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:l="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const l=hf[e??""];return{load:r((t=>{l&&(n(!0),"business"===e?gf(l).finally((()=>n(!1))):pf(t,l).finally((()=>n(!1))))}),[l,e]),isLoading:t}})(e);return o(of,{className:n,image:{icon:"ChatBotIcon",iconVersion:t},ariaLabel:l,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),xf={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"},bf=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",xf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),vf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=D(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Fd,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):Nf(g,l),c("div",{className:"flex gap-lg items-center",children:[B.CHAT_BOT?o(yf,{version:i,iconVersion:m,chat:B.CHAT_BOT,buttonSize:"medium"}):null,o(bf,{version:i,...a})]})]})})),Nf=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,wf={"bg-white":"primary",transparent:"transparent"},Cf=Wt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=wf[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(vf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),kf=Wt((({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=D();return o(g,{className:u("relative flex flex-col",Jg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",zm(l)),...Xg(a)}})})}),{childrenTypes:[]}),Sf=Wt((e=>o(kf,{...e})),{childrenTypes:[]}),If=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",Mu[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Tf=["байт","Кб","Мб","Гб","Тб","Пб"],Pf=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,...xe(r),children:[e,t?c(Fe,{size:"text-l",font:"font-light",children:[t," ",Rf(d,m),o(Fe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Rf=(e,t)=>e||t?o("span",{children:", "}):"",Ef=(e,t)=>(n,a)=>{const i=U(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))} ${Tf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?Df(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Pf,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:_f(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},_f=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,Df=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},Af=d((({href:e,__html:t,target:n,onClose:a})=>c(Rr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Lr,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Tr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),Bf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=bn(Af),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:[_f(i),o(Fe,{font:"font-light",children:e})]}):null})),Mf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Of=Wt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{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",Mf[l]),role:"list",children:i.map(Ff(d,r))}):null]})})),Ff=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?zf(t)(n,a):Ef(e,t)(n,a)},zf=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(Bf,{...a,icon:e,href:Vf(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},Vf=e=>"href"in e,Lf=Wt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"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:p,...f,children:c(Ee,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:We(a,{className:"flex-wrap"}),children:[i?o(Fe,{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(Me,{__html:l,itemSize:"list-m"}):null,o(Fe,{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]})]})})})),$f=`${Jt}/region`;function jf(e="Москва"){return js().location??{name:e}}function qf(e="Москва"){const t=js(),n=r((async()=>{if(!t.location){const n=await Ft($f);t.location=n??{name:e}}}),[t,e]);return Zn($f,n),t}const Uf="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Wf=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=a?5:6,l=(e||[]).map((e=>o(li,{text:i[e],...t(e)},e))),[s,d]=r>0?[l.slice(0,r),l.slice(r)]:[l,[]],[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(Ml,{children:[c("div",{children:[o("div",{className:Uf,children:s}),o(Ol,{className:Uf,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Bl,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Tr,{embedded:!0,onClick:n,children:[o(Dl,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),Hf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Yf=(e,t,n)=>{const a=Hf("all"===t),i=Hf("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 pb-lg",children:[o(Tr,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Tr,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},Gf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__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(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(Fe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Kf=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Fe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Xf=()=>{},Jf=e=>"all"===e?"block":"hidden",Zf=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Xf,renderRemoteWorkplaceCard:l=Xf,getBalloon:s=Xf,getBalloonRemoteWorkplaces:d=Xf,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:y}]=yn(rs),{filteredItems:x,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=ds({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=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",children:[Kf(h,N),m?Gf(m):null,p&&Yf(t,w,C),o("div",{className:u("pb-3xl",Jf(w)),children:o(Wf,{filters:Qf([...t,...i]),field:{field:f,reset:y},onlyOffice:p,labels:ls})})]}),o("div",{className:"h-[600px]",children:o(us,{children:o(Ts,{points:b,isLoad:n,className:"h-full"})})})]}),c(us,{children:[x.map(r),v.map(l)]})]})})),Qf=e=>Object.keys(rs).filter((t=>e.filter((e=>ss[t](e))).length)),ey=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",ty=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:ey(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(Fe,{size:"text-h4",children:ey(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Gl,{color:"green",children:ey(s)})})]}),o(Fl,{children:o(_l,{className:"flex-wrap",children:m?.map(((e,t)=>o(Tl,{...e},String(t))))})})]},String(d))},ny=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ey(t)} №${n}`,body:e.toUpperCase()}),ay=[];const iy=async e=>{const t=await Ft(e,{method:"GET"});return Array.isArray(t)?t:ay},ry={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ly={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},sy=d((({descriptionData:e,className:t})=>{const n=jf(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=Zn(`${Jt}/atms?regionCode=${e}`,iy);return{data:t||ay,isLoad:!t&&!n}}(a);return o(Zf,{className:t,filterItems:oy,data:i,isLoad:r,initFilterState:ry,renderCard:ty,getBalloon:ny,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),oy=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>ly[t](e))),n=!a.length||a.some((t=>ly[t](e)));return t&&n}))},cy=({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(Fe,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e})]}):null]})}),o(Fl,{children:dy(t)})]},String(n)):null,dy=e=>c("div",{children:[c(_l,{className:"flex",children:[o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание банковских карт"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Инвестиционное и накопительное страхование"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Tl,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]}),my=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),uy={branches:[],remoteWorkplaces:[]};const hy=async e=>await Ft(e,{method:"GET"})||uy,py=d((({className:e})=>{const t=jf(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Zn(`${Jt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,hy);return{data:t||uy,isLoad:!t&&!n}}(n);return o(Zf,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ns,renderRemoteWorkplaceCard:cy,getBalloon:is,getBalloonRemoteWorkplaces:my,title:`Офисы филиала ${t?.name}`})})),gy=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(py,{}):o(sy,{descriptionData:e})})})),fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),yy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",xy=Wt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Te(),[m,{toggle:h}]=dn(t),p=o(Ol,{className:u("gap-lg",yy(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(Bl,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});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(Ml,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),by={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"},vy=(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:Ny(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[wy(a),r?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},Ny=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=Cy(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:ky({step:n,iconVersion:i,i:a,stepVersion:t})})})},wy=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",by.description),children:e.description}):null,o(Me,{__html:e.__html})]}),Cy=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",ky=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return Ue(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?by.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Sy=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(S,{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(vy(d,l,r))}):null,We(i,{isVertical:!0})]})})),Iy=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(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Ty=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Pr,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Py(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 Ry=()=>{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 Py(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Ey=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 _y=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(Fe,{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(Dy,{...e},String(t))))})]}):null,Dy=d((({icon:e,...t})=>{const n=fe(),{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(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Ay=(e,t)=>n=>n.name?o(np,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:fm(e,n.name),children:o(Fe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,By=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(kn,"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"})]}))),My=d((({defaultLocation:e})=>{const t=jf(e),n=fe(),{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(np,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Oy=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=qf(t?.default),[s,d]=a(""),m=zi(),u=l((()=>zy(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=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,Fy)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(Rr,{className:"pb-20",head:c("div",{children:[o(Fe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(My,{defaultLocation:t?.default}),o(By,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Ey(e.toLowerCase())(s.toLowerCase())>=.8)).map(Ay(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Fe,{size:"text-h6",children:e})}),t.map(Ay(f,g))]},e)))}),_y(e)]});var g,f})),Fy=e=>e.name?.charAt(0)??"",zy=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Vy=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=bn(Oy,n),{name:s}=jf(),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=Z(J.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[J.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(Ty,{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})})})})),Ly="burgerMenuDialog",$y=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Cn})=>{const{open:i}=bn(Vy),[l]=Ry(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Ly,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Ly})),[e,n,t,a]);return[s,{toggle:s?a:o}]},jy=[],qy=Wt((({sticky:e,...t})=>{const{menuItems:n=jy}=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),[h,p]=a(-1),[f,y]=a(""),{closeAll:x}=ge(),b=r((()=>{p(-1),y(""),x()}),[x]),v=Nn(b),N=s(null),[C,{toggle:k}]=$y({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),S=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=ge(),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(Ty,{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(),k()}),[b,k]),T=r(((e,t)=>{y(t),p(e),x(),S(e,t)}),[x,S]);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(Uy(T,"left",{activeIndex:h,currentItemPosition:f})),o(Iy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Uy(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Uy=(e,t,n)=>(a,i,r)=>o(Iy,{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)),Wy={primary:"bg-white/30",secondary:"bg-main-divider"},Hy={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Yy=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Wy[t],i=Hy[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(Fe,{size:"text-xs",color:i,children:e})})})),Gy=({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})]})]})},Ky={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Xy={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Jy={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Zy={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Qy=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:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer",Ky[a],n?Zy[a]:Jy[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Xy[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Gy({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(Yy,{count:m,version:Hf(n,a)})}):null]})})})),ex=d((e=>o(e?.item?.href?tx:nx,{...e}))),tx=d((e=>{const t=fe(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Qy,{...e,tag:"a",item:i,onClick:a})})),nx=d((({item:e={},onClick:t,...n})=>{const a=r((()=>{t&&t(e)}),[t,e]);return o(Qy,{item:e,onClick:a,...n})})),ax="hidden sm:flex absolute z-40",ix={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},rx=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=Zm({itemCount:t?.length||0});return i((()=>lx(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Um,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ix[r].item,gap:ix[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(ex,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(au,{wcmsIgnore:!0,className:u("left-6",ax,ix[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(iu,{wcmsIgnore:!0,className:u("right-6",ax,ix[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),lx=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},sx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ox=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(sx[t].wrapper,e),children:o(rx,{className:sx[t].component,tabsType:t,...n})}):null,cx="sticky top-1 z-20",dx=Wt((({className:e="",tabs:t=[],block:n,tabsType:l,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=mx(n||{}),p=D(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(globalThis?.location?.search||""),x=y.get[h],b=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,[v,N]=a(px(b,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),w=b[v],C=b.findIndex((e=>Boolean(e.selected)));i((()=>{const e=x?b.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===x)):C;N(-1===e?0:e)}),[C,x]);const k=hx(b[v],v),S=r((e=>{const t=b.indexOf(e),n=b[t];N(t),"group"===n.type&&((e,t)=>{e.text?y.set(h,e?.tabName??String(t)):y.delete(h),p.replace(`${p.pathname}?${y}`,{scroll:!1})})(e,t)}),[b]);return c(g,{className:u({[cx]:[d,f].every(Boolean)},e),defaultPadding:"p-0",block:n,...m,children:[ox({className:u({"pb-1":[n?.slots,"default"===l].every(Boolean),[cx]:[d,!f].every(Boolean)}),items:ux(t,b),activeItem:w,tabsType:l,onChange:S}),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])=>E(t,{...m?.options,slotName:k,parent:n,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(hx)?.filter(Boolean)||[]}),mx=({__id:e,anchor:t})=>t??e??"tabs",ux=(e,t)=>t?.length?t:e,hx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",px=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),gx={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},fx=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:gx[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),yx=d((({className:e="",isOpen:t,onClick:n})=>o(Bl,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),xx={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Fe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Fe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(yx,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},bx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:r,setTableInner:l,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{r===o&&s||m(!0)}),[s,o]);return vx({cell:e,cellProps:{rowIdx:n,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),l(e)},isVisible:d}})})),vx=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in xx))return null;return o(xx[n],{...t,...a})},Nx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:r,setOpenTableInnerIdx:l})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(bx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:r,setOpenTableInnerIdx:l},String(s)))):null}))),wx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Cx=(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(Fe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,kx=d((({rows:e})=>{return o(Um,{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 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Fe,{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(-${wx(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(Fe,{size:"text-xl",children:e.data}):null,e?.cols?Cx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Sx=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 sm:px-m bg-white @4xl:bg-gray relative",children:o(Fe,{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(kx,{rows:t.rowsData})})})]},a)}))}))),Ix=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Tx=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(Fe,{size:"text-xl",font:"font-light",color:Ix(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Px=Wt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[l,s]=a(0),d=r((e=>s(e)),[]),m=i?.[l]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Tx,{currencies:u,activeTabIndex:l,setActiveTabIndex:d,linkToPDF:t}),o(Sx,{activeTabIndex:l,items:m}),o(yx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Fe,{size:"text-h6",children:"Данных нет"}),o(yx,{onClick:n,isOpen:!0})]})})),Rx=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Px,{...t,onClick:n})}):null]}))),Ex=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...l})=>{const[s,d]=a(void 0),m=r((e=>d(e)),[]),[h,p]=a(void 0),g=r((e=>p(e)),[]);return c(Rx,{onHideContentClick:()=>d(void 0),tableInner:s,...l,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Fe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(fx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Nx,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...l},String(t))))}):null]})})),_x=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(au,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(iu,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,Dx=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,_x({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Ax=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:l,hiddenRowsNum:s=0,...d})=>{const m=l?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,y]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),x=(h||[]).map(((e,t)=>o(Ex,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[x.slice(0,-s),x.slice(-s)]:[x,[]],[N,{toggle:w}]=dn(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Ml,{children:[c(Dx,{controls:y,children:[b,o(Ol,{isUnfolded:N,children:v})]}),o(Bl,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(Dx,{controls:y,children:x})})]})})),Bx=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?Mx():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Fe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Ox(n):null,i?o(Me,{richVersion:r,__html:i}):null]})]}))),Mx=()=>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"}),Ox=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Fx={AdTile:Yt,ApplicationForm:Wr,BankAccountFiltration:Iu,BenefitsBlock:_u,BonusBenefitsBlock:Bu,ButtonsBlock:Ou,CalculatorBonus:qu,CalculatorBusinessDeposit:Qu,CalculatorCredit:Wo,CalculatorDeposit:wh,CalculatorRefinancing:Dh,CardTransfer:qh,Carousel:Jh,CarouselCatalogCard:ep,CarouselRecommendationCard:sp,CarouselTariffsCard:mp,DepositFiltration:Eg,ErrorBlock:Bg,Footer:Kg,GalleryLayout:ef,GrantSupport:lf,Header:Cf,Headline:S,HorizontalLayout:Sf,ImgBlock:If,LinkDocs:Of,MobileAppTile:Lf,OfficesAtmsMap:gy,ProductBlock:Ht,RichTextBlock:fy,RollupItem:xy,StepsBlock:Sy,StickyBottomMenu:qy,TabsLayout:dx,TariffsTable:Ax,TextBlock:Bx,VerticalLayout:kf,ApplicationLeadForm:_m,CreditCardForm:lg,CreditForm:Sg},zx=me((()=>{i((()=>{sn()}),[]);const e=cn();vn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");an({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Vx="cookie",Lx=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(Vx)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(Vx,"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(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Pr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function $x(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);vn(globalThis.document,"keydown",t)}const jx=d((()=>{const[e,{close:t}]=Ry(),n=Boolean(e.length);return $x(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})),qx=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Py(pe.observable,"popup",{open:t,close:n}),$x(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})),Ux="header",Wx="footer",Hx="sticky-footer",Yx={},Gx=d((({className:e,data:t=Yx,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=qt(s,l);zx(),qf();const m={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?.[Ux]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:E(i?.[Ux],{...m,slotName:Ux})}):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:m,extraProps:{className:"scroll-mt-12"}}),E(i?.[Wx],{...m,slotName:Wx})]})]}),i?.[Hx]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:E(i?.[Hx],{...m,slotName:Hx})}):null,o(jx,{}),o(qx,{}),o(Lx,{__html:d?.cookieContent?.__html})]})}));Object.assign(Gx,{childrenTypes:[],slots:()=>[Ux,Wx,Hx]});e.Blocks=Fx,e.ContentPage=Gx,e.handlerDecorator=me,e.joinList=hu,e.locationNavigator=rn,e.packageVersion="0.14.843",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,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=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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},p[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}))),k={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"}},S=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 h=k[n],p={marginTop:h.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-pre-wrap",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function P(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 R=[],E=(e,{key:t,ancestors:n=R,slotName:a=null,extraProps:i,renderProps:r=P,...l})=>{const s=i?(e,t)=>P(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||R,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?E(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const A=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:F,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:z,hasPrefix:V});const $="/api/",j=`${$}v1/storage`,q=[B.CDN,$],U=e=>(t,n)=>{if(W(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 z(V(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||F(e)||q.some(V(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&Y[l],height:d=s})=>{const m=D(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=U(m)(z(B.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[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:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?U(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=D();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:Q(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:Q(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(G,{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(" "),me=e=>me._impl(e);function ue(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])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{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})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=D(),{closeAll:t}=ge();return n=>{const a=U(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Z(J.SITE_URL);ye(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,r)))}))}}}const ye=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(V(e))&&V(e)(n||"/"),xe=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ne(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]})})),ve=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",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({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:a}),s=fe()({onClick:l,href:a,...i}),c=t??o(be,{...s});return o(e?Se:ke,{...s,children:c})})),ke=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,...xe(d),children:m}))),Se=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({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(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{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},Pe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Re=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Pe[n],t),children:e}):null,Ee=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=Te(),v=D(),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&&Ie({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:[Re(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:[_e(h,y),Ae(_({...x,extraProps:{className:"@container-normal"}})),Re(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[De(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),_e=(e,t)=>e||t?c("div",{className:"grow space-y-lg min-w-fit",children:[e,t]}):null,De=e=>u(e?"row-span-2":"@xl:row-span-2"),Ae=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Be=(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,Me=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)),Oe=(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,Fe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Fe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ve=(e,t)=>["label"in e?ze(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Oe(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Le=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?Be(n.icon,t):null,o("div",{children:Ve(n)})]}))),$e=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(Le,{benefitsVersion:t,...e},String(n))))}):null)),je=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(Ve)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?je:$e,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),We=(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(He(n))}):null,He=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ye(i,l),d=Ye(r,l);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ge({...i,iconVersion:c}),appendRight:Ge({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ge=e=>Ue(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ke=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Xe=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(Je)}):null)),Je=({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 sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Fe,{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:[Ke(2)(t)," ",n||"₽"]}):null]},String(a)),Ze=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Qe)}):null)),Qe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Fe,{size:"text-m",font:"font-light",children:e})},String(t)),et={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},tt=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:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const P=x?.src?o(ie,{image:x,imageClassName:C}):null,R=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),E=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ee,{className:e,padding:t,defaultPadding:n,...p?{title:R}:{insetTitle:R},...lt(P,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:We(y),backwardButton:k,...T,children:rt(nt(E,{benefitsVersion:s,isTabularBenefits:c}),at(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,it(g),st(f))})})),nt=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(qe,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,at=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Me,{__html:e,richVersion:t,isDotted:n,itemSize:et[a??"L"]}):null,it=e=>e?.length?o(Xe,{priceList:e}):null,rt=(...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},lt=(e,t)=>t?{rightImage:e}:{leftImage:e},st=e=>e?.length?o(Ze,{tags:e}):null;class ot{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof ot?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 ct=()=>!0,dt=(e,t)=>(...n)=>e(...n)&&t(...n),mt=(...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 ut=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&"object"==typeof e&&!ut(e)),pt=e=>e;function gt(e){return e instanceof ot?e._:e}class ft extends ot{from(e){return this.of(e.map(((e=pt)=>([,t])=>e(t))(gt)))}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(ut(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 yt extends ot{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 xt extends ot{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,gt(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 bt extends ot{proto=mt([e=>ut(this._)||"number"==typeof e,()=>ft.prototype],[e=>ht(this._)||"string"==typeof e,()=>xt.prototype],[ct,()=>yt.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 vt=e=>e instanceof ot?e:new bt(e),Nt=e=>{const t=(t,...n)=>gt(e(vt(t),...n));return t.fn=e,t},wt=[],Ct=e=>e instanceof Function?e:t=>e===t,kt=e=>(t,n,a=wt)=>vt(t).entries().reduce(((t,[n,i])=>kt(e)(i,t,a.concat(n))),e(n,[a,vt(t)])),St=Nt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?St(e.get(a),[i,n]):n)})),It=Nt(((e,t)=>t.reduce(St.fn,e))),Tt=e=>kt(((e,[t,n])=>Pt(n)?[...e,[t,gt(n)]]:e))(e,[]),Pt=e=>0===e.size();Nt(((e,t=wt)=>t.reduce(((e,t)=>e.get(t)),e)));const Rt=Nt(((e,[t,...n])=>n.length?e.set(t,Rt(e.get(t),n)):e.filter((([e])=>e!==t)))),Et=(_t=["$ref"]).map(((e,t)=>n=>Ct(e)(n[t+n.length-_t.length]))).reduceRight(dt,ct);var _t;const Dt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(At,e),At=mt([ut,(e,t)=>e[parseInt(t,10)]],[ht,(e,t)=>e[t]],[ct,pt]),Bt=(e,t)=>((e,t={})=>n=>It(t,Tt(n).map((t=>e(t)))))((([e,n])=>{return Et(e)?[(a=e,a.slice(0,-1)),Dt(t(n),n)]:[e,n];var a}))(e),Mt=e=>Tt(e).filter(((e=pt)=>([t])=>e(t))(Et)),Ot=e=>{return t=Mt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Ft(e,t){try{return e?await zt(e,t):null}catch(e){console.error(e)}return null}const zt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Vt=e=>[...new Set(e)],Lt={},$t=["/portal-resources"],jt=(e,t)=>Bt(e,(e=>t?.[e])),qt=(e,t)=>{const n=Ot(e),[r,l]=a({});return i((()=>{Ut(n).then(l)}),[n.join()]),n.length?jt(e,{...t,...r}):e},Ut=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Vt(e).filter((e=>!$t.some((t=>e.startsWith(t))))).map((async e=>[e,Lt[e]||=await zt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Ot(e)));return i.length?Ut(i,a):a}return t};function Wt(e,t={}){const n=d((t=>{const n=qt((({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 Ht=Wt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(tt,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Yt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Gt(0,t?.length)),[t]),a=t?.[n];return a?o(Ht,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Gt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Kt=(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}`}},Xt=e=>e?.replace(/[^+\d]/g,""),Jt="/api/v1";const Zt=e=>e?{phone:Xt(e)}:{},Qt=(e,t="birthday")=>e?{[t]:Kt(e)}:{},en=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),tn=(e,t=!0)=>({[t?"email":"mail"]:e}),nn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Xt(e)}:{},an=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function rn(){return rn._impl()}rn._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),rn.setup=e=>{rn._impl=e};const ln="rshb-query-params";function sn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(ln)||"";return e&&globalThis.sessionStorage?.setItem(ln,e),e}const on=e=>{const t=e.target?.closest("a"),n=rn();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=sn();if(!M(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 cn(){return cn._impl()}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}]}cn._impl=()=>({forwardQuery:on}),cn.setup=e=>{cn._impl=e};const mn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],un=e=>!e?.length,hn=e=>t=>n=>e(n)?[]:[t],pn={},gn=[];const fn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function yn(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=fn(i,r)?i:r;return!fn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=dn(!1),f=s({}),[y,{isValid:x,errors:b}]=function(e,t){const n=l((()=>t?.(e)??pn),[t,e]),a=l((()=>mn(n)(e)??gn),[n,e]),i=un(a);return[n,{isValid:i,errors:a}]}(m,n),v=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||f.current?.[String(e)],s=t?.validator??y[e],o=l&&s?s(r):[];return{value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,y,u]),N=r((e=>{f.current=e,u(e)}),[u]),w=r((()=>{f.current={},g(),u(e)}),[e,u]),C=r((e=>{e.preventDefault(),x?(t&&w(),d?.(m,e)):p()}),[t,m,x,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const xn=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 bn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}function vn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Nn(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return vn(globalThis.document,"click",n),t}const wn=({label:e,errors:t})=>e&&t?`${e}*`:e,Cn=()=>{},kn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Sn=e=>e?kn:"border-error",In=e=>e?o(Fe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Tn=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:x=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),k=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const S=b?"pr-3xl":"",I=Sn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[In(d),y?o("textarea",{className:u("block resize-y min-h-24",Pn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:x,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Pn,S,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:x,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e)]}),b]})})),Pn="w-full border rounded-md text-primary-text outline-none p-m",Rn=e=>o("div",{className:"h-6",children:e?o(Fe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),En=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=Cn,...x})=>{const b=Nn(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(_n(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:b,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(Tn,{type:l||"text","aria-label":t,label:wn({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:Dn({placeholder:d,errors:i,label:t}),value:n,...x})}),Rn(a)]})})),_n=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,Dn=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,An=d((e=>{const[t,{setFalse:n,setTrue:a}]=dn();return o(En,{isOpen:t,onOpen:a,onClose:n,...e})})),Bn=e=>e?.text||e?.key||"",Mn=()=>ue(pe.emitter,"popup"),On=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Fn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:r})=>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:On(t,a).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&&i(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const zn=d((({className:e,label:t,options:n=[],value:l,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:y})=>{const[x,{setFalse:b,setTrue:v}]=dn(),[N,w]=a(""),C=$n(g,n.length),k=x&&!C,S=r((()=>{C||v()}),[C]),I=r((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:l,onClose:c,iconVersion:d}){const m=Mn(),u=r((()=>{m.close(),c&&c()}),[c]),h=r((e=>{u(),l&&l(e)}),[u,l]),p=s(null),g=Nn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(Fn,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,h]),p}({isOpen:x,options:n,value:l,query:N,onChange:y,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[In(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Ln(m,d,C)),onClick:k?I:S,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(l)||h}),Vn(k,f)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Tn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Vn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Ln=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),$n=(e,t)=>e||0===t,jn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(zn,{...i,valid:!n,label:wn({label:t,errors:a})}),Rn(n)]}))),qn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Un=d((({field:e,input:t})=>o(jn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:qn,...e(t?.name??"")}))),Wn=(e="")=>Boolean("trade"===e||"all"===e),Hn=e=>null!=e,Yn=new Map,Gn=(e,t=Yn)=>n=>{const a=Xn(n),i=t.get(a);if(a&&Hn(i))return i;const r=e(...n);return a&&Hn(r)&&t.set(a,Promise.resolve(r)),r},Kn=e=>Boolean(e?.every((e=>Array.isArray(e)?Kn(e):!e||"string"==typeof e))),Xn=e=>Kn(e)?e.toString():"",Jn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Zn(e,t,{fallback:n,cache:r}={}){const s=l((()=>Qn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Hn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Gn(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&Jn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Qn(e){return Array.isArray(e)?e:e instanceof Function?Qn(e()):[e]}const ea=`${Jt}/branches`,ta=[];const na=async e=>await Ft(e,{method:"GET"})||ta;function aa(e=!1){const{data:t}=Zn(`${Jt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,zt);return Array.isArray(t)?t:[]}const ia=(e="")=>"ULTRASERVICE"===e,ra=d((({field:e,input:t,params:n})=>{const a=ia(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?aa(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Zn(e?`${ea}?regionCode=${e}`:null,na);return t||ta}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(jn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),la=(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}},sa=(e,t,n)=>Math.max(t,Math.min(e,n));function oa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ca({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=oa(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const da=1,ma=100,ua=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:da),max:s=(i.length?i.length-1:ma),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=la(e,{normalize:(e=0)=>i.length?ha(i)(e):sa(e,l,s),format:Ke()}),f=r((e=>{p&&p(oa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Fe,{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",kn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),ca({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),pa(a)]})})),ha=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ga=["От 1 000 ₽","До 1 000 000 000 ₽"],fa=d((({field:e,input:t})=>o(ua,{title:"Сумма, ₽",items:ga,min:1e3,max:1e9,...e(t?.name??"")}))),ya=d((({field:e,input:t})=>o(An,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),xa="client",ba=[{key:xa,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],va=d((({field:e,input:t})=>o(jn,{label:"Тип обратившегося",...t,options:ba,...e("applierType")}))),Na=d((({field:e,input:t})=>o(An,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),wa=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=Ca(t,e),c=ka(t,r,l);u.push(o("td",{children:o("div",{className:Sa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ca=(e,t)=>t&&e.toDateString()===t.toDateString(),ka=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Sa=(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"),Ia=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ta=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=Cn})=>{const{firstDayOfWeek:s,totalDays:d}=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:Ia.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:wa({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),Pa=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ra(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ea),r=a.map(((e,t)=>Da(e)?a.slice(0,t).filter(Da).length:-1)),l=a.map(((e,t)=>_a(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Ea=e=>"_"===e,_a=e=>/\d/.test(e),Da=e=>Ea(e)||_a(e),Aa=1940,Ba={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ma=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{Fa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),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",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ra(t,"__.__.____"))},onBlur:()=>{Oa(p)?Fa({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(G,{className:"mr-s",...Ba})]})})),Oa=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Aa&&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},Fa=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Oa(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))}},za=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(Ma,{onChange:a,disabled:l,onClick:e,value:t&&Kt(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Va=Pa.map((e=>({key:e}))),La=Array.from({length:(new Date).getFullYear()-Aa+1},((e,t)=>Aa+t)).reverse().map((e=>({key:String(e)}))),$a=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},ja=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},qa={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ua={className:"min-w-32",iconVersion:"black",isBorder:!1},Wa=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=dn(!1),[y,x]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:k,handleSelectYear:S,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:P,ref:R}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Nn(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(Pa.indexOf(e));const t=$a(l,Pa.indexOf(e));ja({maxDateOfMonth:t,selectedYear:l,selectedMonth:Pa.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:Va,yearsOptions:La,ref:c}})({onYearSelect:v,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:y,showCalendar:p,onChange:h,value:n}),E=((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})(R,370);return c("div",{className:u("space-y-xs",e),ref:R,children:[In(t),c("div",{className:"relative",children:[za({handleChangeVisibleCalendar:P,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":E}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...qa,className:"-rotate-90 cursor-pointer"})}),o(zn,{onChange:k,value:{key:Pa[y]},options:I,...Ua}),o(zn,{onChange:S,value:{key:String(b)},options:T,...Ua}),o("div",{className:"my-auto",onClick:C,children:o(G,{...qa,className:"rotate-90 cursor-pointer"})})]}),o(Ta,{today:n,currentMonth:y,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),Ha=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Wa,{label:wn({label:t,errors:a}),valid:Boolean(!n),...i}),Rn(n)]}))),Ya=d((({field:e,input:t})=>o(Ha,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),Ga=d((({field:e,input:t})=>o(An,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ka=d((({field:e,input:t})=>o(An,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),Xa=d((({field:e,input:t})=>o(Ha,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Ja=d((({field:e,input:t})=>o(An,{label:"Электронная почта",...e(t?.name??""),...t}))),Za=[{key:"ULTRASERVICE",text:"Ультра"}],Qa=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ei=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ti=d((({field:e,input:t})=>o(jn,{label:"Способ получения ответа",options:ei,...e(t?.name??"")}))),ni=d((({field:e,input:t})=>o(An,{label:"ФИО",...e(t?.name??""),...t}))),ai=d((({field:e,input:t})=>o(An,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),ii=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)}))}))),ri=[{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"}],li=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(ii,{paths:ri,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",oi(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":di(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ci(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,si(n)]})})})),si=e=>e?o("div",{className:"ml-s",children:o(Fe,{size:"text-l",font:"font-light",children:e})}):null,oi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ci=(e=!1)=>e?"radio":"checkbox",di=(e=!1)=>u("rounded border",{"bg-primary-main":e}),mi=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(li,{text:t,value:n,disabled:i,onChange:l},a),Rn(r)]}))),ui=d((({field:e,input:t})=>o(mi,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),hi=`${Jt}/outservice`,pi=[];async function gi(){const e=await Ft(`${hi}/outserviceregions`);return e&&Array.isArray(e)?e:pi}const fi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=Zn("outServiceRegions",gi),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(jn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),yi=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,xi=d((({field:e,input:t})=>o(An,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),bi=d((({field:e,input:t})=>o(An,{label:"Имя",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),vi=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(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Ni=d((({field:e,input:t})=>Wn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),wi=d((({field:e,input:t})=>o(An,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Ci=e=>"_"===e,ki=e=>/\d/.test(e),Si=e=>Ci(e)||ki(e),Ii=[..."+7 (___) ___-__-__"],Ti=Ii.findIndex(Ci),Pi=Ii.map(((e,t)=>Si(e)?Ii.slice(0,t).filter(Si).length:-1));function Ri(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>ki(e)?e:t.charAt(Pi[n])||e)),a=Pi.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Ti,a)):n).join("")}const Ei=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Ri(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Tn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),_i=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ei,{"aria-label":t,label:wn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Rn(a)]}))),Di=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(_i,{label:"Телефон",disabled:yi(e,t,n),...e(n),...t})})),Ai=d((({field:e})=>Wn(e("acquiringType")?.value?.key)?o(vi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Bi=Wt((({field:e,input:t,source:n})=>o(jn,{placeholder:"Выберите продукт",label:"Продукт",options:Mi(n?.productList),...e(t?.name??"")}))),Mi=e=>(e??[]).map((e=>({key:e,value:e}))),Oi=`${Jt}/regions`,Fi=[];function zi(e=Oi){const{data:t}=Zn(e,zt);return Array.isArray(t)?t:Fi}const Vi=`${Jt}/outservice/outserviceregions`,Li=d((({field:e,input:t,params:n})=>{var a;const i=zi((a=n?.typeForm,"OUTSERVICE"===a?Vi:void 0));return o(jn,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),$i=d((({field:e,input:t})=>{const n=aa(!0),a=l((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(jn,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),ji=d((({field:e,input:t})=>o(An,{label:"ФИО представителя",...t,...e("representativeName")}))),qi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Ui=/^[а-яё-]*$/i,Wi=(e="")=>Ui.test(e),Hi=hn((e=>null!=e&&""!==e)),Yi="Некорректно заполненное поле",Gi=e=>Hi(e??Yi),Ki=e=>hn((e=>e?.key&&""!==e?.key))(e??Yi),Xi=e=>hn((e=>"string"==typeof e&&e.length>1&&Wi(e)))(e??Yi),Ji=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Zi=e=>hn(Ji)(e),Qi=hn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),er={fullName:Gi(),addressBranch:Ki(),desiredMeetingDate:Gi(),product:Gi(),localities:Gi(),partnerComments:Gi(),collectionCount:Gi(),acquiringType:Ki(),serviceType:Ki(),annualRevenue:Gi(),feedbackMethod:Ki(),serviceDirection:Ki(),secondaryPhone:Zi("Укажите номер телефона"),region:Ki(),situationDescription:Gi(),sufferedFrom:Gi(),applierType:Gi(),surname:Xi("Укажите свою фамилию на кириллице"),name:Xi("Укажите своё имя на кириллице (без сокращений)"),middleName:Xi("Укажите своё отчество на кириллице"),birthday:Gi("Укажите дату рождения"),phone:Zi("Укажите номер телефона"),email:(tr="Укажите электронную почту",hn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(tr)),inn:(e=>hn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Gi(),typeForm:Gi(),consentToReceiveMaterials:Qi,consentDataProcessing:Qi};var tr;const nr=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...er,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(ar(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(ar(a)).filter(ir(e)).map((({name:e})=>[e,a[e??""]]))):r},ar=(e={})=>({name:t})=>Boolean(e[t??""]),ir=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),rr=d((({field:e})=>{const t=e("secondaryPhone");return o(_i,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?qi(t,er.secondaryPhone):t})})),lr=d((({field:e,input:t})=>o(jn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Qa,...e(t?.name??"")}))),sr=d((({field:e,input:t})=>o(An,{label:"Описание ситуации",...t,...e("situationDescription")}))),or=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],cr=d((({field:e,input:t})=>o(jn,{label:"Пострадал в",...t,options:or,...e("sufferedFrom")}))),dr=d((({field:e,input:t})=>o(An,{label:"Фамилия",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t}))),mr=["От 1 мес","До 15 лет"],ur=d((({field:e})=>o(ua,{title:"Срок, месяцев",items:mr,min:1,max:180,...e("term")}))),hr=d((({field:e,input:t})=>o(jn,{label:"Тип обслуживания",options:Za,...e(t?.name??"")}))),pr={horizontal:"@lg:flex-row",vertical:""},gr=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(Fe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",pr[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(li,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),fr=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],yr=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(gr,{className:"whitespace-normal",orientation:"horizontal",items:fr,...e(t?.name??"",{onChange:n})})})})),xr=d((({field:e,input:t})=>o(li,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const br={$ref:"/wcms-resources/outservice-productlist.json"},vr={fullName:ni,addressBranch:ra,desiredMeetingDate:Xa,product:e=>o(Bi,{...e,source:br}),localities:fi,isClient:ui,partnerComments:wi,collectionCount:Ga,acquiringType:Un,onlineCheckout:Ni,posTerminal:Ai,serviceType:hr,term:ur,amount:fa,annualRevenue:ya,vedTypes:yr,feedbackMethod:ti,serviceDirection:lr,bankEmpolee:Na,secondaryPhone:rr,applicationDate:e=>o(An,{label:"Дата и время обращения в Банк",...e}),region:e=>ia(e?.params?.typeForm)?o($i,{...e}):o(Li,{...e}),consentToReceiveMaterials:xr,sufferedFrom:cr,situationDescription:sr,representativeName:ji,applierType:va,surname:dr,name:bi,middleName:xi,birthday:Ya,phone:Di,email:Ja,inn:ai,comment:Ka},Nr=(e,t,n={})=>(a,i)=>{const r={...vr,...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("div",{children:o(r,{field:e,input:a,params:t})},i):null},wr=e=>2===e?"@xl:grid-cols-2":"",Cr=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Fe,{size:"text-h6",children:e})}):null,kr={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")},Sr=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Ir=u("bg-main-gray text-main-disabled cursor-not-allowed"),Tr=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Cn})=>{const y=r("tab"!==c?me(f):f,[c,f]),x=l((()=>xe(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[kr[n]]:!s&&!i,[Sr]:i,[Ir]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...x,onClick:y,children:p})})),Pr=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(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Rr=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Pr,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Er=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",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(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Tr,{type:"button",onClick:n,children:"Хорошо"})]})})})),_r=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:h,...p}=e,g=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Wn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,f={...p,...Mr(o),...Br(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Ar(m?.text,u),...Dr(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Dr=e=>e?.key?{isClient:e?.key===xa}:{},Ar=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Br=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Mr=e=>e?{vedTypes:Object.fromEntries(fr.map((({id:t})=>[t,t===e])))}:{},Or={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:qn[0],serviceType:Za[0],feedbackMethod:ei[0],serviceDirection:Qa[0],vedTypes:fr[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Fr=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","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),zr=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Tr,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(Fr,{blur:!0,size:"small"}):null,n]}))),Vr={primary:kr.primary,secondary:kr.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:kr.secondary,transparent:"","":""},Lr=d((e=>{const t=fe(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=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",{[Vr[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:p,...xe(m),children:h??$r(r,l)})})),$r=(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,jr=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Fe,{children:e}):null,t?o(Lr,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),qr=(e,t,n)=>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(li,{...e}),o(jr,{link:t})]}),Rn(qi(e,Qi).error)]}):o(jr,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(zr,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Ur={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:r,birthday:l,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Jt}${g?"/lead":"/sendcorporatelead"}`,y={typeForm:n,...en(a,g),...tn(r,g),...Zt(i),...Qt(s,"desiredMeetingDate"),...g?Qt(l):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...nn(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(y)});return e?.ok?await e.json():null}catch(e){return null}}},Wr=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),y=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Or[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),x=l((()=>nr(f)),[f]),b=bn(Er),v=cn(),N=r((async(e,t)=>{const a=_r({...e,...m}),i=Boolean(await Ur.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&an({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:k}]=yn(y,{resetOnSubmit:!0,formValidator:x,onSubmit:N}),S=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(xn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:k,children:[a.map(((e,t)=>c("div",{className:u(wr(e.columns),"grid gap-x-m"),children:[Cr(e.title),(e?.inputs||[])?.map(Nr(C,{typeForm:n}))]},`section-${t}`))),qr(S?C("consentDataProcessing"):void 0,s,i)]}),h?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]})})),Hr="Некорректно заполненное поле",Yr="Укажите регион, город/населенный пункт, улицу, дом",Gr=/^[\u0400-\u04FF-\s]+$/u,Kr=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),Xr=()=>hn(Kr)(Yr),Jr=e=>hn((e=>"string"==typeof e&&e.length>1&&Gr.test(e)))(e??Hr),Zr=e=>hn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Hr),Qr=(e,t)=>hn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Hr),el=e=>hn((({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),tl=e=>hn((e=>"string"==typeof e&&6===e.length))(e),nl=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){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},al={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,errorMessage:"Допустимый возраст заёмщика - от 21 года"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},il=e=>el(al[e]),rl={processPersonalDataFlg:Qi,consentProviderFlg:Qi,consentInformFlg:Qi,consentPfrFlg:Qi,consentOthersFlg:Qi,consentFATCA:Qi},ll={addressCourier:Xr(),paymentSystem:Gi("Укажите тип платежной системы"),currency:Gi("Укажите валюту"),cardCategory:Gi("Укажите категорию карты"),codeWord:(e=>hn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Wi(e)))(e??Hr))("Необходимо ввести кодовое слово"),confirmationIncome:Ki(),methodObtain:Gi(),deliveryDate:(e=>hn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},sl={organization:Ki("Выберите тип организации"),organizationAddress:hn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(Yr),organizationPhone:Zi("Укажите номер телефона"),organizationName:Gi("Укажите наименование организации"),legalForm:Gi("Укажите ОПФ"),generalSeniority:Zr("Укажите количество лет стажа"),lastJobExperience:Zr("Укажите стаж на последнем месте работы"),experience5Years:Zr("Укажите общий стаж за последние 5 лет"),jobsNumber:Zr("Укажите количество мест работы за последние 5 лет"),beginDate:Gi("Укажите дату заключения трудового договора"),addressFact:Xr(),addressRegistration:Xr(),addressRetail:Ki("Выберите адрес банка"),addressMatch:Gi(),sex:Gi("Укажите свой пол"),birthPlace:Gi("Укажите место рождения"),education:Ki("Выберите ваше образование"),housing:Ki("Выберите тип жилья"),amountWorkers:Ki("Выберите информацию о количестве сотрудников"),employment:Ki("Выберите информацию о трудоустройстве"),employerActivities:Ki("Выберите вид деятельности организации"),employerOrganization:Ki("Выберите вид организации"),positionOrganization:Ki("Выберите вашу должность"),familyStatus:Ki("Выберите семейное положение"),familyMembers:Qr(2,"Укажите количество членов семьи"),children:Qr(2,"Укажите количество детей"),dependents:Qr(2,"Укажите количество иждивенцев"),totalIncome:Qr(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Qr(10,"Укажите сумму обязательных выплат"),snils:(e=>hn(nl)(e))("Некорректный номер СНИЛС"),conscription:Gi(),armyIdFlg:Qi,dulSerie:(e=>hn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:tl("Укажите номер паспорта"),dulSubdivisionCode:tl("Укажите код подразделения"),dulIssuedBy:Gi("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Gi("Укажите дату регистрации"),retirementIncome:Gi(),otherIncome:Gi(),wages:Gi(),mandatoryPayments:Gi(),bankruptcyFlg:Gi(),shareholderFlg:Gi(),legalEntityName:Gi(),bankEmployeeCode:Gi(),partInBusiness:Gi(),regionRetail:Ki("Выберите регион"),latinSurname:Gi("Укажите фамилию"),surname:Jr("Укажите свою фамилию на кириллице"),name:Jr("Укажите своё имя на кириллице"),middleName:Jr("Укажите своё отчество на кириллице")},ol={...sl,...ll,...rl},cl={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var dl;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(dl||(dl={}));const ml=async(e,t,n)=>{try{return(await ul(e,t,n)).json()}catch(e){return console.error(e),null}};async function ul(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...hl()},credentials:"include",body:n?JSON.stringify(n):null})}const hl=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},pl=d((({onChangeEsiaStatus:e})=>{const t=rn(),n=r((async()=>{try{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},ml("/esia/getLink","POST",n));e?.link&&t.assign(e.link)}catch{e(dl.Error)}var n}),[]);return c("div",{className:"flex gap-lg items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex flex-col justify-around w-full",children:[o("p",{className:"mb-m text-xl",children:"Заполните данные через Госуслуги"}),c("ul",{className:"list-disc list-inside mb-4xl",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block mb-xl self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Tr,{type:"button",onClick:n,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),gl=e=>e?.value||"",fl=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=gl}=e,l=(s=r,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=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(l);return c},yl={url:"suggest/address"},xl={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=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:yl,addressFact:yl,organizationAddress:yl,addressCourier:yl},bl=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)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function vl({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Mn(),y=xl[n],x=r((()=>{h.current=t,f.close()}),[t]),b=r((e=>{x(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await fl({url:y.url,responseItemHandler:y.responseItemHandler,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.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(bl,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,b]),v}const Nl=d((({value:e="",onChange:t=Cn,onDaDataChange:n,name:a="",daDataQueryPrefix:i,dadata:r=!1,...l})=>{const[s,{setFalse:c,setTrue:d}]=dn(),m=vl({isOpen:s&&r,name:a,value:e,daDataQueryPrefix:i,onChange:t,onDaDataChange:n});return o(En,{value:e,onChange:t,inputRef:m,isOpen:s,onOpen:d,onClose:c,...l})})),wl=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Cl(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(Nl,{disabled:yi(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Cl=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}),kl=Wt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Cl(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Nl,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Sl=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?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Nl,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Il=d((({field:e,input:t})=>o(mi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Tl=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:Pl({textItems:r,subText:t,children:n,isPhone:a,...i})})),Pl=({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(Fe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Rl(n,s),i?o(Fe,{color:a,size:"text-m",children:i}):null]}),Rl=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Fe,{size:"text-l",children:t?o("a",{href:`tel:${El(e)}`,children:e.trim()}):e.trim()},String(n)))),El=e=>e.replace(/\D/g,""),_l=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}))),Dl=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Al=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Bl=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(Tr,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Dl,{children:a}),o(Al,{isUnfolded:t,iconVersion:i?"color":""})]}))),Ml=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Ol=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),r=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=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:r,children:n})})})),Fl=d((({children:e})=>{const[t,{toggle:n}]=dn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Ml,{className:"block sm:hidden",children:[o(Ol,{isUnfolded:t,children:e}),o(Bl,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),zl=e=>{const t=Ll(e);return o(Tl,{label:"Режим работы",value:t,className:"max-w-none"})},Vl=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Ll=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[Vl({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Vl({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},$l=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],jl=e=>$l.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??"")}}))),ql=e=>{if(!e)return null;const t=Ul(e);return c(_l,{className:"border-none",children:[o(Tl,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Wl)})}),o(Tl,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]})},Ul=e=>{const t=$l.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},Wl=({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(Fe,{size:"text-xs",children:e})},String(n)),Hl=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Tl,{label:"Валюта",value:e.currency}):null,t?o(Tl,{label:"Купить",value:String(t)}):null,n?o(Tl,{label:"Продать",value:String(n)}):null]},String(a)),Yl={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"}},Gl=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",Yl[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(Fe,{size:"text-m",color:Yl[n].text,children:t})]}))),Kl=(new Date).getDay(),Xl=e=>{const[t]=e?.slice(Kl-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(Gl,{color:"green",children:i}):null,n&&r?o(Gl,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Gl,{color:"red",children:"Выходной"})},Jl=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Zl=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Tl,{label:e,value:t&&n?n:"",subText:Jl({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),Ql=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,es=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ts=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ns=(e,t)=>{if(!e.workSchedule)return null;const n=jl(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(Fe,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e.address})]}):null]}),Xl(n)]}),o(Fl,{children:as(e)})]},String(t))},as=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=jl(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(_l,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Tl,{label:"Факс",value:t,isPhone:!0}),o(Tl,{label:"Телефон филиала",value:e,isPhone:!0}),o(Tl,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Tl,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Tl,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Tl,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(_l,{children:o(Tl,{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(Zl)})})}):c(_l,{children:[o(Tl,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Wl)})}),zl(d)]}),l?.businessScheduleVisibleTag?ql(l?.businessScheduleDescription):null,s?.currencies?.length?o(_l,{className:"flex-wrap",children:s?.currencies?.map(Hl)}):null]})},is=({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=jl(e),n=e?Ll(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ql(n):ts(n,a):es(n):""})(n)}`;return{header:a,body:r}},rs={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},ls={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ss={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)},os=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ss[t](e)))))},cs=()=>{},ds=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=cs,getBalloonRemoteWorkplaces:i=cs})=>{const[r,s,o,c]=l((()=>{const r=os(e,n),l=os(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}},ms=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),us=d((({children:e})=>ms?e:null)),hs="/icons/MapMarkerClusterIcon.svg",ps="/icons/MapMarkerClusterYellowIcon.svg";function gs({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=fs("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=fs("workplaces",e,i),l=ys(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ys(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=ys(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 fs=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?hs:ps,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ys=(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?hs:ps,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),xs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},bs={...xs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},vs=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(bs).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Ns=e=>globalThis[e],ws=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=Ns(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(Ns(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(Ns(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))};const Cs=()=>function(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return ws(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}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ks={...xs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ss=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(ks).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Is=[55.753995,37.614069],Ts=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=Cs();if(i((()=>{l.current?gs({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Ps(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),gs({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 h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(Fr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ss,{yandexMaps:l}),o(Ss,{yandexMaps:l,direction:"out"})]}),vs(l,m,u("right-2 top-80",h))]})})),Ps=e=>{const t=[Es(Rs(e,0)),Es(Rs(e,1))];return t.every((e=>e))?t:Is},Rs=(e,t)=>e.map((e=>e.coords?.[t])),Es=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,_s=e=>Number(e.toString().replace(",",".")),Ds=e=>{const{data:t,error:n}=Zn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,As);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},As=async e=>await Ft(e,{method:"POST"})||[],Bs=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Ds("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await ml("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:_s(e.latitude??Is[0]),gpsLongitude:_s(e.longitude??Is[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=ds({data:n,filtrationState:{},getBalloon:is});return c("div",{children:[o(jn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(us,{children:o(Ts,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Ms(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Os(e,t){return Ms(e,t),Ms(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Fs{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){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 zs{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){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 Vs={};function Ls(e,t=Vs){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 $s=new zs;function js(e){return Ls($s,e)}Os($s,new Fs(globalThis?.localStorage));const qs=()=>js(),Us=Wt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(jn,{placeholder:a,options:l,...e(n),...r})})),Ws=d((({field:e,input:t})=>{const{data:n}=Ds("EMPLOYEES_NUMBER"),a=qs();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Us,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Hs=d((({field:e,input:t})=>o(mi,{text:"Наличие военного билета",...e(t?.name??"")}))),Ys=d((({field:e,input:t})=>o(Nl,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Gs=d((({field:e,input:t})=>o(mi,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ks=d((({field:e,input:t})=>o(Ha,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:yi(e,t)}))),Xs=d((({field:e,input:t})=>o(Nl,{label:"Место рождения",...e(t?.name??""),...t,disabled:yi(e,t)})));function Js(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 Zs=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>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:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Me,{__html:e})})]}))),Qs=d((({field:e,input:t})=>{const[n,r]=a([]),[s]=Js("programId"),{value:d,onChange:m}=e("cardCategory"),u=e("paymentSystem")?.value?.key;i((()=>{u&&s&&(async()=>{const e=await(async(e,t)=>{const n=await ml("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(u,s);r(e),eo(e,d)||m&&m(null)})()}),[u]);const h=l((()=>n?.find((e=>e.key===d?.key))?.description),[n,d]);return c("div",{children:[o(Us,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),h?o(Zs,{__html:h}):null]})})),eo=(e,t)=>e.some((e=>e.key===t?.key)),to=d((({field:e,input:t})=>o(Nl,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),no=d((({field:e,input:t})=>o(Nl,{label:"Кодовое слово",...e(t?.name??""),...t}))),ao=d((({field:e,input:t})=>{const{data:n}=Ds("INCOME_CERT_UNITED"),a=yi(e,t);return c("div",{className:"space-y-xl",children:[a?o(Zs,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(Us,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),io=d((({field:e,input:t})=>{const{data:n}=Ds("MILITARY_STATUS");return o(Us,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ro=()=>js(),lo=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Rr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Tr,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),so=(e,t)=>{const{open:n}=bn(lo),a=Te();return r((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ul(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},oo=d((({className:e,error:t,docId:n,...a})=>{const i=so(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(li,{...a}),n?o(Tr,{embedded:!0,onClick:i,children:o(Dl,{children:"Ознакомиться"})}):null]}),Rn(t)]})})),co=d((({field:e,input:t})=>{const{productType:n}=ro(),a=cl[n??""];return t&&t.name?o(oo,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),mo=Math.round(29.5),uo=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]}))),ho="flex flex-col justify-between lg:flex-row gap-4xl",po="flex flex-col lg:w-1/2 gap-2xl",go="flex flex-col gap-y-xl min-w-52",fo=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Fe,{size:"text-h3",children:"number"==typeof e?[a,Ke(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),yo=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(Fe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(fo,{value:n,...i}):o(Fe,{size:"text-h3",children:"-"})]}))),xo=e=>vo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),bo=(e=[],t=!1,n=[])=>({...vo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),vo=(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]},No=(e,t=0)=>e?.sum?e.sum:t,wo=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Co=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ko=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ua,{items:[`От ${So(e)}`,`До ${So(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),So=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Io=({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(Fe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(gr,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),To=e=>Io({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Po=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ua,{items:e?[`От ${Ke(1)(a.min||0)} ${n}`,`До ${Ke(1)(a.max||0)} ${n}`]:[],step:t,...a}),Ro=({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?.(sa(t?.[i],n.minMonths,n.maxMonths))},Eo=(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)},_o=e=>e,Do=(e=_o)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ao=Do(),Bo=(e=_o)=>Do((t=>-e(t))),Mo=Bo(),Oo=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Fo([e,t],a),Fo=([e,t],n=[])=>({[e]:n.length?Mo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ao(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),zo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Vo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Lo=e=>$o({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$o({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&$o({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&$o({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$o=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],jo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[Vo],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Lo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Oo(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Oo(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Lo({row:e,userInputParams:t,paramsViewSettings:n})&&zo(a,["minSum","maxSum"],e)&&zo(i,["minMonths","maxMonths"],e)))||Vo)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Eo(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},qo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Uo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Wo=Wt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=xo(n?.rateRows),g=r((e=>{const t=jo(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=yn({moneyValue:No(d,2e5),monthsValue:wo(d,mo),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),x=jo(f,n,s),b=To({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(sa(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(sa(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!qo(d)&&p&&Ro({field:y,defParams:p,calcParams:x,map:Uo,monthsValue:"minMonths"})}),[n,d]),o(uo,{className:e,title:t,...h,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),ko({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),Ho({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(go,"@4xl:w-1/2"),children:[o(yo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yo,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(yo,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),We(a,{isVertical:!0}),Co(l)]})]})})})),Ho=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(li,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(li,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(li,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(li,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Yo="calculator",Go=d((({field:e,params:t})=>{const n=r((t=>{e(Yo).onChange?.(t)}),[]);return o(Wo,{...t?.calcData,padding:"p-0",defaultParams:Xo(e(Yo).value),onChange:n})})),Ko={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Xo=(e,t=!1)=>{const n=t?Jo(Ko):Ko;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Jo=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Zo=d((({field:e,input:t})=>{const{data:n}=Ds("CREDIT_IN_RSHB");return o(Us,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Qo={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"},ec=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gr,{label:wn({label:t,errors:a?.errors}),...a}),Rn(n)]}))),tc=[{id:"810",text:"Рубли"}],nc=d((({field:e,input:t})=>{const{data:n}=Ds("CURRENCY"),{programId:a}=ro(),i=l((()=>!Object.keys(Qo).includes(a||"")||"38"===a),[]),r=l((()=>i?tc:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(ec,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),ac=(e,t)=>{if(!t)return null;const n=sc(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")}},ic=(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},rc=(e,t)=>{const n=sc(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},lc=(e,t,n)=>{const a=sc(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},sc=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,oc=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=cc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Cl(n.data?.address));const s={amountWorkers:ic(e?.amountWorkers,n.data?.employee_count),employerActivities:ac(e?.employerActivities??[],a),organization:lc(e?.organization??[],i,r),employerOrganization:rc(e?.employerOrganization??[],i),organizationName:l};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},cc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),dc=d((({field:e,input:t})=>{const n=qs(),{employerActivities:a,employerOrganization:l,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=r((t=>{oc(n,e,t)}),[]);return i((()=>{d&&m&&mc(n)&&(async()=>{const t=await(async e=>{const t=await fl({url:"suggest/party",query:e});return t?.[0]})(m);t&&oc(n,e,t)})()}),[a,l,s,c]),o(Nl,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u,disabled:yi(e,t)})})),mc=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i,productType:r}=e;return[n,a,i,"creditCard"!==r||t].every(Boolean)},uc=d((({field:e,input:t})=>o(Ha,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),hc=d((({field:e,input:t})=>{const{data:n}=Ds("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(ec,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),pc=d((({field:e,input:t})=>o(Nl,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),gc=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(Ha,{label:"Дата выдачи",...e(t?.name??""),disabled:yi(e,t),minDate:a})})),fc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(Nl,{disabled:yi(e,t),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),yc=d((({field:e,input:t})=>o(Nl,{disabled:yi(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),xc=d((({field:e,input:t})=>o(Nl,{disabled:yi(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),bc=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Nl,{disabled:yi(e,t),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),vc=d((({field:e,input:t})=>{const{data:n}=Ds("EDUCATION_LEVEL");return o(Us,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Nc=d((({field:e,input:t})=>o(Nl,{label:"Электронная почта",...e(t?.name??""),...t}))),wc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_ACTIVITY_TYPE"),a=qs();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Us,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Cc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_KIND"),a=qs();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Us,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),kc=d((({field:e,input:t})=>{const{data:n}=Ds("EMPLOYMENT_INFO_UNITED");return o(Us,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Sc=d((({field:e,input:t})=>o(Nl,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Ic=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(sa(Number(n),0,5)))),[]);return o(Nl,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:yi(e,t)})})),Tc=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),c=Number(e("dependents")?.value),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Nl,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),Pc=d((({field:e,input:t})=>{const{data:n}=Ds("MARITAL_STATUS");return o(Us,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Rc=d((({field:e,input:t})=>o(Nl,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t,disabled:yi(e,t)}))),Ec=d((({field:e,input:t})=>{const{data:n}=Ds("HOUSE_TYPE");return o(Us,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),_c=d((({input:e})=>o(Zs,{__html:e?.label}))),Dc=d((({field:e,input:t})=>o(mi,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Ac=d((({field:e,input:t})=>o(Nl,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:yi(e,t)}))),Bc=d((({field:e,input:t})=>o(Nl,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t,disabled:yi(e,t)}))),Mc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Oc=(e="")=>Mc.test(e),Fc=e=>{const t={"А":"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",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},zc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("latinName")?.onChange;i((()=>{l?.(Fc(a))}),[]);const s=r((e=>{(Oc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(An,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Vc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,l=e("latinSurname")?.onChange;i((()=>{l?.(Fc(a))}),[]);const s=r((e=>{(Oc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(An,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Lc=d((({field:e,input:t})=>o(Nl,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),$c=d((({field:e,input:t})=>o(Nl,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),jc=d((({field:e,input:t})=>o(Ha,{label:"Дата рождения",...e(t?.name??""),disabled:yi(e,t)}))),qc=d((({field:e,input:t})=>o(Nl,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Uc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Wc=d((({field:e,input:t})=>o(ec,{orientation:"horizontal",items:Uc,...e(t?.name??"")}))),Hc=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(Nl,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),Yc=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(Nl,{label:"Имя",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),Gc=d((({field:e,input:t})=>{const{data:n}=Ds("ORGANIZATION_TYPE"),a=qs();return i((()=>{n&&(a.organization=n)}),[n]),o(Us,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Kc=d((({field:e,input:t})=>{const n=qs(),a=r((t=>{e?.("inn")?.onChange?.(t.data?.inn),oc(n,e,t)}),[]);return o(Nl,{label:"Наименование организации",...t,...e(t?.name??""),disabled:yi(e,t),onDaDataChange:a})})),Xc=d((({field:e,input:t})=>o(Nl,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Jc=d((({field:e,input:t})=>o(Ha,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),Zc=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(sa(Number(n),0,100)))),[]);return o(Nl,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const Qc=e=>e.map((e=>({key:e.type,text:e.name}))),ed=e=>e?.key,td=d((({field:e,input:t})=>{const[n,r]=a([]),s=js();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await ml("/public-data/creditProgramConditions","POST",{creditProgramId:e});return Qc(t?.paymentSystems||[])})(e);r(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(ec,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:ed,parse:e=>n?.find((t=>t.key===e))})})})),nd=d((({field:e,input:t})=>{const{data:n}=Ds("POSITION");return o(Us,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),ad=async()=>await ml("/public-data/regionsCardDelivery","GET")||void 0,id=d((({field:e,input:t})=>{const{programId:n,productType:a}=qs(),{data:i}=Ds("REGION_RF"),{data:l}=Zn("regionsDelivery",ad),{data:s}=Ds(rd(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(jn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),rd=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",ld=d((({field:e,input:t})=>o(Nl,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),sd=["male","female"],od=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],cd=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 fl({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return sd.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(ec,{label:"Пол",orientation:"horizontal",items:od,...e(t?.name??"")})})),dd=d((({field:e,input:t})=>o(mi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),md=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Ra(e,"___-___-___ __")):t?.(Ra(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Tn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),ud=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(md,{"aria-label":t,label:wn({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),Rn(a)]}))),hd=d((({field:e,input:t})=>o(ud,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),pd=d((({field:e,input:t})=>{const n=r((t=>{(Gr.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(Nl,{label:"Фамилия",maxLength:60,disabled:yi(e,t),...e(t?.name??""),...t,onChange:n})})),gd=d((({field:e,input:t})=>o(Nl,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),fd=d((({field:e,input:t})=>o(Nl,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t,disabled:yi(e,t)}))),yd={$ref:"/wcms-resources/delivery-cities-data.json"},xd={limitedBirthday:jc,name:Yc,surname:pd,middleName:Hc,email:Nc},bd={processPersonalDataFlg:co,consentProviderFlg:co,consentOthersFlg:co,consentInformFlg:co,consentPfrFlg:co,consentInformMaterialsFlg:co,consentPhotoFlg:co,consentFATCA:co},vd={organization:Gc,organizationAddress:wl,organizationPhone:Di,organizationName:Kc,legalForm:$c,generalSeniority:Rc,lastJobExperience:Bc,experience5Years:Ic,jobsNumber:Ac,beginDate:Ks,addressFact:Sl,addressRegistration:wl,addressRetail:Bs,addressMatch:Il,sex:cd,birthPlace:Xs,education:vc,housing:Ec,amountWorkers:Ws,employment:kc,employerActivities:wc,employerOrganization:Cc,positionOrganization:nd,familyStatus:Pc,familyMembers:Tc,children:to,dependents:pc,totalIncome:gd,expenses:Sc,snils:hd,conscription:io,armyIdFlg:Hs,dulSerie:xc,dulNumber:yc,dulIssueDate:gc,dulSubdivisionCode:bc,dulIssuedBy:fc,participantDateRegistration:Jc,retirementIncome:ld,otherIncome:Xc,wages:fd,mandatoryPayments:qc,bankruptcyFlg:Gs,initiateBankruptcyFlg:Dc,shareholderFlg:dd,legalEntityName:Lc,creditInRshbCd:Zo,bankEmployeeCode:Ys,partInBusiness:Zc,regionRetail:id,infoCard:_c,calculator:Go,confirmationIncome:ao,inn:dc,...xd},Nd={addressCourier:e=>o(kl,{...e,source:yd}),paymentSystem:td,currency:nc,cardCategory:Qs,codeWord:no,methodObtain:Wc,deliveryDate:uc,latinName:zc,latinSurname:Vc,deliveryTime:hc},wd="Согласие на все документы",Cd=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(qi(t(e?.name),Qi).error)))),[e]),[d,{toggle:m}]=dn(!0);return o("div",{className:"w-fit",children:c(Ml,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(li,{text:wd,value:a,onChange:i},n),Rn(s?"Отметьте все обязательные соглашения":"")]}),o(Tr,{embedded:!0,ariaLabel:wd,onClick:m,children:o(Al,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Ol,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Nr(t,{},bd))})]})})})),kd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=Sd(t||[],n);return a.length>2?c("div",{children:[i.map(Nr(e,{},{...xd})),o(Cd,{inputs:a,field:e})]}):(t||[])?.map(Nr(e,{},{...xd}))},Sd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(cl[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(cl[t]).includes(String(e))))}),Id=(e,t=!1)=>o(zr,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Td=e=>ul("/user-data/updateUserProfile","PUT",e),Pd=e=>ul("/user-data/updateUserTask","PUT",e),Rd=d((({className:e,seconds:t})=>o("span",{className:e,children:Ed(t)}))),Ed=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),_d=(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 Dd({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}=_d(l,t);return r((e=>{i.current=e,o()}),[])}const Ad={width:"103",height:"21"},Bd={"bg-white":"color",transparent:"white"},Md={"bg-white":"text-primary-main",transparent:"text-white"},Od=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Bd[e]},className:Md[e],width:n?.width,height:n?.height}),Fd={"bg-white":"text-primary-text",transparent:"text-white"},zd=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??"Россельхозбанк",...xe(s),children:[Od(r,n?.image,Ad),l?a??o("div",{className:"ml-s",children:o(Fe,{font:"font-medium",color:Fd[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Vd=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=dn(!1),y=r((async()=>{g();var e;await(e={captchaText:d},ul("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(e=>ul(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(x,[]),o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(zd,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Tr,{className:"w-8",embedded:!0,onClick:x,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Tn,{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(Tr,{version:"secondary",onClick:close,children:"Вернуться"}),o(zr,{version:"secondary",disabled:!d,onClick:y,children:"Отправить"})]}),p?o(Fr,{blur:!1}):null]})})})),Ld=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=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]),p=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:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:$d(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),$d=(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 ${Sn(!n||!a)} rounded-md caret-transparent outline-none`},jd=d((({disabled:e=!1,onClick:t,text:n})=>o(Tr,{type:"button",onClick:t,disabled:e,children:o(Fe,{font:"font-normal",children:n})}))),qd=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Ud=({values:e,onSuccess:t})=>{const[n,l]=a(""),[s,{setTrue:o,setFalse:c}]=dn(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=r((()=>l("")),[]),y=Boolean(0===d&&u),x=p>2||y||!e.every(Boolean),b=r((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>ml("/sms/checkCode","POST",e).then(qd))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{l(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{l(y?"Код просрочен":"")}),[y]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:x,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Wd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:l=4,consents:s,onSuccess:d=Cn,onClose:m=Cn})=>{const[u,h]=a(Array(l).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:y,timeNextReq:x,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=Ud({values:u,onSuccess:d}),C=bn(Vd),k=Xt(e),I=Dd({seconds:x,onTick:v}),T=r((async()=>{var e;await(e={phoneNumber:k,smsCodesSetName:{key:"AUTHENTICATION"}},ul("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:k,sendCode:T})}),[k,I,m]);return i((()=>{T()}),[]),o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Ld,{values:u,setValues:h,errorText:f,hasError:g}):null,Yd(x,T),n?c(Me,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Hd(b,p),y?o(Fr,{blur:!1}):null]})})})),Hd=(e,t)=>o(jd,{text:"Далее",disabled:e,onClick:t}),Yd=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Rd,{className:"pl-2xs",seconds:e})]}):o(Tr,{embedded:!0,onClick:t,children:o(Dl,{children:"Получить новый код"})}),Gd={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Kd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Xd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Jd=d((({onSubmit:e=Cn,onClose:t=Cn})=>{const[n,i]=a(""),[l,s]=a(!1),d=so(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?Kd:Gd;return o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",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:h.title})}),o(C,{align:"text-center",children:h.description}),o(gr,{className:"whitespace-normal",orientation:"horizontal",items:Xd,value:n,onChange:u}),o(Tr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Zd=d((({title:e,icon:t,description:n,onClick:a=Cn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick: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:[o(Fe,{font:"font-medium",size:"text-s",children:e}),n?o(Fe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),Qd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},em={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},tm={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},nm=e=>Object.entries(e).reduce(((e,[t,n])=>t in Qd?[...e,{contactTypeCd:{key:Qd[t]},value:n}]:e),[]),am=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in em){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:em[t]},...a}]}return e}),[]),im=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:h,armyIdFlg:p,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:rm(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in tm?[...e,{incomeTypeCd:{key:tm[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},rm=(e,t)=>(Number(e??0)+Number(t??0)).toString(),lm={WORK:"Работаю",RETIREE:"Пенсионер"},sm={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},om={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"},cm={...om,amur_card:"14",owner_card:"13",travel_card:"15"},dm=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:rm(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},mm=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}},um=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}},hm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,pm=d((function({task:e,isFromLead:t=!1,sendAspects:n=Cn,onClose:a=Cn}){const i=qs(),l=rn(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=cm[d.code],p=Boolean(om[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:y}=s[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{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:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:k=[],employmentContractDate:S,employmentTypeCd:I,organizationName:T,organizationInn:P,organizationActivityTypeCd:R,organizationTypeCd:E,organizationKindCd:_,employeesNumberCd:D,opf:A,seniority:B,generalSeniority:M,jobsNumber:O,lastWorkDuration:F,positionCd:z,maritalStatusCd:V,childrenDependents:L,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q,profile:ee}=t;return{currency:r?.key,paymentSystem:hm(i),cardCategory:hm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:hm(b),participantDateRegistration:v,housing:hm(N),beginDate:S,employment:hm(I,lm),organizationName:T,inn:P,employerActivities:hm(R),organization:hm(E),employerOrganization:hm(_),amountWorkers:hm(D),legalForm:A,generalSeniority:B?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:F?.toString(),positionOrganization:hm(z),familyStatus:hm(V),children:L?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:hm(q),confirmationIncome:hm(Q,sm),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:hm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},esiaAccountTypeCd:ee?.esiaAccountTypeCd,...dm(U),...mm(k),...um(C),...(te=w,te?.key?{sex:"MAN"===te.key?"male":"female"}:null)};var te})(e);i.participantId=f??null,i.taskId=u,i.profileId=y?.id??null,i.programId=h,i.leadForm=t,y?.id&&n(y.id,u),l.assign(g)}),[]),b=r((()=>{l.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Rr,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children: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(Zd,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${Kt(new Date(m))}`:"",onClick:x}),o(Zd,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),gm=d((function({onClose:e=Cn}){const t=rn(),n=r((()=>{t.assign("/natural/loans/all-goals")}),[]),a=r((()=>{t.assign("/")}),[]);return o(Rr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,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(Tr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Tr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),fm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},ym=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),xm=({programId:e,nextStepLink:t,productType:n,data:i})=>{const[l,{setTrue:s,setFalse:o}]=dn(!1),[c,d]=a(),m=(()=>{const e=ro();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),u=(({data:e})=>{const t=cn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});an({aspectsAttributes:ym(e,i),aspects:t,ev:{}})}),[e])})({data:i}),h=rn(),p=r((()=>{h.assign(t)}),[]),g=(e=>{const{open:t}=bn(Jd),n=bn(Wd),a=t=>async n=>{try{t&&await Td({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async r=>{"SIGNED"===r&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(p),f=bn(Wd),y=(()=>{const{open:e}=bn(pm),{open:t}=bn(gm);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:r})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:r}):t({})}}})();return{isSending:l,ok:c,handleSubmit:r((async t=>{try{s();const i=wm(t),r=await(a={profile:{phone:Xt(i.phone)}},ml("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null)));if(!r)throw new Error;const l=async()=>{await vm({programId:e,profileId:r,formData:i,productType:n,saveUserData:m,sendAspects:u}),f.close(),"debitCard"===n?p():g.open(i.phone,r)},o=async()=>{try{const t=await(async e=>{const t=await ml("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await ml("/user-data/getTaskById","POST",e)||void 0)({taskId:t});f.close(),y.open({task:e,isFromLead:!0,sendAspects:u,onClose:l})}else await l()}catch{d(!1)}},c=bm(i,n);f.open({phone:i.phone,consents:c,onSuccess:o})}catch{d(!1)}finally{o()}var a}),[])}},bm=(e,t)=>{const n=cl[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},vm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:r})=>{let l,s;const o=Nm(n,a);await Td(((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&&Kt(l,!0),email:o,phone:Xt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await ml("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:r,phone:l,email:s}=e;return{task:{taskSource:rn().origin,creditProgram:{code:Qo[t]},participants:[{birthDate:r&&Kt(r,!0),midname:i,name:n,surname:a,participantContacts:nm({phone:l&&Xt(l),email:s})}]}}})(n,e));l=t.taskId,s=t.participantId}else{const a=await(async e=>await ml("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});l=a.taskId,s=a.participantId,await Pd((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:rn().origin,id:t,participants:[{birthDate:s&&Kt(s,!0),id:e,midname:l,name:i,surname:r,profile:{id:n},participantContacts:nm({phone:o&&Xt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:fm()}}})({participantId:s,taskId:l,profileId:t,formData:n}))}r(t,l),i({participantId:s,taskId:l,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},Nm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},wm=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Cm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},km=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Cm[e.name||""]])))}},Sm=async(e,t,n=!1)=>{const a=new FormData;a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml"));return await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...hl()},credentials:"include",body:a}).then((e=>e.json())))},Im=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},Tm=e=>Math.floor(e/12),Pm=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.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=>Sm(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Rm=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},Em=e=>{const{esiaAdditionalDocument:t}=e;return[t?.inn,t?.averageMonthlyIncome?.toString(),t?.startWorkDate,t?.workLengthInFiveYears?.toString(),t?.workLength?.toString(),t?.workLengthLastJob?.toString(),t?.jobsNumberInFiveYears?.toString(),t?.pdfFilePayout,t?.pdfFileWorkbook,t?.pdfFileSigPayout,t?.xmlFilePayout,t?.xmlFileSigPayout,t?.xmlFileWorkbook].every(Boolean)},_m=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=ro(),o=r((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=l((()=>km(e,s.leadForm,a)),[e,s.leadForm]),u=r((async(e,a)=>{n(dl.Pending);try{const r=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},ml("/esia/requestProfile","POST",i).then((e=>(qd(e),e))));if(r){const e=await(async(e,t)=>{Rm(e);const n=!t&&Em(e),{profile:a,addInfo:i,document:r,addressRegistration:l,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Pm(o)),{...{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Ri(a.phone),email:a.email,dulIssueDate:r.dulIssueDate,dulIssuedBy:r.dulIssuedBy,dulNumber:r.dulNumber,dulSerie:r.dulSerie,dulSubdivisionCode:r.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:Im(l),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...s&&{addressFact:Im(s)}},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:Tm(o.workLengthInFiveYears).toString(),generalSeniority:Tm(o.workLength).toString(),lastJobExperience:Tm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(r,"debitCard"===t);o((t=>({...t,...e}))),n(dl.Success)}}catch{n(dl.Error)}var i}),[]);return i((()=>{s.productType=t;const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=e.get("code"),a=e.get("state");n&&a?u(n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),m},Dm=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),y=s(null),x=l((()=>(e=>{const t=cl[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:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),b=l((()=>Am(x)),[x]),v=l((()=>Bm(m)),[m]),N=l((()=>nr(b,v)),[b,v]),w=_m({inputs:b,nextStepLink:r,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===dl.Success}),{isSending:C,ok:k,handleSubmit:S}=xm({programId:n,nextStepLink:r,productType:m,data:h}),[,{field:I,onSubmit:T,reset:P}]=yn(w,{formValidator:N,onSubmit:S}),R=bn(Er);return i((()=>{void 0!==k&&R.open({ok:k})}),[k]),i((()=>{g&&y?.current&&y.current.scrollIntoView({block:"start"}),g===dl.Success&&P()}),[y?.current,g]),c(xn,{className:u("container space-y-m",e),title:t,...p,children:[g?null:o(pl,{onChangeEsiaStatus:f}),c("form",{onSubmit:T,className:"space-y-m relative",ref:y,children:[g===dl.Pending?o(Fr,{blur:!1}):null,x.map(((e,t)=>c("div",{className:u(wr(e.columns),"grid gap-x-m"),children:[Cr(e.title),kd({field:I,inputs:e?.inputs},m)]},`section-${t}`))),Id(d,C),g===dl.Error?o(Fe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Am=e=>e?.flatMap((e=>e?.inputs))||[],Bm=e=>({...ol,limitedBirthday:il(e)}),Mm=d((({title:e,description:t})=>{const n=Te();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(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Om=e=>e%2!=0,Fm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",zm=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(Fm),children:[E(r,{...i.options,parent:n}),Om(r.length)?o(Yt,{className:"col-span-6",...i}):null]}),c(Ml,{children:[c(Ol,{className:u(Fm),isUnfolded:s,children:[E(l,{...i.options,parent:n}),Om(l.length)?o(Yt,{className:"col-span-6",...i}):null]}),o(Bl,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Vm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Lm=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),$m=10;function jm(e=0){const t=Math.round(e*$m);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const qm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:jm(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:h,role:"listitem",children:d})})),Um=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Wm=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:h,children:p,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(Ym(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Hm(c,v):{},...N?Lm(h):{},gap:`${l}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(qm,{className:u(m,i?Um[i-1]:"",{"h-full":N},t),style:w?Hm(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Hm=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Ym=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Gm={"horizontal-list":"w-6","vertical-list":"h-6"},Km=({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?Gm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Xm=({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))},Jm=e=>t=>e.scrollWidth/t,Zm=e=>(t,n)=>{e.scrollBy({left:n*Jm(e)(t),behavior:"smooth"})},Qm=({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?[Bo()(i),Do()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?Zm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?Zm(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:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},eu={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},tu=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Qm({itemCount:s.length}),g=nu(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Wm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Xm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",eu[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(Km({activeIndex:t,onClick:f,listType:a}))}):null})),nu=(e=!1)=>({behavior:e?"auto":"smooth"}),au=d((({className:e,name:t,...n})=>o(Tr,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),iu=d((e=>o(au,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),ru=d((e=>o(au,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),lu="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",su=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?ou(t):null,r?o(iu,{wcmsIgnore:!0,className:u(cu(i),m?"left-1":"left-0"),onClick:s}):null,l?o(ru,{wcmsIgnore:!0,className:u(cu(i),m?"right-1":"right-0"),onClick:d}):null]})})),ou=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(lu,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(lu,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),cu=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),du=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:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=Qm({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(Wm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(su,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(tu,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),mu=({blocksToRender:e,...t})=>o(du,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:E(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Vm(!0)),children:P(e,t)},String(n))})}),uu=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[hu(n,t),o(zm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[hu(n,t),mu({...a,blocksToRender:t})]});default:return null}})),hu=(e,t)=>e&&!t.length?o(Mm,{...e}):null,pu=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),gu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(vi,{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))))),fu=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,pu(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(yu(a)).filter(Boolean))]}),n?o("div",{children:o(Tr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),yu=e=>([t,n])=>{const a=n?.type;return"array"===a?xu(t,e)(n):null},xu=(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(Fe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(gu,{items:a,multiple:!n?.single,...t(e)})]},e)},bu=e=>e;function vu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Nu=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,wu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Nu(t[e])||Nu(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Nu(t[e])||Nu(n[e])||Cu(t[e])<=Cu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Nu(t[e])||Nu(n[e])||Cu(t[e]?.min)>=Cu(n[e]?.min)&&Cu(t[e]?.min)<=Cu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Nu(t[e])||Nu(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Nu(t[e])||Nu(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Cu=e=>Number(e||0),ku=(e,{block:t,page:n,normalize:a=bu})=>{const i=t?.blocks||[],[r,s]=yn(e),o=l((()=>vu(i,i.map((e=>jt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=bu)=>e?.filter((([,e])=>wu(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Su={},Iu={},Tu=Wt((({className:e,filtrationSchema:t=Su,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=ku(Iu,{block:i.block,page:i.options?.page}),d=o(zn,{className:"w-64",label:n?.title,options:Pu(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Pu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(fu,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Tr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(uu,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Pu=e=>vu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Ru=(e=!1)=>e?"text-left":"text-center",Eu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},_u=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",Eu[t],e),style:{width:r,height:r},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),Du=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:Ru(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(Au)}):null]})})),Au=({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(_u,{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(Fe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),Bu=(e,t,n)=>{return o(du,{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(Fe,{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(Fe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Mu=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(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?Bu(e,0,t):null]}))),Ou={start:"justify-start",center:"justify-center",end:"justify-end"},Fu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Ou[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:We(e)})})),zu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(Fe,{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:Ke(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]})]}))),Vu=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Fe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Lu=({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(zu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(yo,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(Vu,{title:e,...l}),$u={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},ju={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},qu=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=$u.prefMonthsNum,prefTravelBonusRate:r=$u.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||ju,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},Uu=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=yn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=qu(l,n);return o(uo,{className:e,title:t,...r,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Po({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Lu({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:go,children:[f>=0?o(yo,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,We(a,{isVertical:!0}),Co(i)]})]})})})),Wu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Hu=e=>Io({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Yu=" (c капитализацией)",Gu=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:go,children:[o(yo,{title:`Доход в конце срока${r?Yu:""}`,value:e,postfix:n,prefix:"+"}),o(yo,{title:`Сумма в конце срока${r?Yu:""}`,value:t,postfix:n}),We(a,{isVertical:!0}),i?.map(Co)]}),Ku={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Xu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ju=(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?Ku[e?.rateType]:"",{data:n}=Zn(t?`${Jt}/depositrates/${t}`:null,zt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Zu(s,e)&&zo(a,["minSum","maxSum"],e)&&zo(n,["minDays","maxDays"],e)))||Xu,{rate:m}=d,u=Qu(m,e),h=a+u,p=c||[Xu];return{...d,...Fo(["minSum","maxSum"],p),...Fo(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Zu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Qu=(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)},eh=Wt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=yn({moneyValue:No(l,1e5),daysValue:wo(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=Ju(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=p;return o(uo,{className:e,title:t,...d,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ua,{items:[`От ${Wu(b.min||0)}`,`До ${Wu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[th(p,h),Hu({...h("isMonthlyInterestPayment")})]})]}),Lu({rate:y,depositeName:x,isShowDepositeName:r}),Gu({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),th=(e,t)=>c("div",{className:"space-y-s",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(li,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(li,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),nh=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},ah={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},ih=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?sh(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=>[lh({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),lh({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),lh({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),lh({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,zo(a,["minSum","maxSum"],t),zo(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||ah,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=rh(p,e),f=a+g,y=t||[ah];return{...m,...Fo(["minSum","maxSum"],y),...Fo(["minMonths","maxMonths"],y),availableMonths:nh(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}},rh=(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)},lh=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],sh=(e,t)=>e+Math.round((t-e)/2),oh=(e="rub")=>"rub"===e,ch=(e,t)=>{const{minMonths:n,maxMonths:a}=Fo(["minMonths","maxMonths"],hh(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:sa(i,n,a)}},dh=(e,t)=>{const{minSum:n,maxSum:a}=Fo(["minSum","maxSum"],hh(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:sa(i,n,a)}},mh=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),uh=e=>{const t=oh(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},hh=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},ph=(e,t=!1)=>t?Io({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,gh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[fh(t("isReplenish"),e,a),yh(t("isWithdrawn"),e,a),xh(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Hu(t("isMonthlyInterestPayment")):null,ph(t("isRemoteRegistration"),e.isShowRemoteRegistration),bh(t("extraPercent"),n),e.isShowNewClient?o(li,{text:"Новый сберегатель",...t("isNewClient")}):null]})},fh=(e,t,n=!1)=>t.isShowReplenish?Io({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,yh=(e,t,n=!1)=>t.isShowWithdrawn?Io({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,xh=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,bh=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Fe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(zn,{options:t,...e})]}):null,vh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Nh={text:"₽",key:"rub"},wh={text:"Без учета надбавки",key:"0"},Ch=Wt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Nh],g=r((e=>t=>e?{...t,...uh(t),...dh(t,e),...ch(t,e),...mh(t,e)}:t)(h),[h]),[f,{field:y}]=yn({moneyValue:No(d,2e4),monthsValue:wo(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Nh,extraPercent:d?.extraPercent??wh},{normalizer:g}),x=Ph(y),b=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=hh(h,x),w=ih(f,N,s),{rate:C,income:k,finalSum:S,type:I=""}=w,T=r((()=>{Ro({field:y,defParams:bo(N,b,v),calcParams:w,monthsValue:"minMonths",map:vh})}),[y,h,v]);i((()=>{!qo(d)&&N&&T()}),[d,h]);const P=y?.("extraPercent")?.value?.key,R=Th(C,P),E=C===bo(N,b)?.rate&&P===v?.at(-1)?.key;return o(uo,{className:e,title:t,...m,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[c("div",{className:"flex gap-m",children:[Po({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:kh(x?.key)}),h&&h?.length>1?o(jn,{label:"Валюта",options:p,...y("currency")}):null]}),ko({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),gh({...w,...s},y,v)]}),Lu({rate:R,children:Ih(T,E)}),Gu({income:k,finalSum:S,buttons:[...a,Sh(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),kh=(e="")=>oh(e)?1e3:100,Sh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Ih=(e,t=!1)=>t?null:o(Tr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Th=(e,t)=>Number(e)+Number(t??0),Ph=e=>e?.("currency")?.value??Nh,Rh=e=>Eh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Eh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Eh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],_h={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Dh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[_h],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Rh({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Oo(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Oo(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Rh({row:e,userInputParams:t,paramsViewSettings:n})&&zo(a+l,["minSum","maxSum"],e)&&zo(r,["minSumOld","maxSumOld"],e)&&zo(l,["minSumExtra","maxSumExtra"],e)&&zo(i,["minMonths","maxMonths"],e)))||_h)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Eo(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Ah=Wt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=yn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=Dh(d,n,r),p=l((()=>xo(n?.rateRows)?.rate),[n?.rateRows]),g=To({...m("isAnnuity")});return o(uo,{className:e,title:t,...s,children:c("section",{className:u(ho,e),children:[c("div",{className:po,children:[Po({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),Po({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),ko({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Bh({...h,...r},m),h.isExtraMoney?Po({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(go,"@4xl:w-1/2"),children:[o(yo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yo,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(yo,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(yo,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),We(a,{isVertical:!0}),Co(i)]})]})})})),Bh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(li,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(li,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(li,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Mh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=la(e,{normalize:(e=i)=>n&&a?String(sa(Number(Oh(e)),n,a)):Oh(e),format:Ke(l)}),d=r((e=>t&&t(Oh(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Oh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Fh=d((e=>o(Mh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Fe,{size:"text-xl",font:"font-light",children:"₽"})})}))),zh=new zs;function Vh(){return Ls(zh)}Os(zh,new Fs(globalThis?.sessionStorage));const Lh={private:"p2p/registerP2P",business:"b2c/registerB2C"},$h=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Rr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",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(S,{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]})})},jh=e=>{const t=bn($h),n=Vh(),a=rn(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=rn(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Jt}/payment/${Lh[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:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},qh={amount:1500},Uh=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=jh(i),[{amount:s},{field:d,onSubmit:m}]=yn(qh,{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(Fh,{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(zr,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),Wh=({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(G,{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})]}),Hh="relative h-full",Yh={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Gh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(Jh),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:Kh(n,{someCardsHighlighted:r}),children:[P(n,a,{className:Xh(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),Jh(n)?Wh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Kh=(e,{someCardsHighlighted:t})=>u(Hh,t&&(Jh(e)?"pt-3xl":"pt-16")),Xh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Hh,"min-w-80",Yh[a],t&&(Jh(e)?"pt-16":"pt-3xl"),Vm(n),n&&"h-full"),Jh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Zh=Wt((({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(du,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?Qh(s?.block?.blocks):[],hasBlur:!0,children:Gh({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Qh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],ep={black:"bg-black",white:"bg-white"},tp=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(Ee,{className:"h-full",padding:d,title:o(S,{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:We([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(Fe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(np)]}):null,i?c(Fe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),np=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ep[e]}`},String(t)),ap=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...xe(i),children:r})})),ip=[{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"}}],rp=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=>ip.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ue(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}})),h=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},lp(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:We(m,{className:sp(s??!1,i??!1,n),buttonClassName:h})}),l?o(Fe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),lp=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",sp=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),op=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="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(ap,{href:i,target:m,className:"h-full",data:ym(v),children:c(Ee,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...lt(Ue(r)?o(ie,{image:r}):null,y),buttons:d.length?o(rp,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(qe,{benefits:f}),s?o(Me,{__html:s,isDotted:l,itemSize:"list-s"}):null,cp(a,p)]})})}))),cp=(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,dp=new he,mp=(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(Fe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Fe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:We(i)}):null]},String(t))},up=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const x=l((()=>h.map(mp)),[h]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[N,C]=a(!1);i((()=>dp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const k=r((()=>{dp.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.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(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Ml,{children:[c("div",{children:[b,o(Ol,{isUnfolded:N,children:v})]}),h.length>=m?o(Bl,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:k}):null]}):o("div",{children:b})]})})),hp=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=rn();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await ul("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const r=setInterval(i,24e4);return()=>clearInterval(r)},pp=d((({step:e=10,description:t,showPercentage:n=!0})=>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:[e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),gp=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(pp,{step:a,showPercentage:!1})]})})}));var fp;!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"}(fp||(fp={}));const yp=e=>ml("/user-data/getTaskStatus","POST",e),xp=async e=>{const t=await ml("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},bp=d((({title:e,interval:t=0,onEnd:n=Cn})=>{const[i,r]=a(t);Dd({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(S,{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(Rd,{seconds:i})})]})]})})),vp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Cn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(bp,{interval:s,onEnd:d}):null]}),o(Np,{title:n,items:a}),o(Np,{title:i,items:r,countColumns:!0}),l?o(Lr,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Np=({title:e,items:t,countColumns:n=!1})=>{const a=Te();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(Fe,{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",wr(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:wp(e)},t)))}):null]})]}):null},wp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Fe,{color:"text-secondary-text",size:"text-l",children:e}),o(Fe,{color:"text-primary-text",size:"text-xl",children:t})]}),Cp=d((()=>o(vp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),kp=d((({onExpire:e})=>{const{statusInfo:t}=qs();return o(vp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),Sp=d((()=>{const{statusInfo:e}=qs(),t="courier"===e?.methodObtain;return o(vp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ip=d((()=>{const{statusInfo:e}=qs();return o(vp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Tp(e),buttonText:"Вернуться на главную"})})),Tp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Kt(e?.deliveryDate)}]):t},Pp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Rp=d((()=>{const[e,t]=a(fp.process),{taskId:n}=qs();i((()=>{(async()=>{for(const e of Pp)await xp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await yp({taskId:n});a&&a?.statusCd!==fp.process&&(e(),t(a.statusCd))}),[n]);_d(l,3e4);const s=r((()=>t(fp.rework)),[]);return Ep(e,s)})),Ep=(e,t)=>({IN_PROCESS:o(kp,{onExpire:t}),CANCELLED:o(Cp,{}),FAILED:o(Cp,{}),DRAFT:o(Cp,{}),APPROVED:o(Ip,{}),PRE_DECISION:o(Ip,{}),REVISION:o(Sp,{})}[e]||o(Sp,{})),_p=e=>(t,n)=>t.filter((e=>e)).map((t=>[Dp(n,e),Ap(t,e),Bp(t,e),zp(t,e),Mp(t,e),Op(t,e),Fp(t,e)].some(Boolean)?{...t,required:!1}:t)),Dp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ap=({name:e},t)=>"wages"===e&&"RETIREE"===t("employment")?.key&&!t("inn"),Bp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Mp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Op=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Fp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),zp=({name:e},t)=>"snils"===e&&Vp(t),Vp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Lp={...vd,...Nd},$p=({field:e,inputs:t,params:n})=>t.map(Nr(e,n,Lp)),jp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:r,condition:l},s)=>{const c=_p(qp(t))(e,n),d=[Fp({condition:l},qp(t))?null:Cr(r),...$p({field:t,inputs:c,params:a})].filter(Boolean);return d.length?o("div",{className:u(wr(i),"grid gap-x-m"),children:d},`section-${s}`):null})),qp=e=>t=>e(t)?.value,Up=({formState:e,inputs:t,step:n,productType:a})=>{return nr(_p((t=>e[t]))(t,n),{...ol,limitedBirthday:il(a),dulIssueDate:(i=e.limitedBirthday,hn((e=>!(!e||!i)&&e.getTime()>=new Date(i?.getFullYear()+14,i?.getMonth(),i?.getDate()).getTime()))("Укажите дату выдачи паспорта"))})(e);var i},Wp=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tr,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(zr,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Hp=(e,t,n)=>({...n[e],...t,limitedBirthday:Yp(t?.limitedBirthday),dulIssueDate:Yp(t?.dulIssueDate),participantDateRegistration:Yp(t?.participantDateRegistration),beginDate:Yp(t?.beginDate),deliveryDate:Yp(t?.deliveryDate)}),Yp=e=>{try{return e?new Date(e):void 0}catch(e){return}},Gp=(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:"",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},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Kp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...Gp(),{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Xp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Jp=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:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return{employmentContractDate:Kt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:nm({organizationPhone:p&&Xt(p)}),participantAddresses:am({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},Zp=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:r="",email:l,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g,housing:f,addressRegistration:y,addressFact:x,addressMatch:b}=e;return{birthDate:Kt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Kt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:g?Kt(g,!0):void 0,homeMatchFlg:b,houseTypeCd:f,participantContacts:nm({phone:Xt(r),email:l}),participantAddresses:am({addressRegistration:y,addressFact:x}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Qp=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(l=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),l?new Date(l).toISOString().split(".")[0]:""),office:{id:"3"},...r}:{};var l},eg=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},tg=(e,t)=>{switch(e){case 0:default:return{};case 1:return Zp(t);case 2:return Jp(t);case 3:return im(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:am({addressCourier:t})}:{}})(t)}},ng=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=5===e,c=qs(),d=l((()=>Hp(e,c.leadForm,Kp)),[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 Pd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:rn().origin,id:t,...eg(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...tg(i,a)}],...Xp(a),...Qp(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]},ag=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((t=>Up({formState:t,inputs:s,step:e,productType:"creditCard"})),[s]),[m,u,h]=ng({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=yn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[jp({sections:t,field:p,step:e}),o(Wp,{isSending:h,step:e,onPrevStep:n})]})})),ig=[{title:"Персональные данные",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:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!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}]}],rg=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...ig,{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 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{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:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["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"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],lg=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],sg=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(hp,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=rg[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(gp,{stepsTitles:lg,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Rp,{}):o(ag,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),og=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(pp,{step:a,showPercentage:!1})]})})})),cg=d((()=>o(vp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),dg=d((({onExpire:e})=>{const{statusInfo:t}=qs();return o(vp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),mg=d((()=>{const{statusInfo:e}=qs();return o(vp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ug=d((()=>{const{statusInfo:e}=qs();return o(vp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{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:"Вернуться на главную"})})),hg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],pg=d((()=>{const[e,t]=a(fp.process),{taskId:n}=qs();i((()=>{(async()=>{for(const e of hg)await xp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await yp({taskId:n});a&&a?.statusCd!==fp.process&&(e(),t(a.statusCd))}),[n]);_d(l,3e4);const s=r((()=>t(fp.rework)),[]);return gg(e,s)})),gg=(e,t)=>({IN_PROCESS:o(dg,{onExpire:t}),CANCELLED:o(cg,{}),FAILED:o(cg,{}),DRAFT:o(cg,{}),APPROVED:o(ug,{}),PRE_DECISION:o(ug,{}),REVISION:o(mg,{})}[e]||o(mg,{})),fg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Tr,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(zr,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),yg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},xg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:yg[a?"annuity":"differential"]}},bg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},vg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Zp(t);case 2:return Jp(t);case 3:return im(t);default:return{}}},Ng=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...Gp(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],wg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=dn(!1),o=4===e,c=qs(),d=l((()=>Hp(e,c.leadForm,Ng)),[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&&r&&l){const t=await Pd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:rn().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...vg(i,a)}],...xg(a),...bg(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]},Cg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=qs(),m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((t=>Up({formState:t,inputs:u,step:e,productType:"credit"})),[u]),[p,g,f]=wg({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=yn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[jp({sections:t,field:y,step:e,params:{calcData:m}}),o(fg,{step:e,isSending:f,onPrevStep:a})]})})),kg=[[{columns:1,inputs:[{name:"calculator"}]}],[...ig,{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 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerOrganization",required:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{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:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["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:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],Sg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Ig=Wt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(hp,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=kg[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(og,{stepsTitles:Sg,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(pg,{}):o(Cg,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(l))})]})})})),Tg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Pg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Rg=1e9,Eg={sum:{min:1e4,max:Rg},period:3},_g=Wt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=ku(Eg,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:Dg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Ag(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(fu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Fh,{label:a?.title,min:500,max:Rg,...d("sum",{parse:e=>({min:Number(e),max:Rg}),format:({min:e})=>String(e)})}),o(ua,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(uu,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Dg=e=>Vt((e?.paramsSource?.rateRows||[]).filter(Tg).flatMap((e=>Pg(e.minMonths,e.maxMonths)))),Ag=e=>Vt(e.flatMap((e=>e||[])).filter(Tg).flatMap((e=>Pg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Bg=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,Mg=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:Bg(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),Og=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Fg(n))})})),Fg=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,...xe(t),children:i||null})},String(a)):null},zg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Vg(e)}))),Vg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Lg,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Lg=d((({className:e,item:t})=>{const[n,{toggle:a}]=dn(!1);return c(Ml,{className:e,role:"menuitem",children:[c(Tr,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Dl,{children:[o(_u,{className:"shrink-0",...t.icon}),o(Fe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Al,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Ol,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Og,{items:t.items}):null})]})})),$g=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(jg)}):null)),jg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Fe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(qg)})]},String(t)),qg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Ug(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Ug=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Wg(t)}`,children:o(Fe,{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})}},Wg=e=>e.replaceAll(/\D/g,""),Hg=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{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}`})})),Yg=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(Fe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Hg,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),Gg=d((({className:e="",index:t,...n})=>{const a=fe(),{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}`})})),Kg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Fe,{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(Gg,{index:t,...e},String(t))))}):null]}))),Xg=Wt((({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:h,otherLinks:p=[]}=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(zg,{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($g,{items:l}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(rp,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Lr,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Yg,{title:d,links:r}),o(Kg,{links:i,license:h})]})})),Jg=(e=!1)=>e?{}:{padding:"p-0"},Zg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Qg=[1,2,3,4],ef={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},tf=Wt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=((e={})=>{const[t,n]=a(e.blocks??[]),r=Vh(),s=r?.offerIds||[],o=l((()=>{const n=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>n.get(e))).filter((e=>Boolean(e))),...t.filter((({__id:e=""})=>!s.includes(e)))]}),[t,s]);return i((()=>n(o)),[]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",Zg[n],e),padding:t,version:s,isTheme:c,...h,children:_({...h,block:{...m,blocks:p},renderProps:nf({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>ef,allowRemoveChild:e=>(e?.blocks??[]).length>5}),nf=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>P(n,{...a,blockDecorator:af(a.blockDecorator,i)},{className:u("w-full",Vm(t)),...Jg(e)}),af=(e,t=0)=>(n,a)=>e?.({...n,render:e=>lf(t)({...n,...e},a)},`wrap_${a}`)??lf(t)(n,a),rf=e=>Number(e)<5?"":"hidden",lf=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return Qg.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(ap,{...r.content?.link,className:u(rf(e),(l=e,Qg.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},sf=Wt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=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(jn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Lr,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:ym(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),of={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},cf=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: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":`${of[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...df(h),...xe(s),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"})}))),df=e=>e?{"data-test-id":e}:null,mf="chatbot",uf="text-page__btn-chat",hf="webchat-js-container:webchat_rshb",pf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},gf=async(e,t)=>{const n=e.target;n?.classList.contains(uf)||n?.classList.add(uf);globalThis.document.getElementById(hf)||await ws(mf,t)},ff=async e=>{const t=await ws(mf,`${e}/bundle.js`,!0);((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)}})(`${e}/bundle.css`);globalThis.document.getElementById(hf)?t?.chatOpen?.():(yf(),t?.render?.(hf,!0,"/webchat-api","@container fixed right-0 bottom-0 top-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},yf=()=>{const e=globalThis.document.createElement("div");e.id=hf,globalThis.document.body.appendChild(e)},xf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:l="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const l=pf[e??""];return{load:r((t=>{l&&(n(!0),"business"===e?ff(l).finally((()=>n(!1))):gf(t,l).finally((()=>n(!1))))}),[l,e]),isLoading:t}})(e);return o(cf,{className:n,image:{icon:"ChatBotIcon",iconVersion:t},ariaLabel:l,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),bf={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"},vf=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",bf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Nf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=D(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(zd,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):wf(g,l),c("div",{className:"flex gap-lg items-center",children:[B.CHAT_BOT?o(xf,{version:i,iconVersion:m,chat:B.CHAT_BOT,buttonSize:"medium"}):null,o(vf,{version:i,...a})]})]})})),wf=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Cf={"bg-white":"primary",transparent:"transparent"},kf=Wt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Cf[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(Nf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),Sf=Wt((({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=D();return o(g,{className:u("relative flex flex-col",Zg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",Vm(l)),...Jg(a)}})})}),{childrenTypes:[]}),If=Wt((e=>o(Sf,{...e})),{childrenTypes:[]}),Tf=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",Ou[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Pf=["байт","Кб","Мб","Гб","Тб","Пб"],Rf=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,...xe(r),children:[e,t?c(Fe,{size:"text-l",font:"font-light",children:[t," ",Ef(d,m),o(Fe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Ef=(e,t)=>e||t?o("span",{children:", "}):"",_f=(e,t)=>(n,a)=>{const i=U(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))} ${Pf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?Af(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Rf,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:Df(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},Df=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,Af=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},Bf=d((({href:e,__html:t,target:n,onClose:a})=>c(Rr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Lr,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Tr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),Mf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=bn(Bf),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:[Df(i),o(Fe,{font:"font-light",children:e})]}):null})),Of={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Ff=Wt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{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",Of[l]),role:"list",children:i.map(zf(d,r))}):null]})})),zf=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Vf(t)(n,a):_f(e,t)(n,a)},Vf=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(Mf,{...a,icon:e,href:Lf(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},Lf=e=>"href"in e,$f=Wt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"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:p,...f,children:c(Ee,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:We(a,{className:"flex-wrap"}),children:[i?o(Fe,{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(Me,{__html:l,itemSize:"list-m"}):null,o(Fe,{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]})]})})})),jf=`${Jt}/region`;function qf(e="Москва"){return js().location??{name:e}}function Uf(e="Москва"){const t=js(),n=r((async()=>{if(!t.location){const n=await Ft(jf);t.location=n??{name:e}}}),[t,e]);return Zn(jf,n),t}const Wf="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Hf=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=a?5:6,l=(e||[]).map((e=>o(li,{text:i[e],...t(e)},e))),[s,d]=r>0?[l.slice(0,r),l.slice(r)]:[l,[]],[m,{toggle:u}]=dn(!1);return o("div",{children:e?.length?o("div",{children:c(Ml,{children:[c("div",{children:[o("div",{className:Wf,children:s}),o(Ol,{className:Wf,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Bl,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Tr,{embedded:!0,onClick:n,children:[o(Dl,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),Yf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Gf=(e,t,n)=>{const a=Yf("all"===t),i=Yf("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 pb-lg",children:[o(Tr,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Tr,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},Kf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__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(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(Fe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Xf=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Fe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Jf=()=>{},Zf=e=>"all"===e?"block":"hidden",Qf=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Jf,renderRemoteWorkplaceCard:l=Jf,getBalloon:s=Jf,getBalloonRemoteWorkplaces:d=Jf,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:y}]=yn(rs),{filteredItems:x,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=ds({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=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",children:[Xf(h,N),m?Kf(m):null,p&&Gf(t,w,C),o("div",{className:u("pb-3xl",Zf(w)),children:o(Hf,{filters:ey([...t,...i]),field:{field:f,reset:y},onlyOffice:p,labels:ls})})]}),o("div",{className:"h-[600px]",children:o(us,{children:o(Ts,{points:b,isLoad:n,className:"h-full"})})})]}),c(us,{children:[x.map(r),v.map(l)]})]})})),ey=e=>Object.keys(rs).filter((t=>e.filter((e=>ss[t](e))).length)),ty=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",ny=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:ty(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(Fe,{size:"text-h4",children:ty(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Gl,{color:"green",children:ty(s)})})]}),o(Fl,{children:o(_l,{className:"flex-wrap",children:m?.map(((e,t)=>o(Tl,{...e},String(t))))})})]},String(d))},ay=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ty(t)} №${n}`,body:e.toUpperCase()}),iy=[];const ry=async e=>{const t=await Ft(e,{method:"GET"});return Array.isArray(t)?t:iy},ly={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},sy={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},oy=d((({descriptionData:e,className:t})=>{const n=qf(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=Zn(`${Jt}/atms?regionCode=${e}`,ry);return{data:t||iy,isLoad:!t&&!n}}(a);return o(Qf,{className:t,filterItems:cy,data:i,isLoad:r,initFilterState:ly,renderCard:ny,getBalloon:ay,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),cy=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>sy[t](e))),n=!a.length||a.some((t=>sy[t](e)));return t&&n}))},dy=({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(Fe,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Fe,{size:"text-l",children:e})]}):null]})}),o(Fl,{children:my(t)})]},String(n)):null,my=e=>c("div",{children:[c(_l,{className:"flex",children:[o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Оформление и обслуживание банковских карт"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Инвестиционное и накопительное страхование"})}),o(Tl,{label:"Операции для физических лиц",children:o(Fe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Tl,{label:"Режим работы",className:"max-w-none",children:o(Fe,{children:e})})]}),uy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),hy={branches:[],remoteWorkplaces:[]};const py=async e=>await Ft(e,{method:"GET"})||hy,gy=d((({className:e})=>{const t=qf(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Zn(`${Jt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,py);return{data:t||hy,isLoad:!t&&!n}}(n);return o(Qf,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ns,renderRemoteWorkplaceCard:dy,getBalloon:is,getBalloonRemoteWorkplaces:uy,title:`Офисы филиала ${t?.name}`})})),fy=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(gy,{}):o(oy,{descriptionData:e})})})),yy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),xy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",by=Wt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Te(),[m,{toggle:h}]=dn(t),p=o(Ol,{className:u("gap-lg",xy(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(Bl,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});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(Ml,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),vy={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"},Ny=(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:wy(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Cy(a),r?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},wy=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=ky(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:Sy({step:n,iconVersion:i,i:a,stepVersion:t})})})},Cy=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",vy.description),children:e.description}):null,o(Me,{__html:e.__html})]}),ky=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Sy=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return Ue(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?vy.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Iy=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(S,{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(Ny(d,l,r))}):null,We(i,{isVertical:!0})]})})),Ty=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(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Py=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Pr,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Ry(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 Ey=()=>{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 Ry(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},_y=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 Dy=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(Fe,{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(Ay,{...e},String(t))))})]}):null,Ay=d((({icon:e,...t})=>{const n=fe(),{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(Fe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),By=(e,t)=>n=>n.name?o(ap,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:ym(e,n.name),children:o(Fe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,My=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(kn,"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"})]}))),Oy=d((({defaultLocation:e})=>{const t=qf(e),n=fe(),{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(ap,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Fy=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Uf(t?.default),[s,d]=a(""),m=zi(),u=l((()=>Vy(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=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,zy)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(Rr,{className:"pb-20",head:c("div",{children:[o(Fe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Oy,{defaultLocation:t?.default}),o(My,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&_y(e.toLowerCase())(s.toLowerCase())>=.8)).map(By(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Fe,{size:"text-h6",children:e})}),t.map(By(f,g))]},e)))}),Dy(e)]});var g,f})),zy=e=>e.name?.charAt(0)??"",Vy=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Ly=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=bn(Fy,n),{name:s}=qf(),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=Z(J.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[J.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(Py,{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})})})})),$y="burgerMenuDialog",jy=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Cn})=>{const{open:i}=bn(Ly),[l]=Ey(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))($y,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:$y})),[e,n,t,a]);return[s,{toggle:s?a:o}]},qy=[],Uy=Wt((({sticky:e,...t})=>{const{menuItems:n=qy}=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),[h,p]=a(-1),[f,y]=a(""),{closeAll:x}=ge(),b=r((()=>{p(-1),y(""),x()}),[x]),v=Nn(b),N=s(null),[C,{toggle:k}]=jy({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),S=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=ge(),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(Py,{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(),k()}),[b,k]),T=r(((e,t)=>{y(t),p(e),x(),S(e,t)}),[x,S]);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(Wy(T,"left",{activeIndex:h,currentItemPosition:f})),o(Ty,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Wy(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Wy=(e,t,n)=>(a,i,r)=>o(Ty,{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)),Hy={primary:"bg-white/30",secondary:"bg-main-divider"},Yy={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Gy=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Hy[t],i=Yy[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(Fe,{size:"text-xs",color:i,children:e})})})),Ky=({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})]})]})},Xy={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Jy={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Zy={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Qy={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ex=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:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer",Xy[a],n?Qy[a]:Zy[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Jy[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Ky({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(Gy,{count:m,version:Yf(n,a)})}):null]})})})),tx=d((e=>o(e?.item?.href?nx:ax,{...e}))),nx=d((e=>{const t=fe(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(ex,{...e,tag:"a",item:i,onClick:a})})),ax=d((({item:e={},onClick:t,...n})=>{const a=r((()=>{t&&t(e)}),[t,e]);return o(ex,{item:e,onClick:a,...n})})),ix="hidden sm:flex absolute z-40",rx={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},lx=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=Qm({itemCount:t?.length||0});return i((()=>sx(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Wm,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:rx[r].item,gap:rx[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(tx,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(iu,{wcmsIgnore:!0,className:u("left-6",ix,rx[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(ru,{wcmsIgnore:!0,className:u("right-6",ix,rx[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),sx=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},ox={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cx=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ox[t].wrapper,e),children:o(lx,{className:ox[t].component,tabsType:t,...n})}):null,dx="sticky top-1 z-20",mx=Wt((({className:e="",tabs:t=[],block:n,tabsType:l,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=ux(n||{}),p=D(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(globalThis?.location?.search||""),x=y.get[h],b=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,[v,N]=a(gx(b,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),w=b[v],C=b.findIndex((e=>Boolean(e.selected)));i((()=>{const e=x?b.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===x)):C;N(-1===e?0:e)}),[C,x]);const k=px(b[v],v),S=r((e=>{const t=b.indexOf(e),n=b[t];N(t),"group"===n.type&&((e,t)=>{e.text?y.set(h,e?.tabName??String(t)):y.delete(h),p.replace(`${p.pathname}?${y}`,{scroll:!1})})(e,t)}),[b]);return c(g,{className:u({[dx]:[d,f].every(Boolean)},e),defaultPadding:"p-0",block:n,...m,children:[cx({className:u({"pb-1":[n?.slots,"default"===l].every(Boolean),[dx]:[d,!f].every(Boolean)}),items:hx(t,b),activeItem:w,tabsType:l,onChange:S}),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])=>E(t,{...m?.options,slotName:k,parent:n,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(px)?.filter(Boolean)||[]}),ux=({__id:e,anchor:t})=>t??e??"tabs",hx=(e,t)=>t?.length?t:e,px=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",gx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),fx={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},yx=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:fx[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),xx=d((({className:e="",isOpen:t,onClick:n})=>o(Bl,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),bx={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Fe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Fe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(xx,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},vx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:r,setTableInner:l,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{r===o&&s||m(!0)}),[s,o]);return Nx({cell:e,cellProps:{rowIdx:n,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),l(e)},isVisible:d}})})),Nx=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in bx))return null;return o(bx[n],{...t,...a})},wx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:r,setOpenTableInnerIdx:l})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(vx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:r,setOpenTableInnerIdx:l},String(s)))):null}))),Cx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),kx=(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(Fe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Sx=d((({rows:e})=>{return o(Wm,{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 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Fe,{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(-${Cx(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(Fe,{size:"text-xl",children:e.data}):null,e?.cols?kx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ix=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 sm:px-m bg-white @4xl:bg-gray relative",children:o(Fe,{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(Sx,{rows:t.rowsData})})})]},a)}))}))),Tx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Px=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(Fe,{size:"text-xl",font:"font-light",color:Tx(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Rx=Wt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[l,s]=a(0),d=r((e=>s(e)),[]),m=i?.[l]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Px,{currencies:u,activeTabIndex:l,setActiveTabIndex:d,linkToPDF:t}),o(Ix,{activeTabIndex:l,items:m}),o(xx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Fe,{size:"text-h6",children:"Данных нет"}),o(xx,{onClick:n,isOpen:!0})]})})),Ex=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Rx,{...t,onClick:n})}):null]}))),_x=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...l})=>{const[s,d]=a(void 0),m=r((e=>d(e)),[]),[h,p]=a(void 0),g=r((e=>p(e)),[]);return c(Ex,{onHideContentClick:()=>d(void 0),tableInner:s,...l,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Fe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(yx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(wx,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...l},String(t))))}):null]})})),Dx=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(iu,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(ru,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,Ax=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Dx({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Bx=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:l,hiddenRowsNum:s=0,...d})=>{const m=l?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,y]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),x=(h||[]).map(((e,t)=>o(_x,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[x.slice(0,-s),x.slice(-s)]:[x,[]],[N,{toggle:w}]=dn(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Ml,{children:[c(Ax,{controls:y,children:[b,o(Ol,{isUnfolded:N,children:v})]}),o(Bl,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(Ax,{controls:y,children:x})})]})})),Mx=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?Ox():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Fe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Fx(n):null,i?o(Me,{richVersion:r,__html:i}):null]})]}))),Ox=()=>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"}),Fx=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),zx={AdTile:Yt,ApplicationForm:Wr,BankAccountFiltration:Tu,BenefitsBlock:Du,BonusBenefitsBlock:Mu,ButtonsBlock:Fu,CalculatorBonus:Uu,CalculatorBusinessDeposit:eh,CalculatorCredit:Wo,CalculatorDeposit:Ch,CalculatorRefinancing:Ah,CardTransfer:Uh,Carousel:Zh,CarouselCatalogCard:tp,CarouselRecommendationCard:op,CarouselTariffsCard:up,DepositFiltration:_g,ErrorBlock:Mg,Footer:Xg,GalleryLayout:tf,GrantSupport:sf,Header:kf,Headline:S,HorizontalLayout:If,ImgBlock:Tf,LinkDocs:Ff,MobileAppTile:$f,OfficesAtmsMap:fy,ProductBlock:Ht,RichTextBlock:yy,RollupItem:by,StepsBlock:Iy,StickyBottomMenu:Uy,TabsLayout:mx,TariffsTable:Bx,TextBlock:Mx,VerticalLayout:Sf,ApplicationLeadForm:Dm,CreditCardForm:sg,CreditForm:Ig},Vx=me((()=>{i((()=>{sn()}),[]);const e=cn();vn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");an({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Lx="cookie",$x=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(Lx)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(Lx,"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(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Pr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function jx(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);vn(globalThis.document,"keydown",t)}const qx=d((()=>{const[e,{close:t}]=Ey(),n=Boolean(e.length);return jx(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})),Ux=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Ry(pe.observable,"popup",{open:t,close:n}),jx(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})),Wx="header",Hx="footer",Yx="sticky-footer",Gx={},Kx=d((({className:e,data:t=Gx,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=qt(s,l);Vx(),Uf();const m={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?.[Wx]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:E(i?.[Wx],{...m,slotName:Wx})}):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:m,extraProps:{className:"scroll-mt-12"}}),E(i?.[Hx],{...m,slotName:Hx})]})]}),i?.[Yx]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:E(i?.[Yx],{...m,slotName:Yx})}):null,o(qx,{}),o(Ux,{}),o($x,{__html:d?.cookieContent?.__html})]})}));Object.assign(Kx,{childrenTypes:[],slots:()=>[Wx,Hx,Yx]});e.Blocks=zx,e.ContentPage=Kx,e.handlerDecorator=me,e.joinList=pu,e.locationNavigator=rn,e.packageVersion="0.14.844",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));