@redneckz/wildless-cms-uni-blocks 0.14.667 → 0.14.669

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.
Files changed (87) hide show
  1. package/bundle/bundle.umd.js +26 -20
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  4. package/bundle/utils/dateToISO.d.ts +1 -0
  5. package/dist/components/CreditCardForm/CreditCardForm.js +5 -1
  6. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  7. package/dist/components/CreditCardForm/getSixthStepData.js +2 -2
  8. package/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  9. package/dist/components/CreditForm/CreditForm.js +5 -1
  10. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  11. package/dist/ui-kit/FormField/Fields/AddressRetailField.js +2 -1
  12. package/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  13. package/dist/ui-kit/FormField/validators.js +1 -1
  14. package/dist/ui-kit/FormField/validators.js.map +1 -1
  15. package/dist/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  16. package/dist/ui-kit/YandexMap/YandexMap.js +3 -13
  17. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  18. package/dist/utils/dateToISO.d.ts +1 -0
  19. package/dist/utils/dateToISO.js +10 -0
  20. package/dist/utils/dateToISO.js.map +1 -0
  21. package/lib/components/CreditCardForm/CreditCardForm.js +6 -2
  22. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  23. package/lib/components/CreditCardForm/getSixthStepData.js +2 -2
  24. package/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  25. package/lib/components/CreditForm/CreditForm.js +6 -2
  26. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  27. package/lib/ui-kit/FormField/Fields/AddressRetailField.js +2 -1
  28. package/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  29. package/lib/ui-kit/FormField/validators.js +1 -1
  30. package/lib/ui-kit/FormField/validators.js.map +1 -1
  31. package/lib/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  32. package/lib/ui-kit/YandexMap/YandexMap.js +3 -13
  33. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  34. package/lib/utils/dateToISO.d.ts +1 -0
  35. package/lib/utils/dateToISO.js +7 -0
  36. package/lib/utils/dateToISO.js.map +1 -0
  37. package/mobile/bundle/bundle.umd.js +26 -20
  38. package/mobile/bundle/bundle.umd.min.js +1 -1
  39. package/mobile/bundle/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  40. package/mobile/bundle/utils/dateToISO.d.ts +1 -0
  41. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +5 -1
  42. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  43. package/mobile/dist/components/CreditCardForm/getSixthStepData.js +2 -2
  44. package/mobile/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  45. package/mobile/dist/components/CreditForm/CreditForm.js +5 -1
  46. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  47. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js +2 -1
  48. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  49. package/mobile/dist/ui-kit/FormField/validators.js +1 -1
  50. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  51. package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  52. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +3 -13
  53. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  54. package/mobile/dist/utils/dateToISO.d.ts +1 -0
  55. package/mobile/dist/utils/dateToISO.js +10 -0
  56. package/mobile/dist/utils/dateToISO.js.map +1 -0
  57. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +6 -2
  58. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  59. package/mobile/lib/components/CreditCardForm/getSixthStepData.js +2 -2
  60. package/mobile/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  61. package/mobile/lib/components/CreditForm/CreditForm.js +6 -2
  62. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  63. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js +2 -1
  64. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  65. package/mobile/lib/ui-kit/FormField/validators.js +1 -1
  66. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  67. package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +0 -1
  68. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +3 -13
  69. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  70. package/mobile/lib/utils/dateToISO.d.ts +1 -0
  71. package/mobile/lib/utils/dateToISO.js +7 -0
  72. package/mobile/lib/utils/dateToISO.js.map +1 -0
  73. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +10 -2
  74. package/mobile/src/components/CreditCardForm/getSixthStepData.ts +2 -2
  75. package/mobile/src/components/CreditForm/CreditForm.tsx +10 -2
  76. package/mobile/src/ui-kit/FormField/Fields/AddressRetailField.tsx +2 -6
  77. package/mobile/src/ui-kit/FormField/validators.ts +1 -1
  78. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +45 -59
  79. package/mobile/src/utils/dateToISO.ts +7 -0
  80. package/package.json +1 -1
  81. package/src/components/CreditCardForm/CreditCardForm.tsx +10 -2
  82. package/src/components/CreditCardForm/getSixthStepData.ts +2 -2
  83. package/src/components/CreditForm/CreditForm.tsx +10 -2
  84. package/src/ui-kit/FormField/Fields/AddressRetailField.tsx +2 -6
  85. package/src/ui-kit/FormField/validators.ts +1 -1
  86. package/src/ui-kit/YandexMap/YandexMap.tsx +45 -59
  87. package/src/utils/dateToISO.ts +7 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=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||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),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:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.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:x(t)}))),x=(e=3)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[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(N,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function I(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=S,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const B=[],R=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:i,renderProps:l=I,...r})=>{const s=i?(e,t)=>I(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},i)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const A=["CDN","BASE_PATH"],M=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}}),_=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:E,isHash:z,withoutQuery:F,joinPath:O,hasPrefix:V});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),z(t),[M.CDN,j].some((e=>V(t,e)))].some(Boolean))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`${q}/${t}/attachment`;const a=t?.startsWith("/");return O(V(t,n)?"":n,a?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(O(M.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:a,title:i,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=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(Z).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:J(a)(e),type:te(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(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}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):null)),ae={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","":""},ie="bg-main-divider text-main-disabled",le={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(a({...e,href:n}))}};function a({href:a,target:i,onClick:l}){return r=>{l?.(r),he(a,i,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!E(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>V(e,t)))||!V(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[l]),children:a}):null,xe(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 -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,se[l]),children:i}):null]})})),fe=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",xe(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=ue()({onClick:r,href:a,...i}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:a,version:n}),children:i})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="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(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=a(false);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=l((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&we({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",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:[Se(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-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Be(P({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ie(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ie=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(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(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Pe=d((e=>{const{__html:t="",richVersion:n="",itemSize:a="list-m",isDotted:i=!0}=e,l=i?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,a,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ae=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Me=(e,t)=>e?o(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,_e=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Pe,{...e},`rte-${t}`):null],Ee=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?Re(n.icon,t):null,o("div",{children:_e(n)})]}))),ze=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(Ee,{benefitsVersion:t,...e},String(n))))}):null)),Fe=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(_e)}):null)),Oe=d((({isTabularBenefits:e,...t})=>o(e?Fe:ze,{...t}))),Ve=e=>Boolean(e?.src||e?.icon),Le=(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(je(n))}):null,je=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=qe(i,r),d=qe(l,r);return a||i?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...i,iconVersion:c}),appendRight:$e({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},qe=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},$e=e=>Ve(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({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(Ae,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(a)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ae,{size:"text-m",font:"font-light",children:e})},String(t)),Ge={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Xe=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:T,...I})=>{const B=y?.src?o(ne,{image:y}):null,R=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Oe,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Pe,{richVersion:p,__html:h,isDotted:m,itemSize:Ge[l]}):null,T,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(at,e),at=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,it=(e,t)=>tt(e,{ref:({$ref:e,...n})=>it(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:it(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>it(e,t)))}),lt=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const a in e)lt(e[a],t,[...n,a])},array:e=>{for(let a=0;a<e.length;a++)lt(e[a],t,[...n,a])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>it(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return lt(e,(e=>t.push(e))),t})(e),[l,r]=a({});return i((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...l}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({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(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),a=t?.[n];return a?o(pt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(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}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e)t[a??""]?.(n,i)},St="rshb-query-params";function Tt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function It(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=It(e.find((([e])=>e(t))));return n(t)},Rt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Rt.if=e=>new Pt(void 0,e);class Pt{parent;predicate;unit;get entry(){return[It(this.predicate),It(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Pt(this,e)}then(e){return new Pt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],At=e=>{const t=e.target?.closest("a");if(_(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Tt();if(!_(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;if(n){Mt(t?.target)?.(n)}}},Mt=Rt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function _t(){return _t._impl()}_t._impl=()=>({forwardQuery:At}),_t.setup=e=>{_t._impl=e};const Et=e=>e,zt=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);i((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=l(((e,t)=>{const{parse:n=Et,format:a=Et}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Ot=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 max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})})),Vt=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}function jt(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function qt(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return jt(globalThis.document,"click",n),t}const $t=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);i((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",T=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Gt,T),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,T),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Gt="w-full border rounded-md text-primary-text outline-none p-m",Xt=e=>o("div",{className:"h-6",children:e?o(Ae,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={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:Zt,addressFact:Zt,organizationAddress:Zt,addressCourier:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=en(),x=Qt[n],b=l((()=>{h.current=t,f.close()}),[t]),y=l((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=Jt}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return 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(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((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 b();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,y]),v}const an=d((({className:e,label:t,value:n="",placeholder:a,error:i,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=qt(N),k=l((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!i),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:ln(a,r,t)})}),Xt(i)]})})),ln=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>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:sn(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:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=a(""),C=un(x,n.length),k=b&&!C,S=l((()=>{w(""),y()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=qt(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(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",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(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"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(cn,{...i,valid:!n,label:$t({label:t,errors:a})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((e=>"string"==typeof e&&6===e.length))(e),kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Tn=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.substr(9))}return!1},In=e=>Boolean("0"===e.qc&&"0"===e.qcComplete&&"2"===e.qcHouse),Bn=()=>gn(In)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Rn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),regionRetail:yn("Выберите регион"),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:gn((e=>Boolean(e.fiasCode&&e.city&&e.house)))("Укажите регион, город/населенный пункт, улицу, дом"),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),wages:bn(),mandatoryPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:bn(),deliveryDate:bn("Укажите дату доставки"),addressCourier:Bn()};var Pn;const Dn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,Rn?.[e||""]])).filter((([,e])=>e)))},An=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Mn=(e,t,n=!1)=>n&&t?An(e,t):e,_n=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],En=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:_n,...Mn(e("acquiringType"),Rn.acquiringType,t?.required)}))),zn=(e="")=>Boolean("trade"===e||"all"===e),Fn=e=>null!=e,On=new Map,Vn=e=>Boolean(e?.every((e=>Array.isArray(e)?Vn(e):!e||"string"==typeof e))),Ln=e=>Vn(e)?e.toString():"";function jn(e,t,{fallback:n,cache:l}={}){const s=r((()=>qn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Fn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=On)=>n=>{const a=Ln(n),i=t.get(a);if(a&&Fn(i))return i;const l=e(...n);return a&&Fn(l)&&t.set(a,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(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 $n=[];const Un=async e=>await rt(e,{method:"GET"})||$n;function Wn(e=!1){const{data:t}=jn("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const a=e("region"),l=a?.value?.key,r=a?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=jn(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||$n}(l)?.filter((e=>e?.address));return i((()=>{""!==a?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[a?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...Mn(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=l((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=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{label:"Адрес",disabled:r,...Mn(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((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})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",...Mn(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:i})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...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)}))}))),Jn="appearance-none w-5 h-5 border-solid flex-none",Zn=[{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"}],Qn=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xn,{paths:Zn,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",ta(a)),onClick:s,children:[o("div",{className:u(Jn,"m-0",i?"rounded-full border-2":aa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:na(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ea(n)]})})})),ea=e=>e?o("div",{className:"ml-s",children:o(Ae,{size:"text-l",font:"font-light",children:e})}):null,ta=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",na=(e=!1)=>e?"radio":"checkbox",aa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ia=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:i,onChange:r},a),Xt(l)]}))),la=d((({field:e,input:t})=>o(ia,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...Mn(e("addressMatch"),Rn.addressMatch,t?.required)}))),ra=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),sa="/icons/MapMarkerClusterIcon.svg",oa="/icons/MapMarkerClusterYellowIcon.svg";function ca({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>'),l=da("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=da("workplaces",e,i),r=ma(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ma(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ma(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const da=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?sa:oa,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ma=(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?sa:oa,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ua={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ha={...ua,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},pa=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ha).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ga=e=>globalThis[e],fa=(e,t)=>{const n=document.getElementById(t);if(n){const t=ga(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(ga(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(ga(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))};const xa=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return fa(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${M.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ba={...ua,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},ya=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(ba).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),va=[55.753995,37.614069],Na=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=xa();if(i((()=>{r.current?ca({yandexMaps:d,map:r.current,points:e,isLoad:a,selectedAddress:l}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:wa(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),ca({yandexMaps:d,map:r.current,points:e,isLoad:a})}))}),[d,e,n,a,l]),i((()=>{r.current&&l&&d?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[l]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[a?o(ra,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[o(ya,{yandexMaps:r}),o(ya,{yandexMaps:r,direction:"out"})]}),pa(r,d,u("right-2 top-80",m))]})})),wa=e=>{const t=[ka(Ca(e,0)),ka(Ca(e,1))];return t.every((e=>e))?t:va},Ca=(e,t)=>e.map((e=>e.coords?.[t])),ka=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length;async function Sa(e,t,n){const a=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Ia()},credentials:"include",body:n?JSON.stringify(n):null});return Ta(a)?a.json():a}const Ta=e=>"application/json"===e.headers.get("Content-Type"),Ia=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Ba=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:i,renderFoldButton:r})=>{const[s,o]=a(n),d=l((()=>{o((e=>!e))}),[]),m=i({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const Ra=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Pa=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Da({textItems:l,subText:t,children:n,isPhone:a,...i})})),Da=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Aa(n,s),i?o(Ae,{color:a,size:"text-m",children:i}):null]}),Aa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ae,{size:"text-l",children:t?o("a",{href:`tel:${Ma(e)}`,children:e.trim()}):e.trim()},String(n)))),Ma=e=>e.replace(/\D/g,""),_a=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}))),Ea=e=>{const t=Fa(e);return o(Pa,{label:"Режим работы",value:t,className:"max-w-none"})},za=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Fa=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[za({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),za({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Oa=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Va=e=>Oa.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??"")}}))),La=e=>{if(!e)return null;const t=ja(e);return c(_a,{className:"border-none",children:[o(Pa,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(qa)})}),o(Pa,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]})},ja=e=>{const t=Oa.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},qa=({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(Ae,{size:"text-xs",children:e})},String(n)),$a=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Pa,{label:"Валюта",value:e.currency}):null,t?o(Pa,{label:"Купить",value:String(t)}):null,n?o(Pa,{label:"Продать",value:String(n)}):null]},String(a)),Ua={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"}},Wa=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",Ua[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ae,{size:"text-m",color:Ua[n].text,children:t})]}))),Ha=(new Date).getDay(),Ya=e=>{const[t]=e?.slice(Ha-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Wa,{color:"green",children:i}):null,n&&l?o(Wa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Wa,{color:"red",children:"Выходной"})},Ka=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ga=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(Pa,{label:e,value:t&&n?n:"",subText:Ka({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Xa=["ArrowDownIcon","ArrowUpIcon"],Ja=["Подробнее","Скрыть"],Za=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Ja[Number(e)]}),o(W,{className:"text-primary-text",name:Xa[Number(e)],width:"16",height:"16"})]}),Qa=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ei=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ti=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ni=({name:e,address:t,phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Va(d);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(Ae,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),Ya(h)]}),o("div",{className:"hidden sm:block",children:ai({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:ai({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(u))},ai=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Va(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(_a,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Pa,{label:"Факс",value:t,isPhone:!0}),o(Pa,{label:"Телефон филиала",value:e,isPhone:!0}),o(Pa,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Pa,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Pa,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Pa,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(_a,{children:o(Pa,{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(Ga)})})}):c(_a,{children:[o(Pa,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(qa)})}),Ea(d)]}),r?.businessScheduleVisibleTag?La(r?.businessScheduleDescription):null,s?.currencies?.length?o(_a,{className:"flex-wrap",children:s?.currencies?.map($a)}):null]})},ii=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Va(e),n=e?Fa(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Qa(n):ti(n,a):ei(n):""})(n)}`;return{header:a,body:l}},li=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),ri=d((({children:e})=>li?e:null)),si={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},oi={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ci={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)};function di({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const mi={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"},ui={primary:u("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("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")},hi=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(di(e))}),{className:a,version:i="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(mi[i],ui[i]),a),type:s,role:d,onClick:m,children:e})})),pi=(e,t)=>e&&"underlined"!==t?"primary":"secondary",gi=(e,t,n)=>{const a=pi("all"===t),i=pi("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=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(hi,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(hi,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},fi=({__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(Pe,{__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(ne,{image:e.image}):null,e?.text?o(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,xi="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",bi=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(Qn,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Ba,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:xi,children:s}),o(Ra,{className:xi,isUnfolded:e,children:d})]}),renderFoldButton:yi(n,a)})}):null})},yi=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:vi()})]}),vi=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ni=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Ae,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),wi=()=>{},Ci=e=>"all"===e?"block":"hidden",ki=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=wi,renderRemoteWorkplaceCard:r=wi,getBalloon:s=wi,getBalloonRemoteWorkplaces:d=wi,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=zt(si),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=Bi({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),k={filters:Ti([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:oi};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ni(h,N),m?fi(m):null,p&&gi(t,w,C),o("div",{className:u("pb-3xl",Ci(w)),children:bi(k)})]}),o("div",{className:"h-[600px]",children:o(ri,{children:o(Na,{points:y,isLoad:n,className:"h-full"})})})]}),c(ri,{children:[b.map(l),v.map(r)]})]})})),Si=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ci[t](e)))))},Ti=e=>Object.keys(si).filter((t=>e.filter((e=>ci[t](e))).length)),Ii=()=>{},Bi=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Ii,getBalloonRemoteWorkplaces:i=Ii})=>{const[l,s,o,c]=r((()=>{const l=Si(e,n),r=Si(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.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[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Ri=e=>{const{data:t,error:n}=jn(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Pi);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Pi=async e=>await rt(e,{method:"POST"})||[],Di=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Ri("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await Sa("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return await t.json().then((e=>e?.offices?.map((e=>({...e,gpsLatitude:(e.latitude??va[0]).toString().replace(",","."),gpsLongitude:(e.longitude??va[1]).toString().replace(",",".")})))))})(s?.key??"");l(e||[])})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=Bi({data:n,filtrationState:{},getBalloon:ii}),u=Boolean(s?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...Mn(e("addressRetail"),Rn.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(ri,{children:o(Na,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Ai=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Mi=(e,t,n)=>Math.max(t,Math.min(e,n));function _i(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ei({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){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||l?"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:l,onChange:t=>{const n=_i(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const zi=1,Fi=100,Oi=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:zi),max:s=(i.length?i.length-1:Fi),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Ai(e,{normalize:(e=0)=>i.length?Vi(i)(e):Mi(e,r,s),format:Ue()}),f=l((e=>{p&&p(_i(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Ae,{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 mt-xs box-border","text-primary-text",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ei({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Li(a)]})})),Vi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Li=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ji=["От 1 000 ₽","До 1 000 000 000 ₽"],qi=d((({field:e})=>o(Oi,{title:"Сумма, ₽",items:ji,min:1e3,max:1e9,...e("amount")}))),$i=ht((({field:e,source:t,label:n,fieldName:a,input:i,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:l,label:n,options:s,isSearch:r,...Mn(e(a),Rn[a],i?.required)})})),Ui=d((({field:e,input:t})=>{const{data:n}=Ri("EMPLOYEES_NUMBER");return o($i,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Wi=d((({field:e,input:t})=>o(an,{label:"Годовая выручка, ₽",...Mn(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),Hi=d((({field:e,input:t})=>o(ia,{text:"Наличие военного билета",...Mn(e("armyIdFlg"),Rn.armyIdFlg,t?.required)}))),Yi=d((({field:e,input:t})=>o(an,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...Mn(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),Ki=d((({field:e})=>o(an,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Gi=d((({field:e,input:t})=>o(ia,{text:"В отношении меня ведётся производство по делу о банкротстве",...Mn(e("bankruptcyFlg"),Rn.bankruptcyFlg,t?.required)}))),Xi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,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=Ji(t,e),c=Zi(t,l,r);u.push(o("td",{children:o("div",{className:Qi(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ji=(e,t)=>t&&e.toDateString()===t.toDateString(),Zi=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Qi=(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"),el=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],tl=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({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:el.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Xi({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function al(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const a=[...t],i=a.findIndex(il),l=a.map(((e,t)=>rl(e)?a.slice(0,t).filter(rl).length:-1)),r=a.map(((e,t)=>ll(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const il=e=>"_"===e,ll=e=>/\d/.test(e),rl=e=>il(e)||ll(e),sl=1940,ol={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},cl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),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(al(t,"__.__.____"))},onBlur:()=>{if(dl(p)){const[n,a,i]=p.split(".");d?.(new Date(Number(i),Number(a)-1,Number(n))),e(Number(a)-1),t(Number(i))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...ol})]})})),dl=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=sl&&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++;if(Number(t)>0&&Number(t)<=i)return!0}return!1},ml=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(cl,{onChange:a,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:i,setSelectedYear:l,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")}),ul=nl.map((e=>({key:e}))),hl=Array.from({length:(new Date).getFullYear()-sl+1},((e,t)=>sl+t)).reverse().map((e=>({key:String(e)}))),pl=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},gl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},fl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},xl={className:"min-w-32",iconVersion:"black",isBorder:!1},bl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[b,y]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:T,ref:I}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=qt(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(nl.indexOf(e));const t=pl(r,nl.indexOf(e));gl({maxDateOfMonth:t,selectedYear:r,selectedMonth:nl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ul,yearsOptions:hl,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(I,370);return c("div",{className:u("space-y-xs",e),ref:I,children:[Ht(t),c("div",{className:"relative",children:[ml({handleChangeVisibleCalendar:T,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...fl,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:nl[f]},options:k,...xl}),o(cn,{onChange:C,value:{key:String(b)},options:S,...xl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...fl,className:"rotate-90 cursor-pointer"})})]}),o(tl,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),yl=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(bl,{label:$t({label:t,errors:a}),valid:Boolean(!n),...i}),Xt(n)]}))),vl=d((({field:e,input:t})=>o(yl,{label:"Дата начала работы на текущем месте",...Mn(e("beginDate"),Rn.beginDate,t?.required),...t}))),Nl="birthday",wl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:a}=e(Nl);return o(yl,{label:"Дата рождения",...Mn(e(Nl),Rn.birthday,t?.required),error:n&&a&&!Cl(a)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Nl)})})),Cl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},kl=d((({field:e,input:t})=>o(an,{label:"Место рождения",...Mn(e("birthPlace"),Rn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),Sl=d((({field:e,input:t})=>{const{data:n}=Ri("CARD_TYPE");return o($i,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Tl=d((({field:e,input:t})=>o(an,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...Mn(e("children"),Rn.children,t?.required),...t}))),Il=d((({field:e,input:t})=>o(an,{label:"Кодовое слово",...Mn(e("codeWord"),Rn.codeWord,t?.required),...t}))),Bl=d((({field:e,input:t})=>o(an,{label:"Количество объектов инкассации",type:"number",...Mn(e("collectionCount"),Rn.collectionCount,t?.required)}))),Rl=d((({field:e,input:t})=>o(an,{className:"col-span-2",...Mn(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Pl=d((({field:e,input:t})=>{const{data:n}=Ri("INCOME_CERT_UNITED");return o($i,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Dl=d((({field:e,input:t})=>{const{data:n}=Ri("MILITARY_STATUS");return o($i,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Al={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},Ml=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Sa(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},_l=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(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),El=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>{const{close:r}=de(),s=l((()=>{r(),a&&a()}),[a]);return c("div",{onClick:i,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(_l,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),zl=async(e,t,n=!1)=>{const a=await Ml(t,n);e(o(El,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:a}):o("iframe",{src:`${a}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},Fl=d((({className:e,error:t,docId:n,...a})=>{const{open:i}=de(),l=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...a}),n?o(ye,{className:"text-primary-main",onClick:()=>zl(i,n,l),children:o(Ae,{children:"Ознакомиться"})}):null]}),Xt(t)]})})),Ol=d((({field:e,input:t})=>t&&t.name?o(Fl,{text:Al[t.name]?.text,docId:Al[t.name]?.docId,...Mn(e(t.name),Rn[t.name],t?.required)}):null)),Vl=d((({field:e,input:t})=>{const{data:n}=Ri("CREDIT_IN_RSHB");return o($i,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),Ll={horizontal:"@lg:flex-row",vertical:""},jl=d((({label:e,items:t,value:n,className:a,onChange:i,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ll[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Qn,{isRadio:!0,text:t,value:n===e,onChange:()=>i&&i(e),disabled:l},String(e))))})]}))),ql=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(jl,{label:$t({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),Xt(a)]}))),$l=[{id:"rub",text:"Рубль"}],Ul=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency");return o(ql,{label:"Валюта",orientation:"horizontal",items:$l,value:n,onChange:e=>a?.(e),...Mn(e("currency"),Rn.currency,t?.required)})})),Wl=d((({field:e,input:t})=>o(yl,{label:"Дата доставки",...Mn(e("deliveryDate"),Rn.deliveryDate,t?.required)}))),Hl=d((({field:e,input:t})=>o(an,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...Mn(e("dependents"),Rn.dependents,t?.required),...t}))),Yl=d((({field:e,input:t})=>o(yl,{label:"Желаемая дата встречи",...Mn(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),Kl=d((({field:e,input:t})=>o(ia,{text:"Являюсь инвалидом",...Mn(e("disablePeopleFlg"),Rn.disablePeopleFlg,t?.required)}))),Gl="dulIssueDateField",Xl=d((({field:e,input:t})=>o(yl,{label:"Дата выдачи",...Mn(e(Gl),Rn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Kn(e,Gl)}))),Jl="dulIssuedBy",Zl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,Jl),label:"Кем выдан",...t,...Mn(e(Jl),Rn.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),Ql=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...Mn(e("dulNumber"),Rn.dulNumber,t?.required)}))),er=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...Mn(e("dulSerie"),Rn.dulSerie,t?.required)}))),tr="dulSubdivisionCode",nr=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,tr),label:"Код подразделения",type:"number",maxLength:6,...t,...Mn(e(tr),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),ar=d((({field:e,input:t})=>{const{data:n}=Ri("EDUCATION_LEVEL");return o($i,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),ir=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{label:"Электронная почта",...Mn(e("email"),Rn.email,n),...a})})),lr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_ACTIVITY_TYPE");return o($i,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),rr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_KIND");return o($i,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),sr=d((({field:e,input:t})=>{const{data:n}=Ri("EMPLOYMENT_INFO_UNITED");return o($i,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),or=d((({field:e,input:t})=>o(an,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...Mn(e("expenses"),Rn.expenses,t?.required),...t}))),cr=d((({field:e,input:t})=>o(an,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...Mn(e("experience5Years"),Rn.experience5Years,t?.required),...t}))),dr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,l="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return i((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(an,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),mr=d((({field:e,input:t})=>{const{data:n}=Ri("MARITAL_STATUS");return o($i,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),ur=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],hr=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],pr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],gr=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:pr,...Mn(e("feedbackMethod"),Rn.feedbackMethod,t?.required)}))),fr=d((({field:e,input:t})=>o(an,{label:"ФИО",...Mn(e("fullName"),Rn.fullName,t?.required),...t}))),xr=d((({field:e,input:t})=>o(an,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...Mn(e("generalSeniority"),Rn.generalSeniority,t?.required),...t}))),br=d((({field:e,input:t})=>{const{data:n}=Ri("HOUSE_TYPE");return o($i,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),yr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"ИНН",type:"number",maxLength:12,...t,...Mn(e("inn"),Rn.inn,t?.required),onDaDataChange:n})})),vr=d((({field:e})=>o(ia,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Nr=d((({field:e,input:t})=>o(an,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...Mn(e("jobsNumber"),Rn.jobsNumber,t?.required),...t}))),wr=d((({field:e,input:t})=>o(an,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...Mn(e("lastJobExperience"),Rn.lastJobExperience,t?.required),...t}))),Cr=d((({field:e,input:t})=>o(an,{label:"Наименование юридического лица",...t,...Mn(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),kr=d((({field:e,input:t})=>o(an,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...Mn(e("legalForm"),Rn.legalForm,t?.required),...t}))),Sr=[];async function Tr(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Sr}const Ir=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:a}=jn("outServiceRegions",Tr),l=a?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...Mn(e("localities"),Rn.localities,t?.required),isSearch:!0})})),Br=d((({field:e,input:t})=>o(an,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...Mn(e("mandatoryPayments"),Rn.mandatoryPayments,t?.required),...t}))),Rr=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Pr=d((({field:e,input:t})=>o(ql,{orientation:"horizontal",items:Rr,...Mn(e("methodObtain"),Rn.methodObtain,t?.required)}))),Dr="middleName",Ar=d((({field:e,input:t})=>o(an,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,Dr),...Mn(e(Dr),Rn.middleName,t?.required),...t}))),Mr=d((({field:e,input:t})=>o(an,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),...Mn(e("name"),Rn.name,t?.required),...t}))),_r=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(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Er=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(_r,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),zr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_TYPE");return o($i,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Fr=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"Наименование организации",...t,...Mn(e("organizationName"),Rn.organizationName,t?.required),onDaDataChange:n})})),Or=d((({field:e,input:t})=>o(an,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...Mn(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),Vr=d((({field:e,input:t})=>o(yl,{label:"Дата регистрации по месту жительства",...Mn(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),Lr=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,a={...Mn(e("partInBusiness"),Rn.partInBusiness,t?.required)};return o(an,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...a,...t,onChange:e=>a?.onChange&&a?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?a?.value:"",disabled:!n})})),jr=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{...Mn(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),qr=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],$r=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("paymentSystem");return o(ql,{label:"Платежная система",orientation:"horizontal",items:qr,value:n,onChange:e=>a?.(e),...Mn(e("paymentSystem"),Rn.paymentSystem,t?.required)})})),Ur=e=>"_"===e,Wr=e=>/\d/.test(e),Hr=e=>Ur(e)||Wr(e),Yr=[..."+7 (___) ___-__-__"],Kr=Yr.findIndex(Ur),Gr=Yr.map(((e,t)=>Hr(e)?Yr.slice(0,t).filter(Hr).length:-1));function Xr(e){const t=e.replace(/\D/g,""),n=Yr.map(((e,n)=>Wr(e)?e:t.charAt(Gr[n])||e)),a=Gr.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Kr,a)):n).join("")}const Jr=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Xr(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Zr=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Jr,{"aria-label":t,label:$t({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),Xt(n)]}))),Qr=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Zr,{label:"Телефон",...Mn(e(n),Rn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),es=d((({field:e,input:t})=>{const{data:n}=Ri("POSITION");return o($i,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),ts=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(_r,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),ns=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:as(t?.productList),...An(e("product"),Rn.product)}))),as=e=>(e??[]).map((e=>({key:e,value:e})));function is(e="/api/v1/regions"){const{data:t}=jn(e,st);return Array.isArray(t)?t:[]}const ls=d((({field:e,input:t,url:n})=>{const a=is(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...Mn(e("region"),Rn.region,t?.required)})})),rs=d((({field:e,input:t})=>{const n=Wn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:a,...Mn(e("region"),Rn.region,t?.required)})})),ss=d((({field:e,input:t})=>{const{data:n}=Ri("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...Mn(e("regionRetail"),Rn.regionRetail,t?.required)})})),os=d((({field:e,input:t})=>{const n=e("wages")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(an,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...Mn(e("retirementIncome"),Rn.retirementIncome,t?.required),...t,onChange:a})})),cs=d((({field:e})=>{const t=e("secondaryPhone");return o(Zr,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?An(t,Rn.secondaryPhone):t})})),ds=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:hr,...Mn(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),ms=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],us=d((({field:e,input:t})=>o(ql,{label:"Пол",orientation:"horizontal",items:ms,...Mn(e("sex"),Rn.sex,t?.required)}))),hs=d((({field:e,input:t})=>o(ia,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...Mn(e("shareholderFlg"),Rn.shareholderFlg,t?.required)}))),ps=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(al(e,"___-___-___ __"))),[t]),i=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),gs=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ps,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __"}),Xt(a)]}))),fs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(gs,{label:"СНИЛС",...Mn(e("snils"),Rn.snils,!!n&&t?.required),...t})})),xs=d((({field:e,input:t})=>o(an,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),...Mn(e("surname"),Rn.surname,t?.required),...t}))),bs=["От 1 мес","До 15 лет"],ys=d((({field:e})=>o(Oi,{title:"Срок, месяцев",items:bs,min:1,max:180,...e("term")}))),vs=d((({field:e,input:t})=>o(an,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...Mn(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),Ns=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:ur,...Mn(e("serviceType"),Rn.serviceType,t?.required)}))),ws=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Cs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return i((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(jl,{className:"whitespace-normal",orientation:"horizontal",items:ws,value:t,onChange:e=>n&&n(e)})})})),ks=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(an,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...Mn(e("wages"),Rn.wages,t?.required),...t,onChange:a})}));const Ss={$ref:"/wcms-resources/outservice-productlist.json"},Ts=(e,t,n=!1)=>(a,i)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(xs,{field:e,input:a}),name:o(Mr,{field:e,input:a}),middleName:o(Ar,{field:e,input:a}),phone:o(Qr,{field:e,input:a}),organizationPhone:o(Qr,{field:e,input:a}),email:o(ir,{field:e,input:a}),fullName:o(fr,{field:e,input:a}),inn:o(yr,{field:e,input:a}),legalForm:o(kr,{field:e,input:a}),organizationName:o(Fr,{field:e,input:a}),generalSeniority:o(xr,{field:e,input:a}),lastJobExperience:o(wr,{field:e,input:a}),experience5Years:o(cr,{field:e,input:a}),jobsNumber:o(Nr,{field:e,input:a}),beginDate:o(vl,{field:e,input:a}),addressFact:o(Yn,{field:e,input:a}),organizationAddress:o(Gn,{field:e,input:a}),comment:o(Rl,{field:e,input:a}),addressBranch:o(Hn,{field:e,input:a,isPremium:l}),sex:o(us,{field:e,input:a}),birthday:o(wl,{field:e,input:a,isRetailForm:n}),birthPlace:o(kl,{field:e,input:a}),desiredMeetingDate:o(Yl,{field:e,input:a}),product:o(ns,{field:e,source:Ss}),localities:o(Ir,{field:e,input:a}),isClient:o(vr,{field:e}),partnerComments:o(jr,{field:e,input:a}),collectionCount:o(Bl,{field:e,input:a}),acquiringType:o(En,{field:e,input:a}),onlineCheckout:o(Er,{field:e}),posTerminal:o(ts,{field:e}),serviceType:o(Ns,{field:e,input:a}),term:o(ys,{field:e}),amount:o(qi,{field:e}),annualRevenue:o(Wi,{field:e,input:a}),vedTypes:o(Cs,{field:e}),feedbackMethod:o(gr,{field:e,input:a}),serviceDirection:o(ds,{field:e,input:a}),bankEmpolee:o(Ki,{field:e}),secondaryPhone:o(cs,{field:e}),consentToReceiveMaterials:o(Ol,{field:e,input:a}),processPersonalDataFlg:o(Ol,{field:e,input:a}),consentProviderFlg:o(Ol,{field:e,input:a}),consentOthersFlg:o(Ol,{field:e,input:a}),consentInformFlg:o(Ol,{field:e,input:a}),consentPfrFlg:o(Ol,{field:e,input:a}),applicationDate:o(an,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(rs,{field:e}):o(ls,{field:e,input:a,url:Vt(t)}),education:o(ar,{field:e,input:a}),housing:o(br,{field:e,input:a}),employment:o(sr,{field:e,input:a}),organization:o(zr,{field:e,input:a}),amountWorkers:o(Ui,{field:e,input:a}),employerActivities:o(lr,{field:e,input:a}),employerOrganization:o(rr,{field:e,input:a}),positionOrganization:o(es,{field:e,input:a}),familyStatus:o(mr,{field:e,input:a}),children:o(Tl,{field:e,input:a}),familyMembers:o(dr,{field:e,input:a}),dependents:o(Hl,{field:e,input:a}),totalIncome:o(vs,{field:e,input:a}),expenses:o(or,{field:e,input:a}),snils:o(fs,{field:e,input:a}),conscription:o(Dl,{field:e,input:a}),armyIdFlg:o(Hi,{field:e,input:a}),dulSerie:o(er,{field:e,input:a}),dulNumber:o(Ql,{field:e,input:a}),dulIssueDateField:o(Xl,{field:e,input:a}),dulSubdivisionCode:o(nr,{field:e,input:a}),dulIssuedBy:o(Zl,{field:e,input:a}),addressRegistration:o(Gn,{field:e,input:a}),addressCourier:o(Gn,{field:e,input:a}),participantDateRegistration:o(Vr,{field:e,input:a}),retirementIncome:o(os,{field:e,input:a}),otherIncome:o(Or,{field:e,input:a}),wages:o(ks,{field:e,input:a}),mandatoryPayments:o(Br,{field:e,input:a}),disablePeopleFlg:o(Kl,{field:e,input:a}),bankruptcyFlg:o(Gi,{field:e,input:a}),shareholderFlg:o(hs,{field:e,input:a}),legalEntityName:o(Cr,{field:e,input:a}),creditInRshbCd:o(Vl,{field:e,input:a}),bankEmployeeCode:o(Yi,{field:e,input:a}),partInBusiness:o(Lr,{field:e,input:a}),regionRetail:o(ss,{field:e,input:a}),addressRetail:o(Di,{field:e,input:a}),addressMatch:o(la,{field:e,input:a}),paymentSystem:o($r,{field:e,input:a}),currency:o(Ul,{field:e,input:a}),cardCategory:o(Sl,{field:e,input:a}),codeWord:o(Il,{field:e,input:a}),confirmationIncome:o(Pl,{field:e,input:a}),methodObtain:o(Pr,{field:e,input:a}),deliveryDate:o(Wl,{field:e,input:a})};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:r[a?.name||""]},String(i)):null},Is=e=>2===e?"@xl:grid-cols-2":"",Bs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ae,{size:"text-h6",children:e})}):null,Rs=d((function({responseType:e,typeForm:t}){const n="OK"===e,a=n?"ResponseOKIcon":"ResponseFailIcon",{close:i}=de(),r=l((()=>{i()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(El,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(hi,{type:"button",onClick:r,children:"Хорошо"})]})})})),Ps=e=>{const{open:t,close:n}=de();return{open:(n,a={})=>t(o(Rs,{...e,...n}),a),close:n}},Ds=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],As=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${zn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,u={...d,..._s(o),...Ms(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Ms=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},_s=e=>e?{vedTypes:Object.fromEntries(ws.map((({id:t})=>[t,t===e])))}:{},Es={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:ur[0],feedbackMethod:pr[0],serviceDirection:hr[0],vedTypes:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},zs=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ae,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Ae,{children:t.text})}):null]}))),Fs=(e,t)=>o(hi,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Os=(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(Qn,{...e}),o(zs,{link:t})]}),Xt(An(e,Sn).error)]}):o(zs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Fs(n)]}),Vs={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Nt(a,g),...wt(l,g),...yt(i),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ls=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Es[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=ur[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=a(""),w=Ps({typeForm:n}),C=l((async(e,t)=>{const n=js(x,e),a=Ds(Dn(n));if(!pn(a(e)))return console.warn("validation fail");const i=As({...e,...h}),l=await Vs.send(i,"lead"===m)?"OK":"Fail";if(v(l),l&&w.open({responseType:l}),"OK"===l&&g){const e=_t();kt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:k,onSubmit:S,reset:T}]=zt(b,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return i((()=>{"OK"===y&&(v(""),T())}),[y]),c(Ot,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),(e?.inputs||[])?.map(Ts(k,n))]},`section-${t}`))),Os(I?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{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(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),js=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)}))));function qs(e){const[t,n]=a(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const $s=d((({inputs:e=[],typeForm:t="",field:n,key:a})=>{const i=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(An(n(e?.name),Rn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Ba,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(Ra,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(Ts(n,t))}),renderFoldButton:Us(c("div",{children:[o(Qn,{value:i,onChange:t=>{for(const a of e){const e=n(a.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},a),Xt(l?"Отметьте все обязательные соглашения":"")]}))})})})),Us=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Ws=({field:e,typeForm:t="",inputs:n,isRetailForm:a=!1})=>{const{consentInputs:i,restInputs:l}=Hs(n||[]);return i.length>2?c("div",{children:[l.map(Ts(e,t,a)),o($s,{inputs:i,field:e})]}):(n||[])?.map(Ts(e,t,a))},Hs=e=>({consentInputs:e?.filter((e=>Object.keys(Al).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Al).includes(e.name||"")))||[]}),Ys={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:ur[0],feedbackMethod:pr[0],serviceDirection:hr[0],vedTypes:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},Ks=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ys[e.name||""]]))),typeForm:{key:n,text:""}}},Gs=(e,t)=>o(hi,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xs=e=>Sa("/user-data/updateUserProfile","PUT",e),Js=e=>Sa("/user-data/updateUserTask","PUT",e),Zs={width:"118",height:"24"},Qs={"bg-white":"color",transparent:"white"},eo={"bg-white":"text-primary-main",transparent:"text-white"},to=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Qs[e]},className:eo[e],width:n?.width,height:n?.height}),no={"bg-white":"text-primary-text",transparent:"text-white"},ao=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!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??"Россельхозбанк",...pe(s),children:[to(l,n?.image,Zs),r?a??o("div",{className:"ml-s",children:o(Ae,{font:"font-medium",color:no[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),io=async({code:e,setHasError:t,close:n,sendCode:a=Ut})=>{const i=await(l={captchaText:e},Sa("/sms/checkCaptcha","POST",l));var l;"ERROR"===await i.text()?t(!0):(a(),n?.())},lo=async(e,t)=>{const n=await(e=>Sa(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:l})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1);return i((()=>{lo(s,e)}),[]),o(El,{head:o(ao,{}),onClose:l,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:()=>lo(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(hi,{onClick:t,version:"secondary",children:"Вернуться"}),o(hi,{type:"submit",disabled:!d,onClick:()=>io({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),so=d((({time:e,setTime:t,className:n})=>(i((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:oo(e)})))),oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,co=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:a,setAttemps:i})=>{try{await(l={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},Sa("/sms/sendCode","POST",l)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),i(0),n(180),a(!0)}catch(e){t.open()}var l},mo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((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=l((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:uo(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),uo=(e,t,n=!1)=>{const a=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&a?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},ho=d((({isDisabled:e,onClick:t,text:n})=>o(hi,{type:"button",onClick:t,disabled:e,children:o(Ae,{font:"font-normal",children:n})}))),po=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},go=({close:e,values:t})=>{const[n,s]=a(!1),[o,c]=a(""),[d,m]=a(!1),[u,h]=a(0),[p,g]=a(!1),[f,x]=a(0),b=l((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Sa("/sms/checkCode","POST",e).then(po))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return i((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},fo=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=a(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=go({values:p,close:e}),T=l((()=>{co({phoneNumber:h,captchaDialog:I,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),I=((e,t)=>{const{open:n,close:a,closeAll:i}=de();return{open:()=>n(o(ro,{close:a,onClose:t,...e})),close:a,closeAll:i}})({phoneNumber:h,sendCode:T},t);return i((()=>{T()}),[]),o(El,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(mo,{values:p,setValues:g,errorText:b,hasError:x}):null,bo(v,w,T),o(Pe,{itemSize:"list-s",__html:s}),xo(u,N,f),y?o(ra,{blur:!1}):null]})})})),xo=(e,t,n)=>e?o(ho,{isDisabled:t,onClick:n,text:e}):null,bo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(so,{className:"text-base ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,a)=>e(o(fo,{onClose:t,close:n,...a})),close:t}},vo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},No={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},wo=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,i]=a(""),[r,s]=a(!1),{open:d,close:m}=de(),u=Ce(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),g=r?No:vo;return o(El,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>zl(d,ko,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(jl,{className:"whitespace-normal",orientation:"horizontal",items:Co,value:n,onChange:p}),o(hi,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Co=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ko=2,So=e=>{const{open:t,close:n}=de(),a=yo(),i=(t,i)=>async l=>{n(),"SIGNED"===l&&t?a.open((t=>async n=>{t&&await Xs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(i),To(t)):e()};return{open:(n,a)=>t(o(wo,{handleSubmit:i(n,a),onClose:e}))}},To=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Io=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Sa("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(El,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(hi,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(hi,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Bo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Ro={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Po={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Do=e=>Object.entries(e).reduce(((e,[t,n])=>t in Bo?[...e,{contactTypeCd:{key:Bo[t]},value:n}]:e),[]),Ao=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Ro){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Ro[t]},...a}]}return e}),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>t in Po?[...e,{incomeTypeCd:{key:Po[t]},value:Number(n||0)}]:e),[]),_o=({inputs:e,programId:t,nextStepLink:n,saveForm:i})=>{const[r,s]=a(""),[,c]=qs("taskId"),[,d]=qs("profileId"),[,m]=qs("participantId"),u=(e=>{const{open:t,close:n}=de(),a=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Io,{handleClose:a}),e),close:n}})(n),h=So(u.open),p=yo(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const a=Ds(Dn(e));if(!pn(a(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(l={profile:{phone:bt(n.phone)}},Sa("/public-data/createUserProfile","POST",l));if(e&&n?.phone){const a=async()=>{try{await Eo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:i}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Al).filter((e=>n[e])).map((e=>Al[e]?.text));p.open(a,zo(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},Eo=async({programId:e,profileId:t,formData:n,saveUserData:a,saveForm:i})=>{const l=Oo(n);await Xs(((e,t)=>{const{name:n="",surname:a="",middleName:i="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:i,birthDate:l&&xt(l,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},Sa("/user-data/createDraftTask","POST",o));var o;await Js((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,birthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:Do({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),a(s,r,t),i(n)},zo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Fo(t)}`}),Fo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Oo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Vo=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:i,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Xr(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Lo(i),addressFact:Lo(l),esiaAccountTypeCd:t?.esiaAccountType}},Lo=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`: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}},jo=e=>{const[t,n]=a(!1),[r]=qs("profileId"),[s,o]=qs("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Sa("/esia/updateProfileEsia","POST",t));o({...s,...Vo(n)}),globalThis.location.href=e}var t}),[]);return i((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},qo=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=a(""),{isLoading:g}=jo(l),[f,x]=qs("leadForm"),b=Ks(m,f),{handleSubmit:y,responseStatus:v}=_o({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){Ps({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=zt(b,{onSubmit:y});return i((()=>{"OK"===h&&(p(""),C())}),[h]),o(Ot,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(ra,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),Ws({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Gs(s)]})})})),$o=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Pe,{__html:e}),a?.text?o(ye,{className:"text-primary-main",children:a.text}):null]})]}))),Uo=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:i})=>{const[l,r]=a(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("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) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(so,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(Pe,{__html:i}):null]})]})})),Wo=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(Ho,{title:a,items:i}),o(Ho,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(hi,{className:"w-full mt-lg",children:s}):null]}))),Ho=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Ae,{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",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Yo(e)},t)))}):null]})]}):null},Yo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Ko=d((({title:e,description:t})=>{const n=Ce();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Go=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Xo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Jo(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Zo(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}function Zo(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qo=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:r,onIntersection:s})=>{const c=Jo(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:r})})),ec=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],tc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},b=s([]),y=l(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(ac(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nc(c,v):{},...N?Xo(h):{},gap:`${r}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(Qo,{className:u(m,i?ec[i-1]:"",{"h-full":N},t),style:w?nc(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),nc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ac=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),ic={"horizontal-list":"w-6","vertical-list":"h-6"},lc=({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?ic[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),rc=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=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",r=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",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},sc=e=>e,oc=(e=sc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),cc=oc(),dc=(e=sc)=>oc((t=>-e(t))),mc=dc(),uc=e=>t=>e.scrollWidth/t,hc=e=>(t,n)=>{e.scrollBy({left:n*uc(e)(t),behavior:"smooth"})},pc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((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?[dc()(i),oc()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?hc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?hc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((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}]},gc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},fc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=pc({itemCount:s.length}),g=xc(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(tc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",gc[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(lc({activeIndex:t,onClick:f,listType:a}))}):null})),xc=(e=!1)=>({behavior:e?"auto":"smooth"}),bc=d((({className:e,disabled:t,...n})=>o(ye,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),yc=d((e=>o(bc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),vc=d((e=>o(bc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Nc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",wc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Cc(t):null,l?o(yc,{className:u(kc(i),m?"left-1":"left-0"),onClick:s}):null,r?o(vc,{className:u(kc(i),m?"right-1":"right-0"),onClick:d}):null]})})),Cc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Nc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Nc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),kc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Sc=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=pc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(tc,{containerRef:y,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(wc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(fc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:l,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),Tc=({blocksToRender:e,...t})=>o(Sc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Go(!0)),children:I(e,t)},String(n))})}),Ic=e=>e%2!=0,Bc=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:i="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===i?"justify-between":"justify-center",l),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Rc=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:i=!1,onClick:l})=>o(Bc,{tag:"button",onClick:l,disabled:i,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",i?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Ae,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Pc=({isUnfolded:e,onToggle:t})=>o(Rc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Dc=["ArrowDownIcon","ArrowUpIcon"],Ac="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Mc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Ac),children:[R(l,{...i.options,parent:n}),Ic(l.length)?o(gt,{className:"col-span-6",...i}):null]}),o(Ba,{renderFoldableSection:({isUnfolded:e})=>c(Ra,{className:u(Ac),isUnfolded:e,children:[R(r,{...i.options,parent:n}),Ic(r.length)?o(gt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Rc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Dc[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},_c=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Ec(n,t),Mc({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Ec(n,t),Tc({...a,blocksToRender:t})]});default:return null}})),Ec=(e,t)=>e&&!t.length?o(Ko,{...e}):null,zc=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Fc=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(_r,{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))))),Oc=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,zc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Vc(a)).filter(Boolean))]}),n?o("div",{children:o(hi,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Vc=e=>([t,n])=>{const a=n?.type;return"array"===a?Lc(t,e)(n):null},Lc=(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(Ae,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Fc,{items:a,multiple:!n?.single,...t(e)})]},e)};function jc(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const qc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,$c=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>qc(t[e])||qc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>qc(t[e])||qc(n[e])||Uc(t[e])<=Uc(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>qc(t[e])||qc(n[e])||Uc(t[e]?.min)>=Uc(n[e]?.min)&&Uc(t[e]?.min)<=Uc(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>qc(t[e])||qc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>qc(t[e])||qc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Uc=e=>Number(e||0),Wc=(e,{block:t,page:n,normalize:a=Et})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=zt(e),d=r((()=>jc(i,i.map((e=>mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=Et)=>e?.filter((([,e])=>$c(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Hc={},Yc={},Kc=ht((({className:e,filtrationSchema:t=Hc,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Wc(Yc,{block:i.block,page:i.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:Gc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Gc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Oc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(hi,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(_c,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Gc=e=>jc(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Xc=(e=!1)=>e?"text-left":"text-center",Jc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Zc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:i,...l})=>{const r=String(a?.width||t);return i?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Jc[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),Qc=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Xc(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(ed)}):null]})})),ed=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Zc,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Ae,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Pe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),td=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(Ae,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(Ae,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),nd=(e,t,n)=>o("div",{className:`grid gap-2xs ${ad(t)}`,children:e.map(td(n))}),ad=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},id=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?nd(e,a,t):null]}))),ld={start:"justify-start",center:"justify-center",end:"justify-end"},rd=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",ld[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Le(e)})})),sd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),od="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",cd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",dd="flex flex-col gap-y-xl min-w-52",md=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Ae,{size:"text-h3",children:"number"==typeof e?[a,Ue(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),ud=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(Ae,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(md,{value:n,...i}):o(Ae,{size:"text-h3",children:"-"})]}))),hd=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,pd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Ae,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ue(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),gd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),fd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(pd,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(ud,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(gd,{title:e,...r}),xd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Oi,{items:e?[`От ${Ue(1)(a.min||0)} ${n}`,`До ${Ue(1)(a.max||0)} ${n}`]:[],step:t,...a}),bd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},yd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},vd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=bd.prefMonthsNum,prefTravelBonusRate:l=bd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||yd,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Nd=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=zt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=vd(r,n);return o(sd,{className:e,title:t,...l,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),xd({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?fd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:dd,children:[f>=0?o(ud,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(a,{isVertical:!0}),hd(i)]})]})})})),wd=Math.round(29.5),Cd=(e,t=0)=>e?.sum?e.sum:t,kd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Sd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Td=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:i,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(jl,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Id=e=>Td({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Bd=" (c капитализацией)",Rd=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:dd,children:[o(ud,{title:`Доход в конце срока${l?Bd:""}`,value:e,postfix:n,prefix:"+"}),o(ud,{title:`Сумма в конце срока${l?Bd:""}`,value:t,postfix:n}),Le(a,{isVertical:!0}),i?.map(hd)]}),Pd=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dd([e,t],a),Dd=([e,t],n=[])=>({[e]:n.length?mc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?cc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Ad=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Md={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const _d={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ed=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Md[e?.rateType]:"",{data:n}=jn(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&zd(s,e)&&Ad(a,["minSum","maxSum"],e)&&Ad(n,["minDays","maxDays"],e)))||_d,{rate:m}=d,u=Fd(m,e),h=a+u,p=c||[_d];return{...d,...Dd(["minSum","maxSum"],p),...Dd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},zd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Fd=(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)},Od=ht((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=zt({moneyValue:Cd(r,1e5),daysValue:kd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Ed(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(sd,{className:e,title:t,...d,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Oi,{items:[`От ${Sd(y.min||0)}`,`До ${Sd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Vd(p,h),Id({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),fd({rate:x,depositeName:b,isShowDepositeName:l}),Rd({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var y})),Vd=(e,t)=>c("div",{className:"space-y-s",children:[o(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Qn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Qn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Ld=(e=[],t=!1)=>jd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),jd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},qd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Oi,{items:[`От ${$d(e)}`,`До ${$d(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),$d=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ud=e=>Td({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Wd=({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?.(Mi(t?.[i],n.minMonths,n.maxMonths))},Hd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(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)},Yd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Kd=e=>Gd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Gd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Gd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Xd=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Yd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Pd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Pd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n})&&Ad(a,["minSum","maxSum"],e)&&Ad(i,["minMonths","maxMonths"],e)))||Yd)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Hd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Zd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Qd=ht((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,jd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=zt({moneyValue:Cd(s,2e5),monthsValue:kd(s,wd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=Xd(g,n,r),y=Ud({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return i((()=>{v&&v(Mi(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Mi(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!Jd(s)&&h&&Wd({field:f,defParams:h,calcParams:b,map:Zd,monthsValue:"minMonths"})}),[n,s]),o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),qd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),em({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(a,{isVertical:!0}),hd(l)]})]})})})),em=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Qn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Qn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),tm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},nm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},am=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?rm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[lm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),lm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),lm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),lm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Ad(a,["minSum","maxSum"],t),Ad(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||nm,{rate:u}=m,h=im(u,e),p=a+h,g=t||[nm];return{...m,...Dd(["minSum","maxSum"],g),...Dd(["minMonths","maxMonths"],g),availableMonths:tm(g.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:l,income:h,finalSum:p}},im=(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)},lm=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],rm=(e,t)=>e+Math.round((t-e)/2),sm=(e="rub")=>"rub"===e,om=(e,t)=>{const{minMonths:n,maxMonths:a}=Dd(["minMonths","maxMonths"],um(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Mi(i,n,a)}},cm=(e,t)=>{const{minSum:n,maxSum:a}=Dd(["minSum","maxSum"],um(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Mi(i,n,a)}},dm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),mm=e=>{const t=sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},um=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},hm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Td({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Td({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),pm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Id({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Td({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),pm(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},pm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,gm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},fm={text:"₽",key:"rub"},xm=ht((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[fm],g=l((e=>t=>e?{...t,...mm(t),...cm(t,e),...om(t,e),...dm(t,e)}:t)(h),[h]),[f,{field:x}]=zt({moneyValue:Cd(d,2e4),monthsValue:kd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:fm},{normalize:g}),b=x?.("currency")?.value??fm,y=x?.("isNewClient")?.value,v=um(h,b),N=am(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,T=l((()=>{Wd({field:x,defParams:Ld(v,y),calcParams:N,monthsValue:"minMonths",map:gm})}),[x,h]);i((()=>{!Jd(d)&&v&&T()}),[d,h]);const I=w===Ld(v,y)?.rate;return o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[c("div",{className:"flex gap-m",children:[xd({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:bm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),qd({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),hm({...N,...s},x)]}),fd({rate:w,children:vm(T,I)}),Rd({income:C,finalSum:k,buttons:[...a,ym(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),bm=(e="")=>sm(e)?1e3:100,ym=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},vm=(e,t=!1)=>t?null:o(hi,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Nm=e=>wm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Cm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},km=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Cm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Pd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Pd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n})&&Ad(a+r,["minSum","maxSum"],e)&&Ad(l,["minSumOld","maxSumOld"],e)&&Ad(r,["minSumExtra","maxSumExtra"],e)&&Ad(i,["minMonths","maxMonths"],e)))||Cm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Hd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Sm=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...r})=>{const[s,{field:d}]=zt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=km(s,n,l),h=Ud({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(sd,{className:e,title:t,...r,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),xd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),qd({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Tm({...m,...l},d),m.isExtraMoney?xd({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ud,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(a,{isVertical:!0}),hd(i)]})]})})})),Tm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Qn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Im=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Ai(e,{normalize:(e=i)=>n&&a?String(Mi(Number(Bm(e)),n,a)):Bm(e),format:Ue(r)}),d=l((e=>t&&t(Bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),Bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Rm=d((e=>o(Im,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Pm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Dm={amount:1500},Am=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=zt(Dm),[h,p]=a(!1);return i((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Pm[r],children:[o(Rm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(hi,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Mm=({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(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),_m="relative h-full",Em={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},zm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Vm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:Fm(n,{someCardsHighlighted:l}),children:[I(n,a,{className:Om(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Vm(n)?Mm({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Fm=(e,{someCardsHighlighted:t})=>u(_m,t&&(Vm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Om=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(_m,"min-w-80",Em[a],t&&(Vm(e)?"pt-3xl sm:pt-16":"pt-3xl"),Go(n),n&&"h-full"),Vm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Lm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Sc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?jm(s?.block?.blocks):[],hasBlur:!0,children:zm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),jm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],qm="z-10 border border-solid w-full h-full",$m=u(qm,"absolute hidden @xl:block border-transparent"),Um=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u($m,"top-9 right-12 bg-green-dark")}),o("div",{className:u($m,"top-6 right-8 bg-green")}),o("div",{className:u($m,"top-3 right-4 bg-green-light")}),c("div",{className:u(qm,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Le([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Wm={black:"bg-black",white:"bg-white"},Hm=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Le([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Ym)]}):null,i?c(Ae,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Ym=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Wm[e]}`},String(t)),Km=d((({icon:e,...t})=>{const n=ue(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Gm=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Xm(a):null]})}))),Xm=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Km,{...e},String(t))))}),Jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Zm=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=ue()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(i),children:l})})),Qm=[{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"}}],eu=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>Qm.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ve(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),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},tu(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:Le(m,{className:nu(s??!1,i??!1,n),buttonClassName:h})}),r?o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),tu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",nu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),au=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!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(Zm,{href:i,target:m,className:"h-full",data:Jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Ve(l)?o(ne,{image:l}):null,x),buttons:d.length?o(eu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Oe,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,iu(a,p)]})})}))),iu=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,lu=(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(Ae,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Ae,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Le(i)}):null]},String(t))},ru=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(lu),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=a(!1);return i((()=>ce.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Ve(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(Ba,{renderFoldableSection:()=>c("div",{children:[x,o(Ra,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?su(m?.parent,h,y):null}):o("div",{children:x})]})})),su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),ou=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?cu(n):null,t?.length?cu(t):null]}))),cu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>du({column:e,i:t})))}),du=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},i)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Le([a])})]},String(i))))},`col-${String(t)}`):null,mu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const a=async()=>{const n=await Sa("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?uu(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};a();const i=setInterval(a,24e4);return()=>clearInterval(i)},uu=e=>{401==e&&(globalThis.location.href="/")},hu=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 mr-4 text-gray",children:t}):null]})]}))),pu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(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(hu,{step:a,showPercentage:!1})]})})}));var gu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(gu||(gu={}));const fu=e=>Sa("/user-data/getTaskStatus","POST",e),xu=e=>Sa("/user-data/sendSignalToProcess","POST",e),bu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(yu,{title:a,items:i}),o(yu,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),yu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Ae,{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",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:vu(e)},t)))}):null]})]}):null},vu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Nu=d((()=>o(bu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),wu=d((()=>{const[e]=qs("leadForm");return o(bu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Cu=d((()=>{const[e]=qs("leadForm");return o(bu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ku=d((()=>{const[e]=qs("leadForm");return o(bu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Su=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Tu=d((()=>{const[e,t]=a(gu.process),[n]=qs("taskId");return i((()=>{(async()=>{for(const e of Su)await xu({signalType:e,taskId:n})})();const e=setInterval((()=>fu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==gu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),Iu(e)})),Iu=e=>({IN_PROCESS:o(wu,{}),CANCELLED:o(Nu,{}),APPROVED:o(ku,{}),REVISION:o(Cu,{})}[e]||null),Bu=[{paymentSystem:qr[0].id,currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{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:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Ru=e=>{if(e)try{return new Date(e)}catch(e){return}},Pu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Du(n,e),Au(t,e),Mu(t,e),_u(t,e),Eu(t,e),zu(t,e)].some(Boolean)?{...t,required:!1}:t)),Du=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Au=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Mu=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),_u=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Eu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),zu=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Fu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},Ou=({field:e,inputs:t})=>t.map(Ts(e,"")),Vu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:i},l)=>{const r=Pu(Lu(t))(e,n),s=r.filter((e=>!zu(e,Lu(t))));return c("div",{className:u(Is(a),"grid gap-x-m"),children:[Fu(s),Bs(i),Ou({field:t,inputs:r})]},`section-${l}`)})),Lu=e=>t=>e(t)?.value,ju=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(hi,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(hi,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),qu=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:xt(n,!0),deliveryTimeCd:{value:"TIME_2"}}},$u=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:a,codeWord:i}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(l),email:r}),participantAddresses:Ao({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:i,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:i,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Ao({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,wages:i,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:a,otherDependents:n,participantIncomes:Mo({wages:i,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(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}=e;return{participantAddresses:Ao({addressCourier:t})}})(t);default:return{}}},Uu=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=l((async l=>{const c=Ds(Dn(Pu(Wu(l))(t,e)));if(console.log(Dn(Pu(Wu(l))(t,e))),!pn(c(l)))return console.warn("validation fail");a(l);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...$u(i,a)}],...qu(a)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&i?.(!0),"OK"}),[]);return{handleSubmit:c}},Wu=e=>t=>e[t],Hu=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:r})=>{const[d,m]=qs("leadForm"),u=((e,t)=>({...Bu[e],...t,birthday:Ru(t?.birthday),dulIssueDateField:Ru(t?.dulIssueDateField),participantDateRegistration:Ru(t?.participantDateRegistration),beginDate:Ru(t?.beginDate),deliveryDate:Ru(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=Uu({step:e,inputs:p,onNextStep:a,saveStep:m,finishForm:r}),[,{field:x,onSubmit:b}]=zt(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return i?o(Tu,{}):c("form",{onSubmit:b,className:"space-y-m",children:[Vu({sections:t,field:x,step:e,registerSubmit:g}),o(ju,{step:e,onPrevStep:n})]})})),Yu=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Ku=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],Gu=d((({className:e,...t})=>{const[n,s]=a(0);i(mu,[]);const d=l((()=>{s((e=>Math.min(e+1,6)))}),[]),m=l((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>Yu[n]),[n]),[p,f]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p?null:o(pu,{stepsTitles:Ku,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Hu,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:p,finishForm:f},String(n))})]})})})),Xu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>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(hu,{step:a,showPercentage:!1})]})})})),Ju=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d,intervalExpireAction:m}):null]}),o(Zu,{title:a,items:i}),o(Zu,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Zu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Ae,{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",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Qu(e)},t)))}):null]})]}):null},Qu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),eh=d((()=>o(Ju,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),th=d((({handleExpireTimer:e})=>{const[t]=qs("leadForm");return o(Ju,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),nh=d((()=>{const[e]=qs("leadForm");return o(Ju,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ah=d((()=>{const[e]=qs("leadForm");return o(Ju,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ih=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lh=d((()=>{const[e,t]=a(gu.process),[n]=qs("taskId");i((()=>{(async()=>{for(const e of ih)await xu({signalType:e,taskId:n})})();const e=setInterval((()=>n&&fu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==gu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return rh(e,(()=>t(gu.rework)))})),rh=(e,t)=>({IN_PROCESS:o(th,{handleExpireTimer:t}),CANCELLED:o(eh,{}),APPROVED:o(ah,{}),REVISION:o(nh,{})}[e]||null),sh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField: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:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],oh=e=>{if(e)try{return new Date(e)}catch(e){return}},ch=e=>(t,n)=>t.filter((e=>e)).map((t=>[dh(n,e),mh(t,e),uh(t,e),hh(t,e),ph(t,e),gh(t,e)].some(Boolean)?{...t,required:!1}:t)),dh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,mh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,uh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),hh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ph=({name:e},t)=>"addressFact"===e&&t("addressMatch"),gh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),fh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},xh=({field:e,inputs:t})=>t.map(Ts(e,"")),bh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:i},l)=>{const r=ch(yh(t))(e,n);return c("div",{className:u(Is(a),"grid gap-x-m"),children:[fh(r),Bs(i),xh({field:t,inputs:r})]},`section-${l}`)})),yh=e=>t=>e(t)?.value,vh=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(hi,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(hi,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),Nh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},wh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Ch=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:wh[a?"annuity":"differential"]}},kh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(l),email:r}),participantAddresses:Ao({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:i,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:i,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Ao({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,confirmationIncome:i,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:a,incomeCertificateCd:i,otherDependents:n,participantIncomes:Mo({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(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)}},Sh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=l((async l=>{const c=Ds(Dn(ch(Th(l))(t,e)));if(!pn(c(l)))return console.warn("validation fail");a(l);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...kh(i,a)}],...Ch(a),...Nh(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&i?.(!0),"OK"}),[]);return{handleSubmit:c}},Th=e=>t=>e[t],Ih=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,renderStep:i=bh,isFormFinished:r,finishForm:d})=>{const[m,u]=qs("leadForm"),h=((e,t)=>({...sh[e],...t,birthday:oh(t?.birthday),dulIssueDateField:oh(t?.dulIssueDateField),participantDateRegistration:oh(t?.participantDateRegistration),beginDate:oh(t?.beginDate),deliveryDate:oh(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Sh({step:e,inputs:g,onNextStep:a,saveStep:u,finishForm:d}),[,{field:b,onSubmit:y}]=zt(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(lh,{}):c("form",{onSubmit:y,className:"space-y-m",children:[i({sections:t,field:b,step:e,registerSubmit:f}),o(vh,{step:e,onPrevStep:n})]})})),Bh=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Rh=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Ph=d((({className:e,...t})=>{const[n,s]=a(0);i(mu,[]);const d=l((()=>{s((e=>Math.min(e+1,5)))}),[]),m=l((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>Bh[n]),[n]),p=0===n,[f,x]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p||f?null:o(Xu,{stepsTitles:Rh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Ih,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e,field:t})=>o(Qd,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Dh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ah=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Mh=1e9,_h={sum:{min:1e4,max:Mh},period:3},Eh=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Wc(_h,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:zh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Fh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Oc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Rm,{label:a?.title,min:500,max:Mh,...d("sum",{parse:e=>({min:Number(e),max:Mh}),format:({min:e})=>String(e)})}),o(Oi,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(_c,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),zh=e=>ot((e?.paramsSource?.rateRows||[]).filter(Dh).flatMap((e=>Ah(e.minMonths,e.maxMonths)))),Fh=e=>ot(e.flatMap((e=>e||[])).filter(Dh).flatMap((e=>Ah(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Oh=[{key:"10"},{key:"50"},{key:"100"}],Vh=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Oh,iconVersion:"black"})]})},Lh="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",jh=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Lh,"aria-label":`Страница ${l}`,children:l},String(t)):null},qh={width:"24",height:"24"},$h=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Uh(1===e),...qh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Lh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(jh),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Lh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Uh(e===n),...qh})})]})},Uh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Wh=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o($h,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Vh,{itemCount:a,onItemCountChange:i}):null]}),Hh=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Yh=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Hh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(bl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(bl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(hi,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Kh=({title:e,timestamp:t,publicId:n})=>{const a=ue(),{href:i}=a({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Ae,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Gh="/api/v1/depository",Xh={startDate:void 0,endDate:void 0,query:""},Jh=ht((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=zt(Xh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?xt(a,!0):"",r=i?xt(i,!0):"",s=new URLSearchParams(Gh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=jn(Gh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),b=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Yh,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Kh,{...e},String(e.publicId)))):o(Ko,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Wh,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Zh=e=>"Image"===e?.contentType&&e?.image?o(ne,{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,Qh=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Zh(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ye,{version:i?.version,text:i?.text,...i}):null]}))),ep="location";function tp(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=a(n||null);return i((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,l((n=>e.fire(t,n)),[e,t])]})(ce,"location",ap()??{name:e}),r=l((e=>{ip(e),n(e)}),[]),{data:s}=jn(np()?null:"/api/v1/region",st);return i((()=>{s&&!np()&&n(s)}),[s]),[t??{name:e},r]}const np=()=>Boolean(globalThis.localStorage?.getItem(ep)),ap=()=>{try{const e=globalThis.localStorage?.getItem(ep);return e&&JSON.parse(e)}catch(e){return null}},ip=e=>{try{globalThis.localStorage?.setItem(ep,JSON.stringify(e))}catch(e){}};var lp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(lp||(lp={}));const rp=new Intl.NumberFormat("ru",{style:"currency",currency:lp.RUB}),sp=e=>e?rp.format(e):"",op="text-m font-light text-secondary-text ",cp=`${op} text-left`,dp=`${op} pl-5xl text-center`,mp=`${op} pl-5xl text-right`,up={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},hp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:cp,children:o(Ae,{size:"text-m",children:"Валюта"})}),o("th",{className:dp,children:o(Ae,{size:"text-m",children:"Купить"})}),o("th",{className:mp,children:o(Ae,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(pp)})]}))),pp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:up[t]},width:"24",height:"24"}):null,o(Ae,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ae,{size:"text-h6",children:sp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ae,{size:"text-h6",children:sp(e?.buyExchangeRate)})})]},t)},gp={icon:"GpsIcon"},fp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Zc,{...gp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),xp=(e,t,n)=>{const a=Number(bp(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},bp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),yp=e=>Rt([[e=>e.value!==lp.RUB&&e.oppositeValue!==lp.RUB,()=>e.handleConvert(e.value,lp.RUB)],[e=>e.value===lp.RUB&&e.oppositeValue===lp.RUB,()=>e.handleConvert(e.value,lp.USD)],[e=>e.value===lp.RUB&&e.oppositeValue===lp.RUB,()=>e.handleConvert(e.value,lp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function vp(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Np=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||lp.RUB,selectBuy:n?.[0]?.currency?.currency||lp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[vp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:wp(r,d,n),value:r.inputSell,setValue:e=>kp(d,n)(e,r.selectSell,r.selectBuy)}),vp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Cp(r,d,t),value:r.inputBuy,setValue:e=>Sp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(ye,{text:i.text,version:i?.version,...i}):null]})})),wp=(e,t,n)=>a=>{t({selectSell:a}),yp({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{kp(t,n)(e.inputSell,a,i)}})},Cp=(e,t,n)=>a=>{t({selectBuy:a}),yp({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Sp(t,n)(e.inputBuy,a,i)})},kp=(e,t)=>(n,a,i)=>{e({inputSell:bp(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(xp(n,l,a===lp.RUB)||"")})},Sp=(e,t)=>(n,a,i)=>{e({inputBuy:bp(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(xp(n,l,a===lp.RUB)||"")})};const Tp=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const[i]=tp(),l=function(e){const t=e?.code||"000",{data:n}=jn(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(i),r=Ip(l?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:lp.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:lp.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Te,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(hp,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(fp,{address:l?.address})]}),o(Np,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Ip=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Bp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Rp(n))})})),Rp=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...pe(t),children:i||null})},String(a)):null},Pp=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Dp=["all","footer"],Ap=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Pp(Dp)).map(n).map(Mp)})})),Mp=(e,t)=>{const{text:n,items:a=[],href:i,target:l="_self",onClick:r,dataFooter:s}=e,d=a.filter(Pp(Dp));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:i,target:l,onClick:r,...pe(s),children:n}),d?o(Bp,{items:d}):null]},String(t))},_p=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ep)}):null)),Ep=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(zp)})]},String(t)),zp=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Fp(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Fp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Op(t)}`,children:o(Ae,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Op=e=>e.replaceAll(/\D/g,""),Vp=d((({className:e="",index:t,text:n,...a})=>{const i=ue(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Lp=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(Ae,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Vp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),jp="w-full lg:w-52";function qp(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const $p=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 l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Up=(e,t)=>(n,a)=>{for(const[i,l]of a)n.set(i,e(n.get(i)||t,l));return n},Wp=(e=[])=>e.reduce(((e,t)=>e+t),0),Hp=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Yp=e=>t=>e.map((([e,n])=>[$p(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Gp(t,e))).reduce(Up(Math.max,0),new Map),Kp=e=>t=>{return jc(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Hp(t||"");return n.length?Wp(e.map((e=>cc(n.map($p(e)))))):0})(e))).sort((a=([,e])=>e,n=(e,t)=>a(e)-a(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,a},Gp=(e,t)=>new Map(e.map((e=>[e,t]))),Xp=({basePathList:e,initialQuery:t=""})=>{const[n,l]=a(t||"");i((()=>{null!=t&&l(t)}),[t]);const{data:r}=jn(e?.length?e:null,Jp),[s,o]=a(null);return qp((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Hp(e);if(!i.length)return[];const l=Object.entries(a),r=[...i.map(Yp(l)).reduce(Up(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Kp(i)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Jp=async(...e)=>(await Promise.allSettled(e.map((e=>rt(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Zp=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[a,i]=Xp({basePathList:n,initialQuery:e}),l=r((()=>Qp(t)(a)),[t,a]);return o(El,{head:o(Hh,{autoFocus:!0,...i}),children:o(Ap,{navigationItems:l})})})),Qp=e=>t=>e?.length&&t?.length?jc(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],eg=(e={})=>{const{open:t,close:n}=de();return{open:(n={},a={})=>t(o(Zp,{...e,...n}),a),close:n}},tg=d((({className:e,search:t,...n})=>{const[i,r]=a(""),s=l((()=>r("")),[]),d=eg(n),m=l((e=>{r(e),ng(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Hh,{value:i,placeholder:t?.placeholder,onChange:m}),o(_l,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),ng=e=>e&&e.length>=3,ag=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(ao,{className:jp,logo:l,data:i,showTitle:!1}),o(tg,{className:"grow",navigationItems:t,...e})]})},ig=d((({className:e="",index:t,...n})=>{const a=ue(),{href:i,target:l,text:r,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-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),lg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ae,{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(ig,{index:t,...e},String(t))))}):null]}))),rg=ht((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[ag(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Ap,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(jp,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(_p,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(eu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Lp,{title:m,links:r}),o(lg,{links:l,license:p})]})})),sg=d((({className:e="",title:t,description:n,calendar:a,...i})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...i,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),a?og(a):null]}))),og=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>cg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:dg(e)}),c("div",{className:"text-s",children:[o(Ae,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Ae,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},cg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),dg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),mg=ht((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:Jm(l,s?.key),children:f})}):null]})})}));function ug(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>hg(t)(e)));return n.find((([,e])=>hg(t,!0)(e)))??n[n.length-1]??[]}const hg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(pg(e)(n));return t?a===F(n):a.startsWith(F(n))},pg=e=>t=>{const n=X(G.SITE_URL);return _(t)?e.href:O(n,e.pathname)},gg=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=qt(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),a=t.current.getBoundingClientRect(),i=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${i}px`:a.left>e.left&&(i>a.left?n.current.style.left="":n.current.style.left=`${i}px`)}}),[r]);return jt(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),i((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:xg(t,n)})]})})),fg=d((({isActive:e,...t})=>{const n=ue(),{text:a,href:i,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:l,onClick:r,role:"link",...pe(t?.data),children:a})})),xg=(e,t)=>e?.map(((e,n)=>o(fg,{isActive:e===t,...e},e?.text??String(n)))),bg={default:"w-6 h-6",large:"w-12 h-12"},yg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>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":`${bg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),vg="chatbot",Ng="text-page__btn-chat",wg={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Cg=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:a="Чат",version:l})=>{const r=(e=>{i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=wg[e??""];return n=>{if(t)if("personal"!==e)fa(vg,t);else{const e=n.target;e?.classList.contains(Ng)||e?.classList.add(Ng),document.getElementById("webchat-js-container:webchat_rshb")||fa(vg,t)}}})(e);return o(yg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),kg=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...l})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(l);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(i),children:[o("span",{className:Sg(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Sg=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Tg=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Jo(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(kg,{...i,children:n})})})),Ig={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"},Bg=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ce()?n:t;return i?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",Ig["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Rg=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=ug(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Pg(t):Dg(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(Tg,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(gg,{items:p,activeItem:m,ariaLabel:i}):null,M.CHAT_BOT?o(Cg,{version:t,iconVersion:d,chat:M.CHAT_BOT,ariaLabel:l}):null,o(Bg,{version:t,...n})]})})),Pg=e=>t=>Math.max(t,e+1),Dg=e=>t=>Math.min(t,e),Ag=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(Ae,{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(Mg,{...e},String(t))))})]}):null,Mg=d((({icon:e,...t})=>{const n=ue(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),_g=(e,t)=>n=>n.name?o(Zm,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Jm(e,n.name),children:o(Ae,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Eg=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(Wt,"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"})]}))),zg=d((({foreignOffices:e,branches:t})=>{const[n,i]=tp(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=a(""),u=Og(is()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((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,Fg),{close:p}=de(),g=l((e=>{i(e),p()}),[]);return c(El,{className:"pb-20",head:c("div",{children:[o(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Zm,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Eg,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&$p(e.toLowerCase())(d.toLowerCase())>=.8)).map(_g(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ae,{size:"text-h6",children:e})}),t.map(_g(x,f))]},e)))}),Ag(e)]});var f,x})),Fg=e=>e.name?.charAt(0)||"",Og=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Vg=d((({className:e="",active:t,flat:n,children:a,data:i,...l})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(Lg(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(i),children:o("span",{suppressHydrationWarning:!0,className:jg(t,n),children:d||a})})})),Lg=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),jg=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),qg=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",[i]=tp(n?.branches?.default),r=eg(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(zg,{...e}),n),close:n}})(n),d=l((()=>r.open()),[r]),m=l((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(Vg,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:Jm(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Vg,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(yg,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),$g=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Jo(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(Vg,{...i,children:n})})})),Ug=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?Wg(t):Hg(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(ao,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o($g,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(gg,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(qg,{version:i,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Wg=e=>t=>Math.max(t,e+1),Hg=e=>t=>Math.min(t,e),Yg={"bg-white":"primary",transparent:"transparent"},Kg=["all","header"],Gg=ht((({className:e,bgColor:t="bg-white",logo:n={},version:a=Yg[t],portal:i,header:l={},...r})=>{const{common:s,navigation:d}=Jg(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=ug(m),{internetBankButton:f}=i||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Ug,{activeTopItem:p,navigationItems:m?.filter(Pp(Kg)),version:a,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Xg(a))}),p?.items?.length&&o(Rg,{subItems:p?.items?.filter(Pp(Kg)),version:a,internetBankButton:f})]})})})),Xg=e=>"transparent"===e?"opacity-30":"",Jg=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Zg=(e=!1)=>e?{}:{padding:"p-0"},Qg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},ef=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Qg[n],e),padding:t,version:i,isTheme:l,...s,children:P({...s,extraProps:{...Zg(a),className:Go(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),tf=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",ld[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),nf=(e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function af({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(bc,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(bc,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const lf=d((({className:e="",cards:t=[],button:n})=>{const[i,r]=a(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=nf({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?rf({activeIndex:m,cards:t,selectedCardIndex:i,onClick:s}):null,af({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function rf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:a}){const i=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${i}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:a}){return c("button",{type:"button",onClick:a,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?sf("страховая сумма",e.sum):null,e?.fee?sf("страховой взнос",e.fee):null]}),of(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function sf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Ae,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Ae,{size:"text-l",color:"text-secondary-text",children:e})})]})}function of(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const cf=d((({className:e="",title:t,insuranceTabs:n=[],button:i,...r})=>{const[s,d]=a(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:a}){return o("button",{type:"button",onClick:a,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:df({insuranceTabs:n,button:i})})]})})),df=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(lf,{button:t,cards:e},String(n)))):null};const mf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},uf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},hf=d((e=>{const{className:t="",__html:n,isDotted:a,investmentZeroColumn:i,investmentColumns:l,...r}=e,s=l?[...l]:[];return i&&s.unshift(i),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[zc(o("div",{className:"w-px h-4 bg-gray"}))(s.map(pf)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(xf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Pe,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),pf=(e,t,n)=>{const a=1===t,i=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${gf(a,i,e.cells)}`,children:l.length?o("div",{className:"w-full "+(i?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(ff)}):null},`column_${t}`)},gf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ff=(e,t)=>{const n=e.cellSize||"XS",a=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${uf[n]} ${mf[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Ae,{align:"text-center",children:e.text})},`cell_${t}`):null},xf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,bf=["байт","Кб","Мб","Гб","Тб","Пб"],yf=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",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,...pe(l),children:[e,t?c(Ae,{size:"text-l",font:"font-light",children:[t," ",vf(d,m),o(Ae,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),vf=(e,t)=>e||t?o("span",{children:", "}):"",Nf=(e,t)=>(n,a)=>{const i=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="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))} ${bf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Cf(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(yf,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:wf(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(a))},wf=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Cf=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},kf=d((({href:e,__html:t,target:n})=>{const{close:a}=de(),i=D(),r=$(i)(e),s=l((()=>{a()}),[]);return c(El,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Pe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(hi,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Sf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{if(!e&&!a)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(kf,{...e}),n),close:n}})({__html:a,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[wf(i),o(Ae,{font:"font-light",children:e})]})})),Tf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},If=ht((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Tf[r]),role:"list",children:i.map(Bf(d,l))}):null]})})),Bf=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Rf(t)(n,a):Nf(e,t)(n,a)},Rf=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(Sf,{...a,icon:e,href:Pf(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},Pf=e=>"href"in e,Df=ht((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(a,{className:"flex-wrap"}),children:[i?o(Ae,{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:[r?o(Pe,{__html:r,itemSize:"list-m"}):null,o(Ae,{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",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),Af=(e=[],t={})=>e.filter((({content:e={}})=>$c(t,e))).length,Mf=(e,t)=>e===t;const _f=(Ef=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Mf,((e=Mf)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Ef(n,t[e])))));var Ef;const zf=[],Ff={},Of={primary:"bg-white/30",secondary:"bg-main-divider"},Vf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Lf=d((({count:e,version:t="secondary"})=>{const n=Ce(),a=n?"bg-main-divider":Of[t],i=Vf[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(Ae,{size:"text-xs",color:i,children:e})})})),jf=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(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(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},qf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},$f={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Uf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Wf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Hf=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",qf[a],n?Wf[a]:Uf[a]),role:"tablist","aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?$f[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[jf({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Lf,{count:m,version:pi(n,a)})}):null]})})})),Yf=d((e=>o(e?.item?.href?Kf:Gf,{...e}))),Kf=d((e=>{const t=ue(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Hf,{...e,tag:"a",item:i,onClick:a})})),Gf=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Hf,{item:e,onClick:a,...n})})),Xf=(e,t,n)=>(a,i)=>o(Yf,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Jf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Xf(a,i,t))}))),Zf={categories:[],extraOptions:[],propertyType:[],stage:[]},Qf=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Wc(Zf,{block:i.block,page:i.options?.page}),f=l(((e=Zf)=>p(e)),[]),x=(({hotFilters:e=zf,filtrationState:t=Ff,blocks:n=zf,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>_f(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Af(n,t.filter),version:pi(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Jf,{...x}),o(Oc,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(_c,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ex=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ax(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];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(Ae,{size:"text-h4",children:ax(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Wa,{color:"green",children:ax(s)})})]}),o("div",{className:"hidden sm:block",children:o(_a,{className:"flex-wrap",children:m?.map(nx)})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:o(_a,{className:"flex-wrap",children:m?.map(nx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(d))},tx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ax(t)} №${n}`,body:e.toUpperCase()}),nx=(e,t)=>o(Pa,{...e},String(t)),ax=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ix=[];const lx=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:ix},rx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},sx={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)},ox=d((({descriptionData:e,className:t})=>{const[n]=tp(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=jn(`/api/v1/atms?regionCode=${e}`,lx);return{data:t||ix,isLoad:!t&&!n}}(a);return o(ki,{className:t,filterItems:cx,data:i,isLoad:l,initFilterState:rx,renderCard:ex,getBalloon:tx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),cx=(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=>sx[t](e))),n=!a.length||a.some((t=>sx[t](e)));return t&&n}))},dx=({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(Ae,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:mx({workScheduleDescription:t})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:mx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(n)):null,mx=({workScheduleDescription:e})=>c("div",{children:[c(_a,{className:"flex",children:[o(Pa,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Pa,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание банковских карт"})}),o(Pa,{label:"Операции для физических лиц",children:o(Ae,{children:"Инвестиционное и накопительное страхование"})}),o(Pa,{label:"Операции для физических лиц",children:o(Ae,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Pa,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]}),ux=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),hx={branches:[],remoteWorkplaces:[]};const px=async e=>await rt(e,{method:"GET"})||hx,gx=d((({className:e})=>{const[t]=tp(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=jn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,px);return{data:t||hx,isLoad:!t&&!n}}(n);return o(ki,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ni,renderRemoteWorkplaceCard:dx,getBalloon:ii,getBalloonRemoteWorkplaces:ux,title:`Офисы филиала ${t?.name}`})})),fx=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(gx,{}):o(ox,{descriptionData:e})})})),xx=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),bx="hidden sm:flex absolute z-40 top-10",yx=ht((({className:e="",padding:t,slides:n=[],...i})=>{const[l,r]=a(0),[s,d]=pc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...i,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Xe,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...i})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(tc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(vx({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(yc,{className:u("left-6",bx),onClick:d.scrollLeft}):null,d.canScrollRight?o(vc,{className:u("right-6",bx),onClick:d.scrollRight}):null]})]})})),vx=({activeSlideIndex:e,onClick:t})=>({nav:n},a)=>{const i=a===e,l=i?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(a))},Nx=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ve(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?wx({__html:l,richVersion:r}):null,Cx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Cx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Cx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?Le([a]):null]})]}))),wx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),Cx=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ae,{size:"text-xl",color:a,children:t})]})]}):null,kx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Pe,{__html:t,richVersion:n})})})),Sx=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:i})=>o(Bc,{tag:"button",className:u("border-none bg-transparent items-center group/button",i?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Tx=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Ix=(e=!1)=>e?"MinusIcon":"PlusIcon",Bx=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Rx=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:i,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();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:c,...d,children:o(Ba,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Ra,{className:u("gap-lg",Tx(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Px({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Px=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:i,onToggle:l,isMobile:r=!1})=>{const s=t||(i?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Bx(e):Ix(e))(i,r);return"accordion"===e?o(Sx,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(Rc,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Dx=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Jn,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Ae,{color:"text-primary-text",children:t}):null]})}))),Ax=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Dx,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Dx,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Mx=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(cn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),_x=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Mx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Mx,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ex=["От 1 дня","До 365 дней"],zx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Oi,{min:1,max:365,value:e,items:Ex,onChange:t})]}))),Fx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Mx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Mx,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ox=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(_x,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Vx(m)}),o(zx,{days:i,setDays:e=>m({days:e})}),o(Fx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Lx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Ax,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Vx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Lx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},jx=d((({days:e,tariffs:t=[]})=>{const n=$x(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[qx("Аренда за",e),qx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),qx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),$x=(e,t)=>{const n=Ux(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Ux=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Wx=(e,t)=>e.find((e=>e.branchCode===t)),Hx=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Wx(a,n.selectedBranch),d=Yx(s?.safeBoxCaseVolumes),m=Kx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Gx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ox,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(jx,{days:n.days,tariffs:u})]})})),Yx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Kx=(e,t)=>e?.find((e=>e.volume===t)),Gx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Xx=[];const Jx=async e=>await rt(e,{method:"GET"})||Xx,Zx=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=is(),p=Qx(m.selectedRegion,h),f=function(e){const{data:t}=jn(e?`/api/v1/safeboxes?regionCode=${e}`:null,Jx);return t||Xx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),b=(y=Wx(f,m.selectedBranch)||f,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Hx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(Na,{points:b,className:"h-[640px]"}):null]})})),Qx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,eb=e=>e<4?"w-72":"w-52",tb={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"},nb=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=i.length>3,h=tb,p=(e=>e?"":"opacity-0")(a),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:Xc(f)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:zc(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(ab(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=x,{label:l,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",eb(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(Ae,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:a.description,children:r}):null,o(Pe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),ab=(e,t,n)=>({icon:a},i)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${ib(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Ve(a)?o(ne,{image:{...a,iconVersion:a?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var r},ib=e=>e?"h-16 w-16":"h-24 w-24",lb=d((()=>o("div",{className:"hidden",role:"none"}))),rb="hidden sm:flex absolute z-40",sb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ob=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=pc({itemCount:t?.length||0});return i((()=>cb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(tc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:sb[l].item,gap:sb[l].gap,children:t.map(Xf(n,a,l))}),s.canScrollLeft?o(yc,{className:u("left-6",rb,sb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(vc,{className:u("right-6",rb,sb[l].buttonTop),onClick:s.scrollRight}):null]})})),cb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},db={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},mb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(db[t].wrapper,e),children:o(ob,{className:db[t].component,tabsType:t,...n})}):null,ub=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=hb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=a(fb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const C=gb(x[y],y),k=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[mb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:pb(t,x),activeItem:N,tabsType:r,onChange:k}),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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(gb)?.filter(Boolean)||[]}),hb=({__id:e,anchor:t})=>t??e??"tabs",pb=(e,t)=>t?.length?t:e,gb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",fb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),xb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},bb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:xb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),yb=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),vb={Buttons:({buttons:e})=>Le(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Pe,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ae,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Ae,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(yb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Nb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return wb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),wb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in vb))return null;return o(vb[n],{...t,...a})},Cb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>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(Nb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),kb=(e,t)=>140*Wp(e.slice(0,t).map((e=>e?.cols?.length??1))),Sb=(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(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Tb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=nf({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((i=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,l=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.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(Ae,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${kb(a,i)}px)`},children:a?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ae,{size:"text-xl",children:e.data}):null,e?.cols?Sb(e.cols,i):null]},`row${t}`)))})})]},String(t))})),af({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var i})),Ib=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(Ae,{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(Tb,{rows:t.rowsData})})})]},a)}))}))),Bb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Rb=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(Ae,{size:"text-xl",font:"font-light",color:Bb(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Pb=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Rb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ib,{activeTabIndex:r,items:m}),o(yb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ae,{size:"text-h6",children:"Данных нет"}),o(yb,{onClick:n,isOpen:!0})]})})),Db=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(Pb,{...t,onClick:n})}):null]}))),Ab=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Db,{onHideContentClick:()=>d(void 0),tableInner:s,...r,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(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(bb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Cb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Mb=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,af({...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]})})),_b=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:l=0,...r})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=nf({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Ab,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(Ba,{renderFoldableSection:({isUnfolded:e})=>c(Mb,{controls:p,children:[x,o(Ra,{isUnfolded:e,children:b})]}),renderFoldButton:Pc}):o(Mb,{controls:p,children:f})})]})})),Eb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?zb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Fb(n):null,i?o(Pe,{richVersion:l,__html:i}):null]})]}))),zb=()=>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"}),Fb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ob=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:n})}):null]}))),Vb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ob,{prefix:t,unit:n,suffix:a})})})),Lb=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Qg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:P({...c,extraProps:{className:u("w-full",Go(r)),...Zg(a)}})})}),{childrenTypes:[]}),jb=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",qb=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const l=D();return c(g,{className:e,defaultPadding:jb(e),...i,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(l)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(l)(n)})}):null]})})),$b={AdTile:gt,ApplicationForm:Ls,ApplicationLeadForm:qo,ApplicationStatus:Wo,BankAccountFiltration:Kc,BenefitsBlock:Qc,BonusBenefitsBlock:id,ButtonsBlock:rd,CalculatorBonus:Nd,CalculatorBusinessDeposit:Od,CalculatorCredit:Qd,CalculatorDeposit:xm,CalculatorRefinancing:Sm,CardTransfer:Am,Carousel:Lm,CarouselCard:Um,CarouselCatalogCard:Hm,CarouselLinks:Gm,CarouselRecommendationCard:au,CarouselTariffsCard:ru,ContactsBlock:ou,CreditCardForm:Gu,CreditForm:Ph,DepositFiltration:Eh,Depository:Jh,ErrorBlock:Qh,ExchangeRateTile:Tp,Footer:rg,GracePeriod:sg,GrantSupport:mg,Header:Gg,Headline:k,HorizontalLayout:ef,ImgBlock:tf,InsuranceAmountBlock:cf,InvestmentInfo:hf,LinkDocs:If,MobileAppTile:Df,MortgageFiltration:Qf,OfficesAtmsMap:fx,Placeholder:xx,ProductBlock:pt,ProductGallery:yx,RepresentativeOfficeInfo:Nx,RichTextBlock:kx,RollupItem:Rx,SafeDepositRental:Zx,StepsBlock:nb,StickyBottomMenu:lb,TabsLayout:ub,TariffsTable:_b,TextBlock:Eb,UnitBlock:Vb,VerticalLayout:Lb,Video:qb},Ub=me((()=>{i((()=>{Tt()}),[]);const e=_t();jt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),Wb="cookie",Hb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=Lt();qp((()=>{globalThis.localStorage?.getItem(Wb)||n()}),[],3e3);const i=l((()=>{globalThis.localStorage?.setItem(Wb,"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(Pe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(_l,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function Yb(e){throw new Error(e)}const Kb=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return i((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Yb(e)}}))),[c,d]),n},Gb=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=Kb({onCloseAll:e,onClose:t}),{close:a}=de(),r=l((({key:e})=>{"Escape"===e&&a()}),[]);return jt(globalThis.document,"keydown",r),i((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==n.length-1}),children:e},String(t||a))))}):null})),Xb=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);i((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Yb(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return jt(globalThis.document,"keydown",r),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",children:e.popup}):null})),Jb="header",Zb="footer",Qb="sticky-footer",ey={},ty=d((({className:e,data:t=ey,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=ut(s,r);Ub();const m={key:"",page:{slots:i,blocks:l,fallback:r,...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?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(i?.header,{...m,slotName:Jb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(i?.footer,{...m,slotName:Zb})]})]}),i?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(i?.["sticky-footer"],{...m,slotName:Qb})}):null,o(Gb,{}),o(Xb,{}),o(Hb,{__html:d?.cookieContent?.__html})]})}));Object.assign(ty,{childrenTypes:[],slots:()=>[Jb,Zb,Qb]});e.Blocks=$b,e.ContentPage=ty,e.handlerDecorator=me,e.joinList=zc,e.packageVersion="0.14.666",e.projectSettings=M,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).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=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||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),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:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.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:x(t)}))),x=(e=3)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[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(N,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=S,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const B=[],R=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:i,renderProps:l=T,...r})=>{const s=i?(e,t)=>T(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},i)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:E,isHash:z,withoutQuery:F,joinPath:O,hasPrefix:V});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),z(t),[A.CDN,j].some((e=>V(t,e)))].some(Boolean))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`${q}/${t}/attachment`;const a=t?.startsWith("/");return O(V(t,n)?"":n,a?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(O(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:a,title:i,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=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(Z).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:J(a)(e),type:te(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(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}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):null)),ae={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","":""},ie="bg-main-divider text-main-disabled",le={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(a({...e,href:n}))}};function a({href:a,target:i,onClick:l}){return r=>{l?.(r),he(a,i,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!E(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>V(e,t)))||!V(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[l]),children:a}):null,xe(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 -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,se[l]),children:i}):null]})})),fe=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",xe(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=ue()({onClick:r,href:a,...i}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:a,version:n}),children:i})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="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(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=a(false);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Ie=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=l((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&we({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",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:[Se(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-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Be(P({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Te(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Te=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(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(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Pe=d((e=>{const{__html:t="",richVersion:n="",itemSize:a="list-m",isDotted:i=!0}=e,l=i?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,a,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,_e=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Pe,{...e},`rte-${t}`):null],Ee=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?Re(n.icon,t):null,o("div",{children:_e(n)})]}))),ze=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(Ee,{benefitsVersion:t,...e},String(n))))}):null)),Fe=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(_e)}):null)),Oe=d((({isTabularBenefits:e,...t})=>o(e?Fe:ze,{...t}))),Ve=e=>Boolean(e?.src||e?.icon),Le=(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(je(n))}):null,je=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=qe(i,r),d=qe(l,r);return a||i?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...i,iconVersion:c}),appendRight:$e({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},qe=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},$e=e=>Ve(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({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(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(a)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Ge={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Xe=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=y?.src?o(ne,{image:y}):null,R=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ie,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Oe,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Pe,{richVersion:p,__html:h,isDotted:m,itemSize:Ge[l]}):null,I,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(at,e),at=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,it=(e,t)=>tt(e,{ref:({$ref:e,...n})=>it(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:it(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>it(e,t)))}),lt=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const a in e)lt(e[a],t,[...n,a])},array:e=>{for(let a=0;a<e.length;a++)lt(e[a],t,[...n,a])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>it(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return lt(e,(e=>t.push(e))),t})(e),[l,r]=a({});return i((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...l}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({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(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),a=t?.[n];return a?o(pt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(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}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e)t[a??""]?.(n,i)},St="rshb-query-params";function It(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function Tt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=Tt(e.find((([e])=>e(t))));return n(t)},Rt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Rt.if=e=>new Pt(void 0,e);class Pt{parent;predicate;unit;get entry(){return[Tt(this.predicate),Tt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Pt(this,e)}then(e){return new Pt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(_(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=It();if(!_(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;if(n){At(t?.target)?.(n)}}},At=Rt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function _t(){return _t._impl()}_t._impl=()=>({forwardQuery:Mt}),_t.setup=e=>{_t._impl=e};const Et=e=>e,zt=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);i((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=l(((e,t)=>{const{parse:n=Et,format:a=Et}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Ot=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 max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})})),Vt=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}function jt(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function qt(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return jt(globalThis.document,"click",n),t}const $t=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);i((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",I=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Gt,I),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,I),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Gt="w-full border rounded-md text-primary-text outline-none p-m",Xt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={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:Zt,addressFact:Zt,organizationAddress:Zt,addressCourier:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=en(),x=Qt[n],b=l((()=>{h.current=t,f.close()}),[t]),y=l((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=Jt}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return 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(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((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 b();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,y]),v}const an=d((({className:e,label:t,value:n="",placeholder:a,error:i,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=qt(N),k=l((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!i),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:ln(a,r,t)})}),Xt(i)]})})),ln=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>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:sn(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:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=a(""),C=un(x,n.length),k=b&&!C,S=l((()=>{w(""),y()}),[]),I=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=qt(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:I,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",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(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"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(cn,{...i,valid:!n,label:$t({label:t,errors:a})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((e=>"string"==typeof e&&6===e.length))(e),kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),In=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.substr(9))}return!1},Tn=e=>Boolean(e.region&&e.city&&e.house),Bn=()=>gn(Tn)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Rn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),regionRetail:yn("Выберите регион"),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(In)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:gn((e=>Boolean(e.fiasCode&&e.city&&e.house)))("Укажите регион, город/населенный пункт, улицу, дом"),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),wages:bn(),mandatoryPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:bn(),deliveryDate:bn("Укажите дату доставки"),addressCourier:Bn()};var Pn;const Dn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,Rn?.[e||""]])).filter((([,e])=>e)))},Mn=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},An=(e,t,n=!1)=>n&&t?Mn(e,t):e,_n=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],En=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:_n,...An(e("acquiringType"),Rn.acquiringType,t?.required)}))),zn=(e="")=>Boolean("trade"===e||"all"===e),Fn=e=>null!=e,On=new Map,Vn=e=>Boolean(e?.every((e=>Array.isArray(e)?Vn(e):!e||"string"==typeof e))),Ln=e=>Vn(e)?e.toString():"";function jn(e,t,{fallback:n,cache:l}={}){const s=r((()=>qn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Fn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=On)=>n=>{const a=Ln(n),i=t.get(a);if(a&&Fn(i))return i;const l=e(...n);return a&&Fn(l)&&t.set(a,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(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 $n=[];const Un=async e=>await rt(e,{method:"GET"})||$n;function Wn(e=!1){const{data:t}=jn("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const a=e("region"),l=a?.value?.key,r=a?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=jn(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||$n}(l)?.filter((e=>e?.address));return i((()=>{""!==a?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[a?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...An(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=l((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=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{label:"Адрес",disabled:r,...An(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((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})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",...An(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:i})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...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)}))}))),Jn="appearance-none w-5 h-5 border-solid flex-none",Zn=[{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"}],Qn=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xn,{paths:Zn,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",ta(a)),onClick:s,children:[o("div",{className:u(Jn,"m-0",i?"rounded-full border-2":aa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:na(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ea(n)]})})})),ea=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ta=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",na=(e=!1)=>e?"radio":"checkbox",aa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ia=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:i,onChange:r},a),Xt(l)]}))),la=d((({field:e,input:t})=>o(ia,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...An(e("addressMatch"),Rn.addressMatch,t?.required)}))),ra=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),sa="/icons/MapMarkerClusterIcon.svg",oa="/icons/MapMarkerClusterYellowIcon.svg";function ca({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>'),l=da("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=da("workplaces",e,i),r=ma(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ma(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ma(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const da=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?sa:oa,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ma=(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?sa:oa,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ua={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ha={...ua,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},pa=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ha).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ga=e=>globalThis[e],fa=(e,t)=>{const n=document.getElementById(t);if(n){const t=ga(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(ga(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(ga(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))};const xa=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return fa(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ba={...ua,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},ya=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(ba).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),va=[55.753995,37.614069],Na=d((({points:e,className:t="",zoom:n=5,isLoad:a})=>{const l=s(null),r=xa();if(i((()=>{l.current?ca({yandexMaps:r,map:l.current,points:e,isLoad:a}):r?.ready((()=>{l.current||(l.current=new r.Map("map",{center:wa(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),ca({yandexMaps:r,map:l.current,points:e,isLoad:a})}))}),[r,e,n,a]),!r)return null;const d="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[a?o(ra,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",d),children:[o(ya,{yandexMaps:l}),o(ya,{yandexMaps:l,direction:"out"})]}),pa(l,r,u("right-2 top-80",d))]})})),wa=e=>{const t=[ka(Ca(e,0)),ka(Ca(e,1))];return t.every((e=>e))?t:va},Ca=(e,t)=>e.map((e=>e.coords?.[t])),ka=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length;async function Sa(e,t,n){const a=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Ta()},credentials:"include",body:n?JSON.stringify(n):null});return Ia(a)?a.json():a}const Ia=e=>"application/json"===e.headers.get("Content-Type"),Ta=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Ba=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:i,renderFoldButton:r})=>{const[s,o]=a(n),d=l((()=>{o((e=>!e))}),[]),m=i({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const Ra=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Pa=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Da({textItems:l,subText:t,children:n,isPhone:a,...i})})),Da=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Ma(n,s),i?o(Me,{color:a,size:"text-m",children:i}):null]}),Ma=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Aa(e)}`,children:e.trim()}):e.trim()},String(n)))),Aa=e=>e.replace(/\D/g,""),_a=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}))),Ea=e=>{const t=Fa(e);return o(Pa,{label:"Режим работы",value:t,className:"max-w-none"})},za=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Fa=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[za({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),za({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Oa=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Va=e=>Oa.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??"")}}))),La=e=>{if(!e)return null;const t=ja(e);return c(_a,{className:"border-none",children:[o(Pa,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(qa)})}),o(Pa,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},ja=e=>{const t=Oa.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},qa=({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(Me,{size:"text-xs",children:e})},String(n)),$a=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Pa,{label:"Валюта",value:e.currency}):null,t?o(Pa,{label:"Купить",value:String(t)}):null,n?o(Pa,{label:"Продать",value:String(n)}):null]},String(a)),Ua={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"}},Wa=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",Ua[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Me,{size:"text-m",color:Ua[n].text,children:t})]}))),Ha=(new Date).getDay(),Ya=e=>{const[t]=e?.slice(Ha-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Wa,{color:"green",children:i}):null,n&&l?o(Wa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Wa,{color:"red",children:"Выходной"})},Ka=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ga=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(Pa,{label:e,value:t&&n?n:"",subText:Ka({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Xa=["ArrowDownIcon","ArrowUpIcon"],Ja=["Подробнее","Скрыть"],Za=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Ja[Number(e)]}),o(W,{className:"text-primary-text",name:Xa[Number(e)],width:"16",height:"16"})]}),Qa=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ei=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ti=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ni=({name:e,address:t,phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Va(d);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(Me,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),Ya(h)]}),o("div",{className:"hidden sm:block",children:ai({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:ai({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(u))},ai=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Va(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(_a,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Pa,{label:"Факс",value:t,isPhone:!0}),o(Pa,{label:"Телефон филиала",value:e,isPhone:!0}),o(Pa,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Pa,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Pa,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Pa,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(_a,{children:o(Pa,{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(Ga)})})}):c(_a,{children:[o(Pa,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(qa)})}),Ea(d)]}),r?.businessScheduleVisibleTag?La(r?.businessScheduleDescription):null,s?.currencies?.length?o(_a,{className:"flex-wrap",children:s?.currencies?.map($a)}):null]})},ii=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Va(e),n=e?Fa(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Qa(n):ti(n,a):ei(n):""})(n)}`;return{header:a,body:l}},li=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),ri=d((({children:e})=>li?e:null)),si={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},oi={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ci={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)};function di({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const mi={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"},ui={primary:u("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("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")},hi=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(di(e))}),{className:a,version:i="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(mi[i],ui[i]),a),type:s,role:d,onClick:m,children:e})})),pi=(e,t)=>e&&"underlined"!==t?"primary":"secondary",gi=(e,t,n)=>{const a=pi("all"===t),i=pi("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=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(hi,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(hi,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},fi=({__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(Pe,{__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(ne,{image:e.image}):null,e?.text?o(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,xi="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",bi=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(Qn,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Ba,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:xi,children:s}),o(Ra,{className:xi,isUnfolded:e,children:d})]}),renderFoldButton:yi(n,a)})}):null})},yi=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:vi()})]}),vi=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ni=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),wi=()=>{},Ci=e=>"all"===e?"block":"hidden",ki=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=wi,renderRemoteWorkplaceCard:r=wi,getBalloon:s=wi,getBalloonRemoteWorkplaces:d=wi,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=zt(si),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=Bi({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),k={filters:Ii([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:oi};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ni(h,N),m?fi(m):null,p&&gi(t,w,C),o("div",{className:u("pb-3xl",Ci(w)),children:bi(k)})]}),o("div",{className:"h-[600px]",children:o(ri,{children:o(Na,{points:y,isLoad:n,className:"h-full"})})})]}),c(ri,{children:[b.map(l),v.map(r)]})]})})),Si=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ci[t](e)))))},Ii=e=>Object.keys(si).filter((t=>e.filter((e=>ci[t](e))).length)),Ti=()=>{},Bi=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Ti,getBalloonRemoteWorkplaces:i=Ti})=>{const[l,s,o,c]=r((()=>{const l=Si(e,n),r=Si(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.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[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Ri=e=>{const{data:t,error:n}=jn(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Pi);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Pi=async e=>await rt(e,{method:"POST"})||[],Di=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Ri("REGION_RF"),s=e("regionRetail")?.value||{};e("addressRetail"),i((()=>{(async()=>{const e=await(async e=>{const t=await Sa("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return await t.json().then((e=>e?.offices?.map((e=>({...e,gpsLatitude:(e.latitude??va[0]).toString().replace(",","."),gpsLongitude:(e.longitude??va[1]).toString().replace(",",".")})))))})(s?.key??"");l(e||[])})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:d}=Bi({data:n,filtrationState:{},getBalloon:ii}),m=Boolean(s?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...An(e("addressRetail"),Rn.addressRetail,t?.required&&m),isSearch:!0}),o("div",{className:"h-[600px]",children:o(ri,{children:o(Na,{points:d,isLoad:!r,className:"h-full"})})})]})})),Mi=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ai=(e,t,n)=>Math.max(t,Math.min(e,n));function _i(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ei({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){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||l?"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:l,onChange:t=>{const n=_i(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const zi=1,Fi=100,Oi=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:zi),max:s=(i.length?i.length-1:Fi),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Mi(e,{normalize:(e=0)=>i.length?Vi(i)(e):Ai(e,r,s),format:Ue()}),f=l((e=>{p&&p(_i(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{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 mt-xs box-border","text-primary-text",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ei({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Li(a)]})})),Vi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Li=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ji=["От 1 000 ₽","До 1 000 000 000 ₽"],qi=d((({field:e})=>o(Oi,{title:"Сумма, ₽",items:ji,min:1e3,max:1e9,...e("amount")}))),$i=ht((({field:e,source:t,label:n,fieldName:a,input:i,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:l,label:n,options:s,isSearch:r,...An(e(a),Rn[a],i?.required)})})),Ui=d((({field:e,input:t})=>{const{data:n}=Ri("EMPLOYEES_NUMBER");return o($i,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Wi=d((({field:e,input:t})=>o(an,{label:"Годовая выручка, ₽",...An(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),Hi=d((({field:e,input:t})=>o(ia,{text:"Наличие военного билета",...An(e("armyIdFlg"),Rn.armyIdFlg,t?.required)}))),Yi=d((({field:e,input:t})=>o(an,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...An(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),Ki=d((({field:e})=>o(an,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Gi=d((({field:e,input:t})=>o(ia,{text:"В отношении меня ведётся производство по делу о банкротстве",...An(e("bankruptcyFlg"),Rn.bankruptcyFlg,t?.required)}))),Xi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,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=Ji(t,e),c=Zi(t,l,r);u.push(o("td",{children:o("div",{className:Qi(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ji=(e,t)=>t&&e.toDateString()===t.toDateString(),Zi=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Qi=(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"),el=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],tl=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({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:el.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Xi({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function al(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const a=[...t],i=a.findIndex(il),l=a.map(((e,t)=>rl(e)?a.slice(0,t).filter(rl).length:-1)),r=a.map(((e,t)=>ll(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const il=e=>"_"===e,ll=e=>/\d/.test(e),rl=e=>il(e)||ll(e),sl=1940,ol={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},cl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),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(al(t,"__.__.____"))},onBlur:()=>{if(dl(p)){const[n,a,i]=p.split(".");d?.(new Date(Number(i),Number(a)-1,Number(n))),e(Number(a)-1),t(Number(i))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...ol})]})})),dl=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=sl&&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++;if(Number(t)>0&&Number(t)<=i)return!0}return!1},ml=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(cl,{onChange:a,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:i,setSelectedYear:l,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")}),ul=nl.map((e=>({key:e}))),hl=Array.from({length:(new Date).getFullYear()-sl+1},((e,t)=>sl+t)).reverse().map((e=>({key:String(e)}))),pl=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},gl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},fl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},xl={className:"min-w-32",iconVersion:"black",isBorder:!1},bl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[b,y]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=qt(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(nl.indexOf(e));const t=pl(r,nl.indexOf(e));gl({maxDateOfMonth:t,selectedYear:r,selectedMonth:nl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ul,yearsOptions:hl,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[Ht(t),c("div",{className:"relative",children:[ml({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...fl,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:nl[f]},options:k,...xl}),o(cn,{onChange:C,value:{key:String(b)},options:S,...xl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...fl,className:"rotate-90 cursor-pointer"})})]}),o(tl,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),yl=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(bl,{label:$t({label:t,errors:a}),valid:Boolean(!n),...i}),Xt(n)]}))),vl=d((({field:e,input:t})=>o(yl,{label:"Дата начала работы на текущем месте",...An(e("beginDate"),Rn.beginDate,t?.required),...t}))),Nl="birthday",wl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:a}=e(Nl);return o(yl,{label:"Дата рождения",...An(e(Nl),Rn.birthday,t?.required),error:n&&a&&!Cl(a)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Nl)})})),Cl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},kl=d((({field:e,input:t})=>o(an,{label:"Место рождения",...An(e("birthPlace"),Rn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),Sl=d((({field:e,input:t})=>{const{data:n}=Ri("CARD_TYPE");return o($i,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Il=d((({field:e,input:t})=>o(an,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...An(e("children"),Rn.children,t?.required),...t}))),Tl=d((({field:e,input:t})=>o(an,{label:"Кодовое слово",...An(e("codeWord"),Rn.codeWord,t?.required),...t}))),Bl=d((({field:e,input:t})=>o(an,{label:"Количество объектов инкассации",type:"number",...An(e("collectionCount"),Rn.collectionCount,t?.required)}))),Rl=d((({field:e,input:t})=>o(an,{className:"col-span-2",...An(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Pl=d((({field:e,input:t})=>{const{data:n}=Ri("INCOME_CERT_UNITED");return o($i,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Dl=d((({field:e,input:t})=>{const{data:n}=Ri("MILITARY_STATUS");return o($i,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Ml={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},Al=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Sa(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},_l=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(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),El=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>{const{close:r}=de(),s=l((()=>{r(),a&&a()}),[a]);return c("div",{onClick:i,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(_l,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),zl=async(e,t,n=!1)=>{const a=await Al(t,n);e(o(El,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:a}):o("iframe",{src:`${a}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},Fl=d((({className:e,error:t,docId:n,...a})=>{const{open:i}=de(),l=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...a}),n?o(ye,{className:"text-primary-main",onClick:()=>zl(i,n,l),children:o(Me,{children:"Ознакомиться"})}):null]}),Xt(t)]})})),Ol=d((({field:e,input:t})=>t&&t.name?o(Fl,{text:Ml[t.name]?.text,docId:Ml[t.name]?.docId,...An(e(t.name),Rn[t.name],t?.required)}):null)),Vl=d((({field:e,input:t})=>{const{data:n}=Ri("CREDIT_IN_RSHB");return o($i,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),Ll={horizontal:"@lg:flex-row",vertical:""},jl=d((({label:e,items:t,value:n,className:a,onChange:i,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ll[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Qn,{isRadio:!0,text:t,value:n===e,onChange:()=>i&&i(e),disabled:l},String(e))))})]}))),ql=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(jl,{label:$t({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),Xt(a)]}))),$l=[{id:"rub",text:"Рубль"}],Ul=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency");return o(ql,{label:"Валюта",orientation:"horizontal",items:$l,value:n,onChange:e=>a?.(e),...An(e("currency"),Rn.currency,t?.required)})})),Wl=d((({field:e,input:t})=>o(yl,{label:"Дата доставки",...An(e("deliveryDate"),Rn.deliveryDate,t?.required)}))),Hl=d((({field:e,input:t})=>o(an,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...An(e("dependents"),Rn.dependents,t?.required),...t}))),Yl=d((({field:e,input:t})=>o(yl,{label:"Желаемая дата встречи",...An(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),Kl=d((({field:e,input:t})=>o(ia,{text:"Являюсь инвалидом",...An(e("disablePeopleFlg"),Rn.disablePeopleFlg,t?.required)}))),Gl="dulIssueDateField",Xl=d((({field:e,input:t})=>o(yl,{label:"Дата выдачи",...An(e(Gl),Rn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Kn(e,Gl)}))),Jl="dulIssuedBy",Zl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,Jl),label:"Кем выдан",...t,...An(e(Jl),Rn.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),Ql=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...An(e("dulNumber"),Rn.dulNumber,t?.required)}))),er=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...An(e("dulSerie"),Rn.dulSerie,t?.required)}))),tr="dulSubdivisionCode",nr=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,tr),label:"Код подразделения",type:"number",maxLength:6,...t,...An(e(tr),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),ar=d((({field:e,input:t})=>{const{data:n}=Ri("EDUCATION_LEVEL");return o($i,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),ir=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{label:"Электронная почта",...An(e("email"),Rn.email,n),...a})})),lr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_ACTIVITY_TYPE");return o($i,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),rr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_KIND");return o($i,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),sr=d((({field:e,input:t})=>{const{data:n}=Ri("EMPLOYMENT_INFO_UNITED");return o($i,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),or=d((({field:e,input:t})=>o(an,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...An(e("expenses"),Rn.expenses,t?.required),...t}))),cr=d((({field:e,input:t})=>o(an,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...An(e("experience5Years"),Rn.experience5Years,t?.required),...t}))),dr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,l="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return i((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(an,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),mr=d((({field:e,input:t})=>{const{data:n}=Ri("MARITAL_STATUS");return o($i,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),ur=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],hr=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],pr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],gr=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:pr,...An(e("feedbackMethod"),Rn.feedbackMethod,t?.required)}))),fr=d((({field:e,input:t})=>o(an,{label:"ФИО",...An(e("fullName"),Rn.fullName,t?.required),...t}))),xr=d((({field:e,input:t})=>o(an,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...An(e("generalSeniority"),Rn.generalSeniority,t?.required),...t}))),br=d((({field:e,input:t})=>{const{data:n}=Ri("HOUSE_TYPE");return o($i,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),yr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"ИНН",type:"number",maxLength:12,...t,...An(e("inn"),Rn.inn,t?.required),onDaDataChange:n})})),vr=d((({field:e})=>o(ia,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Nr=d((({field:e,input:t})=>o(an,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...An(e("jobsNumber"),Rn.jobsNumber,t?.required),...t}))),wr=d((({field:e,input:t})=>o(an,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...An(e("lastJobExperience"),Rn.lastJobExperience,t?.required),...t}))),Cr=d((({field:e,input:t})=>o(an,{label:"Наименование юридического лица",...t,...An(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),kr=d((({field:e,input:t})=>o(an,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...An(e("legalForm"),Rn.legalForm,t?.required),...t}))),Sr=[];async function Ir(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Sr}const Tr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:a}=jn("outServiceRegions",Ir),l=a?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...An(e("localities"),Rn.localities,t?.required),isSearch:!0})})),Br=d((({field:e,input:t})=>o(an,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...An(e("mandatoryPayments"),Rn.mandatoryPayments,t?.required),...t}))),Rr=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Pr=d((({field:e,input:t})=>o(ql,{orientation:"horizontal",items:Rr,...An(e("methodObtain"),Rn.methodObtain,t?.required)}))),Dr="middleName",Mr=d((({field:e,input:t})=>o(an,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,Dr),...An(e(Dr),Rn.middleName,t?.required),...t}))),Ar=d((({field:e,input:t})=>o(an,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),...An(e("name"),Rn.name,t?.required),...t}))),_r=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(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Er=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(_r,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),zr=d((({field:e,input:t})=>{const{data:n}=Ri("ORGANIZATION_TYPE");return o($i,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Fr=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"Наименование организации",...t,...An(e("organizationName"),Rn.organizationName,t?.required),onDaDataChange:n})})),Or=d((({field:e,input:t})=>o(an,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...An(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),Vr=d((({field:e,input:t})=>o(yl,{label:"Дата регистрации по месту жительства",...An(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),Lr=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,a={...An(e("partInBusiness"),Rn.partInBusiness,t?.required)};return o(an,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...a,...t,onChange:e=>a?.onChange&&a?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?a?.value:"",disabled:!n})})),jr=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{...An(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),qr=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],$r=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("paymentSystem");return o(ql,{label:"Платежная система",orientation:"horizontal",items:qr,value:n,onChange:e=>a?.(e),...An(e("paymentSystem"),Rn.paymentSystem,t?.required)})})),Ur=e=>"_"===e,Wr=e=>/\d/.test(e),Hr=e=>Ur(e)||Wr(e),Yr=[..."+7 (___) ___-__-__"],Kr=Yr.findIndex(Ur),Gr=Yr.map(((e,t)=>Hr(e)?Yr.slice(0,t).filter(Hr).length:-1));function Xr(e){const t=e.replace(/\D/g,""),n=Yr.map(((e,n)=>Wr(e)?e:t.charAt(Gr[n])||e)),a=Gr.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Kr,a)):n).join("")}const Jr=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Xr(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Zr=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Jr,{"aria-label":t,label:$t({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),Xt(n)]}))),Qr=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Zr,{label:"Телефон",...An(e(n),Rn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),es=d((({field:e,input:t})=>{const{data:n}=Ri("POSITION");return o($i,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),ts=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(_r,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),ns=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:as(t?.productList),...Mn(e("product"),Rn.product)}))),as=e=>(e??[]).map((e=>({key:e,value:e})));function is(e="/api/v1/regions"){const{data:t}=jn(e,st);return Array.isArray(t)?t:[]}const ls=d((({field:e,input:t,url:n})=>{const a=is(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...An(e("region"),Rn.region,t?.required)})})),rs=d((({field:e,input:t})=>{const n=Wn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:a,...An(e("region"),Rn.region,t?.required)})})),ss=d((({field:e,input:t})=>{const{data:n}=Ri("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...An(e("regionRetail"),Rn.regionRetail,t?.required)})})),os=d((({field:e,input:t})=>{const n=e("wages")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(an,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...An(e("retirementIncome"),Rn.retirementIncome,t?.required),...t,onChange:a})})),cs=d((({field:e})=>{const t=e("secondaryPhone");return o(Zr,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Rn.secondaryPhone):t})})),ds=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:hr,...An(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),ms=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],us=d((({field:e,input:t})=>o(ql,{label:"Пол",orientation:"horizontal",items:ms,...An(e("sex"),Rn.sex,t?.required)}))),hs=d((({field:e,input:t})=>o(ia,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...An(e("shareholderFlg"),Rn.shareholderFlg,t?.required)}))),ps=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(al(e,"___-___-___ __"))),[t]),i=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),gs=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ps,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __"}),Xt(a)]}))),fs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(gs,{label:"СНИЛС",...An(e("snils"),Rn.snils,!!n&&t?.required),...t})})),xs=d((({field:e,input:t})=>o(an,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),...An(e("surname"),Rn.surname,t?.required),...t}))),bs=["От 1 мес","До 15 лет"],ys=d((({field:e})=>o(Oi,{title:"Срок, месяцев",items:bs,min:1,max:180,...e("term")}))),vs=d((({field:e,input:t})=>o(an,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),Ns=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:ur,...An(e("serviceType"),Rn.serviceType,t?.required)}))),ws=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Cs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return i((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(jl,{className:"whitespace-normal",orientation:"horizontal",items:ws,value:t,onChange:e=>n&&n(e)})})})),ks=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(an,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("wages"),Rn.wages,t?.required),...t,onChange:a})}));const Ss={$ref:"/wcms-resources/outservice-productlist.json"},Is=(e,t,n=!1)=>(a,i)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(xs,{field:e,input:a}),name:o(Ar,{field:e,input:a}),middleName:o(Mr,{field:e,input:a}),phone:o(Qr,{field:e,input:a}),organizationPhone:o(Qr,{field:e,input:a}),email:o(ir,{field:e,input:a}),fullName:o(fr,{field:e,input:a}),inn:o(yr,{field:e,input:a}),legalForm:o(kr,{field:e,input:a}),organizationName:o(Fr,{field:e,input:a}),generalSeniority:o(xr,{field:e,input:a}),lastJobExperience:o(wr,{field:e,input:a}),experience5Years:o(cr,{field:e,input:a}),jobsNumber:o(Nr,{field:e,input:a}),beginDate:o(vl,{field:e,input:a}),addressFact:o(Yn,{field:e,input:a}),organizationAddress:o(Gn,{field:e,input:a}),comment:o(Rl,{field:e,input:a}),addressBranch:o(Hn,{field:e,input:a,isPremium:l}),sex:o(us,{field:e,input:a}),birthday:o(wl,{field:e,input:a,isRetailForm:n}),birthPlace:o(kl,{field:e,input:a}),desiredMeetingDate:o(Yl,{field:e,input:a}),product:o(ns,{field:e,source:Ss}),localities:o(Tr,{field:e,input:a}),isClient:o(vr,{field:e}),partnerComments:o(jr,{field:e,input:a}),collectionCount:o(Bl,{field:e,input:a}),acquiringType:o(En,{field:e,input:a}),onlineCheckout:o(Er,{field:e}),posTerminal:o(ts,{field:e}),serviceType:o(Ns,{field:e,input:a}),term:o(ys,{field:e}),amount:o(qi,{field:e}),annualRevenue:o(Wi,{field:e,input:a}),vedTypes:o(Cs,{field:e}),feedbackMethod:o(gr,{field:e,input:a}),serviceDirection:o(ds,{field:e,input:a}),bankEmpolee:o(Ki,{field:e}),secondaryPhone:o(cs,{field:e}),consentToReceiveMaterials:o(Ol,{field:e,input:a}),processPersonalDataFlg:o(Ol,{field:e,input:a}),consentProviderFlg:o(Ol,{field:e,input:a}),consentOthersFlg:o(Ol,{field:e,input:a}),consentInformFlg:o(Ol,{field:e,input:a}),consentPfrFlg:o(Ol,{field:e,input:a}),applicationDate:o(an,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(rs,{field:e}):o(ls,{field:e,input:a,url:Vt(t)}),education:o(ar,{field:e,input:a}),housing:o(br,{field:e,input:a}),employment:o(sr,{field:e,input:a}),organization:o(zr,{field:e,input:a}),amountWorkers:o(Ui,{field:e,input:a}),employerActivities:o(lr,{field:e,input:a}),employerOrganization:o(rr,{field:e,input:a}),positionOrganization:o(es,{field:e,input:a}),familyStatus:o(mr,{field:e,input:a}),children:o(Il,{field:e,input:a}),familyMembers:o(dr,{field:e,input:a}),dependents:o(Hl,{field:e,input:a}),totalIncome:o(vs,{field:e,input:a}),expenses:o(or,{field:e,input:a}),snils:o(fs,{field:e,input:a}),conscription:o(Dl,{field:e,input:a}),armyIdFlg:o(Hi,{field:e,input:a}),dulSerie:o(er,{field:e,input:a}),dulNumber:o(Ql,{field:e,input:a}),dulIssueDateField:o(Xl,{field:e,input:a}),dulSubdivisionCode:o(nr,{field:e,input:a}),dulIssuedBy:o(Zl,{field:e,input:a}),addressRegistration:o(Gn,{field:e,input:a}),addressCourier:o(Gn,{field:e,input:a}),participantDateRegistration:o(Vr,{field:e,input:a}),retirementIncome:o(os,{field:e,input:a}),otherIncome:o(Or,{field:e,input:a}),wages:o(ks,{field:e,input:a}),mandatoryPayments:o(Br,{field:e,input:a}),disablePeopleFlg:o(Kl,{field:e,input:a}),bankruptcyFlg:o(Gi,{field:e,input:a}),shareholderFlg:o(hs,{field:e,input:a}),legalEntityName:o(Cr,{field:e,input:a}),creditInRshbCd:o(Vl,{field:e,input:a}),bankEmployeeCode:o(Yi,{field:e,input:a}),partInBusiness:o(Lr,{field:e,input:a}),regionRetail:o(ss,{field:e,input:a}),addressRetail:o(Di,{field:e,input:a}),addressMatch:o(la,{field:e,input:a}),paymentSystem:o($r,{field:e,input:a}),currency:o(Ul,{field:e,input:a}),cardCategory:o(Sl,{field:e,input:a}),codeWord:o(Tl,{field:e,input:a}),confirmationIncome:o(Pl,{field:e,input:a}),methodObtain:o(Pr,{field:e,input:a}),deliveryDate:o(Wl,{field:e,input:a})};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:r[a?.name||""]},String(i)):null},Ts=e=>2===e?"@xl:grid-cols-2":"",Bs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Rs=d((function({responseType:e,typeForm:t}){const n="OK"===e,a=n?"ResponseOKIcon":"ResponseFailIcon",{close:i}=de(),r=l((()=>{i()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(El,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(hi,{type:"button",onClick:r,children:"Хорошо"})]})})})),Ps=e=>{const{open:t,close:n}=de();return{open:(n,a={})=>t(o(Rs,{...e,...n}),a),close:n}},Ds=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ms=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${zn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,u={...d,..._s(o),...As(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},As=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},_s=e=>e?{vedTypes:Object.fromEntries(ws.map((({id:t})=>[t,t===e])))}:{},Es={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:ur[0],feedbackMethod:pr[0],serviceDirection:hr[0],vedTypes:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},zs=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Fs=(e,t)=>o(hi,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Os=(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(Qn,{...e}),o(zs,{link:t})]}),Xt(Mn(e,Sn).error)]}):o(zs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Fs(n)]}),Vs={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Nt(a,g),...wt(l,g),...yt(i),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ls=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Es[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=ur[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=a(""),w=Ps({typeForm:n}),C=l((async(e,t)=>{const n=js(x,e),a=Ds(Dn(n));if(!pn(a(e)))return console.warn("validation fail");const i=Ms({...e,...h}),l=await Vs.send(i,"lead"===m)?"OK":"Fail";if(v(l),l&&w.open({responseType:l}),"OK"===l&&g){const e=_t();kt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:k,onSubmit:S,reset:I}]=zt(b,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return i((()=>{"OK"===y&&(v(""),I())}),[y]),c(Ot,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(Ts(e.columns),"grid gap-x-m"),children:[Bs(e.title),(e?.inputs||[])?.map(Is(k,n))]},`section-${t}`))),Os(T?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{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(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),js=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)}))));function qs(e){const[t,n]=a(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const $s=d((({inputs:e=[],typeForm:t="",field:n,key:a})=>{const i=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Mn(n(e?.name),Rn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Ba,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(Ra,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(Is(n,t))}),renderFoldButton:Us(c("div",{children:[o(Qn,{value:i,onChange:t=>{for(const a of e){const e=n(a.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},a),Xt(l?"Отметьте все обязательные соглашения":"")]}))})})})),Us=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Ws=({field:e,typeForm:t="",inputs:n,isRetailForm:a=!1})=>{const{consentInputs:i,restInputs:l}=Hs(n||[]);return i.length>2?c("div",{children:[l.map(Is(e,t,a)),o($s,{inputs:i,field:e})]}):(n||[])?.map(Is(e,t,a))},Hs=e=>({consentInputs:e?.filter((e=>Object.keys(Ml).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Ml).includes(e.name||"")))||[]}),Ys={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:ur[0],feedbackMethod:pr[0],serviceDirection:hr[0],vedTypes:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},Ks=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ys[e.name||""]]))),typeForm:{key:n,text:""}}},Gs=(e,t)=>o(hi,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xs=e=>Sa("/user-data/updateUserProfile","PUT",e),Js=e=>Sa("/user-data/updateUserTask","PUT",e),Zs={width:"118",height:"24"},Qs={"bg-white":"color",transparent:"white"},eo={"bg-white":"text-primary-main",transparent:"text-white"},to=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Qs[e]},className:eo[e],width:n?.width,height:n?.height}),no={"bg-white":"text-primary-text",transparent:"text-white"},ao=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!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??"Россельхозбанк",...pe(s),children:[to(l,n?.image,Zs),r?a??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:no[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),io=async({code:e,setHasError:t,close:n,sendCode:a=Ut})=>{const i=await(l={captchaText:e},Sa("/sms/checkCaptcha","POST",l));var l;"ERROR"===await i.text()?t(!0):(a(),n?.())},lo=async(e,t)=>{const n=await(e=>Sa(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:l})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1);return i((()=>{lo(s,e)}),[]),o(El,{head:o(ao,{}),onClose:l,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:()=>lo(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(hi,{onClick:t,version:"secondary",children:"Вернуться"}),o(hi,{type:"submit",disabled:!d,onClick:()=>io({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),so=d((({time:e,setTime:t,className:n})=>(i((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:oo(e)})))),oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,co=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:a,setAttemps:i})=>{try{await(l={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},Sa("/sms/sendCode","POST",l)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),i(0),n(180),a(!0)}catch(e){t.open()}var l},mo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((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=l((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:uo(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),uo=(e,t,n=!1)=>{const a=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&a?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},ho=d((({isDisabled:e,onClick:t,text:n})=>o(hi,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-normal",children:n})}))),po=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},go=({close:e,values:t})=>{const[n,s]=a(!1),[o,c]=a(""),[d,m]=a(!1),[u,h]=a(0),[p,g]=a(!1),[f,x]=a(0),b=l((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Sa("/sms/checkCode","POST",e).then(po))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return i((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},fo=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=a(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=go({values:p,close:e}),I=l((()=>{co({phoneNumber:h,captchaDialog:T,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),T=((e,t)=>{const{open:n,close:a,closeAll:i}=de();return{open:()=>n(o(ro,{close:a,onClose:t,...e})),close:a,closeAll:i}})({phoneNumber:h,sendCode:I},t);return i((()=>{I()}),[]),o(El,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(mo,{values:p,setValues:g,errorText:b,hasError:x}):null,bo(v,w,I),o(Pe,{itemSize:"list-s",__html:s}),xo(u,N,f),y?o(ra,{blur:!1}):null]})})})),xo=(e,t,n)=>e?o(ho,{isDisabled:t,onClick:n,text:e}):null,bo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(so,{className:"text-base ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,a)=>e(o(fo,{onClose:t,close:n,...a})),close:t}},vo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},No={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},wo=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,i]=a(""),[r,s]=a(!1),{open:d,close:m}=de(),u=Ce(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),g=r?No:vo;return o(El,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>zl(d,ko,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(jl,{className:"whitespace-normal",orientation:"horizontal",items:Co,value:n,onChange:p}),o(hi,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Co=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ko=2,So=e=>{const{open:t,close:n}=de(),a=yo(),i=(t,i)=>async l=>{n(),"SIGNED"===l&&t?a.open((t=>async n=>{t&&await Xs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(i),Io(t)):e()};return{open:(n,a)=>t(o(wo,{handleSubmit:i(n,a),onClose:e}))}},Io=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),To=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Sa("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(El,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(hi,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(hi,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Bo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Ro={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Po={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Do=e=>Object.entries(e).reduce(((e,[t,n])=>t in Bo?[...e,{contactTypeCd:{key:Bo[t]},value:n}]:e),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Ro){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Ro[t]},...a}]}return e}),[]),Ao=e=>Object.entries(e).reduce(((e,[t,n])=>t in Po?[...e,{incomeTypeCd:{key:Po[t]},value:Number(n||0)}]:e),[]),_o=({inputs:e,programId:t,nextStepLink:n,saveForm:i})=>{const[r,s]=a(""),[,c]=qs("taskId"),[,d]=qs("profileId"),[,m]=qs("participantId"),u=(e=>{const{open:t,close:n}=de(),a=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(To,{handleClose:a}),e),close:n}})(n),h=So(u.open),p=yo(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const a=Ds(Dn(e));if(!pn(a(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(l={profile:{phone:bt(n.phone)}},Sa("/public-data/createUserProfile","POST",l));if(e&&n?.phone){const a=async()=>{try{await Eo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:i}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Ml).filter((e=>n[e])).map((e=>Ml[e]?.text));p.open(a,zo(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},Eo=async({programId:e,profileId:t,formData:n,saveUserData:a,saveForm:i})=>{const l=Oo(n);await Xs(((e,t)=>{const{name:n="",surname:a="",middleName:i="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:i,birthDate:l&&xt(l,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},Sa("/user-data/createDraftTask","POST",o));var o;await Js((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,birthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:Do({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),a(s,r,t),i(n)},zo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Fo(t)}`}),Fo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Oo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Vo=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:i,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Xr(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Lo(i),addressFact:Lo(l),esiaAccountTypeCd:t?.esiaAccountType}},Lo=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`: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}},jo=e=>{const[t,n]=a(!1),[r]=qs("profileId"),[s,o]=qs("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Sa("/esia/updateProfileEsia","POST",t));o({...s,...Vo(n)}),globalThis.location.href=e}var t}),[]);return i((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},qo=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=a(""),{isLoading:g}=jo(l),[f,x]=qs("leadForm"),b=Ks(m,f),{handleSubmit:y,responseStatus:v}=_o({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){Ps({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=zt(b,{onSubmit:y});return i((()=>{"OK"===h&&(p(""),C())}),[h]),o(Ot,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(ra,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Ts(e.columns),"grid gap-x-m"),children:[Bs(e.title),Ws({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Gs(s)]})})})),$o=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Pe,{__html:e}),a?.text?o(ye,{className:"text-primary-main",children:a.text}):null]})]}))),Uo=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:i})=>{const[l,r]=a(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("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) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(so,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(Pe,{__html:i}):null]})]})})),Wo=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(Ho,{title:a,items:i}),o(Ho,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(hi,{className:"w-full mt-lg",children:s}):null]}))),Ho=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Me,{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",Ts(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Yo(e)},t)))}):null]})]}):null},Yo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Ko=d((({title:e,description:t})=>{const n=Ce();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Go=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Xo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Jo(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Zo(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}function Zo(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qo=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:r,onIntersection:s})=>{const c=Jo(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:r})})),ec=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],tc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},b=s([]),y=l(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(ac(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nc(c,v):{},...N?Xo(h):{},gap:`${r}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(Qo,{className:u(m,i?ec[i-1]:"",{"h-full":N},t),style:w?nc(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),nc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ac=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),ic={"horizontal-list":"w-6","vertical-list":"h-6"},lc=({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?ic[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),rc=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=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",r=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",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},sc=e=>e,oc=(e=sc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),cc=oc(),dc=(e=sc)=>oc((t=>-e(t))),mc=dc(),uc=e=>t=>e.scrollWidth/t,hc=e=>(t,n)=>{e.scrollBy({left:n*uc(e)(t),behavior:"smooth"})},pc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((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?[dc()(i),oc()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?hc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?hc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((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}]},gc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},fc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=pc({itemCount:s.length}),g=xc(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(tc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",gc[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(lc({activeIndex:t,onClick:f,listType:a}))}):null})),xc=(e=!1)=>({behavior:e?"auto":"smooth"}),bc=d((({className:e,disabled:t,...n})=>o(ye,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),yc=d((e=>o(bc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),vc=d((e=>o(bc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Nc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",wc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Cc(t):null,l?o(yc,{className:u(kc(i),m?"left-1":"left-0"),onClick:s}):null,r?o(vc,{className:u(kc(i),m?"right-1":"right-0"),onClick:d}):null]})})),Cc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Nc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Nc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),kc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Sc=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=pc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(tc,{containerRef:y,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(wc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(fc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:l,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),Ic=({blocksToRender:e,...t})=>o(Sc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Go(!0)),children:T(e,t)},String(n))})}),Tc=e=>e%2!=0,Bc=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:i="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===i?"justify-between":"justify-center",l),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Rc=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:i=!1,onClick:l})=>o(Bc,{tag:"button",onClick:l,disabled:i,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",i?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Pc=({isUnfolded:e,onToggle:t})=>o(Rc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Dc=["ArrowDownIcon","ArrowUpIcon"],Mc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Ac=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Mc),children:[R(l,{...i.options,parent:n}),Tc(l.length)?o(gt,{className:"col-span-6",...i}):null]}),o(Ba,{renderFoldableSection:({isUnfolded:e})=>c(Ra,{className:u(Mc),isUnfolded:e,children:[R(r,{...i.options,parent:n}),Tc(r.length)?o(gt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Rc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Dc[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},_c=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Ec(n,t),Ac({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Ec(n,t),Ic({...a,blocksToRender:t})]});default:return null}})),Ec=(e,t)=>e&&!t.length?o(Ko,{...e}):null,zc=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Fc=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(_r,{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))))),Oc=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,zc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Vc(a)).filter(Boolean))]}),n?o("div",{children:o(hi,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Vc=e=>([t,n])=>{const a=n?.type;return"array"===a?Lc(t,e)(n):null},Lc=(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(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Fc,{items:a,multiple:!n?.single,...t(e)})]},e)};function jc(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const qc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,$c=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>qc(t[e])||qc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>qc(t[e])||qc(n[e])||Uc(t[e])<=Uc(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>qc(t[e])||qc(n[e])||Uc(t[e]?.min)>=Uc(n[e]?.min)&&Uc(t[e]?.min)<=Uc(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>qc(t[e])||qc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>qc(t[e])||qc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Uc=e=>Number(e||0),Wc=(e,{block:t,page:n,normalize:a=Et})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=zt(e),d=r((()=>jc(i,i.map((e=>mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=Et)=>e?.filter((([,e])=>$c(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Hc={},Yc={},Kc=ht((({className:e,filtrationSchema:t=Hc,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Wc(Yc,{block:i.block,page:i.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:Gc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Gc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Oc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(hi,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(_c,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Gc=e=>jc(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Xc=(e=!1)=>e?"text-left":"text-center",Jc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Zc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:i,...l})=>{const r=String(a?.width||t);return i?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Jc[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),Qc=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Xc(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(ed)}):null]})})),ed=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Zc,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Pe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),td=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(Me,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),nd=(e,t,n)=>o("div",{className:`grid gap-2xs ${ad(t)}`,children:e.map(td(n))}),ad=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},id=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?nd(e,a,t):null]}))),ld={start:"justify-start",center:"justify-center",end:"justify-end"},rd=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",ld[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Le(e)})})),sd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),od="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",cd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",dd="flex flex-col gap-y-xl min-w-52",md=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Me,{size:"text-h3",children:"number"==typeof e?[a,Ue(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),ud=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(Me,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(md,{value:n,...i}):o(Me,{size:"text-h3",children:"-"})]}))),hd=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,pd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ue(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),gd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),fd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(pd,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(ud,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(gd,{title:e,...r}),xd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Oi,{items:e?[`От ${Ue(1)(a.min||0)} ${n}`,`До ${Ue(1)(a.max||0)} ${n}`]:[],step:t,...a}),bd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},yd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},vd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=bd.prefMonthsNum,prefTravelBonusRate:l=bd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||yd,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Nd=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=zt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=vd(r,n);return o(sd,{className:e,title:t,...l,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),xd({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?fd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:dd,children:[f>=0?o(ud,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(a,{isVertical:!0}),hd(i)]})]})})})),wd=Math.round(29.5),Cd=(e,t=0)=>e?.sum?e.sum:t,kd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Sd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Id=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:i,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(jl,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Td=e=>Id({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Bd=" (c капитализацией)",Rd=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:dd,children:[o(ud,{title:`Доход в конце срока${l?Bd:""}`,value:e,postfix:n,prefix:"+"}),o(ud,{title:`Сумма в конце срока${l?Bd:""}`,value:t,postfix:n}),Le(a,{isVertical:!0}),i?.map(hd)]}),Pd=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dd([e,t],a),Dd=([e,t],n=[])=>({[e]:n.length?mc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?cc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Md=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Ad={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const _d={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ed=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Ad[e?.rateType]:"",{data:n}=jn(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&zd(s,e)&&Md(a,["minSum","maxSum"],e)&&Md(n,["minDays","maxDays"],e)))||_d,{rate:m}=d,u=Fd(m,e),h=a+u,p=c||[_d];return{...d,...Dd(["minSum","maxSum"],p),...Dd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},zd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Fd=(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)},Od=ht((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=zt({moneyValue:Cd(r,1e5),daysValue:kd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Ed(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(sd,{className:e,title:t,...d,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Oi,{items:[`От ${Sd(y.min||0)}`,`До ${Sd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Vd(p,h),Td({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),fd({rate:x,depositeName:b,isShowDepositeName:l}),Rd({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var y})),Vd=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Qn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Qn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Ld=(e=[],t=!1)=>jd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),jd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},qd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Oi,{items:[`От ${$d(e)}`,`До ${$d(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),$d=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ud=e=>Id({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Wd=({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?.(Ai(t?.[i],n.minMonths,n.maxMonths))},Hd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(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)},Yd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Kd=e=>Gd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Gd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Gd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Xd=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Yd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Pd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Pd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a,["minSum","maxSum"],e)&&Md(i,["minMonths","maxMonths"],e)))||Yd)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Hd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Zd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Qd=ht((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,jd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=zt({moneyValue:Cd(s,2e5),monthsValue:kd(s,wd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=Xd(g,n,r),y=Ud({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return i((()=>{v&&v(Ai(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Ai(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!Jd(s)&&h&&Wd({field:f,defParams:h,calcParams:b,map:Zd,monthsValue:"minMonths"})}),[n,s]),o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),qd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),em({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(a,{isVertical:!0}),hd(l)]})]})})})),em=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Qn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Qn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),tm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},nm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},am=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?rm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[lm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),lm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),lm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),lm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Md(a,["minSum","maxSum"],t),Md(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||nm,{rate:u}=m,h=im(u,e),p=a+h,g=t||[nm];return{...m,...Dd(["minSum","maxSum"],g),...Dd(["minMonths","maxMonths"],g),availableMonths:tm(g.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:l,income:h,finalSum:p}},im=(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)},lm=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],rm=(e,t)=>e+Math.round((t-e)/2),sm=(e="rub")=>"rub"===e,om=(e,t)=>{const{minMonths:n,maxMonths:a}=Dd(["minMonths","maxMonths"],um(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ai(i,n,a)}},cm=(e,t)=>{const{minSum:n,maxSum:a}=Dd(["minSum","maxSum"],um(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ai(i,n,a)}},dm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),mm=e=>{const t=sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},um=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},hm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Id({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Id({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),pm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Td({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Id({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),pm(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},pm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,gm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},fm={text:"₽",key:"rub"},xm=ht((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[fm],g=l((e=>t=>e?{...t,...mm(t),...cm(t,e),...om(t,e),...dm(t,e)}:t)(h),[h]),[f,{field:x}]=zt({moneyValue:Cd(d,2e4),monthsValue:kd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:fm},{normalize:g}),b=x?.("currency")?.value??fm,y=x?.("isNewClient")?.value,v=um(h,b),N=am(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,I=l((()=>{Wd({field:x,defParams:Ld(v,y),calcParams:N,monthsValue:"minMonths",map:gm})}),[x,h]);i((()=>{!Jd(d)&&v&&I()}),[d,h]);const T=w===Ld(v,y)?.rate;return o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[c("div",{className:"flex gap-m",children:[xd({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:bm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),qd({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),hm({...N,...s},x)]}),fd({rate:w,children:vm(I,T)}),Rd({income:C,finalSum:k,buttons:[...a,ym(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),bm=(e="")=>sm(e)?1e3:100,ym=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},vm=(e,t=!1)=>t?null:o(hi,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Nm=e=>wm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Cm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},km=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Cm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Pd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Pd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a+r,["minSum","maxSum"],e)&&Md(l,["minSumOld","maxSumOld"],e)&&Md(r,["minSumExtra","maxSumExtra"],e)&&Md(i,["minMonths","maxMonths"],e)))||Cm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Hd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Sm=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...r})=>{const[s,{field:d}]=zt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=km(s,n,l),h=Ud({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(sd,{className:e,title:t,...r,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),xd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),qd({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Im({...m,...l},d),m.isExtraMoney?xd({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ud,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(a,{isVertical:!0}),hd(i)]})]})})})),Im=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Qn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Tm=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Mi(e,{normalize:(e=i)=>n&&a?String(Ai(Number(Bm(e)),n,a)):Bm(e),format:Ue(r)}),d=l((e=>t&&t(Bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),Bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Rm=d((e=>o(Tm,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Pm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Dm={amount:1500},Mm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=zt(Dm),[h,p]=a(!1);return i((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Pm[r],children:[o(Rm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(hi,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Am=({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(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),_m="relative h-full",Em={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},zm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Vm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:Fm(n,{someCardsHighlighted:l}),children:[T(n,a,{className:Om(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Vm(n)?Am({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Fm=(e,{someCardsHighlighted:t})=>u(_m,t&&(Vm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Om=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(_m,"min-w-80",Em[a],t&&(Vm(e)?"pt-3xl sm:pt-16":"pt-3xl"),Go(n),n&&"h-full"),Vm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Lm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Sc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?jm(s?.block?.blocks):[],hasBlur:!0,children:zm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),jm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],qm="z-10 border border-solid w-full h-full",$m=u(qm,"absolute hidden @xl:block border-transparent"),Um=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u($m,"top-9 right-12 bg-green-dark")}),o("div",{className:u($m,"top-6 right-8 bg-green")}),o("div",{className:u($m,"top-3 right-4 bg-green-light")}),c("div",{className:u(qm,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Le([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Wm={black:"bg-black",white:"bg-white"},Hm=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ie,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Le([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Ym)]}):null,i?c(Me,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Ym=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Wm[e]}`},String(t)),Km=d((({icon:e,...t})=>{const n=ue(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Gm=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Xm(a):null]})}))),Xm=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Km,{...e},String(t))))}),Jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Zm=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=ue()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(i),children:l})})),Qm=[{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"}}],eu=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>Qm.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ve(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),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},tu(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:Le(m,{className:nu(s??!1,i??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),tu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",nu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),au=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!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(Zm,{href:i,target:m,className:"h-full",data:Jm(v),children:c(Ie,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Ve(l)?o(ne,{image:l}):null,x),buttons:d.length?o(eu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Oe,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,iu(a,p)]})})}))),iu=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,lu=(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(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Le(i)}):null]},String(t))},ru=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(lu),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=a(!1);return i((()=>ce.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Ve(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(Ba,{renderFoldableSection:()=>c("div",{children:[x,o(Ra,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?su(m?.parent,h,y):null}):o("div",{children:x})]})})),su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),ou=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?cu(n):null,t?.length?cu(t):null]}))),cu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>du({column:e,i:t})))}),du=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},i)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Le([a])})]},String(i))))},`col-${String(t)}`):null,mu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const a=async()=>{const n=await Sa("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?uu(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};a();const i=setInterval(a,24e4);return()=>clearInterval(i)},uu=e=>{401==e&&(globalThis.location.href="/")},hu=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 mr-4 text-gray",children:t}):null]})]}))),pu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(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(hu,{step:a,showPercentage:!1})]})})}));var gu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(gu||(gu={}));const fu=e=>Sa("/user-data/getTaskStatus","POST",e),xu=e=>Sa("/user-data/sendSignalToProcess","POST",e),bu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(yu,{title:a,items:i}),o(yu,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),yu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Me,{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",Ts(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:vu(e)},t)))}):null]})]}):null},vu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Nu=d((()=>o(bu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),wu=d((()=>{const[e]=qs("leadForm");return o(bu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Cu=d((()=>{const[e]=qs("leadForm");return o(bu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ku=d((()=>{const[e]=qs("leadForm");return o(bu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Su=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Iu=d((()=>{const[e,t]=a(gu.process),[n]=qs("taskId");return i((()=>{(async()=>{for(const e of Su)await xu({signalType:e,taskId:n})})();const e=setInterval((()=>fu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==gu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),Tu(e)})),Tu=e=>({IN_PROCESS:o(wu,{}),CANCELLED:o(Nu,{}),APPROVED:o(ku,{}),REVISION:o(Cu,{})}[e]||null),Bu=[{paymentSystem:qr[0].id,currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{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:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Ru=e=>{if(e)try{return new Date(e)}catch(e){return}},Pu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Du(n,e),Mu(t,e),Au(t,e),_u(t,e),Eu(t,e),zu(t,e)].some(Boolean)?{...t,required:!1}:t)),Du=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Mu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Au=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),_u=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Eu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),zu=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Fu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},Ou=({field:e,inputs:t})=>t.map(Is(e,"")),Vu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:i},l)=>{const r=Pu(Lu(t))(e,n),s=r.filter((e=>!zu(e,Lu(t))));return c("div",{className:u(Ts(a),"grid gap-x-m"),children:[Fu(s),Bs(i),Ou({field:t,inputs:r})]},`section-${l}`)})),Lu=e=>t=>e(t)?.value,ju=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(hi,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(hi,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),qu=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(a=n,a?new Date(a).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var a},$u=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:a,codeWord:i}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(l),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:i,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:i,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,wages:i,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:a,otherDependents:n,participantIncomes:Ao({wages:i,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(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}=e;return{participantAddresses:Mo({addressCourier:t})}})(t);default:return{}}},Uu=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=l((async l=>{const c=Ds(Dn(Pu(Wu(l))(t,e)));if(console.log(Dn(Pu(Wu(l))(t,e))),!pn(c(l)))return console.warn("validation fail");a(l);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...$u(i,a)}],...qu(a)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&i?.(!0),"OK"}),[]);return{handleSubmit:c}},Wu=e=>t=>e[t],Hu=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:r})=>{const[d,m]=qs("leadForm"),u=((e,t)=>({...Bu[e],...t,birthday:Ru(t?.birthday),dulIssueDateField:Ru(t?.dulIssueDateField),participantDateRegistration:Ru(t?.participantDateRegistration),beginDate:Ru(t?.beginDate),deliveryDate:Ru(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=Uu({step:e,inputs:p,onNextStep:a,saveStep:m,finishForm:r}),[,{field:x,onSubmit:b}]=zt(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return i?o(Iu,{}):c("form",{onSubmit:b,className:"space-y-m",children:[Vu({sections:t,field:x,step:e,registerSubmit:g}),o(ju,{step:e,onPrevStep:n})]})})),Yu=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Ku=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],Gu=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(mu,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Yu[n]),[n]),[b,y]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[b?null:o(pu,{stepsTitles:Ku,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Hu,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:y},String(n))})]})})})),Xu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>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(hu,{step:a,showPercentage:!1})]})})})),Ju=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d,intervalExpireAction:m}):null]}),o(Zu,{title:a,items:i}),o(Zu,{title:l,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Zu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();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(Me,{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",Ts(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Qu(e)},t)))}):null]})]}):null},Qu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),eh=d((()=>o(Ju,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),th=d((({handleExpireTimer:e})=>{const[t]=qs("leadForm");return o(Ju,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),nh=d((()=>{const[e]=qs("leadForm");return o(Ju,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ah=d((()=>{const[e]=qs("leadForm");return o(Ju,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ih=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lh=d((()=>{const[e,t]=a(gu.process),[n]=qs("taskId");i((()=>{(async()=>{for(const e of ih)await xu({signalType:e,taskId:n})})();const e=setInterval((()=>n&&fu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==gu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return rh(e,(()=>t(gu.rework)))})),rh=(e,t)=>({IN_PROCESS:o(th,{handleExpireTimer:t}),CANCELLED:o(eh,{}),APPROVED:o(ah,{}),REVISION:o(nh,{})}[e]||null),sh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField: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:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],oh=e=>{if(e)try{return new Date(e)}catch(e){return}},ch=e=>(t,n)=>t.filter((e=>e)).map((t=>[dh(n,e),mh(t,e),uh(t,e),hh(t,e),ph(t,e),gh(t,e)].some(Boolean)?{...t,required:!1}:t)),dh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,mh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,uh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),hh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ph=({name:e},t)=>"addressFact"===e&&t("addressMatch"),gh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),fh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},xh=({field:e,inputs:t})=>t.map(Is(e,"")),bh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:i},l)=>{const r=ch(yh(t))(e,n);return c("div",{className:u(Ts(a),"grid gap-x-m"),children:[fh(r),Bs(i),xh({field:t,inputs:r})]},`section-${l}`)})),yh=e=>t=>e(t)?.value,vh=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(hi,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(hi,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),Nh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},wh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Ch=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:wh[a?"annuity":"differential"]}},kh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(l),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:i,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:i,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,confirmationIncome:i,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:a,incomeCertificateCd:i,otherDependents:n,participantIncomes:Ao({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(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)}},Sh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=l((async l=>{const c=Ds(Dn(ch(Ih(l))(t,e)));if(!pn(c(l)))return console.warn("validation fail");a(l);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...kh(i,a)}],...Ch(a),...Nh(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&i?.(!0),"OK"}),[]);return{handleSubmit:c}},Ih=e=>t=>e[t],Th=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,renderStep:i=bh,isFormFinished:r,finishForm:d})=>{const[m,u]=qs("leadForm"),h=((e,t)=>({...sh[e],...t,birthday:oh(t?.birthday),dulIssueDateField:oh(t?.dulIssueDateField),participantDateRegistration:oh(t?.participantDateRegistration),beginDate:oh(t?.beginDate),deliveryDate:oh(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Sh({step:e,inputs:g,onNextStep:a,saveStep:u,finishForm:d}),[,{field:b,onSubmit:y}]=zt(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(lh,{}):c("form",{onSubmit:y,className:"space-y-m",children:[i({sections:t,field:b,step:e,registerSubmit:f}),o(vh,{step:e,onPrevStep:n})]})})),Bh=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Rh=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Ph=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(mu,[]);const p=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Bh[n]),[n]),b=0===n,[y,v]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[b||y?null:o(Xu,{stepsTitles:Rh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Th,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:v,renderStep:b?({registerSubmit:e,field:t})=>o(Qd,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Dh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Mh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ah=1e9,_h={sum:{min:1e4,max:Ah},period:3},Eh=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Wc(_h,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:zh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Fh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Oc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Rm,{label:a?.title,min:500,max:Ah,...d("sum",{parse:e=>({min:Number(e),max:Ah}),format:({min:e})=>String(e)})}),o(Oi,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(_c,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),zh=e=>ot((e?.paramsSource?.rateRows||[]).filter(Dh).flatMap((e=>Mh(e.minMonths,e.maxMonths)))),Fh=e=>ot(e.flatMap((e=>e||[])).filter(Dh).flatMap((e=>Mh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Oh=[{key:"10"},{key:"50"},{key:"100"}],Vh=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Oh,iconVersion:"black"})]})},Lh="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",jh=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Lh,"aria-label":`Страница ${l}`,children:l},String(t)):null},qh={width:"24",height:"24"},$h=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Uh(1===e),...qh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Lh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(jh),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Lh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Uh(e===n),...qh})})]})},Uh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Wh=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o($h,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Vh,{itemCount:a,onItemCountChange:i}):null]}),Hh=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Yh=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Hh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(bl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(bl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(hi,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Kh=({title:e,timestamp:t,publicId:n})=>{const a=ue(),{href:i}=a({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Gh="/api/v1/depository",Xh={startDate:void 0,endDate:void 0,query:""},Jh=ht((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=zt(Xh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?xt(a,!0):"",r=i?xt(i,!0):"",s=new URLSearchParams(Gh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=jn(Gh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),b=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Yh,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Kh,{...e},String(e.publicId)))):o(Ko,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Wh,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Zh=e=>"Image"===e?.contentType&&e?.image?o(ne,{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,Qh=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Zh(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ye,{version:i?.version,text:i?.text,...i}):null]}))),ep="location";function tp(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=a(n||null);return i((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,l((n=>e.fire(t,n)),[e,t])]})(ce,"location",ap()??{name:e}),r=l((e=>{ip(e),n(e)}),[]),{data:s}=jn(np()?null:"/api/v1/region",st);return i((()=>{s&&!np()&&n(s)}),[s]),[t??{name:e},r]}const np=()=>Boolean(globalThis.localStorage?.getItem(ep)),ap=()=>{try{const e=globalThis.localStorage?.getItem(ep);return e&&JSON.parse(e)}catch(e){return null}},ip=e=>{try{globalThis.localStorage?.setItem(ep,JSON.stringify(e))}catch(e){}};var lp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(lp||(lp={}));const rp=new Intl.NumberFormat("ru",{style:"currency",currency:lp.RUB}),sp=e=>e?rp.format(e):"",op="text-m font-light text-secondary-text ",cp=`${op} text-left`,dp=`${op} pl-5xl text-center`,mp=`${op} pl-5xl text-right`,up={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},hp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:cp,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:dp,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:mp,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(pp)})]}))),pp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:up[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:sp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:sp(e?.buyExchangeRate)})})]},t)},gp={icon:"GpsIcon"},fp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Zc,{...gp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),xp=(e,t,n)=>{const a=Number(bp(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},bp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),yp=e=>Rt([[e=>e.value!==lp.RUB&&e.oppositeValue!==lp.RUB,()=>e.handleConvert(e.value,lp.RUB)],[e=>e.value===lp.RUB&&e.oppositeValue===lp.RUB,()=>e.handleConvert(e.value,lp.USD)],[e=>e.value===lp.RUB&&e.oppositeValue===lp.RUB,()=>e.handleConvert(e.value,lp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function vp(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Np=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||lp.RUB,selectBuy:n?.[0]?.currency?.currency||lp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[vp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:wp(r,d,n),value:r.inputSell,setValue:e=>kp(d,n)(e,r.selectSell,r.selectBuy)}),vp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Cp(r,d,t),value:r.inputBuy,setValue:e=>Sp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(ye,{text:i.text,version:i?.version,...i}):null]})})),wp=(e,t,n)=>a=>{t({selectSell:a}),yp({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{kp(t,n)(e.inputSell,a,i)}})},Cp=(e,t,n)=>a=>{t({selectBuy:a}),yp({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Sp(t,n)(e.inputBuy,a,i)})},kp=(e,t)=>(n,a,i)=>{e({inputSell:bp(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(xp(n,l,a===lp.RUB)||"")})},Sp=(e,t)=>(n,a,i)=>{e({inputBuy:bp(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(xp(n,l,a===lp.RUB)||"")})};const Ip=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const[i]=tp(),l=function(e){const t=e?.code||"000",{data:n}=jn(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(i),r=Tp(l?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:lp.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:lp.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Ie,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(hp,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(fp,{address:l?.address})]}),o(Np,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Tp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Bp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Rp(n))})})),Rp=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...pe(t),children:i||null})},String(a)):null},Pp=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Dp=["all","footer"],Mp=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Pp(Dp)).map(n).map(Ap)})})),Ap=(e,t)=>{const{text:n,items:a=[],href:i,target:l="_self",onClick:r,dataFooter:s}=e,d=a.filter(Pp(Dp));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:i,target:l,onClick:r,...pe(s),children:n}),d?o(Bp,{items:d}):null]},String(t))},_p=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ep)}):null)),Ep=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(zp)})]},String(t)),zp=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Fp(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Fp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Op(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Op=e=>e.replaceAll(/\D/g,""),Vp=d((({className:e="",index:t,text:n,...a})=>{const i=ue(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Lp=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(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Vp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),jp="w-full lg:w-52";function qp(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const $p=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 l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Up=(e,t)=>(n,a)=>{for(const[i,l]of a)n.set(i,e(n.get(i)||t,l));return n},Wp=(e=[])=>e.reduce(((e,t)=>e+t),0),Hp=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Yp=e=>t=>e.map((([e,n])=>[$p(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Gp(t,e))).reduce(Up(Math.max,0),new Map),Kp=e=>t=>{return jc(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Hp(t||"");return n.length?Wp(e.map((e=>cc(n.map($p(e)))))):0})(e))).sort((a=([,e])=>e,n=(e,t)=>a(e)-a(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,a},Gp=(e,t)=>new Map(e.map((e=>[e,t]))),Xp=({basePathList:e,initialQuery:t=""})=>{const[n,l]=a(t||"");i((()=>{null!=t&&l(t)}),[t]);const{data:r}=jn(e?.length?e:null,Jp),[s,o]=a(null);return qp((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Hp(e);if(!i.length)return[];const l=Object.entries(a),r=[...i.map(Yp(l)).reduce(Up(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Kp(i)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Jp=async(...e)=>(await Promise.allSettled(e.map((e=>rt(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Zp=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[a,i]=Xp({basePathList:n,initialQuery:e}),l=r((()=>Qp(t)(a)),[t,a]);return o(El,{head:o(Hh,{autoFocus:!0,...i}),children:o(Mp,{navigationItems:l})})})),Qp=e=>t=>e?.length&&t?.length?jc(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],eg=(e={})=>{const{open:t,close:n}=de();return{open:(n={},a={})=>t(o(Zp,{...e,...n}),a),close:n}},tg=d((({className:e,search:t,...n})=>{const[i,r]=a(""),s=l((()=>r("")),[]),d=eg(n),m=l((e=>{r(e),ng(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Hh,{value:i,placeholder:t?.placeholder,onChange:m}),o(_l,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),ng=e=>e&&e.length>=3,ag=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(ao,{className:jp,logo:l,data:i,showTitle:!1}),o(tg,{className:"grow",navigationItems:t,...e})]})},ig=d((({className:e="",index:t,...n})=>{const a=ue(),{href:i,target:l,text:r,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-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),lg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{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(ig,{index:t,...e},String(t))))}):null]}))),rg=ht((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[ag(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Mp,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(jp,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(_p,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(eu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Lp,{title:m,links:r}),o(lg,{links:l,license:p})]})})),sg=d((({className:e="",title:t,description:n,calendar:a,...i})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...i,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),a?og(a):null]}))),og=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>cg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:dg(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},cg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),dg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),mg=ht((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:Jm(l,s?.key),children:f})}):null]})})}));function ug(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>hg(t)(e)));return n.find((([,e])=>hg(t,!0)(e)))??n[n.length-1]??[]}const hg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(pg(e)(n));return t?a===F(n):a.startsWith(F(n))},pg=e=>t=>{const n=X(G.SITE_URL);return _(t)?e.href:O(n,e.pathname)},gg=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=qt(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),a=t.current.getBoundingClientRect(),i=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${i}px`:a.left>e.left&&(i>a.left?n.current.style.left="":n.current.style.left=`${i}px`)}}),[r]);return jt(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),i((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:xg(t,n)})]})})),fg=d((({isActive:e,...t})=>{const n=ue(),{text:a,href:i,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:l,onClick:r,role:"link",...pe(t?.data),children:a})})),xg=(e,t)=>e?.map(((e,n)=>o(fg,{isActive:e===t,...e},e?.text??String(n)))),bg={default:"w-6 h-6",large:"w-12 h-12"},yg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>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":`${bg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),vg="chatbot",Ng="text-page__btn-chat",wg={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Cg=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:a="Чат",version:l})=>{const r=(e=>{i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=wg[e??""];return n=>{if(t)if("personal"!==e)fa(vg,t);else{const e=n.target;e?.classList.contains(Ng)||e?.classList.add(Ng),document.getElementById("webchat-js-container:webchat_rshb")||fa(vg,t)}}})(e);return o(yg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),kg=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...l})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(l);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(i),children:[o("span",{className:Sg(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Sg=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Ig=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Jo(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(kg,{...i,children:n})})})),Tg={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"},Bg=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ce()?n:t;return i?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",Tg["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Rg=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=ug(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Pg(t):Dg(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(Ig,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(gg,{items:p,activeItem:m,ariaLabel:i}):null,A.CHAT_BOT?o(Cg,{version:t,iconVersion:d,chat:A.CHAT_BOT,ariaLabel:l}):null,o(Bg,{version:t,...n})]})})),Pg=e=>t=>Math.max(t,e+1),Dg=e=>t=>Math.min(t,e),Mg=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(Me,{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(Ag,{...e},String(t))))})]}):null,Ag=d((({icon:e,...t})=>{const n=ue(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),_g=(e,t)=>n=>n.name?o(Zm,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Jm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Eg=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(Wt,"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"})]}))),zg=d((({foreignOffices:e,branches:t})=>{const[n,i]=tp(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=a(""),u=Og(is()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((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,Fg),{close:p}=de(),g=l((e=>{i(e),p()}),[]);return c(El,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Zm,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Eg,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&$p(e.toLowerCase())(d.toLowerCase())>=.8)).map(_g(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(_g(x,f))]},e)))}),Mg(e)]});var f,x})),Fg=e=>e.name?.charAt(0)||"",Og=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Vg=d((({className:e="",active:t,flat:n,children:a,data:i,...l})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(Lg(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(i),children:o("span",{suppressHydrationWarning:!0,className:jg(t,n),children:d||a})})})),Lg=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),jg=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),qg=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",[i]=tp(n?.branches?.default),r=eg(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(zg,{...e}),n),close:n}})(n),d=l((()=>r.open()),[r]),m=l((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(Vg,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:Jm(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Vg,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(yg,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),$g=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Jo(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(Vg,{...i,children:n})})})),Ug=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?Wg(t):Hg(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(ao,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o($g,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(gg,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(qg,{version:i,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Wg=e=>t=>Math.max(t,e+1),Hg=e=>t=>Math.min(t,e),Yg={"bg-white":"primary",transparent:"transparent"},Kg=["all","header"],Gg=ht((({className:e,bgColor:t="bg-white",logo:n={},version:a=Yg[t],portal:i,header:l={},...r})=>{const{common:s,navigation:d}=Jg(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=ug(m),{internetBankButton:f}=i||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Ug,{activeTopItem:p,navigationItems:m?.filter(Pp(Kg)),version:a,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Xg(a))}),p?.items?.length&&o(Rg,{subItems:p?.items?.filter(Pp(Kg)),version:a,internetBankButton:f})]})})})),Xg=e=>"transparent"===e?"opacity-30":"",Jg=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Zg=(e=!1)=>e?{}:{padding:"p-0"},Qg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},ef=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Qg[n],e),padding:t,version:i,isTheme:l,...s,children:P({...s,extraProps:{...Zg(a),className:Go(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),tf=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",ld[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),nf=(e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function af({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(bc,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(bc,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const lf=d((({className:e="",cards:t=[],button:n})=>{const[i,r]=a(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=nf({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?rf({activeIndex:m,cards:t,selectedCardIndex:i,onClick:s}):null,af({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function rf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:a}){const i=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${i}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:a}){return c("button",{type:"button",onClick:a,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?sf("страховая сумма",e.sum):null,e?.fee?sf("страховой взнос",e.fee):null]}),of(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function sf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function of(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const cf=d((({className:e="",title:t,insuranceTabs:n=[],button:i,...r})=>{const[s,d]=a(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:a}){return o("button",{type:"button",onClick:a,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:df({insuranceTabs:n,button:i})})]})})),df=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(lf,{button:t,cards:e},String(n)))):null};const mf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},uf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},hf=d((e=>{const{className:t="",__html:n,isDotted:a,investmentZeroColumn:i,investmentColumns:l,...r}=e,s=l?[...l]:[];return i&&s.unshift(i),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[zc(o("div",{className:"w-px h-4 bg-gray"}))(s.map(pf)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(xf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Pe,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),pf=(e,t,n)=>{const a=1===t,i=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${gf(a,i,e.cells)}`,children:l.length?o("div",{className:"w-full "+(i?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(ff)}):null},`column_${t}`)},gf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ff=(e,t)=>{const n=e.cellSize||"XS",a=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${uf[n]} ${mf[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},xf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,bf=["байт","Кб","Мб","Гб","Тб","Пб"],yf=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",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,...pe(l),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",vf(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),vf=(e,t)=>e||t?o("span",{children:", "}):"",Nf=(e,t)=>(n,a)=>{const i=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="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))} ${bf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Cf(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(yf,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:wf(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(a))},wf=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Cf=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},kf=d((({href:e,__html:t,target:n})=>{const{close:a}=de(),i=D(),r=$(i)(e),s=l((()=>{a()}),[]);return c(El,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Pe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(hi,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Sf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{if(!e&&!a)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(kf,{...e}),n),close:n}})({__html:a,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[wf(i),o(Me,{font:"font-light",children:e})]})})),If={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Tf=ht((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",If[r]),role:"list",children:i.map(Bf(d,l))}):null]})})),Bf=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Rf(t)(n,a):Nf(e,t)(n,a)},Rf=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(Sf,{...a,icon:e,href:Pf(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},Pf=e=>"href"in e,Df=ht((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Ie,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(a,{className:"flex-wrap"}),children:[i?o(Me,{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:[r?o(Pe,{__html:r,itemSize:"list-m"}):null,o(Me,{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",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),Mf=(e=[],t={})=>e.filter((({content:e={}})=>$c(t,e))).length,Af=(e,t)=>e===t;const _f=(Ef=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Af,((e=Af)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Ef(n,t[e])))));var Ef;const zf=[],Ff={},Of={primary:"bg-white/30",secondary:"bg-main-divider"},Vf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Lf=d((({count:e,version:t="secondary"})=>{const n=Ce(),a=n?"bg-main-divider":Of[t],i=Vf[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(Me,{size:"text-xs",color:i,children:e})})})),jf=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(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(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},qf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},$f={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Uf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Wf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Hf=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",qf[a],n?Wf[a]:Uf[a]),role:"tablist","aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?$f[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[jf({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Lf,{count:m,version:pi(n,a)})}):null]})})})),Yf=d((e=>o(e?.item?.href?Kf:Gf,{...e}))),Kf=d((e=>{const t=ue(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Hf,{...e,tag:"a",item:i,onClick:a})})),Gf=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Hf,{item:e,onClick:a,...n})})),Xf=(e,t,n)=>(a,i)=>o(Yf,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Jf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Xf(a,i,t))}))),Zf={categories:[],extraOptions:[],propertyType:[],stage:[]},Qf=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Wc(Zf,{block:i.block,page:i.options?.page}),f=l(((e=Zf)=>p(e)),[]),x=(({hotFilters:e=zf,filtrationState:t=Ff,blocks:n=zf,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>_f(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Mf(n,t.filter),version:pi(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Jf,{...x}),o(Oc,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(_c,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ex=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ax(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];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(Me,{size:"text-h4",children:ax(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Wa,{color:"green",children:ax(s)})})]}),o("div",{className:"hidden sm:block",children:o(_a,{className:"flex-wrap",children:m?.map(nx)})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:o(_a,{className:"flex-wrap",children:m?.map(nx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(d))},tx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ax(t)} №${n}`,body:e.toUpperCase()}),nx=(e,t)=>o(Pa,{...e},String(t)),ax=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ix=[];const lx=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:ix},rx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},sx={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)},ox=d((({descriptionData:e,className:t})=>{const[n]=tp(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=jn(`/api/v1/atms?regionCode=${e}`,lx);return{data:t||ix,isLoad:!t&&!n}}(a);return o(ki,{className:t,filterItems:cx,data:i,isLoad:l,initFilterState:rx,renderCard:ex,getBalloon:tx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),cx=(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=>sx[t](e))),n=!a.length||a.some((t=>sx[t](e)));return t&&n}))},dx=({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(Me,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:mx({workScheduleDescription:t})}),o(Ba,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Ra,{isUnfolded:e,children:mx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Za({isUnfolded:e,onToggle:t})})]},String(n)):null,mx=({workScheduleDescription:e})=>c("div",{children:[c(_a,{className:"flex",children:[o(Pa,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Pa,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(Pa,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(Pa,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Pa,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),ux=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),hx={branches:[],remoteWorkplaces:[]};const px=async e=>await rt(e,{method:"GET"})||hx,gx=d((({className:e})=>{const[t]=tp(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=jn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,px);return{data:t||hx,isLoad:!t&&!n}}(n);return o(ki,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ni,renderRemoteWorkplaceCard:dx,getBalloon:ii,getBalloonRemoteWorkplaces:ux,title:`Офисы филиала ${t?.name}`})})),fx=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(gx,{}):o(ox,{descriptionData:e})})})),xx=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),bx="hidden sm:flex absolute z-40 top-10",yx=ht((({className:e="",padding:t,slides:n=[],...i})=>{const[l,r]=a(0),[s,d]=pc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...i,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Xe,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...i})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(tc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(vx({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(yc,{className:u("left-6",bx),onClick:d.scrollLeft}):null,d.canScrollRight?o(vc,{className:u("right-6",bx),onClick:d.scrollRight}):null]})]})})),vx=({activeSlideIndex:e,onClick:t})=>({nav:n},a)=>{const i=a===e,l=i?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(a))},Nx=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ve(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?wx({__html:l,richVersion:r}):null,Cx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Cx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Cx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?Le([a]):null]})]}))),wx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),Cx=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:a,children:t})]})]}):null,kx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Pe,{__html:t,richVersion:n})})})),Sx=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:i})=>o(Bc,{tag:"button",className:u("border-none bg-transparent items-center group/button",i?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Ix=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Tx=(e=!1)=>e?"MinusIcon":"PlusIcon",Bx=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Rx=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:i,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();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:c,...d,children:o(Ba,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Ra,{className:u("gap-lg",Ix(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Px({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Px=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:i,onToggle:l,isMobile:r=!1})=>{const s=t||(i?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Bx(e):Tx(e))(i,r);return"accordion"===e?o(Sx,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(Rc,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Dx=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Jn,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Mx=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Dx,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Dx,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ax=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(cn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),_x=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ex=["От 1 дня","До 365 дней"],zx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Oi,{min:1,max:365,value:e,items:Ex,onChange:t})]}))),Fx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ox=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(_x,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Vx(m)}),o(zx,{days:i,setDays:e=>m({days:e})}),o(Fx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Lx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Mx,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Vx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Lx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},jx=d((({days:e,tariffs:t=[]})=>{const n=$x(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[qx("Аренда за",e),qx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),qx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),$x=(e,t)=>{const n=Ux(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Ux=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Wx=(e,t)=>e.find((e=>e.branchCode===t)),Hx=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Wx(a,n.selectedBranch),d=Yx(s?.safeBoxCaseVolumes),m=Kx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Gx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ox,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(jx,{days:n.days,tariffs:u})]})})),Yx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Kx=(e,t)=>e?.find((e=>e.volume===t)),Gx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Xx=[];const Jx=async e=>await rt(e,{method:"GET"})||Xx,Zx=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=is(),p=Qx(m.selectedRegion,h),f=function(e){const{data:t}=jn(e?`/api/v1/safeboxes?regionCode=${e}`:null,Jx);return t||Xx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),b=(y=Wx(f,m.selectedBranch)||f,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Hx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(Na,{points:b,className:"h-[640px]"}):null]})})),Qx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,eb=e=>e<4?"w-72":"w-52",tb={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"},nb=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=i.length>3,h=tb,p=(e=>e?"":"opacity-0")(a),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:Xc(f)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:zc(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(ab(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=x,{label:l,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",eb(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(Me,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:a.description,children:r}):null,o(Pe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),ab=(e,t,n)=>({icon:a},i)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${ib(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Ve(a)?o(ne,{image:{...a,iconVersion:a?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var r},ib=e=>e?"h-16 w-16":"h-24 w-24",lb=d((()=>o("div",{className:"hidden",role:"none"}))),rb="hidden sm:flex absolute z-40",sb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ob=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=pc({itemCount:t?.length||0});return i((()=>cb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(tc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:sb[l].item,gap:sb[l].gap,children:t.map(Xf(n,a,l))}),s.canScrollLeft?o(yc,{className:u("left-6",rb,sb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(vc,{className:u("right-6",rb,sb[l].buttonTop),onClick:s.scrollRight}):null]})})),cb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},db={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},mb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(db[t].wrapper,e),children:o(ob,{className:db[t].component,tabsType:t,...n})}):null,ub=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=hb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=a(fb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const C=gb(x[y],y),k=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[mb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:pb(t,x),activeItem:N,tabsType:r,onChange:k}),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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(gb)?.filter(Boolean)||[]}),hb=({__id:e,anchor:t})=>t??e??"tabs",pb=(e,t)=>t?.length?t:e,gb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",fb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),xb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},bb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:xb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),yb=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),vb={Buttons:({buttons:e})=>Le(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Pe,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(yb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Nb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return wb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),wb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in vb))return null;return o(vb[n],{...t,...a})},Cb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>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(Nb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),kb=(e,t)=>140*Wp(e.slice(0,t).map((e=>e?.cols?.length??1))),Sb=(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(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Ib=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=nf({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((i=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,l=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.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(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${kb(a,i)}px)`},children:a?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?Sb(e.cols,i):null]},`row${t}`)))})})]},String(t))})),af({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var i})),Tb=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(Me,{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(Ib,{rows:t.rowsData})})})]},a)}))}))),Bb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Rb=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(Me,{size:"text-xl",font:"font-light",color:Bb(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Pb=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Rb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Tb,{activeTabIndex:r,items:m}),o(yb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(yb,{onClick:n,isOpen:!0})]})})),Db=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(Pb,{...t,onClick:n})}):null]}))),Mb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Db,{onHideContentClick:()=>d(void 0),tableInner:s,...r,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(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(bb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Cb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Ab=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,af({...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]})})),_b=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:l=0,...r})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=nf({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Mb,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(Ba,{renderFoldableSection:({isUnfolded:e})=>c(Ab,{controls:p,children:[x,o(Ra,{isUnfolded:e,children:b})]}),renderFoldButton:Pc}):o(Ab,{controls:p,children:f})})]})})),Eb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?zb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Fb(n):null,i?o(Pe,{richVersion:l,__html:i}):null]})]}))),zb=()=>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"}),Fb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ob=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:n})}):null]}))),Vb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ob,{prefix:t,unit:n,suffix:a})})})),Lb=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Qg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:P({...c,extraProps:{className:u("w-full",Go(r)),...Zg(a)}})})}),{childrenTypes:[]}),jb=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",qb=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const l=D();return c(g,{className:e,defaultPadding:jb(e),...i,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(l)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(l)(n)})}):null]})})),$b={AdTile:gt,ApplicationForm:Ls,ApplicationLeadForm:qo,ApplicationStatus:Wo,BankAccountFiltration:Kc,BenefitsBlock:Qc,BonusBenefitsBlock:id,ButtonsBlock:rd,CalculatorBonus:Nd,CalculatorBusinessDeposit:Od,CalculatorCredit:Qd,CalculatorDeposit:xm,CalculatorRefinancing:Sm,CardTransfer:Mm,Carousel:Lm,CarouselCard:Um,CarouselCatalogCard:Hm,CarouselLinks:Gm,CarouselRecommendationCard:au,CarouselTariffsCard:ru,ContactsBlock:ou,CreditCardForm:Gu,CreditForm:Ph,DepositFiltration:Eh,Depository:Jh,ErrorBlock:Qh,ExchangeRateTile:Ip,Footer:rg,GracePeriod:sg,GrantSupport:mg,Header:Gg,Headline:k,HorizontalLayout:ef,ImgBlock:tf,InsuranceAmountBlock:cf,InvestmentInfo:hf,LinkDocs:Tf,MobileAppTile:Df,MortgageFiltration:Qf,OfficesAtmsMap:fx,Placeholder:xx,ProductBlock:pt,ProductGallery:yx,RepresentativeOfficeInfo:Nx,RichTextBlock:kx,RollupItem:Rx,SafeDepositRental:Zx,StepsBlock:nb,StickyBottomMenu:lb,TabsLayout:ub,TariffsTable:_b,TextBlock:Eb,UnitBlock:Vb,VerticalLayout:Lb,Video:qb},Ub=me((()=>{i((()=>{It()}),[]);const e=_t();jt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),Wb="cookie",Hb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=Lt();qp((()=>{globalThis.localStorage?.getItem(Wb)||n()}),[],3e3);const i=l((()=>{globalThis.localStorage?.setItem(Wb,"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(Pe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(_l,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function Yb(e){throw new Error(e)}const Kb=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return i((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Yb(e)}}))),[c,d]),n},Gb=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=Kb({onCloseAll:e,onClose:t}),{close:a}=de(),r=l((({key:e})=>{"Escape"===e&&a()}),[]);return jt(globalThis.document,"keydown",r),i((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==n.length-1}),children:e},String(t||a))))}):null})),Xb=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);i((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Yb(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return jt(globalThis.document,"keydown",r),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",children:e.popup}):null})),Jb="header",Zb="footer",Qb="sticky-footer",ey={},ty=d((({className:e,data:t=ey,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=ut(s,r);Ub();const m={key:"",page:{slots:i,blocks:l,fallback:r,...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?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(i?.header,{...m,slotName:Jb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(i?.footer,{...m,slotName:Zb})]})]}),i?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(i?.["sticky-footer"],{...m,slotName:Qb})}):null,o(Gb,{}),o(Xb,{}),o(Hb,{__html:d?.cookieContent?.__html})]})}));Object.assign(ty,{childrenTypes:[],slots:()=>[Jb,Zb,Qb]});e.Blocks=$b,e.ContentPage=ty,e.handlerDecorator=me,e.joinList=zc,e.packageVersion="0.14.668",e.projectSettings=A,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})}));