@redneckz/wildless-cms-uni-blocks 0.14.237 → 0.14.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +20 -9
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/dist/components/OfficesAtmsMap/OfficesMap.js +7 -7
- package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/dist/hooks/useNavigateHandler.js +13 -1
- package/dist/hooks/useNavigateHandler.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/lib/components/OfficesAtmsMap/OfficesMap.js +7 -7
- package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/lib/hooks/useNavigateHandler.js +13 -1
- package/lib/hooks/useNavigateHandler.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +20 -9
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +7 -7
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/dist/hooks/useNavigateHandler.js +13 -1
- package/mobile/dist/hooks/useNavigateHandler.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +7 -7
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +7 -7
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/lib/hooks/useNavigateHandler.js +13 -1
- package/mobile/lib/hooks/useNavigateHandler.js.map +1 -1
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +7 -7
- package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +7 -7
- package/mobile/src/hooks/useNavigateHandler.ts +15 -1
- package/package.json +2 -2
- package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +7 -7
- package/src/components/OfficesAtmsMap/OfficesMap.tsx +7 -7
- package/src/hooks/useNavigateHandler.ts +15 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const 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,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t};const h=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{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}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={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","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",r||i,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),k={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>{const i=k[l]||"h3";return o(i,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a})})),T=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={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"}},B=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(S,{className:p("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(T,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...u,children:a}):null]})})),M=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),V=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=M,blocksRegistry:r={},ancestors:s=V}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const P=[],z=(e,{key:t,ancestors:l=P,slotName:n=null,extraProps:a,renderProps:i=R,...r})=>{const s=a?(e,t)=>R(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||P,[r.parent,n]]:l},a)))};function A({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const D=e=>e&&!e.endsWith("/")?`${e}/`:e,j=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return j.includes(t)?D(l):l}}),L=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!L(e)&&(!t||"_self"===t)),O=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),_=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var U=Object.freeze({__proto__:null,isURL:L,isLocalURL:$,isHash:O,withoutQuery:F,joinPath:_});const H="/api/",W=`${H}v1/storage`,K=e=>(t,l=E.BASE_PATH)=>{if([!t,L(t),O(t),[E.CDN,H].some((e=>q(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`${W}/${t}/file`;const n=t?.startsWith("/");return _(q(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},q=(e,t)=>t&&e&&e.startsWith(t),G={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},Y=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=u(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=K(d)(_(E.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:X(e,s)}):o(Z,{className:e,children:c("svg",{className:p(Q(r),G[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),X=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},Q=e=>e?"":"w-full h-full",Z=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=(e,t)=>l=>l&&!L(l)?K(e)(_(t,l)):l,ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:i},r)=>o("source",{srcSet:J(a,n)(e),type:ne(l),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?le({...t,src:J(a,n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:p("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}),ne=e=>e?`image/${String(e)}`:void 0,ae=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ie={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","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:l})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" "),me=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),he=e=>he._impl(e);function ue(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=me();return e=>({...e,href:t&&!l?e.href:K(n)(e.href,l),"aria-label":e.text,onClick:he(i(e))});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&$(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}he._impl=e=>e,he.setup=e=>{he._impl=e};const pe=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),ge=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=fe(e)?"hidden lg:block":"";return c("div",{className:p(xe(e),"flex gap-xs"),children:[n?o("div",{className:p(r,ce[i]),children:n}):null,fe(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:p(r,ce[i]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return p("group/btn items-center justify-center",fe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},fe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),be=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=ue()({onClick:r,href:n,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:n,version:l}),children:a})));function we(e,t,l=!1){const n="primary"===e?"white":"black",a="Вернуться назад";return c("div",{className:p(l?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),o(ye,{version:"link",className:"group-data-secondary:text-white/80",text:a,ariaLabel:a,onClick:t,type:"button"})]})}const ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=i((()=>{v.back()}),[]);return c("div",{className:Se(n,l,e),children:[f?we(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Ve(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,b]}),Me(A({...y,extraProps:{className:"@container-normal"}})),Ve(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Te(g):"",Ie(g),Re(x)),imageAlign:h}),Be(s)]})]})]})})),Se=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Te=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Be=e=>e?o("div",{className:"self-end",children:e}):null,Me=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ve=(e,{className:t,imageAlign:l})=>e?o("div",{className:p("shrink-1/2 justify-self-center",l&&ke[l],t),children:e}):null,Re=e=>e?"hidden @xl:block":"",Pe=(e=[])=>e.reduce(((e,t)=>e+t),0),ze=(e=[])=>e?.length?Pe(e)/e.length:0,Ae=(e,t="normal")=>e?o("div",{className:p("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(ae,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),je=(e,t)=>e?o(T,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ee=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),Le=(e,t)=>e?o(Ee,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(De,{...e},`rte-${t}`):["label"in e?Le(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:je(e.description,t)},String(t)):null],Oe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:$e(l)})]}))),Fe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),_e=e=>{return((t=e.map(Fe))?.length?Math.sqrt(Math.abs(ze(t.map((e=>e**2)))-ze(t)**2)):0)>16;var t},Ue=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),He=e=>!e.some(Ue),We=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",_e(l)||He(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Oe,{benefitsVersion:t,...e},String(l))))}):null)),Ke=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("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)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ke:We,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Xe(l))}):null,Xe=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=Qe(a,r),d=Qe(i,r);return n||a?.icon?o(ye,{className:p("basis-full @lg:basis-auto",e),appendLeft:Ze({...a,iconVersion:c}),appendRight:Ze({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},Qe=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ze=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Je=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),et={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},tt=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=et[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:l.map(((e,l)=>o(Je,{isDotted:t,dotClassName:p(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),lt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),nt=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(at)}):null)),at=({label:e,amount:t},l)=>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(Ee,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[lt(2)(t)," ₽"]}):null]},String(l)),it=d((({className:e,tags:t})=>t?.length?o("div",{className:p("flex flex-wrap gap-xs",e),role:"list",children:t.map(rt)}):null)),rt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ee,{size:"text-m",font:"font-light",children:e})},String(t)),st={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},ot=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:S,...T})=>{const I=y?.src?o(ae,{image:y}):null,M=o(B,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ct(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ye(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(De,{__html:h}):null,p?.length?o(tt,{items:p,isDotted:g,listItemSize:st[i]}):null,S,x?.length?o(nt,{priceList:x}):null,dt(f)]})})})),ct=(e,t)=>t?{rightImage:e}:{leftImage:e},dt=e=>e?.length?o(it,{tags:e}):null,mt=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ut=(e,t)=>{return l=e,Boolean(ht(l)&&"string"==typeof l.$ref)?t.ref(e):ht(e)?t.record(e):mt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},pt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(gt,e),gt=(e,t)=>e&&t?ht(e)?e[t]:mt(e)?e[parseInt(t,10)]:e:e,xt=(e,t)=>ut(e,{ref:({$ref:e,...l})=>xt(e?pt(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:xt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>xt(e,t)))}),ft=(e,t,l=[])=>{ut(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)ft(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)ft(e[n],t,[...l,n])}})};async function bt(e,t){try{return e?await yt(e,t):null}catch(e){console.error(e)}return null}const yt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),vt=e=>[...new Set(e)],Nt={},wt=["/portal-resources"],kt=(e,t)=>xt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return ft(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(vt(e).filter((e=>!wt.some((t=>e.startsWith(t))))).map((async e=>[e,Nt[e]||=await yt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?kt(e,{...t,...i}):e};function St(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Tt=St((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(ot,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>Bt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(Tt,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Mt=e=>e?.replace(/[^+\d]/g,"");function Vt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:i="",email:r,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"email":"mail"]:r,...Rt(i),...t?{birthday:s?.toLocaleString()}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Pt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Rt=(e,t)=>e?{[t?"phoneNumber":"phone"]:Mt(e)}:{},Pt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Mt(e)}:{},zt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),At=e=>e,Dt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=i(((e,t)=>{const{parse:l=At,format:n=At}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=i((e=>{r(e),m(e)}),[]),g=i((()=>{r(e),c(!1),m({})}),[e]),x=i((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},jt=e=>o("div",{className:"h-6",children:e?o(Ee,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function Et(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},$t=e=>e?o(Ee,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Ot=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",T=Ft(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[$t(d),N?o("textarea",{className:p("block resize-y min-h-24",C,T),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:p("h-14",C,S,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),Ft=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",_t=e=>e?.text||e?.key||"";function Ut(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ht(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return Ut(globalThis.document,"click",l),t}const Wt=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Kt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:Wt(t,n).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===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:_t(e)}),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function qt({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=i((()=>{m.close(),c&&c()}),[c]),p=i((e=>{u(),r&&r(e)}),[u,r]),g=s(null),x=Ht(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Kt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,p]),g}const Gt=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=Et(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=i((()=>{v(""),f()}),[]),C=qt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:k,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[$t(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:C,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Xt(s,r,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:_t(a)||d}),Yt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o(Ot,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Yt=(e,t)=>o(Y,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Xt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Qt=()=>{},Zt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Jt(t,e),c=el(t,i,r);h.push(o("td",{children:o("div",{className:tl(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Jt=(e,t)=>t&&e.toDateString()===t.toDateString(),el=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),tl=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),ll=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],nl=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Qt})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:ll.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Zt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),al=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],il=al.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),sl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},ol={className:"min-w-32",iconVersion:"black",isBorder:!1},cl=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=Et(!1),[u,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=Ht(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(al.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:il,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[$t(t),c("div",{className:"relative",children:[dl(C,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(Y,{...sl,className:"-rotate-90 cursor-pointer"})}),o(Gt,{onChange:v,value:{key:al[u]},options:w,...ol}),o(Gt,{onChange:N,value:{key:String(x)},options:k,...ol}),o("div",{className:"my-auto",onClick:y,children:o(Y,{...sl,className:"rotate-90 cursor-pointer"})})]}),o(nl,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:r,max:s})]}):null]})]})})),dl=(e,t,l)=>c("div",{onClick:e,className:p("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(T,{children:t&&Lt(t)}),o(Y,{...sl,name:"CalendarIcon"})]}),ml=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(cl,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),jt(l)]}))),hl=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,type:d,...m})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Ot,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),jt(a)]}))),ul=e=>"_"===e,pl=e=>/\d/.test(e),gl=e=>ul(e)||pl(e),xl=[..."+7 (___) ___-__-__"],fl=xl.findIndex(ul),bl=xl.map(((e,t)=>gl(e)?xl.slice(0,t).filter(gl).length:-1));const yl=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=xl.map(((e,l)=>pl(e)?e:t.charAt(bl[l])||e)),n=bl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(fl,n)):l).join("")}(e))),[t]);return o(Ot,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),vl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:p("shrink-0 w-full",e),children:[o(yl,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),jt(n)]}))),Nl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(Gt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),jt(l)]}))),wl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],kl=e=>!e?.length,Cl=e=>t=>l=>e(l)?[]:[t],Sl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Tl=e=>null!=e,Il=new Map,Bl=e=>Boolean(e?.every((e=>Array.isArray(e)?Bl(e):!e||"string"==typeof e))),Ml=e=>Bl(e)?e.toString():"";function Vl(e,t,{fallback:l,cache:i}={}){const s=r((()=>Rl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Tl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Il)=>l=>{const n=Ml(l),a=t.get(n);if(n&&Tl(a))return a;const i=e(...l);return n&&Tl(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Rl(e){return Array.isArray(e)?e:e instanceof Function?Rl(e()):[e]}const Pl=[];const zl=async e=>await bt(e,{method:"GET"})||Pl;function Al(){const{data:e}=Vl("/api/v1/branchesByRegions",yt);return Array.isArray(e)?e:[]}const Dl="Некорректно заполненное поле",jl=Cl((e=>null!=e&&""!==e))(Dl),El=Cl((e=>e?.key&&""!==e?.key))(Dl),Ll=Cl((e=>"string"==typeof e&&e.length>1))(Dl),$l=Cl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Dl),Ol=(Fl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Cl((e=>"string"==typeof e&&Fl.test(e))))(Dl);var Fl;const _l=Cl((e=>"boolean"==typeof e&&e))(Dl),Ul=e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)),Hl={typeForm:jl,surname:Ll,name:Ll,region:El,addressBranch:El,phone:Ol,birthday:jl,email:jl,fullName:Ll,inn:$l,partnerComments:jl,collectionCount:jl,comment:jl,acquiringType:El,serviceType:El,consentDataProcessing:_l,annualRevenue:jl},Wl=(e,t,l=!1)=>l?Sl(e,t):e,Kl=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.key,i=e("region")?.value?.text,r=l?Al()?.find((e=>e?.region===i))?.branches:function(e){const{data:t}=Vl(e?`/api/v1/branches?regionCode=${e}`:null,zl);return t||Pl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(Nl,{label:"Адрес",placeholder:"Выберите адрес",options:(r||[]).map((({address:e=""})=>({key:e,text:e}))),...Wl(e("addressBranch"),Hl.addressBranch,t?.required)})}));function ql(){const{data:e}=Vl("/api/v1/regions",yt);return Array.isArray(e)?e:[]}const Gl=d((({field:e,input:t})=>{const l=ql();return o(Nl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...Wl(e("region"),Hl.region,t?.required)})})),Yl=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Xl=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Ql=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Zl=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Jl="container space-y-m",en=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),tn=[{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"}],ln=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(en,{paths:tn,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":an(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:nn(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Ee,{size:"text-l",font:"font-light",children:l})}):null]})})})),nn=e=>e?"radio":"checkbox",an=e=>p("rounded border",e?"bg-primary-main":""),rn=d((({text:e,link:t})=>c(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Ee,{children:e}),t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Ee,{children:t.text})}):null]})));function sn({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const on={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"},cn={primary:p("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:p("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")},dn=d((({children:e,...t})=>{const l=e=>({...e,onClick:he(sn(e))}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":p(on[a],cn[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),mn=(e,t)=>o(dn,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),hn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(ln,{...e}),o(rn,{link:t})]}),jt(Sl(e,_l).error)]}):o(rn,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),mn(l)]}),un={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},pn={typeForm:jl,region:jl,surname:jl,name:Ll,feedbackMethod:jl,phone:Ol,email:jl,comment:jl,consentDataProcessing:_l},gn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{xn(e,l)}),[l]),[,{field:a,...r}]=Dt(un,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=bn(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:Jl,onSubmit:r.onSubmit,children:o(Yl,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(Nl,{label:"Тема",placeholder:"Выберите тему",options:Xl,...Sl(a("typeForm"),jl)}),s?o(Nl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Zl,...Sl(a("serviceDirection"),jl)}):null,o(Gl,{field:a}),s?o(Kl,{field:a}):null,c("div",{className:"space-y-s",children:[o(hl,{label:"Фамилия",...Sl(a("surname"),Ll)}),o(hl,{label:"Имя",...Sl(a("name"),Ll)}),o(hl,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(ml,{label:"Дата рождения",...Sl(a("birthday"),jl)})]}),d?c("div",{children:[o(hl,{label:"ИНН",...Sl(a("inn"),$l)}),o(hl,{label:"Наименование организации",...a("fullName")})]}):null,o(Nl,{label:"Способ получения ответа",options:Ql,...Sl(a("feedbackMethod"),jl)}),o(vl,{label:"Телефон",...Sl(a("phone"),Ol)}),s?c("div",{children:[o(vl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?Sl(a("secondaryPhone"),Ol):a("secondaryPhone")}),o(hl,{label:"Электронная почта",...Sl(a("email"),jl)}),o(hl,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(hl,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(hl,{label:"Электронная почта",...Sl(a("email"),jl)}),o(hl,{...Sl(a("comment"),jl),placeholder:"Ваше сообщение",isTextarea:!0}),hn(a("consentDataProcessing"),t,e)]})})})})),xn=(e,t)=>{const l=bn(e?.typeForm.key,e?.serviceDirection?.key),n=wl({...pn,...fn(e,l)});kl(n(e))&&t(e,!l)},fn=(e,t)=>t?{addressBranch:jl,inn:$l}:"FEEDBACK"===e.typeForm.key?{birthday:jl}:{addressBranch:jl},bn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,yn=d((e=>{const{button:t,regionSource:l}=e,[a,i]=n({key:""}),r=l?.regions??[],s=de({className:"text-white",version:t?.version}),d=r?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[r?o(Nl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:r.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:i}):null,d?o("div",{className:"text-center",children:o(ye,{href:d,target:"_blank",className:p("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),vn={ApplicationFormGrantSupport:yn,ApplicationFormFeedback:gn},Nn=Vt(),wn=St((({className:e,formBlock:t,...l})=>{const[a,r]=n(""),s=i((async(e,t=!1)=>{const l=Cn(e),n=await Nn.send(l,t)?"OK":"Fail";return r(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(S,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?kn(t,s):null,a?o(zt,{responseType:a}):null]})})})),kn=(e,t)=>{const l=e?.formType;if(!l||!(l in vn))return null;return o(vn[l],{...e,onSubmit:t})},Cn=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),Sn=d((e=>{const{className:t,title:l,responseType:n,children:a,...i}=e;return o(x,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(S,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(zt,{responseType:n}):null]})})})),Tn=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ln,{text:t,value:l,disabled:a,onChange:r},n),jt(i)]}))),In=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Bn=d((({field:e,input:t})=>o(Nl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:In,...Wl(e("acquiringType"),Hl.acquiringType,t?.required)}))),Mn=(e="")=>Boolean("trade"===e||"all"===e),Vn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Rn=(e,t,l)=>Math.max(t,Math.min(e,l));function Pn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function zn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-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:p("w-2 h-2 rounded-full",s<=t||i?"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:l,step:n,value:s,disabled:i,onInput:t=>{const l=Pn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const An=1,Dn=100,jn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:An),max:s=(a.length?a.length-1:Dn),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:u}=e,g=Vn(e,{normalize:(e=0)=>a.length?En(a)(e):Rn(e,r,s),format:lt()}),x=i((e=>{u&&u(Pn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),zn({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:u})]}),Ln(n)]})})),En=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Ln=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),$n=["От 1 000 ₽","До 1 000 000 000 ₽"],On=d((({field:e})=>o(jn,{title:"Сумма, ₽",items:$n,min:1e3,max:1e9,...e("amount")}))),Fn=d((({field:e,input:t})=>o(hl,{className:"col-span-2",...Wl(e("comment"),Hl.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),_n=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:p("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:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Un=d((({field:e})=>Mn(e("acquiringType")?.value?.key)?o(_n,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Hn=d((({field:e})=>Mn(e("acquiringType")?.value?.key)?o(_n,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Wn=d((({field:e,input:t})=>{const l=Al(),n=r((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(Nl,{label:"Регион",placeholder:"Выберите регион",options:n,...Wl(e("region"),Hl.region,t?.required)})})),Kn=["От 1 мес","До 15 лет"],qn=d((({field:e})=>o(jn,{title:"Срок, месяцев",items:Kn,min:1,max:180,...e("term")}))),Gn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Yn=d((({field:e})=>o(Nl,{label:"Тип обслуживания",options:Gn,...Sl(e("serviceType"),jl)}))),Xn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Ee,{color:"text-primary-text",children:t}):null]})}))),Qn=["currencyControl","documentOperations","conversionTransactions","otherIssues"],Zn=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m space-x-m grid @xl:flex @xl:items-center",children:[o(Xn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),Jn=(e,t)=>(l,n)=>{const{required:a,...i}=l,r="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(hl,{label:"Фамилия",...Wl(e("surname"),Hl.surname,a)}),name:o(hl,{label:"Имя",...Wl(e("name"),Hl.name,a),...i}),middleName:o(hl,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(vl,{label:"Телефон",...Wl(e("phone"),Hl.phone,a)}),email:o(hl,{label:"Электронная почта",...Wl(e("email"),Hl.email,a)}),fullName:o(hl,{label:"ФИО",...Wl(e("fullName"),Hl.fullName,a),...i}),inn:o(hl,{label:"ИНН",type:"number",...Wl(e("inn"),Hl.inn,a)}),comment:o(Fn,{field:e,input:l}),region:r?o(Wn,{field:e}):o(Gl,{field:e,input:l}),addressBranch:o(Kl,{field:e,input:l,isPremium:r}),birthday:o(ml,{label:"Дата рождения",...Wl(e("birthday"),Hl.birthday,a)}),isClient:o(Tn,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),consentToReceiveMaterials:o(Tn,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(hl,{...Wl(e("partnerComments"),Hl.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i}),collectionCount:o(hl,{label:"Количество объектов инкассации",type:"number",...Wl(e("partnerComments"),Hl.collectionCount,a)}),acquiringType:o(Bn,{field:e,input:l}),onlineCheckout:o(Un,{field:e}),posTerminal:o(Hn,{field:e}),serviceType:o(Yn,{field:e}),term:o(qn,{field:e}),amount:o(On,{field:e}),annualRevenue:o(hl,{label:"Годовая выручка, ₽",...Wl(e("annualRevenue"),Hl.annualRevenue,a)}),vedTypes:o(Zn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===n))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const ea=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${Mn(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,h={...d,...la(o),...ta(c),...m?{partnerComments:m}:{}};return Object.fromEntries(Object.entries(h)?.map((([e,t])=>[e,t?.key||t])))},ta=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},la=e=>e?{vedTypes:Object.fromEntries(Qn.map((t=>[t,t===e])))}:{},na={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:In[0],serviceType:Gn[0],vedTypes:Qn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},aa=(e,t="")=>{const l=Object.fromEntries(Ul(e).map((e=>[e,na[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=Gn[1]),{...l,typeForm:{key:t,text:""}}},ia=Vt(),ra=d((({className:e,title:t,typeForm:l="",sections:a=[],button:r,link:s,endpoint:d,additionalParams:m,isContacts:h,...u})=>{const g=a?.flatMap((e=>e?.inputs))||[],x=aa(g,l),[f,b]=n(""),y=i((async e=>{const t=ca(g,e),l=wl((e=>{const t=Ul(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Hl?.[e]])))})(t));if(!kl(l(e)))return"Fail";const n=ea({...e,...m}),a=await ia.send(n,"lead"===d)?"OK":"Fail";return b(a),a}),[]),[,{field:v,onSubmit:N}]=Dt(x,{onSubmit:y}),w=oa(g)?.name;return c(Sn,{className:p(Jl,e),title:t,responseType:f,...u,children:[c("form",{onSubmit:N,children:[a.map(((e,t)=>c("div",{className:p(sa(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,(e?.inputs||[])?.map(Jn(v,l))]},`section-${t}`))),hn(w?v("consentDataProcessing"):void 0,s,r)]}),h?c("div",{className:"space-y-m",children:[o(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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(ae,{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(ae,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),sa=e=>2===e?"@xl:grid-cols-2":"",oa=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ca=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>l===t?.[e?.condition?.name])))),da="text-left",ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ha=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:p("rounded-icon object-fit flex justify-center items-center",ma[l],e),children:o(Y,{...i,width:"54%",height:"54%",name:a})}):null})),ua=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(S,{headingType:"h3",as:"h2",className:da,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(pa)}):null]}))),pa=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(ha,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(S,{headingType:"h6",children:e}),o(Ee,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(tt,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),ga=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function xa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const fa=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:xa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}(i((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),ba=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],ya=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Na(l))}),[g,x]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?va(c,v):{},...N?ga(h):{},gap:`${r}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(C=(e,l)=>o(fa,{className:p(m,a?ba[a-1]:"",N?"h-full":"",t),style:w?va(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(u)});var C})),va=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Na=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ka={"horizontal-list":"w-6","vertical-list":"h-6"},Ca=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:p("flex gap-xs",wa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?ka[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Sa=e=>e,Ta=(e=Sa)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Ia=Ta(),Ba=(e=Sa)=>Ta((t=>-e(t))),Ma=Ba(),Va=e=>t=>e.scrollWidth/t,Ra=e=>(t,l)=>{e.scrollBy({left:l*Va(e)(t),behavior:"smooth"})},Pa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ba()(a),Ta()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Ra(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Ra(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},za=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(r)?r.length:0,[h,u]=Pa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(ya,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:i,children:r}),a?o(Ca,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),Aa=(e,t,l)=>{return o(za,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:p("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(ae,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Da=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(B,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Aa(e,0,t):null]}))),ja={start:"justify-start",center:"justify-center",end:"justify-end"},Ea=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",ja[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ye(e)})})),La=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const $a=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),Oa=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Ee,{size:"text-h3",children:[i,lt(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Ee,{size:"text-h3",children:"-"})})]}))),Fa=Math.round(29.5),_a={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ua={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ha={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Wa={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ka={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},qa=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Ha.prefMonthsNum,prefTravelBonusRate:i=Ha.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ha,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},Ga=e=>e?o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Ya=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>c("div",{children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:lt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Xa=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Qa=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?o(Xa,{title:e,...i}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Ya,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),o("div",{className:"@xl:hidden",children:o(Oa,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function Za({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${lt(2)(l.min||0)} ₽`,`До ${lt(2)(l.max||0)} ₽`];return o(jn,{items:e?n:[],step:t,...l})}const Ja=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Dt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=qa(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[Za({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),Za({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...i("restExpenseValue")})]}),h>=0?Qa({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(Oa,{title:"Баллов за год",value:u}):null,Ye(l,{isVertical:!0}),Ga(n)]})]})})),ei=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),ti=(e,t=0)=>e?.sum?e.sum:t,li=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,ni=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,ai={horizontal:"gap-5xl",vertical:"flex-col gap-s"},ii=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${ai[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(ln,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),ri=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(ii,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),si=e=>ri({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),oi=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:ci([e,t],n),ci=([e,t],l=[])=>({[e]:l.length?Ma(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Ia(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),di=(e,[t,l],n)=>e>=n[t]&&e<=n[l],mi={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const hi=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730,c=function(e){const t=e?.rateType?mi[e?.rateType]:"",{data:l}=Vl(t?`/api/v1/depositrates/${t}`:null,yt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...Ka,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>r===e.isMonthlyInterestPayment&&ui(s,e)&&di(n,["minSum","maxSum"],e)&&di(l,["minDays","maxDays"],e)))||Ka,{rate:m}=d,h=pi(m,e),u=n+h,p=c||[Ka];return{...d,...ci(["minSum","maxSum"],p),...ci(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},ui=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,pi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},gi=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:i,rateParams:r})=>{const[s,{field:d}]=Dt({moneyValue:ti(i,1e5),daysValue:li(i,60),isReplenished:Boolean(i?.isReplenished),isPartialWithdrawal:Boolean(i?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(i?.isMonthlyInterestPayment)}),m=hi(s,r),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(jn,{items:[`От ${ni(f.min||0)}`,`До ${ni(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[xi(m,d),si({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Qa({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[fi(u,h),Ye(t,{isVertical:!0}),Ga(l),Ga(n)]})});var f})),xi=(e,t)=>c("div",{className:"space-y-s",children:[o(Ee,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(ln,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ln,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),fi=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(Oa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(Oa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),bi=e=>yi({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&yi({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&yi({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&yi({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),yi=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],vi=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Ni=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[_a],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>bi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=oi(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=oi(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>bi({row:e,userInputParams:t,paramsViewSettings:l})&&di(n,["minSum","maxSum"],e)&&di(a,["minMonths","maxMonths"],e)))||_a)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=vi(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},wi=({min:e=0,max:t=0,availableMonths:l,...n})=>o(jn,{items:[`От ${ki(e)}`,`До ${ki(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),ki=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ci=e=>ri({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Si=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:d}]=Dt({moneyValue:ti(r,2e5),monthsValue:li(r,Fa),isAnnuity:Boolean(r?.isAnnuity),isInsurance:Boolean(r?.isEnableInsurance),isSalaryClient:Boolean(r?.isEnableSalaryClient),isPensionClient:Boolean(r?.isEnablePensionClient),isStateEmployee:Boolean(r?.isEnableStateEmployee)}),m=Ni(s,t,i),h=Ci({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")}),{onChange:u}=d("moneyValue"),{onChange:p}=d("monthsValue");return a((()=>{u&&u(Rn(s.moneyValue,m.minSum,m.maxSum))}),[m.minSum,m.maxSum]),a((()=>{p&&p(Rn(s.monthsValue,m.minMonths,m.maxMonths))}),[m.minMonths,m.maxMonths]),o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Сумма кредита, ₽",step:500,min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),wi({title:"Срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Ti({...m,...i},d),o("div",{className:"sm:hidden",children:h})]}),rateChildren:Qa({rate:m.rate}),resultChildren:c("div",{children:[o(Oa,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:h}),Ye(l,{isVertical:!0}),Ga(n)]})})})),Ti=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ln,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ln,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ln,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ln,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ii=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Bi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows?.[0]?Ri(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Vi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Vi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&di(n,["minSum","maxSum"],t)&&di(a||i,["minMonths","maxMonths"],t)))||Wa,{rate:c}=o,d=Mi(c,e),m=n+d,h=t?.rateRows||[Wa];return{...o,...ci(["minSum","maxSum"],h),...ci(["minMonths","maxMonths"],h),availableMonths:Ii(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:d,finalSum:m}},Mi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Vi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],Ri=(e,t)=>e+Math.round((t-e)/2),Pi=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s}=e,[d,{field:m}]=Dt({moneyValue:ti(s,2e4),monthsValue:li(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Bi(d,l,r),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Rn(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(ei,{className:t,inputChildren:c("div",{children:[Za({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),wi({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),zi({...h,...r},m)]}),rateChildren:Qa({rate:p}),resultChildren:c("div",{children:[o(Oa,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(Oa,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ye(n,{isVertical:!0}),Ga(i)]})})})),zi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?si({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ri({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Ai=e=>Di({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Di({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Di=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],ji=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Ua],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Ai({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=oi(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=oi(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Ai({row:e,userInputParams:t,paramsViewSettings:l})&&di(n+r,["minSum","maxSum"],e)&&di(i,["minSumOld","maxSumOld"],e)&&di(r,["minSumExtra","maxSumExtra"],e)&&di(a,["minMonths","maxMonths"],e)))||Ua)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=vi(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},Ei=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Dt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=ji(i,t,a),d=Ci({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),Za({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),wi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),Li({...s,...a},r),s.isExtraMoney?Za({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Qa({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(Oa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(Oa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ye(l,{isVertical:!0}),Ga(n)]})})})),Li=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ln,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ln,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ln,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$i={CreditCalculatorForm:Si,DepositCalculatorForm:Pi,BusinessDepositCalculatorForm:gi,BonusCalculatorForm:Ja,RefinancingCalculatorForm:Ei},Oi=St((({className:e,calculatorTabs:t=[],...l})=>o(x,{className:e,defaultPadding:"p-0",...l,children:_i(t)}))),Fi=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in $i))return null;const l=$i[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(S,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},_i=e=>{if(!e||!e.length)return null;return 1===e.length?Fi(e[0]):e.map(((e,t)=>o(La,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o($a,{isUnfolded:t,children:Fi(e)}),renderFoldButton:Ui(e)},t.toString())))},Ui=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(Y,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Ee,{align:n,color:"text-white",children:e.nav?.title}),o(Ee,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(Y,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Hi=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Vn(e,{normalize:(e=a)=>l&&n?String(Rn(Number(Wi(e)),l,n)):Wi(e),format:lt(r)}),d=i((e=>t&&t(Wi(e))),[t]);return o(Ot,{onChange:d,...s,...c})})),Wi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ki=d((e=>o(Hi,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ee,{size:"text-xl",font:"font-light",children:"₽"})})}))),qi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Gi={amount:1500},Yi=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...d})=>{const[{amount:m},{field:h}]=Dt(Gi),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(S,{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:qi[s],children:[o(Ki,{valid:!u,placeholder:i,label:l,max:3e5,min:1,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),r?.text?o(dn,{className:"w-full mt-lg",type:"submit",disabled:u,children:r.text}):null]})]})})),Xi=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qi=d((({className:e,disabled:t,...l})=>o(ye,{rounded:!0,className:p("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,...l,children:o(ae,{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"})}))),Zi=d((e=>o(Qi,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Ji=d((e=>o(Qi,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),er="absolute top-[calc(50%-24px)] z-40",tr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=i((()=>{a?(d&&t!==l-1&&h(),r()):h()}),[h,r,a,d,t,l]),b=i((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[nr(e),g?o(Zi,{className:p(er,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Ji,{className:p(er,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),nr=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(tr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(tr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ar=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ir=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(T,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),rr="relative h-full",sr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},or=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(mr);return A({...n,renderProps:(n,a,r)=>c("div",{className:cr(n,{someCardsHighlighted:i}),children:[R(n,a,{className:dr(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),mr(n)?ir({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},cr=(e,{someCardsHighlighted:t})=>p(rr,t&&(mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),dr=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(rr,"min-w-80",sr[n],t&&(mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ar(l),l&&"h-full"),mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hr=St((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,isEmbedded:s=!1,cardSize:d="normal",...m})=>{const{blocks:h=[]}=m.block||{},u=t||h?.length,[g,{inc:f,dec:b}]=Xi({itemCount:u,visibleItemCount:l},Math.floor(l/2)),[y,v]=Pa({itemCount:u}),[N]=v.visibleIndicesRange,w=h&&"CarouselBankHistoryCard"===h[0]?.type;return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:"p-6xl",...m,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(ya,{containerRef:y,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:or({noCardBorder:n,activeIndex:g,cardSize:d,...m})}),o(lr,{scroll:v,arrowsPadded:i,onScrollLeft:b,onScrollRight:f,hasEdgeBlocks:w,activeIndex:g,itemCount:u})]}),o(Ca,{className:"@5xl:hidden",containerRef:y,activeIndex:N,dotCount:u,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),ur=d((({title:e,description:t,className:l})=>o(x,{className:l,defaultPadding:"p-6xl",children:o(B,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),pr="z-10 border border-solid w-full h-full",gr=p(pr,"absolute hidden @xl:block border-transparent"),xr=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(gr,"top-9 right-12 bg-green-dark")}),o("div",{className:p(gr,"top-6 right-8 bg-green")}),o("div",{className:p(gr,"top-3 right-4 bg-green-light")}),c("div",{className:p(pr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ye([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),fr={black:"bg-black",white:"bg-white"},br=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(B,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ae,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Ye([i],{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(Ee,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(yr)]}):null,a?c(Ee,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),yr=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${fr[e]}`},String(t)),vr="20",Nr="absolute w-full h-full border border-white",wr=d((({className:e="",icon:t,...l})=>{const n=ue(),{text:a,href:i,target:r,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:i,target:r,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ae,{imageClassName:"text-green-dark",image:t,width:vr,height:vr}):null,o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ae,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"color"},imageClassName:"group-hover/link:text-primary-main",width:vr,height:vr})]}),o("div",{className:p(Nr,"-bottom-1 -left-1")}),o("div",{className:p(Nr,"-bottom-2 -left-2")})]})}):null})),kr=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row sm:items-center gap-s justify-between",children:[c("div",{children:[o(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Cr(n,"sm:self-end sm:pt-s"):null]})}))),Cr=(e,t="")=>{const l=Math.ceil(e.length/3);return o(hr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,isEmbedded:!0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:"flex flex-wrap gap-2xs sm:gap-0 sm:justify-center",children:e.slice(3*l,3*(l+1)).map(((e,t)=>o(wr,{...e},String(t))))},String(l))))})},Sr=d((({className:e="",href:t,target:l,isRemote:n=!1,onClick:a,children:i})=>{const r=ue({isRemote:n})({href:t,target:l,onClick:a});return o(t?"a":"div",{className:p("block",e),...t?r:{},role:t?"link":"none",children:i})})),Tr=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],Ir=e=>Tr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Br=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=Ir(t),o=Ge(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=p("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),r?o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Mr=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=false,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Sr,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(B,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ct(Ge(i)?o(ae,{image:i}):null,f),buttons:d.length?o(Br,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(qe,{benefits:g}),o(tt,{items:r,isDotted:s,listItemSize:"S"}),Vr(n,u)]})})}))),Vr=(e,t)=>e?o(T,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Rr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Ee,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Ee,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ye(a)}):null]},String(t))},Pr=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const d=r.map(Rr),[m,h]=i>0?[d.slice(0,i),d.slice(i)]:[d,[]];return c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ge(n)?o("div",{className:"self-center",children:o(ae,{image:n})}):null,t?o(S,{className:p("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ye,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(La,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o($a,{isUnfolded:e,children:h})]}),renderFoldButton:r.length>1?zr:null}):o("div",{children:m})]})})),zr=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(Y,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ar=(e=!1)=>e?"text-white":"",Dr=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),jr=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(ae,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(ae,{image:t})}),l?o(S,{headingType:"h4",className:Ar(a),title:l}):null,n?o("div",{className:Dr(a),children:n}):null]}))),Er=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:p("h-full","border-main-divider border-b"),children:e?e.map(Or(l,t)):null})}))),Lr=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$r=(e=!1)=>""+(e?"text-white":""),Or=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(T,{size:"text-s",color:Lr(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(T,{size:"text-s",align:"text-right",color:$r(e),children:l})}):null,n?o("div",{className:"text-right",children:o(T,{size:"text-s",color:Lr(e),children:n})}):null]})]},String(a)),Fr=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:p("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(jr,{...e,isFillGradient:n}),r?.length?r.map((({rowHeader:e,cell:t},l)=>o(Er,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ye,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,_r({onToggleColumn:i,isFillGradient:n,showRow:a})]})})})),_r=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Ee,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),Ur=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(S,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(Hr,{...e})})]})})),Hr=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:r,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=i((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=i((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},i)=>{return o(Fr,{visibleRowLength:a,showRow:c[i],header:n,columnData:(r=e,r?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===i&&l,onToggleColumn:()=>m(i),...s},String(i));var r}));return o("tbody","horizontal"===r?{children:o(za,{onVisibleIndicesChange:h,children:u})}:{children:u})})),Wr=e=>e%2!=0,Kr=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),qr=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>o(Kr,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Ee,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Gr=({isUnfolded:e,onToggle:t})=>o(qr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Yr=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ae,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:da})]}))),Xr=["ArrowDownIcon","ArrowUpIcon"],Qr="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Zr=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...i})=>{const[r,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(Yr,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(Qr),children:[z(r,{...i.options,parent:n}),Wr(r.length)?o(It,{className:"col-span-6",...i}):null]}),o(La,{renderFoldableSection:({isUnfolded:e})=>c($a,{className:p(Qr),isUnfolded:e,children:[z(s,{...i.options,parent:n}),Wr(s.length)?o(It,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(qr,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Xr[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),Jr=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(_n,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),es=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>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-5xl",children:[a,Object.entries(l).map(ts(e))]}),n?o("div",{children:o(dn,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ts=e=>([t,l])=>{const n=l?.type;return"array"===n?ls(t,e)(l):null},ls=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(Jr,{items:n,multiple:!l?.single,...t(e)})]},e)};function ns(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const as=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,is=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>as(t[e])||as(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||rs(t[e])<=rs(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>as(t[e])||as(l[e])||rs(t[e]?.min)>=rs(l[e]?.min)&&rs(t[e]?.min)<=rs(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>as(t[e])||as(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),rs=e=>Number(e||0),ss=(e,{block:t,page:l,normalize:n=At})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Dt(e),d=r((()=>ns(a,a.map((e=>kt(e.content,l?.fallback))))),[a,l?.fallback]),m=i===e?a:((e,t)=>(l=At)=>e?.filter((([,e])=>is(t,l(e)||{}))).map((([e])=>e)))(d,i)(n);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},os=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),ds=1e9,ms={sum:{min:1e4,max:ds},period:3},hs=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=ss(ms,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:us(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=ps(h),g=c("div",{children:[o(Ki,{label:n?.title,min:500,max:ds,...d("sum",{parse:e=>({min:Number(e),max:ds}),format:({min:e})=>String(e)})}),o(jn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[es({field:d,reset:m,filtrationSchema:t,resetButton:l,children:g}),o(Zr,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),us=e=>vt((e?.paramsSource?.rateRows||[]).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))),ps=e=>vt(e.flatMap((e=>e||[])).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],gs=e=>"Image"===e?.contentType&&e?.image?o(ae,{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,xs=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:gs(n)}),o(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),fs="location";function bs(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(h,"location",vs()??{name:e}),r=i((e=>{Ns(e),l(e)}),[]),{data:s}=Vl(ys()?null:"/api/v1/region",yt);return a((()=>{s&&!ys()&&l(s)}),[s]),[t??{name:e},r]}const ys=()=>Boolean(globalThis.localStorage?.getItem(fs)),vs=()=>{try{const e=globalThis.localStorage?.getItem(fs);return e&&JSON.parse(e)}catch(e){return null}},Ns=e=>{try{globalThis.localStorage?.setItem(fs,JSON.stringify(e))}catch(e){}};var ws;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ws||(ws={}));const ks=new Intl.NumberFormat("ru",{style:"currency",currency:ws.RUB}),Cs=e=>e?ks.format(e):"",Ss="text-left text-m font-light text-secondary-text",Ts=`${Ss} pl-5xl`,Is={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Bs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Ss,children:o(Ee,{size:"text-m",children:"Валюта"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Купить"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:Is[t]},width:"24",height:"24"}):null,o(Ee,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Vs={icon:"GpsIcon"},Rs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(ha,{...Vs,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(T,{size:"text-l",color:"text-primary-main",children:t}):null,o(T,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Ps=(e,t,l)=>{const n=Number(zs(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),As=e=>{return(t=[[e=>e.value!==ws.RUB&&e.oppositeValue!==ws.RUB,()=>e.handleConvert(e.value,ws.RUB)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.USD)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.CNY)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function Ds(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Ot,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(Gt,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const js=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ws.RUB,selectBuy:l?.[0]?.currency?.currency||ws.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[Ds({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:Es(r,d,l),value:r.inputSell,setValue:e=>$s(d,l)(e,r.selectSell,r.selectBuy)}),Ds({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Ls(r,d,t),value:r.inputBuy,setValue:e=>Os(d,t)(e,r.selectBuy,r.selectSell)}),a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),Es=(e,t,l)=>n=>{t({selectSell:n}),As({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{$s(t,l)(e.inputSell,n,a)}})},Ls=(e,t,l)=>n=>{t({selectBuy:n}),As({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>Os(t,l)(e.inputBuy,n,a)})},$s=(e,t)=>(l,n,a)=>{e({inputSell:zs(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputBuy:String(Ps(l,i,n===ws.RUB)||"")})},Os=(e,t)=>(l,n,a)=>{e({inputBuy:zs(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputSell:String(Ps(l,i,n===ws.RUB)||"")})};const Fs=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=bs(),i=function(e){const t=e?.code||"000",{data:l}=Vl(`/api/v1/exchangerates?regionCode=${t}`,yt);return l||{}}(a),r=_s(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ws.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:ws.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[r?o(Bs,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(Rs,{address:i?.address})]}),r.length&&s.length&&d.length?o(js,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),_s=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Us=(e,t)=>o(ha,{...e,iconBgVersion:t,className:"shrink-0"}),Hs=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Kr,{tag:"button",className:p("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Us(a,t),e?o(Ee,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(Y,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),Ws=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>o(x,{className:p("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(La,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o($a,{className:p("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:A({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ks({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),Ks=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(Hs,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):o(qr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},qs=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Gs):null,o(ye,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Gs=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Ee,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Ys)})]},String(t)),Ys=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Xs(e.type,e.text)}),o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Xs=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Qs(t)}`,children:o(Ee,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Qs=e=>e.replaceAll(/\D/g,""),Zs=["split_version","New","Old"],Js=d((({className:e="",index:t,text:l,...n})=>{const a=ue(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:p("",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),eo=d((({title:e,links:t,className:l=""})=>c("div",{className:p("flex flex-col gap-4",l),children:[o(Ee,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(Js,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),to=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:p("flex flex-col",e),children:t.map(lo(l))}):null)),lo=e=>(t,l)=>{const{text:n,...a}=t,i=ue({isRemote:!(!E.BASE_PATH||!e)&&!E.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:c}=i(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},no=d((({className:e="",index:t,...l})=>{const n=ue({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),ao=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(Ee,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(no,{index:t,...e},String(t))))}):null]}))),io=St((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=i((()=>{const[e,t,l]=Zs;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:ro(n)}),o(qs,{className:"overflow-hidden",items:r}),c("div",{className:"mt-xl",children:[o(Br,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(so)}),o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(Js,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(eo,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(ao,{links:h})]})})),ro=e=>e?.filter((e=>e.icon)).map(((e,t)=>o(Ws,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(to,{items:e.items,basePath:D(e.href)})},String(t)))),so=({href:e="/",text:t},l)=>{const{label:n}=Ir(e);return o(ye,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},oo={width:"34",height:"34"},co={"bg-white":"color",transparent:"white"},mo={"bg-white":"text-primary-main",transparent:"text-white"},ho=(e,t,l)=>o(ae,t?.src?{image:t,className:mo[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:co[e]},className:mo[e],width:l?.width,height:l?.height}),uo={"bg-white":"text-primary-text",transparent:"text-white"},po=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[ho(i,l?.image,oo),r?n??o("div",{className:"ml-s",children:o(Ee,{font:"font-medium",color:uo[i],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),go={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},xo=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const r=u(),s=E.BASE_PATH?.startsWith(r.pathname),d=i((()=>{r.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(po,{className:"my-2xs",bgColor:e,logo:t})}):fo(d),n?o("div",{children:o(ye,{href:n,ariaLabel:"Войти",target:"_blank",className:p("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",go["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),fo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(ae,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),bo={"bg-white":"primary",transparent:"transparent"},yo=St((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=bo[e],portal:n,...a})=>{const{logo:i}=a.options?.page?.sitemap??{},{internetBankUrl:r}=n||{};return o(x,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(xo,{bgColor:e,logo:i,alwaysShowLogo:t,internetBankUrl:r,version:l,...a})})})})),vo={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},No=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",vo[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:A({...c,extraProps:{className:p("w-full",ar(r)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),wo=St((e=>o(No,{...e})),{childrenTypes:[]}),ko=d((e=>{const{className:t,image:l,...n}=e;return o(x,{className:t,defaultPadding:"p-0",...n,children:o(ae,{image:l})})})),Co=["байт","Кб","Мб","Гб","Тб","Пб"],So=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",d=a?String(a):"";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:l,target:n,children:[e,t?c(Ee,{size:"text-l",font:"font-light",children:[t," ",To(s,d),o(Ee,{color:"text-secondary-text",children:l&&`${s+r+d}`})]}):null]})})),To=(e,t)=>e||t?o("span",{children:", "}):"",Io={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Bo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Io[r]),role:"list",children:a.map(Mo(d,i))}):null]})})),Mo=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?K(e)(l?.attachment?.src):l?.href,i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${Co[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Vo(a):l?.fileFormat;return o("div",{role:"listitem",children:o(So,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?o(ae,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Vo=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Ro=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const g="secondary"===h?"p-m min-w-32":"min-w-24",f=i?.src?o(ae,{className:"hidden lg:block",image:i}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:h,...u,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(S,{headingType:"h3",title:m,className:p("whitespace-pre-wrap",l)}),rightImage:f,buttons:Ye(n,{className:"flex-wrap"}),children:[a?o(Ee,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(tt,{items:r,listItemSize:"M"}),o(Ee,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",g),children:o(ae,{className:"w-fit",image:s})}):null,i?.src?o(ae,{className:"lg:hidden",image:i}):null]})]})})})),Po={primary:"bg-white/30",secondary:"bg-main-divider"},zo={primary:"text-white",secondary:"text-secondary-text"},Ao=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",Po[t]),role:"status",children:o(Ee,{size:"text-xs",color:zo[t],children:e})}))),Do=(e=[],t={})=>e.filter((({content:e={}})=>is(t,e))).length,jo=(e,t)=>e===t;const Eo=(Lo=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(jo,((e=jo)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>Lo(l,t[e])))));var Lo;const $o=[],Oo={},Fo={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},_o={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Uo={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Ho={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Wo=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...d}=t;return o(i,{className:p("h-12","block flex-1","cursor-pointer",Fo[n],l?Ho[n]:Uo[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?_o[n]:"text-secondary-text hover:text-primary-main"),children:[o(Ee,{size:"text-m",children:r}),s?o("div",{className:"ml-xs",children:s}):null]})})})),Ko=d((e=>o(e?.item?.href?qo:Go,{...e}))),qo=d((e=>{const t=ue(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Wo,{...e,tag:"a",item:a,onClick:n})})),Go=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(Wo,{item:e,onClick:n,...l})})),Yo=(e,t,l)=>(n,a)=>o(Ko,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Xo=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Yo(n,a,t))}))),Qo={categories:[],extraOptions:[],propertyType:[],stage:[]},Zo=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ss(Qo,{block:a.block,page:a.options?.page}),g=i(((e=Qo)=>u(e)),[]),f=(({hotFilters:e=$o,filtrationState:t=Oo,blocks:l=$o,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Eo(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:o(Ao,{version:t===e[a]?"primary":"secondary",count:Do(l,t.filter)})})))),[e,l,a]),c=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Xo,{...f}),es({field:m,reset:h,filtrationSchema:l,resetButton:n}),o(Zr,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function Jo(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const ec={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},tc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ec).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),lc=e=>globalThis[e];const nc=()=>function(e,t){const[l,r]=n(),s=i((()=>r(lc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),r(void 0)}}if(!lc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ac={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},ic=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(ac).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:l,width:"20",height:"16"})})})),rc={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},sc=[55.753995,37.614069],oc=d((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=nc(),[d,m]=n();if(a((()=>{i?.current?r&&(Jo(r,i.current,e),e?.length||i.current.setCenter(sc)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?cc(e):sc,zoom:l,controls:[],suppressMapOpenBlock:!0}),Jo(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(rc),h,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(Y,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(ic,{yandexMaps:i}),o(ic,{yandexMaps:i,direction:"out"})]}),tc(i.current,r,p("right-2 top-80",h))]})})),cc=e=>[mc(dc(e,0)),mc(dc(e,1))],dc=(e,t)=>e.map((e=>e.coords[t])),mc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,hc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему"},uc="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",pc=(e,{field:t,reset:l},n=3)=>{const a=(e||[]).map((e=>o(ln,{text:hc[e],...t(e)},e))),[i,r]=n>0?[a.slice(0,n),a.slice(n)]:[a,[]];return o("div",{children:e?.length?o("div",{children:r.length>0?o(La,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:uc,children:i}),o($a,{className:uc,isUnfolded:e,children:r})]}),renderFoldButton:gc(l)}):o("div",{className:uc,children:i})}):null})},gc=e=>({isUnfolded:t,onToggle:l})=>c("div",{className:"flex",children:[o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0 mr-lg",appendRight:o(Y,{name:["ArrowDownIcon","ArrowUpIcon"][Number(t)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(t)],onClick:l}),o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,text:"Очистить фильтр",appendRight:o(Y,{name:"CloseIcon",width:"16",height:"16"})})]}),xc=()=>{},fc=()=>[],bc=e=>"all"===e?"block":"hidden",yc=d((({className:e,data:t=[],renderCard:l=xc,filterItems:a=fc,getBalloon:i=xc,initFilterState:s={},descriptionData:d,title:m})=>{const[h,{field:u,reset:g}]=Dt(s),[x,f,y]=r((()=>{const e=a(t,h),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,h]),[v,N]=n("all");return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(S,{headingType:"h2",children:m}),y?o(Ee,{size:"text-h2",color:"text-secondary-text",children:`(${y})`}):null]}),d?Nc(d):null,vc(t,v,N),o("div",{className:p("pb-2xl",bc(v)),children:pc(Object.keys(s),{field:u,reset:g})})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(oc,{points:f,className:"h-full"})})})]}),x.map(l)]})})),vc=(e,t,l)=>{const n="business"===t?"primary":"secondary",a=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex pb-lg",children:[o(dn,{className:"mr-m","data-id":"all",onClick:t=>a(t,"all",e),version:"all"===t?"primary":"secondary",children:"Для физических лиц"}),o(dn,{"data-id":"business",onClick:t=>a(t,"business",e),version:n,children:"Для юридических лиц"})]})},Nc=({__html:e,list:t})=>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(De,{__html:e})}):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(ae,{image:e.image}):null,e?.text?o(Ee,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,wc={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},kc=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",wc[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ae,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ee,{size:"text-m",color:wc[l].text,children:t})]}))),Cc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Sc({textItems:a,subText:t,children:l,...n})})),Sc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>c("div",{className:p("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Ee,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>o(Ee,{size:"text-l",children:e.trim()},String(t)))),a?o(Ee,{color:n,size:"text-m",children:a}):null]}),Tc=d((({className:e,children:t})=>o("div",{className:p("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Ic=["ArrowDownIcon","ArrowUpIcon"],Bc=["Подробнее","Скрыть"],Mc=({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:Bc[Number(e)]}),o(Y,{className:"text-primary-text",name:Ic[Number(e)],width:"16",height:"16"})]}),Vc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:zc(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];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(Ee,{size:"text-h4",children:zc(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),o(kc,{color:"green",children:zc(s)})]}),o("div",{className:"hidden sm:block",children:o(Tc,{className:"flex-wrap",children:m?.map(Pc)})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o($a,{isUnfolded:e,children:o(Tc,{className:"flex-wrap",children:m?.map(Pc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Mc({isUnfolded:e,onToggle:t})})]},String(d))},Rc=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${zc(t)} №${l}`,body:e.toUpperCase()}),Pc=(e,t)=>o(Cc,{...e},String(t)),zc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Ac=[];const Dc=async e=>{const t=await bt(e,{method:"GET"});return Array.isArray(t)?t:Ac},jc={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Ec={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Lc=d((({data:e,className:t})=>{const[l]=bs(),n=function(e){const{data:t=Ac}=Vl(`/api/v1/atms?regionCode=${e}`,Dc);return t}(l?.code??"000");return o(yc,{className:t,filterItems:$c,data:n,initFilterState:jc,renderCard:Vc,getBalloon:Rc,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),$c=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>Ec[t](e))),l=!n.length||n.some((t=>Ec[t](e)));return t&&l}))},Oc=e=>{const t=_c(e);return o(Cc,{label:"Режим работы",value:t,className:"max-w-none"})},Fc=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",_c=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Fc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Fc({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},Uc=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Hc=e=>Uc.map((([t,l,n])=>({key:t,title:n,short:l,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??"")}}))),Wc=e=>{if(!e)return null;const t=Kc(e);return c(Tc,{className:"border-none",children:[o(Cc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(qc)})}),o(Cc,{label:"Режим работы",className:"max-w-none",children:o(Ee,{children:e})})]})},Kc=e=>{const t=Uc.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},qc=({short:e,status:t},l)=>o("div",{className:p("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(Ee,{size:"text-xs",children:e})},String(l)),Gc=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Cc,{label:"Валюта",value:e.currency}):null,t?o(Cc,{label:"Купить",value:String(t)}):null,l?o(Cc,{label:"Продать",value:String(l)}):null]},String(n)),Yc=(new Date).getDay(),Xc=e=>{const[t]=e?.slice(Yc-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(kc,{color:"green",children:a}):null,l&&i?o(kc,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(kc,{color:"red",children:"Выходной"})},Qc=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Zc=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Cc,{label:e,value:t&&l?l:"",subText:Qc({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),Jc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ed=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${e}</p>`,td=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ld=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Hc(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(Ee,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),Xc(u)]}),o("div",{className:"hidden sm:block",children:nd({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o($a,{isUnfolded:e,children:nd({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Mc({isUnfolded:e,onToggle:t})})]},String(h))},nd=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=Hc(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Tc,{className:"flex-wrap",children:[o(Cc,{label:"Факс",value:t}),o(Cc,{label:"Телефон филиала",value:e}),o(Cc,{label:"Для обращений юридических лиц",value:l}),o(Cc,{label:"Обслуживание физических лиц",value:n}),o(Cc,{label:"Для консультаций по валютному контролю",value:i}),o(Cc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?o(Tc,{children:o(Cc,{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(Zc)})})}):c(Tc,{children:[o(Cc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(qc)})}),Oc(d)]}),r?.businessScheduleVisibleTag?Wc(r?.businessScheduleDescription):null,s?.currencies?.length?o(Tc,{className:"flex-wrap",children:s?.currencies?.map(Gc)}):null]})},ad=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=Hc(e),l=e?_c(t):"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&!e.businessScheduleDescription?Jc(l):ed(l):td(l):null})(l)}`;return{header:n,body:i}},id=[];const rd=async e=>{const t=await bt(e,{method:"GET"});return Array.isArray(t)?t:id},sd={workingSaturday:!1,premiumService:!1,privateBanking:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},od={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday),premiumService:e=>Boolean(e.workSchedule?.premiumService),privateBanking:e=>Boolean(e.workSchedule?.privateBanking),sellingCoins:e=>Boolean(e.workSchedule?.sellingCoins),buyingCoins:e=>Boolean(e.workSchedule?.buyingCoins),bullionOperations:e=>Boolean(e.workSchedule?.bullionOperations),preciousMetalsOperations:e=>Boolean(e.workSchedule?.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean(e.workSchedule?.transferringDataToBiometricSystem)},cd=d((({className:e})=>{const[t]=bs(),l=function(e){const{data:t=id}=Vl(`/api/v1/branches?regionCode=${e}`,rd);return t}(t?.code??"000");return o(yc,{className:e,filterItems:dd,data:l,initFilterState:sd,renderCard:ld,getBalloon:ad,title:`Офисы филиала ${t?.name}`})})),dd=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>od[t](e)))))},md=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(cd,{}):o(Lc,{data:e})})})),hd=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),ud=d((({className:e,padding:t,slides:l=[],...n})=>o(x,{className:p("overflow-hidden relative",e),padding:t,...n,children:o(za,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(ot,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),pd=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(x,{className:p("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ge(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:r})}):null,s?o(S,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?gd(i):null,xd({label:"Адрес",data:e,iconName:"GeolocationIcon"}),xd({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),xd({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ye([n]):null]})]}))),gd=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{__html:e})}),xd=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(Y,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ee,{size:"text-xl",color:n,children:t})]})]}):null,fd=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(De,{__html:t,richVersion:l})})})),bd=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(Xn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Xn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),yd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(Gt,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),vd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(yd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(yd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Nd=["От 1 дня","До 365 дней"],wd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ee,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(jn,{min:1,max:365,value:e,items:Nd,onChange:t})]}))),kd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(yd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(yd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Cd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(vd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Sd(m)}),o(wd,{days:a,setDays:e=>m({days:e})}),o(kd,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Td(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ee,{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(bd,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Sd=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Td=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Id=d((({days:e,tariffs:t=[]})=>{const l=Md(e,t),n="На рисунке изображена пачка листов\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:[Bd("Аренда за",e),Bd("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),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(ae,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(T,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),Bd=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ee,{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})]}),Md=(e,t)=>{const l=Vd(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Vd=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},Rd=(e,t)=>e.find((e=>e.branchCode===t)),Pd=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=Rd(n,l.selectedBranch),d=zd(s?.safeBoxCaseVolumes),m=Ad(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=Dd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Cd,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Id,{days:l.days,tariffs:h})]})})),zd=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ad=(e,t)=>e?.find((e=>e.volume===t)),Dd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,jd=[];const Ed=async e=>await bt(e,{method:"GET"})||jd,Ld=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=ql(),p=$d(m.selectedRegion,u),g=function(e){const{data:t}=Vl(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ed);return t||jd}(p),f=i((e=>h((t=>({...t,...e})))),[h]),b=(y=Rd(g,m.selectedBranch)||g,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(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Pd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(T,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(oc,{points:b,className:"h-[640px]"}):null]})})),$d=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Od(e){throw new Error(e)}const Fd={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},_d={normal:"",small:"min-h-6xl"},Ud={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"},Hd=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...d})=>c(x,{className:p("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(Wd(i,r))})}):null,Ye(a,{isVertical:!0})]}))),Wd=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return Kd(e,t)(l,n);case"rte":return o(De,{__html:l.__html});default:Od(l)}},Kd=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:qd(e,t)(l,n)}),c("div",{className:p("flex flex-col justify-center h-fit",_d[e]),children:[l.label?o(T,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:p("text-s font-light text-left",Ud.description),children:l.description}):null]})]})},String(n)),qd=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",i=Boolean(l?.icon?.src),r=Fd[e][i?"image":"icon"],s=i?"transparent"===t:t;return o(x,{className:p(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:Ge(l?.icon)?o(ae,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Gd(e),height:Gd(e)}):o("span",{className:p("text-h4","transparent"===t?Ud.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},Gd=e=>"normal"===e?"38":"24",Yd=e=>({href:t})=>!!t&&F(Xd(t,e)).startsWith(F(t)),Xd=(e,t)=>L(e)?t.href:t.pathname;function Qd(e=[]){const t=u(),l=e.findIndex((e=>Yd(E.BASE_PATH?{pathname:E.BASE_PATH}:e))(t));return[l,e[l]]}const Zd=d((({isActive:e,onClick:t})=>c("button",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(Y,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),Jd=d((({isActive:e,item:t,onClick:l})=>{const n=ue({isRemote:!0}),{href:a,onClick:i}=n({href:t?.href,onClick:l});return c("a",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:i,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const em=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Od(e)}}))),[c,d]),l},tm=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ae,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),lm=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=me(),r=i((()=>{a(),n&&n()}),[n]);return c("div",{className:p("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(tm,{className:"absolute top-0 right-0",onClose:r}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),nm=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const am=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(Ee,{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(im,{...e},String(t))))})]}):null,im=d((({icon:e,...t})=>{const l=ue(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),rm=e=>t=>t.name?o(Sr,{isRemote:!0,href:`/branches/${t.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>{e&&e(t)},children:o(Ee,{size:"text-l",font:"font-light",children:t.name})},String(t.id)):null,sm=d((({className:e,searchTerm:t,onSearch:l})=>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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),om=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=bs(t),r=ue({isRemote:!0}),{href:s}=r({href:`/branches/${l.slug}`}),[d,m]=n(""),h=dm(ql()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,cm),{close:p}=me(),g=i((e=>{a(e),p()}),[]);return c(lm,{className:"pb-20",head:c("div",{children:[o(Ee,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(T,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Sr,{isRemote:!0,href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(sm,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&nm(e.toLowerCase())(d.toLowerCase())>=.8)).map(rm(g))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(u.entries()).map((x=g,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ee,{size:"text-h6",children:e})}),t.map(rm(x))]},e)))}),am(e)]});var x})),cm=e=>e.name?.charAt(0)||"",dm=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),mm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ae,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})}));function hm(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const um=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},pm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),gm=e=>t=>e.map((([e,l])=>[nm(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>fm(t,e))).reduce(um(Math.max,0),new Map),xm=e=>t=>{return ns(t,t.map((({title:e})=>e)).map((e=>t=>{const l=pm(t||"");return l.length?Pe(e.map((e=>Ia(l.map(nm(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},fm=(e,t)=>new Map(e.map((e=>[e,t]))),bm=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=Vl(e?.length?e:null,ym),[s,o]=n(null);return hm((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=pm(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(gm(i)).reduce(um(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return xm(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},ym=async(...e)=>(await Promise.allSettled(e.map((e=>bt(_(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),vm=["all","footer"],Nm=d((({className:e,topItems:t})=>{const l=ue({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.filter(Cm).map(l).map(wm)})})),wm=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter(Cm);return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(km,{...e,basePath:D(a),index:t},String(t))))]},String(t))},km=d((({text:e,index:t,basePath:l,...n})=>{const a=ue({isRemote:!(!E.BASE_PATH||!l)&&!E.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),Cm=e=>!e.displayArea||vm.includes(e.displayArea.toLowerCase()),Sm=d((({initialQuery:e,topItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=bm({basePathList:l,initialQuery:e}),i=r((()=>Tm(t)(n)),[t,n]);return o(lm,{head:o(mm,{autoFocus:!0,...a}),children:o(Nm,{topItems:i})})})),Tm=e=>t=>e?.length&&t?.length?ns(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:_("/",t)})))}))):[],Im=d((({className:e,...t})=>{const[l,a]=n(""),r=i((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=me();return{open:(l={},n={})=>t(o(Sm,{...e,...l}),n),close:l}})(t),d=i((e=>{a(e),Bm(e)&&s.open({initialQuery:e},{onClose:r})}),[r,s]);return c("div",{className:p("relative",e),role:"search",children:[o(mm,{value:l,onChange:d}),o(tm,{className:"absolute top-0 right-0 sm:hidden",onClose:r})]})})),Bm=e=>e&&e.length>=3,Mm=d((({item:e,basePath:t})=>{const l=ue({isRemote:!(!E.BASE_PATH||!t)&&!E.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:i}=l(e),r=u(),s=Yd(r)({href:n});return c("a",{className:p(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:i,children:[e.text,o(ae,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),Vm=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:p("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Rm=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=bs(l),m=(e=>{const{open:t,close:l}=me();return{open:(l={})=>t(o(om,{...e}),l),close:l}})(e),[h,u]=Pa({itemCount:t?.length??0}),[p]=Qd(t),[g,x]=n(p),f=r((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=i((e=>x(e)),[]);return o(lm,{head:o("div",{className:"flex items-center",children:o(S,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(ya,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(Vm,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[Pm(b,f?.href),o(Im,{className:"grow mb-5",...e}),zm(s),Am(d,(()=>m.open()))]})]})})})),Pm=(e,t)=>e?o("div",{children:e.map(((e,l)=>o(Mm,{item:e,basePath:t},String(l))))}):null,zm=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(ae,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Am=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(ae,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Ee,{size:"text-h5",children:e.name}),o(Ee,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),Dm="burgerMenuDialog",jm=e=>{const{open:t,closeAll:l,close:n}=me(),a=em(),i=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Dm,a),r=()=>t(o(Rm,{...e}),{id:Dm});return[i,{open:r,close:n,toggle:()=>{i?l():r()}}]},Em=[],Lm=St((({sticky:e,...t})=>{const{menuItems:l=Em}=e??{},[n,{toggle:a,close:i}]=jm(t.options?.page?.sitemap??{}),[,r]=Qd(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(x,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map($m(r,i)),o(Zd,{isActive:n,onClick:a}),m.map($m(r,i))]})})})),$m=(e,t)=>(l,n)=>o(Jd,{isActive:l===e,item:l,onClick:t},l.href||String(n)),Om="hidden sm:flex absolute z-40 top-0",Fm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Pa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(ya,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(Yo(l,n,a))}),r.canScrollLeft?o(Zi,{className:p("left-6",Om),onClick:r.scrollLeft}):null,r.canScrollRight?o(Ji,{className:p("right-6",Om),onClick:r.scrollRight}):null]})})),_m=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(Xo,{...t});case"centered":return o("div",{className:"flex",children:o(Xo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Fm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Um="tab",Hm=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=r((()=>l.map(Km)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Wm(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=i((e=>{const t=g.indexOf(e),n=l[t];b(t),Wm(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Um,e.name):t.delete(Um),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:_m({items:g,value:g[f],tabsMode:s,onChange:y})})})),Wm=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},Km=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,qm={start:"text-start",center:"text-center",end:"text-end"},Gm=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ae,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),Ym=d((({tab:e})=>{const t=ue(),{onClick:l}=t({...e,onClick:()=>{e.href&&!$(e.href)&&(globalThis.location.href=e.href)}});return hm(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Xm=St((({className:e="",tabs:t=[],block:l,tabAlign:a,...i})=>{const[r,s]=n(Zm(t)),d=Qm(t[r],r),m=t.length,[h,{inc:u,dec:g}]=Xi({itemCount:m},r),[f,b]=Pa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...i,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(ya,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(Jm(r,s,a))}),o(lr,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[r]?.href?o(Ym,{tab:t[r]}):z(l?.slots?.[d],{...i?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Qm)||[],childrenTypes:{exclude:["TabsLayout"]}}),Qm=(e,t)=>e?.title||`Слот №${t}`,Zm=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Jm=(e,t,l="start")=>(n,a)=>o(Gm,{className:qm[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),eh={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},th=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:eh[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),lh=d((({className:e="",isOpen:t,onClick:l})=>o(ye,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),nh={Buttons:({buttons:e})=>Ye(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,List:({isDotted:e,...t})=>o(tt,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ee,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Ee,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(lh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},ah=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return ih({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),ih=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in nh))return null;return o(nh[l],{...t,...n})},rh=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,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(ah,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),sh=(e,t)=>140*Pe(e.slice(0,t).map((e=>e?.cols?.length??1))),oh=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ee,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ch=d((({rows:e})=>{return o(ya,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,i=p("flex duration-1000 text-center",0!==l?"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(Ee,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${sh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ee,{size:"text-xl",children:e.data}):null,e?.cols?oh(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),dh=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;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(Ee,{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(ch,{rows:t.rowsData})})})]},n)}))}))),mh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),hh=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>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:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Ee,{size:"text-xl",font:"font-light",color:mh(t===l),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function uh(e){const t=await fetch(e);return await t.json()}const ph=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Vl(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),uh);return t||{}}(e),[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(hh,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(dh,{activeTabIndex:r,items:m}),o(lh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ee,{size:"text-h6",children:"Данных нет"}),o(lh,{onClick:l,isOpen:!0})]})})),gh=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@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(ph,{...t,onClick:l})}):null]}))),xh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,u]=n(void 0),g=i((e=>u(e)),[]);return c(gh,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:p("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ae,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(th,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(rh,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function fh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(Qi,{className:p("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Qi,{className:p("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const bh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,fh({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),yh=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=Xi({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(xh,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[f,b]=i>0?[g.slice(0,-i),g.slice(-i)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:i>0?o(La,{renderFoldableSection:({isUnfolded:e})=>c(bh,{controls:u,children:[f,o($a,{isUnfolded:e,children:b})]}),renderFoldButton:Gr}):o(bh,{controls:u,children:g})})]})})),vh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?Nh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ee,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?wh(l):null,a?o(De,{__html:a}):null]})]}))),Nh=()=>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"}),wh=e=>o(T,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),kh=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ee,{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,l?o("div",{className:"gradient-color-text",children:o(Ee,{size:"text-h2",children:l})}):null]}))),Ch=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(kh,{prefix:t,unit:l,suffix:n})})})),Sh={AdTile:It,ApplicationForm:wn,ApplicationFormCustom:ra,BenefitsBlock:ua,BonusBenefitsBlock:Da,ButtonsBlock:Ea,Calculator:Oi,CardTransfer:Yi,Carousel:hr,CarouselBankHistoryCard:ur,CarouselCard:xr,CarouselCatalogCard:br,CarouselLinks:kr,CarouselRecommendationCard:Mr,CarouselTariffsCard:Pr,ComparisonTable:Ur,DepositFiltration:hs,ErrorBlock:xs,ExchangeRateTile:Fs,Footer:io,Header:yo,Headline:B,HorizontalLayout:wo,ImgBlock:ko,LinkDocs:Bo,MobileAppTile:Ro,MortgageFiltration:Zo,OfficesAtmsMap:md,Placeholder:hd,ProductBlock:Tt,ProductGallery:ud,RepresentativeOfficeInfo:pd,RichTextBlock:fd,RollupItem:Ws,SafeDepositRental:Ld,StepsBlock:Hd,StickyBottomMenu:Lm,Tabs:Hm,TabsLayout:Xm,TariffsTable:yh,TextBlock:vh,UnitBlock:Ch,VerticalLayout:No},Th="rshb-query-params";function Ih(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Th)||"";return e&&globalThis.sessionStorage?.setItem(Th,e),e}const Bh=he((()=>{a((()=>{Ih()}),[]),Ut(globalThis,"click",Mh)})),Mh=e=>{const t=Vh(e.target),[l]=E._.YANDEX_METRIKA_ID?.split(",").reverse()??[],n=t?.dataset?.ymtarget;if([l,n,globalThis.ym].every(Boolean)&&globalThis.ym(l,"reachGoal",n),L(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=Ih();if(!L(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(t?.href)||t?.href;l&&(globalThis.location.href=l)}},Vh=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Rh="cookie",Ph=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=Et();hm((()=>{globalThis.localStorage?.getItem(Rh)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(Rh,"true"),a()}),[]);return l?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:c(T,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Sr,{isRemote:!0,className:zh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Sr,{isRemote:!0,className:zh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(tm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),zh=e=>p("inline mx-2xs",e?"text-green-dark":""),Ah=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=em({onCloseAll:e,onClose:t}),{close:n}=me(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return Ut(globalThis.document,"keydown",r),a((()=>{l.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"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Dh=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Od(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return Ut(globalThis.document,"keydown",r),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),jh="header",Eh="footer",Lh="sticky-footer",$h={},Oh=d((({className:e,data:t=$h,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=Ct(s,r);Bh();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(a?.header,{...m,slotName:jh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[A({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),z(a?.footer,{...m,slotName:Eh})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:z(a?.["sticky-footer"],{...m,slotName:Lh})}):null,o(Ah,{}),o(Dh,{}),o(Ph,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(Oh,{childrenTypes:[],slots:()=>[jh,Eh,Lh]});e.Blocks=Sh,e.ContentPage=Oh,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=he,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.236",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=U,e.useRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const 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,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t};const h=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{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}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={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","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",r||i,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),k={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>{const i=k[l]||"h3";return o(i,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a})})),T=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={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"}},B=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(S,{className:p("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(T,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...u,children:a}):null]})})),M=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),V=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=M,blocksRegistry:r={},ancestors:s=V}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const P=[],z=(e,{key:t,ancestors:l=P,slotName:n=null,extraProps:a,renderProps:i=R,...r})=>{const s=a?(e,t)=>R(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||P,[r.parent,n]]:l},a)))};function A({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const D=e=>e&&!e.endsWith("/")?`${e}/`:e,j=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return j.includes(t)?D(l):l}}),L=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!L(e)&&(!t||"_self"===t)),O=e=>Boolean(e?.startsWith("#")),_=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var U=Object.freeze({__proto__:null,isURL:L,isLocalURL:$,isHash:O,withoutQuery:_,joinPath:F});const H="/api/",W=`${H}v1/storage`,K=e=>(t,l=E.BASE_PATH)=>{if([!t,L(t),O(t),[E.CDN,H].some((e=>q(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`${W}/${t}/file`;const n=t?.startsWith("/");return F(q(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},q=(e,t)=>t&&e&&e.startsWith(t),G={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},Y=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=u(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=K(d)(F(E.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:X(e,s)}):o(Z,{className:e,children:c("svg",{className:p(Q(r),G[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),X=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},Q=e=>e?"":"w-full h-full",Z=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=(e,t)=>l=>l&&!L(l)?K(e)(F(t,l)):l,ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:i},r)=>o("source",{srcSet:J(a,n)(e),type:ne(l),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?le({...t,src:J(a,n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:p("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}),ne=e=>e?`image/${String(e)}`:void 0,ae=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ie={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","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:l})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" "),me=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),he=e=>he._impl(e);function ue(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=me();return e=>({...e,href:t&&!l?e.href:K(n)(e.href,l),"aria-label":e.text,onClick:he(i(e))});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&$(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}he._impl=e=>e,he.setup=e=>{he._impl=e};const pe=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),ge=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=fe(e)?"hidden lg:block":"";return c("div",{className:p(xe(e),"flex gap-xs"),children:[n?o("div",{className:p(r,ce[i]),children:n}):null,fe(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:p(r,ce[i]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return p("group/btn items-center justify-center",fe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},fe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),be=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=ue()({onClick:r,href:n,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:n,version:l}),children:a})));function we(e,t,l=!1){const n="primary"===e?"white":"black",a="Вернуться назад";return c("div",{className:p(l?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),o(ye,{version:"link",className:"group-data-secondary:text-white/80",text:a,ariaLabel:a,onClick:t,type:"button"})]})}const ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=i((()=>{v.back()}),[]);return c("div",{className:Se(n,l,e),children:[f?we(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Ve(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,b]}),Me(A({...y,extraProps:{className:"@container-normal"}})),Ve(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Te(g):"",Ie(g),Re(x)),imageAlign:h}),Be(s)]})]})]})})),Se=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Te=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Be=e=>e?o("div",{className:"self-end",children:e}):null,Me=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ve=(e,{className:t,imageAlign:l})=>e?o("div",{className:p("shrink-1/2 justify-self-center",l&&ke[l],t),children:e}):null,Re=e=>e?"hidden @xl:block":"",Pe=(e=[])=>e.reduce(((e,t)=>e+t),0),ze=(e=[])=>e?.length?Pe(e)/e.length:0,Ae=(e,t="normal")=>e?o("div",{className:p("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(ae,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),je=(e,t)=>e?o(T,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ee=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),Le=(e,t)=>e?o(Ee,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(De,{...e},`rte-${t}`):["label"in e?Le(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:je(e.description,t)},String(t)):null],Oe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:$e(l)})]}))),_e=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Fe=e=>{return((t=e.map(_e))?.length?Math.sqrt(Math.abs(ze(t.map((e=>e**2)))-ze(t)**2)):0)>16;var t},Ue=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),He=e=>!e.some(Ue),We=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",Fe(l)||He(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Oe,{benefitsVersion:t,...e},String(l))))}):null)),Ke=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("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)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ke:We,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Xe(l))}):null,Xe=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=Qe(a,r),d=Qe(i,r);return n||a?.icon?o(ye,{className:p("basis-full @lg:basis-auto",e),appendLeft:Ze({...a,iconVersion:c}),appendRight:Ze({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},Qe=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ze=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Je=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),et={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},tt=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=et[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:l.map(((e,l)=>o(Je,{isDotted:t,dotClassName:p(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),lt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),nt=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(at)}):null)),at=({label:e,amount:t},l)=>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(Ee,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[lt(2)(t)," ₽"]}):null]},String(l)),it=d((({className:e,tags:t})=>t?.length?o("div",{className:p("flex flex-wrap gap-xs",e),role:"list",children:t.map(rt)}):null)),rt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ee,{size:"text-m",font:"font-light",children:e})},String(t)),st={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},ot=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:S,...T})=>{const I=y?.src?o(ae,{image:y}):null,M=o(B,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ct(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ye(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(De,{__html:h}):null,p?.length?o(tt,{items:p,isDotted:g,listItemSize:st[i]}):null,S,x?.length?o(nt,{priceList:x}):null,dt(f)]})})})),ct=(e,t)=>t?{rightImage:e}:{leftImage:e},dt=e=>e?.length?o(it,{tags:e}):null,mt=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ut=(e,t)=>{return l=e,Boolean(ht(l)&&"string"==typeof l.$ref)?t.ref(e):ht(e)?t.record(e):mt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},pt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(gt,e),gt=(e,t)=>e&&t?ht(e)?e[t]:mt(e)?e[parseInt(t,10)]:e:e,xt=(e,t)=>ut(e,{ref:({$ref:e,...l})=>xt(e?pt(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:xt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>xt(e,t)))}),ft=(e,t,l=[])=>{ut(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)ft(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)ft(e[n],t,[...l,n])}})};async function bt(e,t){try{return e?await yt(e,t):null}catch(e){console.error(e)}return null}const yt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),vt=e=>[...new Set(e)],Nt={},wt=["/portal-resources"],kt=(e,t)=>xt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return ft(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(vt(e).filter((e=>!wt.some((t=>e.startsWith(t))))).map((async e=>[e,Nt[e]||=await yt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?kt(e,{...t,...i}):e};function St(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Tt=St((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(ot,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>Bt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(Tt,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Mt=e=>e?.replace(/[^+\d]/g,"");function Vt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:i="",email:r,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"email":"mail"]:r,...Rt(i),...t?{birthday:s?.toLocaleString()}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Pt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Rt=(e,t)=>e?{[t?"phoneNumber":"phone"]:Mt(e)}:{},Pt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Mt(e)}:{},zt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),At=e=>e,Dt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=i(((e,t)=>{const{parse:l=At,format:n=At}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=i((e=>{r(e),m(e)}),[]),g=i((()=>{r(e),c(!1),m({})}),[e]),x=i((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},jt=e=>o("div",{className:"h-6",children:e?o(Ee,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function Et(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},$t=e=>e?o(Ee,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Ot=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",T=_t(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[$t(d),N?o("textarea",{className:p("block resize-y min-h-24",C,T),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:p("h-14",C,S,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),_t=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Ft=e=>e?.text||e?.key||"";function Ut(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ht(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return Ut(globalThis.document,"click",l),t}const Wt=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Kt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:Wt(t,n).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===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Ft(e)}),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function qt({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=i((()=>{m.close(),c&&c()}),[c]),p=i((e=>{u(),r&&r(e)}),[u,r]),g=s(null),x=Ht(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Kt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,p]),g}const Gt=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=Et(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=i((()=>{v(""),f()}),[]),C=qt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:k,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[$t(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:C,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Xt(s,r,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ft(a)||d}),Yt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o(Ot,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Yt=(e,t)=>o(Y,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Xt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Qt=()=>{},Zt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Jt(t,e),c=el(t,i,r);h.push(o("td",{children:o("div",{className:tl(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Jt=(e,t)=>t&&e.toDateString()===t.toDateString(),el=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),tl=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),ll=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],nl=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Qt})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:ll.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Zt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),al=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],il=al.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),sl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},ol={className:"min-w-32",iconVersion:"black",isBorder:!1},cl=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=Et(!1),[u,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=Ht(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(al.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:il,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[$t(t),c("div",{className:"relative",children:[dl(C,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(Y,{...sl,className:"-rotate-90 cursor-pointer"})}),o(Gt,{onChange:v,value:{key:al[u]},options:w,...ol}),o(Gt,{onChange:N,value:{key:String(x)},options:k,...ol}),o("div",{className:"my-auto",onClick:y,children:o(Y,{...sl,className:"rotate-90 cursor-pointer"})})]}),o(nl,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:r,max:s})]}):null]})]})})),dl=(e,t,l)=>c("div",{onClick:e,className:p("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(T,{children:t&&Lt(t)}),o(Y,{...sl,name:"CalendarIcon"})]}),ml=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(cl,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),jt(l)]}))),hl=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,type:d,...m})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Ot,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),jt(a)]}))),ul=e=>"_"===e,pl=e=>/\d/.test(e),gl=e=>ul(e)||pl(e),xl=[..."+7 (___) ___-__-__"],fl=xl.findIndex(ul),bl=xl.map(((e,t)=>gl(e)?xl.slice(0,t).filter(gl).length:-1));const yl=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=xl.map(((e,l)=>pl(e)?e:t.charAt(bl[l])||e)),n=bl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(fl,n)):l).join("")}(e))),[t]);return o(Ot,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),vl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:p("shrink-0 w-full",e),children:[o(yl,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),jt(n)]}))),Nl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(Gt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),jt(l)]}))),wl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],kl=e=>!e?.length,Cl=e=>t=>l=>e(l)?[]:[t],Sl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Tl=e=>null!=e,Il=new Map,Bl=e=>Boolean(e?.every((e=>Array.isArray(e)?Bl(e):!e||"string"==typeof e))),Ml=e=>Bl(e)?e.toString():"";function Vl(e,t,{fallback:l,cache:i}={}){const s=r((()=>Rl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Tl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Il)=>l=>{const n=Ml(l),a=t.get(n);if(n&&Tl(a))return a;const i=e(...l);return n&&Tl(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Rl(e){return Array.isArray(e)?e:e instanceof Function?Rl(e()):[e]}const Pl=[];const zl=async e=>await bt(e,{method:"GET"})||Pl;function Al(){const{data:e}=Vl("/api/v1/branchesByRegions",yt);return Array.isArray(e)?e:[]}const Dl="Некорректно заполненное поле",jl=Cl((e=>null!=e&&""!==e))(Dl),El=Cl((e=>e?.key&&""!==e?.key))(Dl),Ll=Cl((e=>"string"==typeof e&&e.length>1))(Dl),$l=Cl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Dl),Ol=(_l=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Cl((e=>"string"==typeof e&&_l.test(e))))(Dl);var _l;const Fl=Cl((e=>"boolean"==typeof e&&e))(Dl),Ul=e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)),Hl={typeForm:jl,surname:Ll,name:Ll,region:El,addressBranch:El,phone:Ol,birthday:jl,email:jl,fullName:Ll,inn:$l,partnerComments:jl,collectionCount:jl,comment:jl,acquiringType:El,serviceType:El,consentDataProcessing:Fl,annualRevenue:jl},Wl=(e,t,l=!1)=>l?Sl(e,t):e,Kl=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.key,i=e("region")?.value?.text,r=l?Al()?.find((e=>e?.region===i))?.branches:function(e){const{data:t}=Vl(e?`/api/v1/branches?regionCode=${e}`:null,zl);return t||Pl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(Nl,{label:"Адрес",placeholder:"Выберите адрес",options:(r||[]).map((({address:e=""})=>({key:e,text:e}))),...Wl(e("addressBranch"),Hl.addressBranch,t?.required)})}));function ql(){const{data:e}=Vl("/api/v1/regions",yt);return Array.isArray(e)?e:[]}const Gl=d((({field:e,input:t})=>{const l=ql();return o(Nl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...Wl(e("region"),Hl.region,t?.required)})})),Yl=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Xl=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Ql=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Zl=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Jl="container space-y-m",en=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),tn=[{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"}],ln=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(en,{paths:tn,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":an(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:nn(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Ee,{size:"text-l",font:"font-light",children:l})}):null]})})})),nn=e=>e?"radio":"checkbox",an=e=>p("rounded border",e?"bg-primary-main":""),rn=d((({text:e,link:t})=>c(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Ee,{children:e}),t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Ee,{children:t.text})}):null]})));function sn({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const on={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"},cn={primary:p("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:p("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")},dn=d((({children:e,...t})=>{const l=e=>({...e,onClick:he(sn(e))}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":p(on[a],cn[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),mn=(e,t)=>o(dn,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),hn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(ln,{...e}),o(rn,{link:t})]}),jt(Sl(e,Fl).error)]}):o(rn,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),mn(l)]}),un={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},pn={typeForm:jl,region:jl,surname:jl,name:Ll,feedbackMethod:jl,phone:Ol,email:jl,comment:jl,consentDataProcessing:Fl},gn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{xn(e,l)}),[l]),[,{field:a,...r}]=Dt(un,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=bn(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:Jl,onSubmit:r.onSubmit,children:o(Yl,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(Nl,{label:"Тема",placeholder:"Выберите тему",options:Xl,...Sl(a("typeForm"),jl)}),s?o(Nl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Zl,...Sl(a("serviceDirection"),jl)}):null,o(Gl,{field:a}),s?o(Kl,{field:a}):null,c("div",{className:"space-y-s",children:[o(hl,{label:"Фамилия",...Sl(a("surname"),Ll)}),o(hl,{label:"Имя",...Sl(a("name"),Ll)}),o(hl,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(ml,{label:"Дата рождения",...Sl(a("birthday"),jl)})]}),d?c("div",{children:[o(hl,{label:"ИНН",...Sl(a("inn"),$l)}),o(hl,{label:"Наименование организации",...a("fullName")})]}):null,o(Nl,{label:"Способ получения ответа",options:Ql,...Sl(a("feedbackMethod"),jl)}),o(vl,{label:"Телефон",...Sl(a("phone"),Ol)}),s?c("div",{children:[o(vl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?Sl(a("secondaryPhone"),Ol):a("secondaryPhone")}),o(hl,{label:"Электронная почта",...Sl(a("email"),jl)}),o(hl,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(hl,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(hl,{label:"Электронная почта",...Sl(a("email"),jl)}),o(hl,{...Sl(a("comment"),jl),placeholder:"Ваше сообщение",isTextarea:!0}),hn(a("consentDataProcessing"),t,e)]})})})})),xn=(e,t)=>{const l=bn(e?.typeForm.key,e?.serviceDirection?.key),n=wl({...pn,...fn(e,l)});kl(n(e))&&t(e,!l)},fn=(e,t)=>t?{addressBranch:jl,inn:$l}:"FEEDBACK"===e.typeForm.key?{birthday:jl}:{addressBranch:jl},bn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,yn=d((e=>{const{button:t,regionSource:l}=e,[a,i]=n({key:""}),r=l?.regions??[],s=de({className:"text-white",version:t?.version}),d=r?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[r?o(Nl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:r.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:i}):null,d?o("div",{className:"text-center",children:o(ye,{href:d,target:"_blank",className:p("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),vn={ApplicationFormGrantSupport:yn,ApplicationFormFeedback:gn},Nn=Vt(),wn=St((({className:e,formBlock:t,...l})=>{const[a,r]=n(""),s=i((async(e,t=!1)=>{const l=Cn(e),n=await Nn.send(l,t)?"OK":"Fail";return r(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(S,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?kn(t,s):null,a?o(zt,{responseType:a}):null]})})})),kn=(e,t)=>{const l=e?.formType;if(!l||!(l in vn))return null;return o(vn[l],{...e,onSubmit:t})},Cn=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),Sn=d((e=>{const{className:t,title:l,responseType:n,children:a,...i}=e;return o(x,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(S,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(zt,{responseType:n}):null]})})})),Tn=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ln,{text:t,value:l,disabled:a,onChange:r},n),jt(i)]}))),In=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Bn=d((({field:e,input:t})=>o(Nl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:In,...Wl(e("acquiringType"),Hl.acquiringType,t?.required)}))),Mn=(e="")=>Boolean("trade"===e||"all"===e),Vn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Rn=(e,t,l)=>Math.max(t,Math.min(e,l));function Pn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function zn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-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:p("w-2 h-2 rounded-full",s<=t||i?"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:l,step:n,value:s,disabled:i,onInput:t=>{const l=Pn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const An=1,Dn=100,jn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:An),max:s=(a.length?a.length-1:Dn),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:u}=e,g=Vn(e,{normalize:(e=0)=>a.length?En(a)(e):Rn(e,r,s),format:lt()}),x=i((e=>{u&&u(Pn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),zn({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:u})]}),Ln(n)]})})),En=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Ln=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),$n=["От 1 000 ₽","До 1 000 000 000 ₽"],On=d((({field:e})=>o(jn,{title:"Сумма, ₽",items:$n,min:1e3,max:1e9,...e("amount")}))),_n=d((({field:e,input:t})=>o(hl,{className:"col-span-2",...Wl(e("comment"),Hl.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Fn=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:p("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:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Un=d((({field:e})=>Mn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Hn=d((({field:e})=>Mn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Wn=d((({field:e,input:t})=>{const l=Al(),n=r((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(Nl,{label:"Регион",placeholder:"Выберите регион",options:n,...Wl(e("region"),Hl.region,t?.required)})})),Kn=["От 1 мес","До 15 лет"],qn=d((({field:e})=>o(jn,{title:"Срок, месяцев",items:Kn,min:1,max:180,...e("term")}))),Gn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Yn=d((({field:e})=>o(Nl,{label:"Тип обслуживания",options:Gn,...Sl(e("serviceType"),jl)}))),Xn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Ee,{color:"text-primary-text",children:t}):null]})}))),Qn=["currencyControl","documentOperations","conversionTransactions","otherIssues"],Zn=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m space-x-m grid @xl:flex @xl:items-center",children:[o(Xn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(Xn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),Jn=(e,t)=>(l,n)=>{const{required:a,...i}=l,r="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(hl,{label:"Фамилия",...Wl(e("surname"),Hl.surname,a)}),name:o(hl,{label:"Имя",...Wl(e("name"),Hl.name,a),...i}),middleName:o(hl,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(vl,{label:"Телефон",...Wl(e("phone"),Hl.phone,a)}),email:o(hl,{label:"Электронная почта",...Wl(e("email"),Hl.email,a)}),fullName:o(hl,{label:"ФИО",...Wl(e("fullName"),Hl.fullName,a),...i}),inn:o(hl,{label:"ИНН",type:"number",...Wl(e("inn"),Hl.inn,a)}),comment:o(_n,{field:e,input:l}),region:r?o(Wn,{field:e}):o(Gl,{field:e,input:l}),addressBranch:o(Kl,{field:e,input:l,isPremium:r}),birthday:o(ml,{label:"Дата рождения",...Wl(e("birthday"),Hl.birthday,a)}),isClient:o(Tn,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),consentToReceiveMaterials:o(Tn,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(hl,{...Wl(e("partnerComments"),Hl.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i}),collectionCount:o(hl,{label:"Количество объектов инкассации",type:"number",...Wl(e("partnerComments"),Hl.collectionCount,a)}),acquiringType:o(Bn,{field:e,input:l}),onlineCheckout:o(Un,{field:e}),posTerminal:o(Hn,{field:e}),serviceType:o(Yn,{field:e}),term:o(qn,{field:e}),amount:o(On,{field:e}),annualRevenue:o(hl,{label:"Годовая выручка, ₽",...Wl(e("annualRevenue"),Hl.annualRevenue,a)}),vedTypes:o(Zn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===n))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const ea=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${Mn(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,h={...d,...la(o),...ta(c),...m?{partnerComments:m}:{}};return Object.fromEntries(Object.entries(h)?.map((([e,t])=>[e,t?.key||t])))},ta=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},la=e=>e?{vedTypes:Object.fromEntries(Qn.map((t=>[t,t===e])))}:{},na={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:In[0],serviceType:Gn[0],vedTypes:Qn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},aa=(e,t="")=>{const l=Object.fromEntries(Ul(e).map((e=>[e,na[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=Gn[1]),{...l,typeForm:{key:t,text:""}}},ia=Vt(),ra=d((({className:e,title:t,typeForm:l="",sections:a=[],button:r,link:s,endpoint:d,additionalParams:m,isContacts:h,...u})=>{const g=a?.flatMap((e=>e?.inputs))||[],x=aa(g,l),[f,b]=n(""),y=i((async e=>{const t=ca(g,e),l=wl((e=>{const t=Ul(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Hl?.[e]])))})(t));if(!kl(l(e)))return"Fail";const n=ea({...e,...m}),a=await ia.send(n,"lead"===d)?"OK":"Fail";return b(a),a}),[]),[,{field:v,onSubmit:N}]=Dt(x,{onSubmit:y}),w=oa(g)?.name;return c(Sn,{className:p(Jl,e),title:t,responseType:f,...u,children:[c("form",{onSubmit:N,children:[a.map(((e,t)=>c("div",{className:p(sa(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,(e?.inputs||[])?.map(Jn(v,l))]},`section-${t}`))),hn(w?v("consentDataProcessing"):void 0,s,r)]}),h?c("div",{className:"space-y-m",children:[o(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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(ae,{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(ae,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),sa=e=>2===e?"@xl:grid-cols-2":"",oa=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ca=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>l===t?.[e?.condition?.name])))),da="text-left",ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ha=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:p("rounded-icon object-fit flex justify-center items-center",ma[l],e),children:o(Y,{...i,width:"54%",height:"54%",name:a})}):null})),ua=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(S,{headingType:"h3",as:"h2",className:da,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(pa)}):null]}))),pa=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(ha,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(S,{headingType:"h6",children:e}),o(Ee,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(tt,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),ga=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function xa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const fa=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:xa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}(i((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),ba=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],ya=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Na(l))}),[g,x]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?va(c,v):{},...N?ga(h):{},gap:`${r}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(C=(e,l)=>o(fa,{className:p(m,a?ba[a-1]:"",N?"h-full":"",t),style:w?va(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(u)});var C})),va=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Na=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ka={"horizontal-list":"w-6","vertical-list":"h-6"},Ca=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:p("flex gap-xs",wa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?ka[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Sa=e=>e,Ta=(e=Sa)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Ia=Ta(),Ba=(e=Sa)=>Ta((t=>-e(t))),Ma=Ba(),Va=e=>t=>e.scrollWidth/t,Ra=e=>(t,l)=>{e.scrollBy({left:l*Va(e)(t),behavior:"smooth"})},Pa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ba()(a),Ta()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Ra(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Ra(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},za=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(r)?r.length:0,[h,u]=Pa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(ya,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:i,children:r}),a?o(Ca,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),Aa=(e,t,l)=>{return o(za,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:p("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(ae,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Da=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(B,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Aa(e,0,t):null]}))),ja={start:"justify-start",center:"justify-center",end:"justify-end"},Ea=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",ja[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ye(e)})})),La=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const $a=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),Oa=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Ee,{size:"text-h3",children:[i,lt(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Ee,{size:"text-h3",children:"-"})})]}))),_a=Math.round(29.5),Fa={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ua={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ha={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Wa={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ka={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},qa=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Ha.prefMonthsNum,prefTravelBonusRate:i=Ha.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ha,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},Ga=e=>e?o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Ya=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>c("div",{children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:lt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Xa=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Qa=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?o(Xa,{title:e,...i}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Ya,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),o("div",{className:"@xl:hidden",children:o(Oa,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function Za({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${lt(2)(l.min||0)} ₽`,`До ${lt(2)(l.max||0)} ₽`];return o(jn,{items:e?n:[],step:t,...l})}const Ja=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Dt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=qa(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[Za({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),Za({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...i("restExpenseValue")})]}),h>=0?Qa({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(Oa,{title:"Баллов за год",value:u}):null,Ye(l,{isVertical:!0}),Ga(n)]})]})})),ei=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),ti=(e,t=0)=>e?.sum?e.sum:t,li=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,ni=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,ai={horizontal:"gap-5xl",vertical:"flex-col gap-s"},ii=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${ai[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(ln,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),ri=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(ii,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),si=e=>ri({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),oi=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:ci([e,t],n),ci=([e,t],l=[])=>({[e]:l.length?Ma(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Ia(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),di=(e,[t,l],n)=>e>=n[t]&&e<=n[l],mi={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const hi=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730,c=function(e){const t=e?.rateType?mi[e?.rateType]:"",{data:l}=Vl(t?`/api/v1/depositrates/${t}`:null,yt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...Ka,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>r===e.isMonthlyInterestPayment&&ui(s,e)&&di(n,["minSum","maxSum"],e)&&di(l,["minDays","maxDays"],e)))||Ka,{rate:m}=d,h=pi(m,e),u=n+h,p=c||[Ka];return{...d,...ci(["minSum","maxSum"],p),...ci(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},ui=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,pi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},gi=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:i,rateParams:r})=>{const[s,{field:d}]=Dt({moneyValue:ti(i,1e5),daysValue:li(i,60),isReplenished:Boolean(i?.isReplenished),isPartialWithdrawal:Boolean(i?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(i?.isMonthlyInterestPayment)}),m=hi(s,r),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(jn,{items:[`От ${ni(f.min||0)}`,`До ${ni(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[xi(m,d),si({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Qa({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[fi(u,h),Ye(t,{isVertical:!0}),Ga(l),Ga(n)]})});var f})),xi=(e,t)=>c("div",{className:"space-y-s",children:[o(Ee,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(ln,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ln,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),fi=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(Oa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(Oa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),bi=e=>yi({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&yi({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&yi({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&yi({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),yi=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],vi=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Ni=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[Fa],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>bi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=oi(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=oi(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>bi({row:e,userInputParams:t,paramsViewSettings:l})&&di(n,["minSum","maxSum"],e)&&di(a,["minMonths","maxMonths"],e)))||Fa)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=vi(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},wi=({min:e=0,max:t=0,availableMonths:l,...n})=>o(jn,{items:[`От ${ki(e)}`,`До ${ki(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),ki=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ci=e=>ri({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Si=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:d}]=Dt({moneyValue:ti(r,2e5),monthsValue:li(r,_a),isAnnuity:Boolean(r?.isAnnuity),isInsurance:Boolean(r?.isEnableInsurance),isSalaryClient:Boolean(r?.isEnableSalaryClient),isPensionClient:Boolean(r?.isEnablePensionClient),isStateEmployee:Boolean(r?.isEnableStateEmployee)}),m=Ni(s,t,i),h=Ci({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")}),{onChange:u}=d("moneyValue"),{onChange:p}=d("monthsValue");return a((()=>{u&&u(Rn(s.moneyValue,m.minSum,m.maxSum))}),[m.minSum,m.maxSum]),a((()=>{p&&p(Rn(s.monthsValue,m.minMonths,m.maxMonths))}),[m.minMonths,m.maxMonths]),o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Сумма кредита, ₽",step:500,min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),wi({title:"Срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Ti({...m,...i},d),o("div",{className:"sm:hidden",children:h})]}),rateChildren:Qa({rate:m.rate}),resultChildren:c("div",{children:[o(Oa,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:h}),Ye(l,{isVertical:!0}),Ga(n)]})})})),Ti=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ln,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ln,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ln,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ln,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ii=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Bi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows?.[0]?Ri(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Vi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Vi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&di(n,["minSum","maxSum"],t)&&di(a||i,["minMonths","maxMonths"],t)))||Wa,{rate:c}=o,d=Mi(c,e),m=n+d,h=t?.rateRows||[Wa];return{...o,...ci(["minSum","maxSum"],h),...ci(["minMonths","maxMonths"],h),availableMonths:Ii(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:d,finalSum:m}},Mi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Vi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],Ri=(e,t)=>e+Math.round((t-e)/2),Pi=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s}=e,[d,{field:m}]=Dt({moneyValue:ti(s,2e4),monthsValue:li(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Bi(d,l,r),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Rn(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(ei,{className:t,inputChildren:c("div",{children:[Za({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),wi({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),zi({...h,...r},m)]}),rateChildren:Qa({rate:p}),resultChildren:c("div",{children:[o(Oa,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(Oa,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ye(n,{isVertical:!0}),Ga(i)]})})})),zi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?si({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ri({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Ai=e=>Di({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Di({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Di=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],ji=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Ua],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Ai({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=oi(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=oi(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Ai({row:e,userInputParams:t,paramsViewSettings:l})&&di(n+r,["minSum","maxSum"],e)&&di(i,["minSumOld","maxSumOld"],e)&&di(r,["minSumExtra","maxSumExtra"],e)&&di(a,["minMonths","maxMonths"],e)))||Ua)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=vi(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},Ei=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Dt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=ji(i,t,a),d=Ci({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return o(ei,{className:e,inputChildren:c("div",{children:[Za({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),Za({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),wi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),Li({...s,...a},r),s.isExtraMoney?Za({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Qa({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(Oa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(Oa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ye(l,{isVertical:!0}),Ga(n)]})})})),Li=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ln,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ln,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ln,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$i={CreditCalculatorForm:Si,DepositCalculatorForm:Pi,BusinessDepositCalculatorForm:gi,BonusCalculatorForm:Ja,RefinancingCalculatorForm:Ei},Oi=St((({className:e,calculatorTabs:t=[],...l})=>o(x,{className:e,defaultPadding:"p-0",...l,children:Fi(t)}))),_i=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in $i))return null;const l=$i[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(S,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},Fi=e=>{if(!e||!e.length)return null;return 1===e.length?_i(e[0]):e.map(((e,t)=>o(La,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o($a,{isUnfolded:t,children:_i(e)}),renderFoldButton:Ui(e)},t.toString())))},Ui=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(Y,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Ee,{align:n,color:"text-white",children:e.nav?.title}),o(Ee,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(Y,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Hi=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Vn(e,{normalize:(e=a)=>l&&n?String(Rn(Number(Wi(e)),l,n)):Wi(e),format:lt(r)}),d=i((e=>t&&t(Wi(e))),[t]);return o(Ot,{onChange:d,...s,...c})})),Wi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ki=d((e=>o(Hi,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ee,{size:"text-xl",font:"font-light",children:"₽"})})}))),qi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Gi={amount:1500},Yi=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...d})=>{const[{amount:m},{field:h}]=Dt(Gi),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(S,{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:qi[s],children:[o(Ki,{valid:!u,placeholder:i,label:l,max:3e5,min:1,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),r?.text?o(dn,{className:"w-full mt-lg",type:"submit",disabled:u,children:r.text}):null]})]})})),Xi=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qi=d((({className:e,disabled:t,...l})=>o(ye,{rounded:!0,className:p("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,...l,children:o(ae,{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"})}))),Zi=d((e=>o(Qi,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Ji=d((e=>o(Qi,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),er="absolute top-[calc(50%-24px)] z-40",tr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=i((()=>{a?(d&&t!==l-1&&h(),r()):h()}),[h,r,a,d,t,l]),b=i((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[nr(e),g?o(Zi,{className:p(er,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Ji,{className:p(er,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),nr=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(tr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(tr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ar=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ir=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(T,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),rr="relative h-full",sr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},or=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(mr);return A({...n,renderProps:(n,a,r)=>c("div",{className:cr(n,{someCardsHighlighted:i}),children:[R(n,a,{className:dr(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),mr(n)?ir({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},cr=(e,{someCardsHighlighted:t})=>p(rr,t&&(mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),dr=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(rr,"min-w-80",sr[n],t&&(mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ar(l),l&&"h-full"),mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hr=St((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,isEmbedded:s=!1,cardSize:d="normal",...m})=>{const{blocks:h=[]}=m.block||{},u=t||h?.length,[g,{inc:f,dec:b}]=Xi({itemCount:u,visibleItemCount:l},Math.floor(l/2)),[y,v]=Pa({itemCount:u}),[N]=v.visibleIndicesRange,w=h&&"CarouselBankHistoryCard"===h[0]?.type;return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:"p-6xl",...m,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(ya,{containerRef:y,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:or({noCardBorder:n,activeIndex:g,cardSize:d,...m})}),o(lr,{scroll:v,arrowsPadded:i,onScrollLeft:b,onScrollRight:f,hasEdgeBlocks:w,activeIndex:g,itemCount:u})]}),o(Ca,{className:"@5xl:hidden",containerRef:y,activeIndex:N,dotCount:u,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),ur=d((({title:e,description:t,className:l})=>o(x,{className:l,defaultPadding:"p-6xl",children:o(B,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),pr="z-10 border border-solid w-full h-full",gr=p(pr,"absolute hidden @xl:block border-transparent"),xr=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(gr,"top-9 right-12 bg-green-dark")}),o("div",{className:p(gr,"top-6 right-8 bg-green")}),o("div",{className:p(gr,"top-3 right-4 bg-green-light")}),c("div",{className:p(pr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ye([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),fr={black:"bg-black",white:"bg-white"},br=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(B,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ae,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Ye([i],{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(Ee,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(yr)]}):null,a?c(Ee,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),yr=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${fr[e]}`},String(t)),vr="20",Nr="absolute w-full h-full border border-white",wr=d((({className:e="",icon:t,...l})=>{const n=ue(),{text:a,href:i,target:r,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:i,target:r,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ae,{imageClassName:"text-green-dark",image:t,width:vr,height:vr}):null,o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ae,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"color"},imageClassName:"group-hover/link:text-primary-main",width:vr,height:vr})]}),o("div",{className:p(Nr,"-bottom-1 -left-1")}),o("div",{className:p(Nr,"-bottom-2 -left-2")})]})}):null})),kr=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row sm:items-center gap-s justify-between",children:[c("div",{children:[o(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Cr(n,"sm:self-end sm:pt-s"):null]})}))),Cr=(e,t="")=>{const l=Math.ceil(e.length/3);return o(hr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,isEmbedded:!0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:"flex flex-wrap gap-2xs sm:gap-0 sm:justify-center",children:e.slice(3*l,3*(l+1)).map(((e,t)=>o(wr,{...e},String(t))))},String(l))))})},Sr=d((({className:e="",href:t,target:l,isRemote:n=!1,onClick:a,children:i})=>{const r=ue({isRemote:n})({href:t,target:l,onClick:a});return o(t?"a":"div",{className:p("block",e),...t?r:{},role:t?"link":"none",children:i})})),Tr=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],Ir=e=>Tr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Br=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=Ir(t),o=Ge(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=p("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),r?o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Mr=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=false,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Sr,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(B,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ct(Ge(i)?o(ae,{image:i}):null,f),buttons:d.length?o(Br,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(qe,{benefits:g}),o(tt,{items:r,isDotted:s,listItemSize:"S"}),Vr(n,u)]})})}))),Vr=(e,t)=>e?o(T,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Rr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Ee,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Ee,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ye(a)}):null]},String(t))},Pr=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const d=r.map(Rr),[m,h]=i>0?[d.slice(0,i),d.slice(i)]:[d,[]];return c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ge(n)?o("div",{className:"self-center",children:o(ae,{image:n})}):null,t?o(S,{className:p("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ye,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(La,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o($a,{isUnfolded:e,children:h})]}),renderFoldButton:r.length>1?zr:null}):o("div",{children:m})]})})),zr=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(Y,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ar=(e=!1)=>e?"text-white":"",Dr=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),jr=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(ae,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(ae,{image:t})}),l?o(S,{headingType:"h4",className:Ar(a),title:l}):null,n?o("div",{className:Dr(a),children:n}):null]}))),Er=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:p("h-full","border-main-divider border-b"),children:e?e.map(Or(l,t)):null})}))),Lr=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$r=(e=!1)=>""+(e?"text-white":""),Or=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(T,{size:"text-s",color:Lr(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(T,{size:"text-s",align:"text-right",color:$r(e),children:l})}):null,n?o("div",{className:"text-right",children:o(T,{size:"text-s",color:Lr(e),children:n})}):null]})]},String(a)),_r=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:p("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(jr,{...e,isFillGradient:n}),r?.length?r.map((({rowHeader:e,cell:t},l)=>o(Er,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ye,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,Fr({onToggleColumn:i,isFillGradient:n,showRow:a})]})})})),Fr=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Ee,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),Ur=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(S,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(Hr,{...e})})]})})),Hr=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:r,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=i((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=i((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},i)=>{return o(_r,{visibleRowLength:a,showRow:c[i],header:n,columnData:(r=e,r?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===i&&l,onToggleColumn:()=>m(i),...s},String(i));var r}));return o("tbody","horizontal"===r?{children:o(za,{onVisibleIndicesChange:h,children:u})}:{children:u})})),Wr=e=>e%2!=0,Kr=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),qr=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>o(Kr,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Ee,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Gr=({isUnfolded:e,onToggle:t})=>o(qr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Yr=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ae,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:da})]}))),Xr=["ArrowDownIcon","ArrowUpIcon"],Qr="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Zr=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...i})=>{const[r,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(Yr,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(Qr),children:[z(r,{...i.options,parent:n}),Wr(r.length)?o(It,{className:"col-span-6",...i}):null]}),o(La,{renderFoldableSection:({isUnfolded:e})=>c($a,{className:p(Qr),isUnfolded:e,children:[z(s,{...i.options,parent:n}),Wr(s.length)?o(It,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(qr,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Xr[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),Jr=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(Fn,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),es=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>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-5xl",children:[a,Object.entries(l).map(ts(e))]}),n?o("div",{children:o(dn,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ts=e=>([t,l])=>{const n=l?.type;return"array"===n?ls(t,e)(l):null},ls=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(Jr,{items:n,multiple:!l?.single,...t(e)})]},e)};function ns(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const as=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,is=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>as(t[e])||as(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||rs(t[e])<=rs(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>as(t[e])||as(l[e])||rs(t[e]?.min)>=rs(l[e]?.min)&&rs(t[e]?.min)<=rs(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>as(t[e])||as(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),rs=e=>Number(e||0),ss=(e,{block:t,page:l,normalize:n=At})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Dt(e),d=r((()=>ns(a,a.map((e=>kt(e.content,l?.fallback))))),[a,l?.fallback]),m=i===e?a:((e,t)=>(l=At)=>e?.filter((([,e])=>is(t,l(e)||{}))).map((([e])=>e)))(d,i)(n);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},os=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),ds=1e9,ms={sum:{min:1e4,max:ds},period:3},hs=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=ss(ms,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:us(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=ps(h),g=c("div",{children:[o(Ki,{label:n?.title,min:500,max:ds,...d("sum",{parse:e=>({min:Number(e),max:ds}),format:({min:e})=>String(e)})}),o(jn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[es({field:d,reset:m,filtrationSchema:t,resetButton:l,children:g}),o(Zr,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),us=e=>vt((e?.paramsSource?.rateRows||[]).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))),ps=e=>vt(e.flatMap((e=>e||[])).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],gs=e=>"Image"===e?.contentType&&e?.image?o(ae,{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,xs=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:gs(n)}),o(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),fs="location";function bs(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(h,"location",vs()??{name:e}),r=i((e=>{Ns(e),l(e)}),[]),{data:s}=Vl(ys()?null:"/api/v1/region",yt);return a((()=>{s&&!ys()&&l(s)}),[s]),[t??{name:e},r]}const ys=()=>Boolean(globalThis.localStorage?.getItem(fs)),vs=()=>{try{const e=globalThis.localStorage?.getItem(fs);return e&&JSON.parse(e)}catch(e){return null}},Ns=e=>{try{globalThis.localStorage?.setItem(fs,JSON.stringify(e))}catch(e){}};var ws;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ws||(ws={}));const ks=new Intl.NumberFormat("ru",{style:"currency",currency:ws.RUB}),Cs=e=>e?ks.format(e):"",Ss="text-left text-m font-light text-secondary-text",Ts=`${Ss} pl-5xl`,Is={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Bs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Ss,children:o(Ee,{size:"text-m",children:"Валюта"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Купить"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:Is[t]},width:"24",height:"24"}):null,o(Ee,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Vs={icon:"GpsIcon"},Rs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(ha,{...Vs,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(T,{size:"text-l",color:"text-primary-main",children:t}):null,o(T,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Ps=(e,t,l)=>{const n=Number(zs(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),As=e=>t=>{const[,l]=e.find((([e])=>e(t)))||[];return l},Ds=e=>As([[e=>e.value!==ws.RUB&&e.oppositeValue!==ws.RUB,()=>e.handleConvert(e.value,ws.RUB)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.USD)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function js(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Ot,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(Gt,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Es=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ws.RUB,selectBuy:l?.[0]?.currency?.currency||ws.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[js({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:Ls(r,d,l),value:r.inputSell,setValue:e=>Os(d,l)(e,r.selectSell,r.selectBuy)}),js({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:$s(r,d,t),value:r.inputBuy,setValue:e=>_s(d,t)(e,r.selectBuy,r.selectSell)}),a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),Ls=(e,t,l)=>n=>{t({selectSell:n}),Ds({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{Os(t,l)(e.inputSell,n,a)}})},$s=(e,t,l)=>n=>{t({selectBuy:n}),Ds({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>_s(t,l)(e.inputBuy,n,a)})},Os=(e,t)=>(l,n,a)=>{e({inputSell:zs(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputBuy:String(Ps(l,i,n===ws.RUB)||"")})},_s=(e,t)=>(l,n,a)=>{e({inputBuy:zs(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputSell:String(Ps(l,i,n===ws.RUB)||"")})};const Fs=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=bs(),i=function(e){const t=e?.code||"000",{data:l}=Vl(`/api/v1/exchangerates?regionCode=${t}`,yt);return l||{}}(a),r=Us(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ws.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:ws.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[r?o(Bs,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(Rs,{address:i?.address})]}),r.length&&s.length&&d.length?o(Es,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),Us=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Hs=(e,t)=>o(ha,{...e,iconBgVersion:t,className:"shrink-0"}),Ws=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Kr,{tag:"button",className:p("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Hs(a,t),e?o(Ee,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(Y,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),Ks=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>o(x,{className:p("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(La,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o($a,{className:p("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:A({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qs({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),qs=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(Ws,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):o(qr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Gs=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Ys):null,o(ye,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Ys=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Ee,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Xs)})]},String(t)),Xs=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Qs(e.type,e.text)}),o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Qs=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Zs(t)}`,children:o(Ee,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Zs=e=>e.replaceAll(/\D/g,""),Js=["split_version","New","Old"],eo=d((({className:e="",index:t,text:l,...n})=>{const a=ue(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:p("",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),to=d((({title:e,links:t,className:l=""})=>c("div",{className:p("flex flex-col gap-4",l),children:[o(Ee,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(eo,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),lo=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:p("flex flex-col",e),children:t.map(no(l))}):null)),no=e=>(t,l)=>{const{text:n,...a}=t,i=ue({isRemote:!(!E.BASE_PATH||!e)&&!E.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:c}=i(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},ao=d((({className:e="",index:t,...l})=>{const n=ue({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),io=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(Ee,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(ao,{index:t,...e},String(t))))}):null]}))),ro=St((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=i((()=>{const[e,t,l]=Js;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:so(n)}),o(Gs,{className:"overflow-hidden",items:r}),c("div",{className:"mt-xl",children:[o(Br,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(oo)}),o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(eo,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(to,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(io,{links:h})]})})),so=e=>e?.filter((e=>e.icon)).map(((e,t)=>o(Ks,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(lo,{items:e.items,basePath:D(e.href)})},String(t)))),oo=({href:e="/",text:t},l)=>{const{label:n}=Ir(e);return o(ye,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},co={width:"34",height:"34"},mo={"bg-white":"color",transparent:"white"},ho={"bg-white":"text-primary-main",transparent:"text-white"},uo=(e,t,l)=>o(ae,t?.src?{image:t,className:ho[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:mo[e]},className:ho[e],width:l?.width,height:l?.height}),po={"bg-white":"text-primary-text",transparent:"text-white"},go=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[uo(i,l?.image,co),r?n??o("div",{className:"ml-s",children:o(Ee,{font:"font-medium",color:po[i],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),xo={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},fo=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const r=u(),s=E.BASE_PATH?.startsWith(r.pathname),d=i((()=>{r.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(go,{className:"my-2xs",bgColor:e,logo:t})}):bo(d),n?o("div",{children:o(ye,{href:n,ariaLabel:"Войти",target:"_blank",className:p("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",xo["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),bo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(ae,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),yo={"bg-white":"primary",transparent:"transparent"},vo=St((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=yo[e],portal:n,...a})=>{const{logo:i}=a.options?.page?.sitemap??{},{internetBankUrl:r}=n||{};return o(x,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(fo,{bgColor:e,logo:i,alwaysShowLogo:t,internetBankUrl:r,version:l,...a})})})})),No={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},wo=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",No[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:A({...c,extraProps:{className:p("w-full",ar(r)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),ko=St((e=>o(wo,{...e})),{childrenTypes:[]}),Co=d((e=>{const{className:t,image:l,...n}=e;return o(x,{className:t,defaultPadding:"p-0",...n,children:o(ae,{image:l})})})),So=["байт","Кб","Мб","Гб","Тб","Пб"],To=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",d=a?String(a):"";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:l,target:n,children:[e,t?c(Ee,{size:"text-l",font:"font-light",children:[t," ",Io(s,d),o(Ee,{color:"text-secondary-text",children:l&&`${s+r+d}`})]}):null]})})),Io=(e,t)=>e||t?o("span",{children:", "}):"",Bo={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Mo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Bo[r]),role:"list",children:a.map(Vo(d,i))}):null]})})),Vo=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?K(e)(l?.attachment?.src):l?.href,i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${So[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Ro(a):l?.fileFormat;return o("div",{role:"listitem",children:o(To,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?o(ae,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Ro=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Po=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const g="secondary"===h?"p-m min-w-32":"min-w-24",f=i?.src?o(ae,{className:"hidden lg:block",image:i}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:h,...u,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(S,{headingType:"h3",title:m,className:p("whitespace-pre-wrap",l)}),rightImage:f,buttons:Ye(n,{className:"flex-wrap"}),children:[a?o(Ee,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(tt,{items:r,listItemSize:"M"}),o(Ee,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",g),children:o(ae,{className:"w-fit",image:s})}):null,i?.src?o(ae,{className:"lg:hidden",image:i}):null]})]})})})),zo={primary:"bg-white/30",secondary:"bg-main-divider"},Ao={primary:"text-white",secondary:"text-secondary-text"},Do=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",zo[t]),role:"status",children:o(Ee,{size:"text-xs",color:Ao[t],children:e})}))),jo=(e=[],t={})=>e.filter((({content:e={}})=>is(t,e))).length,Eo=(e,t)=>e===t;const Lo=($o=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(Eo,((e=Eo)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>$o(l,t[e])))));var $o;const Oo=[],_o={},Fo={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},Uo={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Ho={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Wo={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Ko=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...d}=t;return o(i,{className:p("h-12","block flex-1","cursor-pointer",Fo[n],l?Wo[n]:Ho[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?Uo[n]:"text-secondary-text hover:text-primary-main"),children:[o(Ee,{size:"text-m",children:r}),s?o("div",{className:"ml-xs",children:s}):null]})})})),qo=d((e=>o(e?.item?.href?Go:Yo,{...e}))),Go=d((e=>{const t=ue(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Ko,{...e,tag:"a",item:a,onClick:n})})),Yo=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(Ko,{item:e,onClick:n,...l})})),Xo=(e,t,l)=>(n,a)=>o(qo,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Qo=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Xo(n,a,t))}))),Zo={categories:[],extraOptions:[],propertyType:[],stage:[]},Jo=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ss(Zo,{block:a.block,page:a.options?.page}),g=i(((e=Zo)=>u(e)),[]),f=(({hotFilters:e=Oo,filtrationState:t=_o,blocks:l=Oo,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Lo(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:o(Do,{version:t===e[a]?"primary":"secondary",count:jo(l,t.filter)})})))),[e,l,a]),c=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Qo,{...f}),es({field:m,reset:h,filtrationSchema:l,resetButton:n}),o(Zr,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function ec(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const tc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},lc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(tc).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),nc=e=>globalThis[e];const ac=()=>function(e,t){const[l,r]=n(),s=i((()=>r(nc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),r(void 0)}}if(!nc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ic={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},rc=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(ic).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:l,width:"20",height:"16"})})})),sc={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},oc=[55.753995,37.614069],cc=d((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=ac(),[d,m]=n();if(a((()=>{i?.current?r&&(ec(r,i.current,e),e?.length||i.current.setCenter(oc)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?dc(e):oc,zoom:l,controls:[],suppressMapOpenBlock:!0}),ec(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(sc),h,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(Y,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(rc,{yandexMaps:i}),o(rc,{yandexMaps:i,direction:"out"})]}),lc(i.current,r,p("right-2 top-80",h))]})})),dc=e=>[hc(mc(e,0)),hc(mc(e,1))],mc=(e,t)=>e.map((e=>e.coords[t])),hc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,uc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему"},pc="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",gc=(e,{field:t,reset:l},n=3)=>{const a=(e||[]).map((e=>o(ln,{text:uc[e],...t(e)},e))),[i,r]=n>0?[a.slice(0,n),a.slice(n)]:[a,[]];return o("div",{children:e?.length?o("div",{children:r.length>0?o(La,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:pc,children:i}),o($a,{className:pc,isUnfolded:e,children:r})]}),renderFoldButton:xc(l)}):o("div",{className:pc,children:i})}):null})},xc=e=>({isUnfolded:t,onToggle:l})=>c("div",{className:"flex",children:[o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0 mr-lg",appendRight:o(Y,{name:["ArrowDownIcon","ArrowUpIcon"][Number(t)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(t)],onClick:l}),o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,text:"Очистить фильтр",appendRight:o(Y,{name:"CloseIcon",width:"16",height:"16"})})]}),fc=()=>{},bc=()=>[],yc=e=>"all"===e?"block":"hidden",vc=d((({className:e,data:t=[],renderCard:l=fc,filterItems:a=bc,getBalloon:i=fc,initFilterState:s={},descriptionData:d,title:m})=>{const[h,{field:u,reset:g}]=Dt(s),[x,f,y]=r((()=>{const e=a(t,h),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,h]),[v,N]=n("all");return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(S,{headingType:"h2",children:m}),y?o(Ee,{size:"text-h2",color:"text-secondary-text",children:`(${y})`}):null]}),d?wc(d):null,Nc(t,v,N),o("div",{className:p("pb-2xl",yc(v)),children:gc(Object.keys(s),{field:u,reset:g})})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(cc,{points:f,className:"h-full"})})})]}),x.map(l)]})})),Nc=(e,t,l)=>{const n="business"===t?"primary":"secondary",a=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex pb-lg",children:[o(dn,{className:"mr-m","data-id":"all",onClick:t=>a(t,"all",e),version:"all"===t?"primary":"secondary",children:"Для физических лиц"}),o(dn,{"data-id":"business",onClick:t=>a(t,"business",e),version:n,children:"Для юридических лиц"})]})},wc=({__html:e,list:t})=>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(De,{__html:e})}):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(ae,{image:e.image}):null,e?.text?o(Ee,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,kc={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Cc=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",kc[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ae,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ee,{size:"text-m",color:kc[l].text,children:t})]}))),Sc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Tc({textItems:a,subText:t,children:l,...n})})),Tc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>c("div",{className:p("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Ee,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>o(Ee,{size:"text-l",children:e.trim()},String(t)))),a?o(Ee,{color:n,size:"text-m",children:a}):null]}),Ic=d((({className:e,children:t})=>o("div",{className:p("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Bc=["ArrowDownIcon","ArrowUpIcon"],Mc=["Подробнее","Скрыть"],Vc=({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:Mc[Number(e)]}),o(Y,{className:"text-primary-text",name:Bc[Number(e)],width:"16",height:"16"})]}),Rc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Ac(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];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(Ee,{size:"text-h4",children:Ac(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),o(Cc,{color:"green",children:Ac(s)})]}),o("div",{className:"hidden sm:block",children:o(Ic,{className:"flex-wrap",children:m?.map(zc)})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o($a,{isUnfolded:e,children:o(Ic,{className:"flex-wrap",children:m?.map(zc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Vc({isUnfolded:e,onToggle:t})})]},String(d))},Pc=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${Ac(t)} №${l}`,body:e.toUpperCase()}),zc=(e,t)=>o(Sc,{...e},String(t)),Ac=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Dc=[];const jc=async e=>{const t=await bt(e,{method:"GET"});return Array.isArray(t)?t:Dc},Ec={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Lc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},$c=d((({data:e,className:t})=>{const[l]=bs(),n=function(e){const{data:t=Dc}=Vl(`/api/v1/atms?regionCode=${e}`,jc);return t}(l?.code??"000");return o(vc,{className:t,filterItems:Oc,data:n,initFilterState:Ec,renderCard:Rc,getBalloon:Pc,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),Oc=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>Lc[t](e))),l=!n.length||n.some((t=>Lc[t](e)));return t&&l}))},_c=e=>{const t=Uc(e);return o(Sc,{label:"Режим работы",value:t,className:"max-w-none"})},Fc=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",Uc=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Fc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Fc({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},Hc=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Wc=e=>Hc.map((([t,l,n])=>({key:t,title:n,short:l,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??"")}}))),Kc=e=>{if(!e)return null;const t=qc(e);return c(Ic,{className:"border-none",children:[o(Sc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Gc)})}),o(Sc,{label:"Режим работы",className:"max-w-none",children:o(Ee,{children:e})})]})},qc=e=>{const t=Hc.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},Gc=({short:e,status:t},l)=>o("div",{className:p("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(Ee,{size:"text-xs",children:e})},String(l)),Yc=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Sc,{label:"Валюта",value:e.currency}):null,t?o(Sc,{label:"Купить",value:String(t)}):null,l?o(Sc,{label:"Продать",value:String(l)}):null]},String(n)),Xc=(new Date).getDay(),Qc=e=>{const[t]=e?.slice(Xc-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Cc,{color:"green",children:a}):null,l&&i?o(Cc,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(Cc,{color:"red",children:"Выходной"})},Zc=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Jc=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Sc,{label:e,value:t&&l?l:"",subText:Zc({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),ed=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,td=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${e}</p>`,ld=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,nd=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Wc(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(Ee,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),Qc(u)]}),o("div",{className:"hidden sm:block",children:ad({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o($a,{isUnfolded:e,children:ad({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Vc({isUnfolded:e,onToggle:t})})]},String(h))},ad=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=Wc(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Ic,{className:"flex-wrap",children:[o(Sc,{label:"Факс",value:t}),o(Sc,{label:"Телефон филиала",value:e}),o(Sc,{label:"Для обращений юридических лиц",value:l}),o(Sc,{label:"Обслуживание физических лиц",value:n}),o(Sc,{label:"Для консультаций по валютному контролю",value:i}),o(Sc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?o(Ic,{children:o(Sc,{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(Jc)})})}):c(Ic,{children:[o(Sc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Gc)})}),_c(d)]}),r?.businessScheduleVisibleTag?Kc(r?.businessScheduleDescription):null,s?.currencies?.length?o(Ic,{className:"flex-wrap",children:s?.currencies?.map(Yc)}):null]})},id=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=Wc(e),l=e?Uc(t):"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&!e.businessScheduleDescription?ed(l):td(l):ld(l):null})(l)}`;return{header:n,body:i}},rd=[];const sd=async e=>{const t=await bt(e,{method:"GET"});return Array.isArray(t)?t:rd},od={workingSaturday:!1,premiumService:!1,privateBanking:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},cd={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday),premiumService:e=>Boolean(e.premiumService),privateBanking:e=>Boolean(e.privateBanking),sellingCoins:e=>Boolean(e.sellingCoins),buyingCoins:e=>Boolean(e.buyingCoins),bullionOperations:e=>Boolean(e.bullionOperations),preciousMetalsOperations:e=>Boolean(e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean(e.transferringDataToBiometricSystem)},dd=d((({className:e})=>{const[t]=bs(),l=function(e){const{data:t=rd}=Vl(`/api/v1/branches?regionCode=${e}`,sd);return t}(t?.code??"000");return o(vc,{className:e,filterItems:md,data:l,initFilterState:od,renderCard:nd,getBalloon:id,title:`Офисы филиала ${t?.name}`})})),md=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>cd[t](e)))))},hd=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(dd,{}):o($c,{data:e})})})),ud=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),pd=d((({className:e,padding:t,slides:l=[],...n})=>o(x,{className:p("overflow-hidden relative",e),padding:t,...n,children:o(za,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(ot,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),gd=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(x,{className:p("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ge(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:r})}):null,s?o(S,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?xd(i):null,fd({label:"Адрес",data:e,iconName:"GeolocationIcon"}),fd({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),fd({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ye([n]):null]})]}))),xd=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{__html:e})}),fd=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(Y,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ee,{size:"text-xl",color:n,children:t})]})]}):null,bd=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(De,{__html:t,richVersion:l})})})),yd=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(Xn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Xn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),vd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(Gt,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),Nd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(vd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(vd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),wd=["От 1 дня","До 365 дней"],kd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ee,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(jn,{min:1,max:365,value:e,items:wd,onChange:t})]}))),Cd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(vd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(vd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Sd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Nd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Td(m)}),o(kd,{days:a,setDays:e=>m({days:e})}),o(Cd,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Id(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ee,{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(yd,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Td=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Id=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Bd=d((({days:e,tariffs:t=[]})=>{const l=Vd(e,t),n="На рисунке изображена пачка листов\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:[Md("Аренда за",e),Md("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),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(ae,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(T,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),Md=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ee,{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})]}),Vd=(e,t)=>{const l=Rd(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Rd=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},Pd=(e,t)=>e.find((e=>e.branchCode===t)),zd=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=Pd(n,l.selectedBranch),d=Ad(s?.safeBoxCaseVolumes),m=Dd(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=jd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Sd,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Bd,{days:l.days,tariffs:h})]})})),Ad=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Dd=(e,t)=>e?.find((e=>e.volume===t)),jd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Ed=[];const Ld=async e=>await bt(e,{method:"GET"})||Ed,$d=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=ql(),p=Od(m.selectedRegion,u),g=function(e){const{data:t}=Vl(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ld);return t||Ed}(p),f=i((e=>h((t=>({...t,...e})))),[h]),b=(y=Pd(g,m.selectedBranch)||g,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(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(zd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(T,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(cc,{points:b,className:"h-[640px]"}):null]})})),Od=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function _d(e){throw new Error(e)}const Fd={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},Ud={normal:"",small:"min-h-6xl"},Hd={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"},Wd=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...d})=>c(x,{className:p("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(Kd(i,r))})}):null,Ye(a,{isVertical:!0})]}))),Kd=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return qd(e,t)(l,n);case"rte":return o(De,{__html:l.__html});default:_d(l)}},qd=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Gd(e,t)(l,n)}),c("div",{className:p("flex flex-col justify-center h-fit",Ud[e]),children:[l.label?o(T,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:p("text-s font-light text-left",Hd.description),children:l.description}):null]})]})},String(n)),Gd=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",i=Boolean(l?.icon?.src),r=Fd[e][i?"image":"icon"],s=i?"transparent"===t:t;return o(x,{className:p(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:Ge(l?.icon)?o(ae,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Yd(e),height:Yd(e)}):o("span",{className:p("text-h4","transparent"===t?Hd.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},Yd=e=>"normal"===e?"38":"24",Xd=e=>({href:t})=>!!t&&_(Qd(t,e)).startsWith(_(t)),Qd=(e,t)=>L(e)?t.href:t.pathname;function Zd(e=[]){const t=u(),l=e.findIndex((e=>Xd(E.BASE_PATH?{pathname:E.BASE_PATH}:e))(t));return[l,e[l]]}const Jd=d((({isActive:e,onClick:t})=>c("button",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(Y,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),em=d((({isActive:e,item:t,onClick:l})=>{const n=ue({isRemote:!0}),{href:a,onClick:i}=n({href:t?.href,onClick:l});return c("a",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:i,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const tm=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:_d(e)}}))),[c,d]),l},lm=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ae,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),nm=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=me(),r=i((()=>{a(),n&&n()}),[n]);return c("div",{className:p("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(lm,{className:"absolute top-0 right-0",onClose:r}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),am=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const im=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(Ee,{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(rm,{...e},String(t))))})]}):null,rm=d((({icon:e,...t})=>{const l=ue(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),sm=e=>t=>t.name?o(Sr,{isRemote:!0,href:`/branches/${t.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>{e&&e(t)},children:o(Ee,{size:"text-l",font:"font-light",children:t.name})},String(t.id)):null,om=d((({className:e,searchTerm:t,onSearch:l})=>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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),cm=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=bs(t),r=ue({isRemote:!0}),{href:s}=r({href:`/branches/${l.slug}`}),[d,m]=n(""),h=mm(ql()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,dm),{close:p}=me(),g=i((e=>{a(e),p()}),[]);return c(nm,{className:"pb-20",head:c("div",{children:[o(Ee,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(T,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Sr,{isRemote:!0,href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(om,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&am(e.toLowerCase())(d.toLowerCase())>=.8)).map(sm(g))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(u.entries()).map((x=g,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ee,{size:"text-h6",children:e})}),t.map(sm(x))]},e)))}),im(e)]});var x})),dm=e=>e.name?.charAt(0)||"",mm=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),hm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ae,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})}));function um(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const pm=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},gm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),xm=e=>t=>e.map((([e,l])=>[am(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>bm(t,e))).reduce(pm(Math.max,0),new Map),fm=e=>t=>{return ns(t,t.map((({title:e})=>e)).map((e=>t=>{const l=gm(t||"");return l.length?Pe(e.map((e=>Ia(l.map(am(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},bm=(e,t)=>new Map(e.map((e=>[e,t]))),ym=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=Vl(e?.length?e:null,vm),[s,o]=n(null);return um((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=gm(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(xm(i)).reduce(pm(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return fm(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},vm=async(...e)=>(await Promise.allSettled(e.map((e=>bt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Nm=["all","footer"],wm=d((({className:e,topItems:t})=>{const l=ue({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.filter(Sm).map(l).map(km)})})),km=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter(Sm);return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(Cm,{...e,basePath:D(a),index:t},String(t))))]},String(t))},Cm=d((({text:e,index:t,basePath:l,...n})=>{const a=ue({isRemote:!(!E.BASE_PATH||!l)&&!E.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),Sm=e=>!e.displayArea||Nm.includes(e.displayArea.toLowerCase()),Tm=d((({initialQuery:e,topItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=ym({basePathList:l,initialQuery:e}),i=r((()=>Im(t)(n)),[t,n]);return o(nm,{head:o(hm,{autoFocus:!0,...a}),children:o(wm,{topItems:i})})})),Im=e=>t=>e?.length&&t?.length?ns(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],Bm=d((({className:e,...t})=>{const[l,a]=n(""),r=i((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=me();return{open:(l={},n={})=>t(o(Tm,{...e,...l}),n),close:l}})(t),d=i((e=>{a(e),Mm(e)&&s.open({initialQuery:e},{onClose:r})}),[r,s]);return c("div",{className:p("relative",e),role:"search",children:[o(hm,{value:l,onChange:d}),o(lm,{className:"absolute top-0 right-0 sm:hidden",onClose:r})]})})),Mm=e=>e&&e.length>=3,Vm=d((({item:e,basePath:t})=>{const l=ue({isRemote:!(!E.BASE_PATH||!t)&&!E.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:i}=l(e),r=u(),s=Xd(r)({href:n});return c("a",{className:p(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:i,children:[e.text,o(ae,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),Rm=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:p("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Pm=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=bs(l),m=(e=>{const{open:t,close:l}=me();return{open:(l={})=>t(o(cm,{...e}),l),close:l}})(e),[h,u]=Pa({itemCount:t?.length??0}),[p]=Zd(t),[g,x]=n(p),f=r((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=i((e=>x(e)),[]);return o(nm,{head:o("div",{className:"flex items-center",children:o(S,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(ya,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(Rm,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[zm(b,f?.href),o(Bm,{className:"grow mb-5",...e}),Am(s),Dm(d,(()=>m.open()))]})]})})})),zm=(e,t)=>e?o("div",{children:e.map(((e,l)=>o(Vm,{item:e,basePath:t},String(l))))}):null,Am=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(ae,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Dm=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(ae,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Ee,{size:"text-h5",children:e.name}),o(Ee,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),jm="burgerMenuDialog",Em=e=>{const{open:t,closeAll:l,close:n}=me(),a=tm(),i=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(jm,a),r=()=>t(o(Pm,{...e}),{id:jm});return[i,{open:r,close:n,toggle:()=>{i?l():r()}}]},Lm=[],$m=St((({sticky:e,...t})=>{const{menuItems:l=Lm}=e??{},[n,{toggle:a,close:i}]=Em(t.options?.page?.sitemap??{}),[,r]=Zd(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(x,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map(Om(r,i)),o(Jd,{isActive:n,onClick:a}),m.map(Om(r,i))]})})})),Om=(e,t)=>(l,n)=>o(em,{isActive:l===e,item:l,onClick:t},l.href||String(n)),_m="hidden sm:flex absolute z-40 top-0",Fm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Pa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(ya,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(Xo(l,n,a))}),r.canScrollLeft?o(Zi,{className:p("left-6",_m),onClick:r.scrollLeft}):null,r.canScrollRight?o(Ji,{className:p("right-6",_m),onClick:r.scrollRight}):null]})})),Um=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(Qo,{...t});case"centered":return o("div",{className:"flex",children:o(Qo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Fm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Hm="tab",Wm=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=r((()=>l.map(qm)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Km(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=i((e=>{const t=g.indexOf(e),n=l[t];b(t),Km(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Hm,e.name):t.delete(Hm),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:Um({items:g,value:g[f],tabsMode:s,onChange:y})})})),Km=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},qm=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Gm={start:"text-start",center:"text-center",end:"text-end"},Ym=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ae,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),Xm=d((({tab:e})=>{const t=ue(),{onClick:l}=t({...e,onClick:()=>{e.href&&!$(e.href)&&(globalThis.location.href=e.href)}});return um(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Qm=St((({className:e="",tabs:t=[],block:l,tabAlign:a,...i})=>{const[r,s]=n(Jm(t)),d=Zm(t[r],r),m=t.length,[h,{inc:u,dec:g}]=Xi({itemCount:m},r),[f,b]=Pa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...i,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(ya,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(eh(r,s,a))}),o(lr,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[r]?.href?o(Xm,{tab:t[r]}):z(l?.slots?.[d],{...i?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Zm)||[],childrenTypes:{exclude:["TabsLayout"]}}),Zm=(e,t)=>e?.title||`Слот №${t}`,Jm=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),eh=(e,t,l="start")=>(n,a)=>o(Ym,{className:Gm[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),th={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},lh=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:th[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),nh=d((({className:e="",isOpen:t,onClick:l})=>o(ye,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),ah={Buttons:({buttons:e})=>Ye(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,List:({isDotted:e,...t})=>o(tt,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ee,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Ee,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(nh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},ih=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return rh({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),rh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in ah))return null;return o(ah[l],{...t,...n})},sh=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,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(ih,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),oh=(e,t)=>140*Pe(e.slice(0,t).map((e=>e?.cols?.length??1))),ch=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ee,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,dh=d((({rows:e})=>{return o(ya,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,i=p("flex duration-1000 text-center",0!==l?"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(Ee,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${oh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ee,{size:"text-xl",children:e.data}):null,e?.cols?ch(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),mh=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;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(Ee,{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(dh,{rows:t.rowsData})})})]},n)}))}))),hh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),uh=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>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:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Ee,{size:"text-xl",font:"font-light",color:hh(t===l),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function ph(e){const t=await fetch(e);return await t.json()}const gh=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Vl(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),ph);return t||{}}(e),[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(uh,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(mh,{activeTabIndex:r,items:m}),o(nh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ee,{size:"text-h6",children:"Данных нет"}),o(nh,{onClick:l,isOpen:!0})]})})),xh=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@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(gh,{...t,onClick:l})}):null]}))),fh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,u]=n(void 0),g=i((e=>u(e)),[]);return c(xh,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:p("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ae,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(lh,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(sh,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function bh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(Qi,{className:p("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Qi,{className:p("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const yh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,bh({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),vh=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=Xi({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(fh,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[f,b]=i>0?[g.slice(0,-i),g.slice(-i)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:i>0?o(La,{renderFoldableSection:({isUnfolded:e})=>c(yh,{controls:u,children:[f,o($a,{isUnfolded:e,children:b})]}),renderFoldButton:Gr}):o(yh,{controls:u,children:g})})]})})),Nh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?wh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ee,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?kh(l):null,a?o(De,{__html:a}):null]})]}))),wh=()=>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"}),kh=e=>o(T,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ch=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ee,{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,l?o("div",{className:"gradient-color-text",children:o(Ee,{size:"text-h2",children:l})}):null]}))),Sh=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(Ch,{prefix:t,unit:l,suffix:n})})})),Th={AdTile:It,ApplicationForm:wn,ApplicationFormCustom:ra,BenefitsBlock:ua,BonusBenefitsBlock:Da,ButtonsBlock:Ea,Calculator:Oi,CardTransfer:Yi,Carousel:hr,CarouselBankHistoryCard:ur,CarouselCard:xr,CarouselCatalogCard:br,CarouselLinks:kr,CarouselRecommendationCard:Mr,CarouselTariffsCard:Pr,ComparisonTable:Ur,DepositFiltration:hs,ErrorBlock:xs,ExchangeRateTile:Fs,Footer:ro,Header:vo,Headline:B,HorizontalLayout:ko,ImgBlock:Co,LinkDocs:Mo,MobileAppTile:Po,MortgageFiltration:Jo,OfficesAtmsMap:hd,Placeholder:ud,ProductBlock:Tt,ProductGallery:pd,RepresentativeOfficeInfo:gd,RichTextBlock:bd,RollupItem:Ks,SafeDepositRental:$d,StepsBlock:Wd,StickyBottomMenu:$m,Tabs:Wm,TabsLayout:Qm,TariffsTable:vh,TextBlock:Nh,UnitBlock:Sh,VerticalLayout:wo},Ih="rshb-query-params";function Bh(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Ih)||"";return e&&globalThis.sessionStorage?.setItem(Ih,e),e}const Mh=he((()=>{a((()=>{Bh()}),[]),Ut(globalThis,"click",Vh)})),Vh=e=>{const t=Rh(e.target),[l]=E._.YANDEX_METRIKA_ID?.split(",").reverse()??[],n=t?.dataset?.ymtarget;if([l,n,globalThis.ym].every(Boolean)&&globalThis.ym(l,"reachGoal",n),L(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=Bh();if(!L(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(t?.href)||t?.href;l&&Ph(t?.target)?.(l)}},Rh=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Ph=As([[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)]]),zh="cookie",Ah=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=Et();um((()=>{globalThis.localStorage?.getItem(zh)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(zh,"true"),a()}),[]);return l?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:c(T,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Sr,{isRemote:!0,className:Dh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Sr,{isRemote:!0,className:Dh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(lm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),Dh=e=>p("inline mx-2xs",e?"text-green-dark":""),jh=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=tm({onCloseAll:e,onClose:t}),{close:n}=me(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return Ut(globalThis.document,"keydown",r),a((()=>{l.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"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Eh=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:_d(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return Ut(globalThis.document,"keydown",r),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Lh="header",$h="footer",Oh="sticky-footer",_h={},Fh=d((({className:e,data:t=_h,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=Ct(s,r);Mh();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(a?.header,{...m,slotName:Lh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[A({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),z(a?.footer,{...m,slotName:$h})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:z(a?.["sticky-footer"],{...m,slotName:Oh})}):null,o(jh,{}),o(Eh,{}),o(Ah,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(Fh,{childrenTypes:[],slots:()=>[Lh,$h,Oh]});e.Blocks=Th,e.ContentPage=Fh,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=he,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.238",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=U,e.useRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}));
|