@redneckz/wildless-cms-uni-blocks 0.14.700 → 0.14.702
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/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
- package/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/bundle/bundle.umd.js +252 -30
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/dist/api/RetailAPI/draftTasksKZO.js +9 -0
- package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
- package/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/dist/api/RetailAPI/getTaskById.d.ts +6 -0
- package/dist/api/RetailAPI/getTaskById.js +9 -0
- package/dist/api/RetailAPI/getTaskById.js.map +1 -0
- package/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
- package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
- package/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
- package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
- package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
- package/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/dist/ui-kit/DraftDialog/utils.js +85 -0
- package/dist/ui-kit/DraftDialog/utils.js.map +1 -0
- package/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/lib/api/RetailAPI/draftTasksKZO.js +6 -0
- package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
- package/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/lib/api/RetailAPI/getTaskById.d.ts +6 -0
- package/lib/api/RetailAPI/getTaskById.js +6 -0
- package/lib/api/RetailAPI/getTaskById.js.map +1 -0
- package/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
- package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
- package/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
- package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
- package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
- package/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/lib/ui-kit/DraftDialog/utils.js +78 -0
- package/lib/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/bundle/bundle.umd.js +252 -30
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.js +9 -0
- package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
- package/mobile/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/mobile/dist/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/dist/api/RetailAPI/getTaskById.js +9 -0
- package/mobile/dist/api/RetailAPI/getTaskById.js.map +1 -0
- package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
- package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
- package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
- package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.js +85 -0
- package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.js +6 -0
- package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
- package/mobile/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getTaskById.d.ts +6 -0
- package/mobile/lib/api/RetailAPI/getTaskById.js +6 -0
- package/mobile/lib/api/RetailAPI/getTaskById.js.map +1 -0
- package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +8 -8
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +6 -6
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
- package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
- package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
- package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.js +78 -0
- package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -0
- package/mobile/src/api/RetailAPI/draftTasksKZO.ts +33 -0
- package/mobile/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
- package/mobile/src/api/RetailAPI/getTaskById.ts +12 -0
- package/mobile/src/api/RetailAPI/updateUserTask.ts +8 -8
- package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
- package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
- package/mobile/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
- package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
- package/mobile/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
- package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
- package/mobile/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
- package/mobile/src/ui-kit/DraftDialog/utils.ts +148 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/draftTasksKZO.ts +33 -0
- package/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
- package/src/api/RetailAPI/getTaskById.ts +12 -0
- package/src/api/RetailAPI/updateUserTask.ts +8 -8
- package/src/components/ApplicationLeadForm/LeadFormState.ts +6 -6
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
- package/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
- package/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
- package/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
- package/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
- package/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
- package/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
- package/src/ui-kit/DraftDialog/utils.ts +148 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function B(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const R=[],P=(e,{key:t,ancestors:n=R,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||R,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function E(){return E._impl()}E._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),E.setup=e=>{E._impl=e};const A=["CDN","BASE_PATH"],M=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:O,isHash:z,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:F,hasPrefix:V});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),z(t),[M.CDN,q].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const i=t?.startsWith("/");return F(V(t,n)?"":n,i?"/":(a=e.pathname,a?.split("/").slice(0,-1).join("/")),t);var a},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=E(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(F(M.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=E();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):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","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(i,a)=>(n.current||={},n.current[a]||=n=>e.fire(t,{...n??{},type:a}),n.current[a])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=E(),{closeAll:n}=he();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),ge(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}const ge=(e,t,n)=>{if(!O(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),ye=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=pe()({onClick:r,href:i,...a}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:i,version:n}),children:a})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=E(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Re(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Re=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ee=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:i=!0,children:a})=>e||a?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:a})}):null)),Ae=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?_e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null,"__html"in e?o(Ee,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Oe(n)})]}))),Fe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...t}))),qe=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map($e(n))}):null,$e=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=Ue(a,r),d=Ue(l,r);return i||a?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...a,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>qe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=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(Ke)}):null)),Ke=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[He(2)(t)," ",n||"₽"]}):null]},String(i)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,R=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Qe(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ee,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const nt=()=>!0,it=(e,t)=>(...n)=>e(...n)&&t(...n),at=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(lt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class dt extends tt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class ut extends tt{proto=at([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,i=gt)=>ht(t).entries().reduce(((t,[n,a])=>xt(e)(a,t,i.concat(n))),e(n,[i,ht(t)])),yt=pt(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?yt(e.get(i),[a,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(it,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=at([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(i=e,i.slice(0,-1)),kt(t(n),n)]:[e,n];var i}))(e),Bt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Rt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Et=e=>[...new Set(e)],At={},Mt=["/portal-resources"],_t=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Rt(e),[l,r]=i({});return a((()=>{zt(n).then(r)}),[n.join()]),n.length?_t(e,{...t,...l}):e},zt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Et(e).filter((e=>!Mt.some((t=>e.startsWith(t))))).map((async e=>[e,At[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),i={...t,...n},a=Object.entries(n).flatMap((([,e])=>Rt(e)));return a.length?zt(a,i):i}return t};function Ft(e,t={}){const n=d((t=>{const n=Ot((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=Ft((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>qt(0,t?.length)),[t]),i=t?.[n];return i?o(Vt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),qt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),jt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},$t=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:$t(e)}:{},Ht=(e,t="birthday")=>e?{[t]:jt(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:$t(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)};function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(_(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const i=(e=>{const t=Qt();if(!_(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;i&&n.assign(i,t?.target)}};function tn(){return tn._impl()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=nn,format:i=nn}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})}));function sn(e,t={}){const{open:n,close:i,...a}=he();return{open:l(((a,l={})=>n({dialog:o(e,{...t,...a,onClose:()=>{i(),a.onClose?.()}}),...l})),[e,n,i]),close:i,...a}}function on(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function cn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?hn:"border-error",gn=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,fn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=pn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[gn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:i,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);a((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(fn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(i,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Bn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Rn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=i(""),C=Mn(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.open({popup:o(Pn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[gn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(r)||h}),En(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(fn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),En=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Mn=(e,t)=>e||0===t,_n=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Dn,{...a,valid:!n,label:mn({label:t,errors:i})}),yn(n)]}))),On=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],Fn=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>Fn(e??Vn),jn=e=>zn((e=>e?.key&&""!==e?.key))(e??Vn),$n=e=>zn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>zn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>zn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>zn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,zn((e=>"string"==typeof e&&t.test(e))))(e);var t},Kn=zn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Gn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Xn=e=>Boolean(e.region&&e.city&&e.house),Jn=()=>zn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d]+$/u,Qn=(e="")=>Zn.test(e),ei=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},ti={typeForm:qn(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:jn(),addressBranch:jn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),limitedBirthday:zn(ei)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:qn("Укажите место рождения"),education:jn("Выберите ваше образование"),housing:jn("Выберите тип жилья"),employment:jn("Выберите информацию о трудоустройстве"),organization:jn("Выберите тип организации"),amountWorkers:jn("Выберите информацию о количестве сотрудников"),employerActivities:jn("Выберите вид деятельности организации"),employerOrganization:jn("Выберите вид организации"),positionOrganization:jn("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>zn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Un(),inn:(e=>zn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:$n("Укажите количество лет стажа"),lastJobExperience:$n("Укажите стаж на последнем месте работы"),experience5Years:$n("Укажите общий стаж за последние 5 лет"),jobsNumber:$n("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:jn(),feedbackMethod:jn(),serviceType:jn(),serviceDirection:jn(),regionRetail:jn("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Kn,annualRevenue:qn(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:jn("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Gn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Kn,sex:qn("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:jn("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:jn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Jn(),cardCategory:qn("Укажите категорию карты"),paymentSystem:qn("Укажите тип платежной системы"),currency:qn("Укажите валюту")};var ni;const ii=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(_n,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=(e,t=di)=>n=>{const i=hi(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l},ui=e=>Boolean(e?.every((e=>Array.isArray(e)?ui(e):!e||"string"==typeof e))),hi=e=>ui(e)?e.toString():"",pi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function gi(e,t,{fallback:n,cache:l}={}){const s=r((()=>fi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await mi(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&pi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function fi(e){return Array.isArray(e)?e:e instanceof Function?fi(e()):[e]}const xi=`${Ut}/branches`,yi=[];const bi=async e=>await Pt(e,{method:"GET"})||yi;function vi(e=!1){const{data:t}=gi(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Ni=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?vi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=gi(e?`${xi}?regionCode=${e}`:null,bi);return t||yi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(_n,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),wi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),Ci=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Si=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.(ki(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),ki=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.house,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Ii=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ti="appearance-none w-5 h-5 border-solid flex-none",Bi=[{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"}],Ri=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ii,{paths:Bi,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Di(i)),onClick:s,children:[o("div",{className:u(Ti,"m-0",a?"rounded-full border-2":Ai(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ei(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Pi(n)]})})})),Pi=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,Di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ei=(e=!1)=>e?"radio":"checkbox",Ai=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Mi=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Ri,{text:t,value:n,disabled:a,onChange:r},i),yn(l)]}))),_i=d((({field:e,input:t})=>o(Mi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Oi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),zi="/icons/MapMarkerClusterIcon.svg",Fi="/icons/MapMarkerClusterYellowIcon.svg";function Vi({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=Li("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=Li("workplaces",e,a),r=qi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=qi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=qi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Li=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?zi:Fi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),qi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?zi:Fi,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ji={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},$i={...ji,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Ui=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values($i).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Wi=e=>globalThis[e];function Hi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=Wi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Wi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(Wi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const Yi={...ji,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ki=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Yi).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Gi=[55.753995,37.614069],Xi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=Hi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${M.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?Vi({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ji(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Vi({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Oi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ki,{yandexMaps:r}),o(Ki,{yandexMaps:r,direction:"out"})]}),Ui(r,m,u("right-2 top-80",h))]})})),Ji=e=>{const t=[Qi(Zi(e,0)),Qi(Zi(e,1))];return t.every((e=>e))?t:Gi},Zi=(e,t)=>e.map((e=>e.coords?.[t])),Qi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ea=async(e,t,n)=>{try{return(await ta(e,t,n)).json()}catch(e){return console.error(e),null}};async function ta(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...na()},credentials:"include",body:n?JSON.stringify(n):null})}const na=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ia=e=>Number(e.toString().replace(",",".")),aa=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const la=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),ra=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:sa({textItems:l,subText:t,children:n,isPhone:i,...a})})),sa=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||oa(n,s),a?o(Me,{color:i,size:"text-m",children:a}):null]}),oa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${ca(e)}`,children:e.trim()}):e.trim()},String(n)))),ca=e=>e.replace(/\D/g,""),da=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),ma=e=>{const t=ha(e);return o(ra,{label:"Режим работы",value:t,className:"max-w-none"})},ua=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ha=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ua({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),ua({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},pa=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ga=e=>pa.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),fa=e=>{if(!e)return null;const t=xa(e);return c(da,{className:"border-none",children:[o(ra,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ya)})}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},xa=e=>{const t=pa.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},ya=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Me,{size:"text-xs",children:e})},String(n)),ba=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(ra,{label:"Валюта",value:e.currency}):null,t?o(ra,{label:"Купить",value:String(t)}):null,n?o(ra,{label:"Продать",value:String(n)}):null]},String(i)),va={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"}},Na=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",va[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Me,{size:"text-m",color:va[n].text,children:t})]}))),wa=(new Date).getDay(),Ca=e=>{const[t]=e?.slice(wa-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Na,{color:"green",children:a}):null,n&&l?o(Na,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Na,{color:"red",children:"Выходной"})},Sa=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",ka=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(ra,{label:e,value:t&&n?n:"",subText:Sa({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),Ia=["ArrowDownIcon","ArrowUpIcon"],Ta=["Подробнее","Скрыть"],Ba=({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:Ta[Number(e)]}),o(W,{className:"text-primary-text",name:Ia[Number(e)],width:"16",height:"16"})]}),Ra=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Pa=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Da=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ea=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ga(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),Ca(h)]}),o("div",{className:"hidden sm:block",children:Aa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:Aa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(u))},Aa=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ga(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(da,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(ra,{label:"Факс",value:t,isPhone:!0}),o(ra,{label:"Телефон филиала",value:e,isPhone:!0}),o(ra,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(ra,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(ra,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(ra,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(da,{children:o(ra,{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(ka)})})}):c(da,{children:[o(ra,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ya)})}),ma(d)]}),r?.businessScheduleVisibleTag?fa(r?.businessScheduleDescription):null,s?.currencies?.length?o(da,{className:"flex-wrap",children:s?.currencies?.map(ba)}):null]})},Ma=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ga(e),n=e?ha(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ra(n):Da(n,i):Pa(n):""})(n)}`;return{header:i,body:l}},_a={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Oa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},za={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Fa=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>za[t](e)))))},Va=()=>{},La=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Va,getBalloonRemoteWorkplaces:a=Va})=>{const[l,s,o,c]=r((()=>{const l=Fa(e,n),r=Fa(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},qa=e=>{const{data:t,error:n}=gi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ja);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ja=async e=>await Pt(e,{method:"POST"})||[],$a=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Ua=d((({children:e})=>$a?e:null)),Wa=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=qa("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>{const t=await ea("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ia(e.latitude??Gi[0]),gpsLongitude:ia(e.longitude??Gi[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=La({data:n,filtrationState:{},getBalloon:Ma}),u=Boolean(s?.key);return c("div",{children:[o(_n,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Ua,{children:o(Xi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Ha=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},Ya=(e,t,n)=>Math.max(t,Math.min(e,n));function Ka(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ga({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=Ka(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const Xa=1,Ja=100,Za=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:Xa),max:s=(a.length?a.length-1:Ja),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=Ha(e,{normalize:(e=0)=>a.length?Qa(a)(e):Ya(e,r,s),format:He()}),f=l((e=>{p&&p(Ka(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ga({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),el(i)]})})),Qa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),el=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),tl=["От 1 000 ₽","До 1 000 000 000 ₽"],nl=d((({field:e})=>o(Za,{title:"Сумма, ₽",items:tl,min:1e3,max:1e9,...e("amount")})));function il(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const al={};function ll(e,t=al){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const rl=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var sl,ol;function cl(e){return ll(rl,e)}sl=rl,ol=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),il(sl,ol),il(ol,sl),sl.bus.watch((({type:e,event:t})=>{null!=t?ol.setItem(e,t):ol.removeItem(e)}));const dl=()=>cl(),ml=Ft((({field:e,source:t,fieldName:n,input:i,placeholder:a="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(_n,{placeholder:a,options:s,...li(e(n),ti[n],i?.required),...r})})),ul=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYEES_NUMBER"),i=dl();return a((()=>{n&&(i.amountWorkers=n)}),[n]),o(ml,{field:e,source:i.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),hl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),pl=d((({field:e,input:t})=>o(Mi,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),gl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),fl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),xl=d((({field:e,input:t})=>o(Mi,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),yl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=bl(t,e),c=vl(t,l,r);u.push(o("td",{children:o("div",{className:Nl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},bl=(e,t)=>t&&e.toDateString()===t.toDateString(),vl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Nl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),wl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Cl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:wl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:yl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Sl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function kl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Il),l=i.map(((e,t)=>Bl(e)?i.slice(0,t).filter(Bl).length:-1)),r=i.map(((e,t)=>Tl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Il=e=>"_"===e,Tl=e=>/\d/.test(e),Bl=e=>Il(e)||Tl(e),Rl=1940,Pl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Dl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(kl(t,"__.__.____"))},onBlur:()=>{if(El(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Pl})]})})),El=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Rl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Al=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Dl,{onChange:i,disabled:r,onClick:e,value:t&&jt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Ml=Sl.map((e=>({key:e}))),_l=Array.from({length:(new Date).getFullYear()-Rl+1},((e,t)=>Rl+t)).reverse().map((e=>({key:String(e)}))),Ol=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},zl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Fl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Vl={className:"min-w-32",iconVersion:"black",isBorder:!1},Ll=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Sl.indexOf(e));const t=Ol(r,Sl.indexOf(e));zl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Sl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Ml,yearsOptions:_l,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[gn(t),c("div",{className:"relative",children:[Al({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Fl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Sl[f]},options:S,...Vl}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Vl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Fl,className:"rotate-90 cursor-pointer"})})]}),o(Cl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),ql=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ll,{label:mn({label:t,errors:i}),valid:Boolean(!n),...a}),yn(n)]}))),jl=d((({field:e,input:t})=>o(ql,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),$l=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...li(e("birthday"),ti.birthday,t?.required)}))),Ul=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ci(e,"birthPlace")}))),Wl=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Hl(e){const t=globalThis.localStorage?.getItem(e),[n,a]=i(t?Wl(t):null);return[n,l((t=>{a((n=>{const i=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(i)),i}))}),[e])]}const Yl=d((({field:e,input:t})=>{const[n,l]=i([]),[r]=Hl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.type;return a((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ea("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Kl(e,s)||c&&c(null)})()}),[d]),o(ml,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Kl=(e,t)=>e.some((e=>e.key===t?.key)),Gl=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...li(e("children"),ti.children,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),Jl=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...li(e("collectionCount"),ti.collectionCount,t?.required)}))),Zl=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Ql=d((({field:e,input:t})=>{const{data:n}=qa("INCOME_CERT_UNITED");return o(ml,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),er=d((({field:e,input:t})=>{const{data:n}=qa("MILITARY_STATUS");return o(ml,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),tr={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function nr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const ir={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"},ar={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},lr=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(nr(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(ir[a],ar[a]),i),type:s,role:d,onClick:m,children:e})})),rr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:a,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),or=d((({src:e,convertToPng:t,onClose:n})=>c(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(lr,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),cr=e=>{const{open:t}=sn(or),n=ke();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ta(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:i})}}),[t,e,n])},dr=d((({className:e,error:t,docId:n,...i})=>{const a=cr(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Ri,{...i}),n?o(Ne,{className:"text-primary-main",onClick:a,children:o(Me,{children:"Ознакомиться"})}):null]}),yn(t)]})})),mr=d((({field:e,input:t})=>t&&t.name?o(dr,{text:tr[t.name]?.text,docId:tr[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),ur=Math.round(29.5),hr=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),pr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",gr="flex flex-col lg:w-1/2 gap-2xl",fr="flex flex-col gap-y-xl min-w-52",xr=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(Me,{size:"text-h3",children:"number"==typeof e?[i,He(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),yr=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(xr,{value:n,...a}):o(Me,{size:"text-h3",children:"-"})]}))),br=(e=[],t=!1)=>vr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),vr=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},Nr=(e,t=0)=>e?.sum?e.sum:t,wr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Cr=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Sr=({min:e=0,max:t=0,availableMonths:n,...i})=>o(Za,{items:[`От ${kr(e)}`,`До ${kr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),kr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ir={horizontal:"@lg:flex-row",vertical:""},Tr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ir[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Ri,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),Br=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(Tr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Rr=e=>Br({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Pr=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(Za,{items:e?[`От ${He(1)(i.min||0)} ${n}`,`До ${He(1)(i.max||0)} ${n}`]:[],step:t,...i}),Dr=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(Ya(t?.[a],n.minMonths,n.maxMonths))},Er=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},Ar=e=>e,Mr=(e=Ar)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),_r=Mr(),Or=(e=Ar)=>Mr((t=>-e(t))),zr=Or(),Fr=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Vr([e,t],i),Vr=([e,t],n=[])=>({[e]:n.length?zr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?_r(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Lr=(e,[t,n],i)=>e>=i[t]&&e<=i[n],qr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},jr=e=>$r({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$r({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&$r({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&$r({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$r=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Ur=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[qr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>jr({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Fr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Fr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>jr({row:e,userInputParams:t,paramsViewSettings:n})&&Lr(i,["minSum","maxSum"],e)&&Lr(a,["minMonths","maxMonths"],e)))||qr)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=Er(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},Wr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Hr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Yr=Ft((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,vr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Nr(s,2e5),monthsValue:wr(s,ur),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});a((()=>{x&&d?.(g)}),[g,x]);const y=Ur(g,n,r),b=Rr({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(Ya(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(Ya(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!Wr(s)&&h&&Dr({field:f,defParams:h,calcParams:y,map:Hr,monthsValue:"minMonths"})}),[n,s]),o(hr,{className:e,title:t,...m,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Sr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Kr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(fr,"@4xl:w-1/2"),children:[o(yr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(yr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Cr(l)]})]})})})),Kr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Ri,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Ri,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Ri,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Gr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Xr=(e,t=!1)=>{const n=t?Jr(Gr):Gr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Jr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Zr="calculator",Qr=d((({field:e,params:t})=>{const n=l((t=>{e(Zr).onChange?.(t)}),[]);return o(Yr,{...t?.calcData,padding:"p-0",defaultParams:Xr(e(Zr).value),onChange:n})})),es=d((({field:e,input:t})=>{const{data:n}=qa("CREDIT_IN_RSHB");return o(ml,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),ts=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Tr,{label:mn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),yn(i)]}))),ns=[{id:"810",text:"Рубли"}],is=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency"),{data:a}=qa("CURRENCY"),l=a?.map((e=>({id:e.key,text:e.value})))??ns;return o(ts,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),as=d((({field:e,input:t})=>o(ql,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),ls=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),rs=d((({field:e,input:t})=>o(ql,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),ss=d((({field:e,input:t})=>o(Mi,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),os="dulIssueDateField",cs=d((({field:e,input:t})=>o(ql,{label:"Дата выдачи",...li(e(os),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ci(e,os)}))),ds="dulIssuedBy",ms=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ds),label:"Кем выдан",...t,...li(e(ds),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),us=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),hs=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),ps="dulSubdivisionCode",gs=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ps),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...li(e(ps),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),fs=d((({field:e,input:t})=>{const{data:n}=qa("EDUCATION_LEVEL");return o(ml,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),xs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),ys=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_ACTIVITY_TYPE"),i=dl();return a((()=>{n&&(i.employerActivities=n)}),[n]),o(ml,{field:e,source:i.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),bs=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_KIND"),i=dl();return a((()=>{n&&(i.employerOrganization=n)}),[n]),o(ml,{field:e,source:i.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),vs=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYMENT_INFO_UNITED");return o(ml,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ns=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...li(e("expenses"),ti.expenses,t?.required),...t}))),ws=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),Cs=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ss=d((({field:e,input:t})=>{const{data:n}=qa("MARITAL_STATUS");return o(ml,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),ks=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Is=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ts=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bs=d((({field:e,input:t})=>o(_n,{label:"Способ получения ответа",options:Ts,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),Rs=d((({field:e,input:t})=>o(kn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),Ps=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ds=d((({field:e,input:t})=>{const{data:n}=qa("HOUSE_TYPE");return o(ml,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Es=e=>t=>e.map((e=>({key:t,text:e.value||""}))).find((e=>e.key===t))??null,As=(e,t,n)=>{const i=n.data?.inn??"",a=Number(n.data?.opf?.code),l=n.data?.okved??"";t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(ki(n.data?.address)),t?.("amountWorkers")?.onChange?.(((e,t)=>{const[n]=[e?.find((e=>Number(t)<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n})(e?.amountWorkers,n.data?.employee_count)),t?.("employerActivities")?.onChange?.(((e,t)=>{if(!t)return null;const n=Es(e),i=+t?.split(".")[0],a=+t?.split(".")[1];switch(i){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(a<22?"GOVERNANCE":22===a?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(i>=10&&i<=33?"INDUSTRY":i>=5&&i<=9?"FUEL_AND_ENERGY":i>=49&&i<=53?"TRANSPORT":"OTHER_SECTORS")}})(e?.employerActivities??[],l)),t?.("organization")?.onChange?.(((e,t,n)=>Es(e)("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL"))(e?.organization??[],a,i)),t?.("employerOrganization")?.onChange?.(((e,t)=>{const n=Es(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")})(e?.employerOrganization??[],a))},Ms=d((({field:e,input:t})=>{const n=dl(),i=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),As(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:i})})),_s=d((({field:e})=>o(Mi,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Os=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),zs=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Fs=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Vs=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Ls="limitedBirthday",qs=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...li(e(Ls),ti.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ci(e,Ls)}))),js=`${Ut}/outservice`,$s=[];async function Us(){const e=await Pt(`${js}/outserviceregions`);return e&&Array.isArray(e)?e:$s}const Ws=d((({field:e,input:t})=>{const n=e("region"),i=n?.value?.key,{data:l}=gi("outServiceRegions",Us),r=l?.find((e=>e.code===i))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==i&&e?.("localities")?.onChange?.("")}),[i]),o(_n,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),Hs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),Ys=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Ks=d((({field:e,input:t})=>o(ts,{orientation:"horizontal",items:Ys,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),Gs="middleName",Xs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ci(e,Gs),...li(e(Gs),ti.middleName,t?.required),...t}))),Js=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ci(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),Zs=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Qs=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Zs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),eo=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_TYPE"),i=dl();return a((()=>{n&&(i.organization=n)}),[n]),o(ml,{field:e,source:i.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),to=d((({field:e,input:t})=>{const n=dl(),i=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),As(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:i})})),no=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),io=d((({field:e,input:t})=>o(ql,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),ao="partInBusiness",lo=d((({field:e,input:t})=>{const n=l((t=>{e(ao)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...li(e(ao),ti.partInBusiness,t?.required),...t,onChange:n})})),ro=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),so=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Hl("programId"),[c,d]=i([]);a((()=>{s&&(async()=>{const e=await(async e=>{const t=await ea("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems||[]})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.type===e)))),[c,r]);return o(ts,{label:"Платежная система",orientation:"horizontal",items:oo(c),...li(e("paymentSystem"),ti.paymentSystem,t?.required),value:n?.type,onChange:m})})),oo=e=>e?.map((e=>({id:e.type,text:e.name})))??[],co=e=>"_"===e,mo=e=>/\d/.test(e),uo=e=>co(e)||mo(e),ho=[..."+7 (___) ___-__-__"],po=ho.findIndex(co),go=ho.map(((e,t)=>uo(e)?ho.slice(0,t).filter(uo).length:-1));function fo(e){const t=e.replace(/\D/g,""),n=ho.map(((e,n)=>mo(e)?e:t.charAt(go[n])||e)),i=go.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(po,i)):n).join("")}const xo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(fo(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),yo=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(xo,{"aria-label":t,label:mn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),yn(n)]}))),bo=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(yo,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&Ci(e,n),...t})})),vo=d((({field:e,input:t})=>{const{data:n}=qa("POSITION");return o(ml,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),No=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Zs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),wo=d((({field:e,source:t})=>o(_n,{placeholder:"Выберите продукт",label:"Продукт",options:Co(t?.productList),...ai(e("product"),ti.product)}))),Co=e=>(e??[]).map((e=>({key:e,value:e}))),So=`${Ut}/outservice/outserviceregions`,ko=`${Ut}/regions`,Io=[];function To(e=ko){const{data:t}=gi(e,Dt);return Array.isArray(t)?t:Io}const Bo=d((({field:e,input:t,params:n})=>{var i;const a=To((i=n?.typeForm,"OUTSERVICE"===i?So:void 0));return o(_n,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...li(e("region"),ti.region,t?.required)})})),Ro=d((({field:e,input:t})=>{const n=vi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(_n,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),Po=d((({field:e,input:t})=>{const{data:n}=qa("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(_n,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),Do=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),Eo=d((({field:e})=>{const t=e("secondaryPhone");return o(yo,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),Ao=d((({field:e,input:t})=>o(_n,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Is,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),Mo=["male","female"],_o=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Oo=d((({field:e,input:t})=>{const n=e("name")?.value,{value:i,onChange:l}=e("sex");return a((()=>{n&&!i&&(async()=>{const e=await(async e=>{const t=await ea("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return Mo.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(ts,{label:"Пол",orientation:"horizontal",items:_o,...li(e("sex"),ti.sex,t?.required)})})),zo=d((({field:e,input:t})=>o(Mi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Fo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(kl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Vo=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fo,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),yn(i)]}))),Lo=d((({field:e,input:t})=>o(Vo,{label:"СНИЛС",...li(e("snils"),ti.snils,t?.required),...t}))),qo=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ci(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),jo=["От 1 мес","До 15 лет"],$o=d((({field:e})=>o(Za,{title:"Срок, месяцев",items:jo,min:1,max:180,...e("term")}))),Uo=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Wo=d((({field:e,input:t})=>o(_n,{label:"Тип обслуживания",options:ks,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ho=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Yo=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Tr,{className:"whitespace-normal",orientation:"horizontal",items:Ho,value:t,onChange:e=>n&&n(e)})})})),Ko=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Go={$ref:"/wcms-resources/outservice-productlist.json"},Xo=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(qo,{field:e,input:n}),name:o(Js,{field:e,input:n}),middleName:o(Xs,{field:e,input:n}),phone:o(bo,{field:e,input:n}),organizationPhone:o(bo,{field:e,input:n}),email:o(xs,{field:e,input:n}),fullName:o(Rs,{field:e,input:n}),inn:o(Ms,{field:e,input:n}),legalForm:o(Vs,{field:e,input:n}),organizationName:o(to,{field:e,input:n}),generalSeniority:o(Ps,{field:e,input:n}),lastJobExperience:o(zs,{field:e,input:n}),experience5Years:o(ws,{field:e,input:n}),jobsNumber:o(Os,{field:e,input:n}),beginDate:o(jl,{field:e,input:n}),addressFact:o(wi,{field:e,input:n}),organizationAddress:o(Si,{field:e,input:n}),comment:o(Zl,{field:e,input:n}),addressBranch:o(Ni,{field:e,input:n,isPremium:a}),sex:o(Oo,{field:e,input:n}),birthday:o($l,{field:e,input:n}),limitedBirthday:o(qs,{field:e,input:n}),birthPlace:o(Ul,{field:e,input:n}),desiredMeetingDate:o(rs,{field:e,input:n}),product:o(wo,{field:e,source:Go}),localities:o(Ws,{field:e,input:n}),isClient:o(_s,{field:e}),partnerComments:o(ro,{field:e,input:n}),collectionCount:o(Jl,{field:e,input:n}),acquiringType:o(si,{field:e,input:n}),onlineCheckout:o(Qs,{field:e}),posTerminal:o(No,{field:e}),serviceType:o(Wo,{field:e,input:n}),term:o($o,{field:e}),amount:o(nl,{field:e}),annualRevenue:o(hl,{field:e,input:n}),vedTypes:o(Yo,{field:e}),feedbackMethod:o(Bs,{field:e,input:n}),serviceDirection:o(Ao,{field:e,input:n}),bankEmpolee:o(fl,{field:e}),secondaryPhone:o(Eo,{field:e}),consentToReceiveMaterials:o(mr,{field:e,input:n}),processPersonalDataFlg:o(mr,{field:e,input:n}),consentProviderFlg:o(mr,{field:e,input:n}),consentOthersFlg:o(mr,{field:e,input:n}),consentInformFlg:o(mr,{field:e,input:n}),consentPfrFlg:o(mr,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(Ro,{field:e}):o(Bo,{field:e,input:n,params:t}),education:o(fs,{field:e,input:n}),housing:o(Ds,{field:e,input:n}),employment:o(vs,{field:e,input:n}),organization:o(eo,{field:e,input:n}),amountWorkers:o(ul,{field:e,input:n}),employerActivities:o(ys,{field:e,input:n}),employerOrganization:o(bs,{field:e,input:n}),positionOrganization:o(vo,{field:e,input:n}),familyStatus:o(Ss,{field:e,input:n}),children:o(Gl,{field:e,input:n}),familyMembers:o(Cs,{field:e,input:n}),dependents:o(ls,{field:e,input:n}),totalIncome:o(Uo,{field:e,input:n}),expenses:o(Ns,{field:e,input:n}),snils:o(Lo,{field:e,input:n}),conscription:o(er,{field:e,input:n}),armyIdFlg:o(pl,{field:e,input:n}),dulSerie:o(hs,{field:e,input:n}),dulNumber:o(us,{field:e,input:n}),dulIssueDateField:o(cs,{field:e,input:n}),dulSubdivisionCode:o(gs,{field:e,input:n}),dulIssuedBy:o(ms,{field:e,input:n}),addressRegistration:o(Si,{field:e,input:n}),addressCourier:o(Si,{field:e,input:n}),participantDateRegistration:o(io,{field:e,input:n}),retirementIncome:o(Do,{field:e,input:n}),otherIncome:o(no,{field:e,input:n}),wages:o(Ko,{field:e,input:n}),mandatoryPayments:o(Hs,{field:e,input:n}),disablePeopleFlg:o(ss,{field:e,input:n}),bankruptcyFlg:o(xl,{field:e,input:n}),shareholderFlg:o(zo,{field:e,input:n}),legalEntityName:o(Fs,{field:e,input:n}),creditInRshbCd:o(es,{field:e,input:n}),bankEmployeeCode:o(gl,{field:e,input:n}),partInBusiness:o(lo,{field:e,input:n}),regionRetail:o(Po,{field:e,input:n}),addressRetail:o(Wa,{field:e,input:n}),addressMatch:o(_i,{field:e,input:n}),paymentSystem:o(so,{field:e,input:n}),currency:o(is,{field:e,input:n}),cardCategory:o(Yl,{field:e,input:n}),codeWord:o(Xl,{field:e,input:n}),confirmationIncome:o(Ql,{field:e,input:n}),methodObtain:o(Ks,{field:e,input:n}),deliveryDate:o(as,{field:e,input:n}),calculator:o(Qr,{field:e,params:t})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(i)):null},Jo=e=>2===e?"@xl:grid-cols-2":"",Zo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Qo=d((({responseType:e,typeForm:t,onClose:n})=>{const i="OK"===e,a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:i?"Ваша заявка отправлена":"Не удалось отправить заявку",description:i?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(lr,{type:"button",onClick:n,children:"Хорошо"})]})})})),ec=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],tc=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ic(o),...nc(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},nc=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ic=e=>e?{vedTypes:Object.fromEntries(Ho.map((({id:t})=>[t,t===e])))}:{},ac={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ks[0],feedbackMethod:Ts[0],serviceDirection:Is[0],vedTypes:Ho[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},lc=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),rc=(e,t)=>o(lr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),sc=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Ri,{...e}),o(lc,{link:t})]}),yn(ai(e,Kn).error)]}):o(lc,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),rc(n)]}),oc={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(i,g),...Kt(l,g),...Wt(a),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},cc=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||ac[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=ks[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=sn(Qo),C=l((async(e,t)=>{const i=dc(x,e),a=ec(ii(i));if(!On(a(e)))return console.warn("validation fail");const l=tc({...e,...h}),r=await oc.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&N.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Jo(e.columns),"grid gap-x-m"),children:[Zo(e.title),(e?.inputs||[])?.map(Xo(S,{typeForm:n}))]},`section-${t}`))),sc(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),dc=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)})))),mc=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(aa,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(la,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Xo(n,{typeForm:t}))}),renderFoldButton:uc(c("div",{children:[o(Ri,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),uc=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),hc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=pc(n||[]);return i.length>2?c("div",{children:[a.map(Xo(e,{typeForm:t})),o(mc,{inputs:i,field:e})]}):(n||[])?.map(Xo(e,{typeForm:t}))},pc=e=>({consentInputs:e?.filter((e=>Object.keys(tr).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(tr).includes(e.name||"")))||[]}),gc=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],fc=(e,t)=>o(lr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),xc=e=>ta("/user-data/updateUserProfile","PUT",e),yc=e=>ta("/user-data/updateUserTask","PUT",e),bc=(e,t)=>l((n=>{const i=n instanceof Function?n(e[t]):n;null!=i?e[t]=i:delete e[t]}),[e,t]),vc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),Nc={width:"103",height:"21"},wc={"bg-white":"color",transparent:"white"},Cc={"bg-white":"text-primary-main",transparent:"text-white"},Sc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:wc[e]},className:Cc[e],width:n?.width,height:n?.height}),kc={"bg-white":"text-primary-text",transparent:"text-white"},Ic=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[Sc(l,n?.image,Nc),r?i??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:kc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Tc=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=i(""),[d,m]=i(""),[u,h]=i(!1),p=l((async()=>{const e=await(i={captchaText:d},ta("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>ta(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(g,[]),o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Ic,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(fn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(lr,{onClick:close,version:"secondary",children:"Вернуться"}),o(lr,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Bc=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Rc(e)})))),Rc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Pc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:Dc(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),Dc=(e,t,n=!1)=>{const i=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!i)} rounded-md caret-transparent outline-none`},Ec=d((({isDisabled:e,onClick:t,text:n})=>o(lr,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-normal",children:n})}))),Ac=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Mc=({values:e,onSuccess:t})=>{const[n,r]=i(""),[s,o]=i(!1),[c,d]=i(0),[m,u]=i(!1),[h,p]=i(0),g=l((()=>r("")),[]),f=Boolean(0===c&&m),x=h>2||f||!e.every(Boolean),y=l((async()=>{try{u(!1),d(0),p((e=>e+1)),o(!0),await(async e=>ea("/sms/checkCode","POST",e).then(Ac))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),g(),t?.(e.join(""))}catch{r(h>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{o(!1)}}),[e,h]);return a((()=>{r(f?"Код просрочен":"")}),[f]),{handleSubmit:y,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:c,isSubmitButtonDisabled:x,setTimeNextReq:d,setIsTimerStarted:u,setAttempts:p}},_c=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=i(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Mc({values:m,onSuccess:s}),w=sn(Tc),C=$t(e),S=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},ea("/sms/sendCode","POST",e).then((t=>!vc(t,e.phoneNumber))))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:S,onClose:d})}),[C,d]);return a((()=>{S()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Pc,{values:m,setValues:u,errorText:g,hasError:p}):null,zc(x,b,S),c(Ee,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),Oc(y,h),f?o(Oi,{blur:!1}):null]})})})),Oc=(e,t)=>o(Ec,{text:"Далее",isDisabled:e,onClick:t}),zc=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Bc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Fc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Vc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Lc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],qc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,a]=i(""),[r,s]=i(!1),d=cr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),h=r?Vc:Fc;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(Tr,{className:"whitespace-normal",orientation:"horizontal",items:Lc,value:n,onChange:u}),o(lr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),jc=d((({onClose:e})=>{const t=Jt(),[n,i]=Hl("leadForm"),a=l((async()=>{const e=await(n={redirectUri:t.href},ea("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),r=l((()=>{if(null!==n){const e={...n};Reflect.deleteProperty(e,"esiaAccountTypeCd"),i(e)}e?.()}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:r,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex flex-wrap gap-lg w-full",children:[o(lr,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(lr,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),$c={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Uc={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Wc={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Hc=e=>Object.entries(e).reduce(((e,[t,n])=>t in $c?[...e,{contactTypeCd:{key:$c[t]},value:n}]:e),[]),Yc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Uc){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Uc[t]},...i}]}return e}),[]),Kc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Wc?[...e,{incomeTypeCd:{key:Wc[t]},value:Number(n||0)}]:e),[]),Gc=()=>cl(),Xc=({inputs:e,programId:t,nextStepLink:n})=>{const[a,r]=i(""),s=Gc(),o=bc(s,"leadForm"),c=(e=>{const{open:t}=sn(jc),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),d=(e=>{const{open:t}=sn(qc),n=sn(_c),i=t=>async n=>{try{t&&await xc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},a=(t,a)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:i(a)}):e()};return{open:(n,i)=>t({onSubmit:a(n,i),onClose:e})}})(c),m=sn(_c),u=l((({participantId:e,taskId:t,profileId:n,programId:i})=>{s.participantId=e,s.taskId=t,s.profileId=n,s.programId=i}),[]);return{handleSubmit:l((async n=>{const i=ec(ii(e));var a;if(On(i(n)))try{const e=await(a={profile:{phone:$t(n.phone)}},ea("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await Jc({programId:t,profileId:e,formData:n,saveUserData:u,saveForm:o}),m.close(),d.open(n.phone,e)}catch{r("Fail")}},a=Object.keys(tr).filter((e=>n[e])).map((e=>tr[e]?.text));m.open({phone:n?.phone,consents:a,onSuccess:i})}}catch{r("Fail")}}),[]),responseStatus:a}},Jc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=Zc(n);await xc(((e,t)=>{const{name:n="",surname:i="",middleName:a="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&jt(l,!0),email:s,phone:$t(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await ea("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await yc((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&jt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:Hc({phone:o&&$t(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l}))}catch(e){console.log(e)}i({participantId:s,taskId:r,profileId:t,programId:e}),a(n)},Zc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Qc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ks[0],feedbackMethod:Ts[0],serviceDirection:Is[0],vedTypes:Ho[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:{name:"",type:""},cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},ed=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Qc[e.name||""]]))),typeForm:{key:"",text:""}}},td=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:fo(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:nd(a),addressFact:nd(l),esiaAccountTypeCd:t?.esiaAccountType}},nd=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},id=(e,t)=>{const n=Jt(),[i,{setTrue:s,setFalse:o}]=on(!1),c=Gc(),d=bc(c,"leadForm"),m=r((()=>ed(e,c.leadForm)),[e,c.leadForm]),u=l((async(e,i,a)=>{s();try{const r=await(l={profileId:e,code:i,state:a,redirectUri:globalThis.location?.href},ea("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,...td(r)}))),n.assign(t)}finally{o()}var l}),[t]);return a((()=>{const e=Wl(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),i=t.get("state");e&&n&&i?u(e,n,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[m,{isLoading:i}]},ad=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",button:l,...s})=>{const d=r((()=>gc?.flatMap((e=>e?.inputs))||[]),[gc]),[m,{isLoading:h}]=id(d,i),{handleSubmit:p,responseStatus:g}=Xc({inputs:d,programId:n,nextStepLink:i}),[,{field:f,onSubmit:x}]=an(m,{onSubmit:p}),y=sn(Qo);return a((()=>{g&&y.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:x,className:"space-y-m relative",children:[h?o(Oi,{blur:!1}):null,gc.map(((e,t)=>c("div",{className:u(Jo(e.columns),"grid gap-x-m"),children:[Zo(e.title),hc({field:f,inputs:e?.inputs})]},`section-${t}`))),fc(l)]})})})),ld=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),rd=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",sd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),od=10;function cd(e=0){const t=Math.round(e*od);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const dd=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:cd(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),md=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],ud=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(pd(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?hd(c,v):{},...N?sd(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(dd,{className:u(m,a?md[a-1]:"",{"h-full":N},t),style:w?hd(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),hd=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),pd=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),gd={"horizontal-list":"w-6","vertical-list":"h-6"},fd=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?gd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),xd=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},yd=e=>t=>e.scrollWidth/t,bd=e=>(t,n)=>{e.scrollBy({left:n*yd(e)(t),behavior:"smooth"})},vd=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Or()(a),Mr()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?bd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?bd(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Nd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},wd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=vd({itemCount:s.length}),g=Cd(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(ud,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(xd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Nd[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(fd({activeIndex:t,onClick:f,listType:i}))}):null})),Cd=(e=!1)=>({behavior:e?"auto":"smooth"}),Sd=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),kd=d((e=>o(Sd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Id=d((e=>o(Sd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Td="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Bd=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?Rd(t):null,l?o(kd,{className:u(Pd(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Id,{className:u(Pd(a),m?"right-1":"right-0"),onClick:d}):null]})})),Rd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Td,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Td,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Pd=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Dd=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=vd({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(ud,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Bd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(wd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Ed=({blocksToRender:e,...t})=>o(Dd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",rd(!0)),children:B(e,t)},String(n))})}),Ad=e=>e%2!=0,Md=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),_d=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Md,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("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(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Od=({isUnfolded:e,onToggle:t})=>o(_d,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),zd=["ArrowDownIcon","ArrowUpIcon"],Fd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Vd=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Fd),children:[P(l,{...a.options,parent:n}),Ad(l.length)?o(Lt,{className:"col-span-6",...a}):null]}),o(aa,{renderFoldableSection:({isUnfolded:e})=>c(la,{className:u(Fd),isUnfolded:e,children:[P(r,{...a.options,parent:n}),Ad(r.length)?o(Lt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(_d,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:zd[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Ld=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[qd(n,t),Vd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[qd(n,t),Ed({...i,blocksToRender:t})]});default:return null}})),qd=(e,t)=>e&&!t.length?o(ld,{...e}):null,jd=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),$d=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(Zs,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),Ud=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset: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-xl",children:[e,jd(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Wd(i)).filter(Boolean))]}),n?o("div",{children:o(lr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Wd=e=>([t,n])=>{const i=n?.type;return"array"===i?Hd(t,e)(n):null},Hd=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o($d,{items:i,multiple:!n?.single,...t(e)})]},e)};function Yd(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Kd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Gd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>Kd(t[e])||Kd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Kd(t[e])||Kd(n[e])||Xd(t[e])<=Xd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>Kd(t[e])||Kd(n[e])||Xd(t[e]?.min)>=Xd(n[e]?.min)&&Xd(t[e]?.min)<=Xd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>Kd(t[e])||Kd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Kd(t[e])||Kd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Xd=e=>Number(e||0),Jd=(e,{block:t,page:n,normalize:i=nn})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Yd(a,a.map((e=>_t(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=nn)=>e?.filter((([,e])=>Gd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Zd={},Qd={},em=Ft((({className:e,filtrationSchema:t=Zd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Jd(Qd,{block:a.block,page:a.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:tm(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>tm(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Ud,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(lr,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Ld,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),tm=e=>Yd(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),nm=(e=!1)=>e?"text-left":"text-center",im={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},am=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",im[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),lm=d((({className:e="",title:t,benefitList:n,...i})=>{const a=ke();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:nm(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(rm)}):null]})})),rm=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(am,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ee,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),sm=(e,t,n)=>{return o(Dd,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Me,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Me,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},om=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?sm(e,0,t):null]}))),cm={start:"justify-start",center:"justify-center",end:"justify-end"},dm=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",cm[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),mm=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),um=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),hm=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(mm,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(yr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(um,{title:e,...r}),pm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},gm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},fm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=pm.prefMonthsNum,prefTravelBonusRate:l=pm.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||gm,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},xm=Ft((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=fm(r,n);return o(hr,{className:e,title:t,...l,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Pr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?hm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:fr,children:[f>=0?o(yr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Cr(a)]})]})})})),ym=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,bm=e=>Br({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),vm=" (c капитализацией)",Nm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:fr,children:[o(yr,{title:`Доход в конце срока${l?vm:""}`,value:e,postfix:n,prefix:"+"}),o(yr,{title:`Сумма в конце срока${l?vm:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Cr)]}),wm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Cm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Sm=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?wm[e?.rateType]:"",{data:n}=gi(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&km(s,e)&&Lr(i,["minSum","maxSum"],e)&&Lr(n,["minDays","maxDays"],e)))||Cm,{rate:m}=d,u=Im(m,e),h=i+u,p=c||[Cm];return{...d,...Vr(["minSum","maxSum"],p),...Vr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},km=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Im=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},Tm=Ft((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Nr(r,1e5),daysValue:wr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Sm(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(hr,{className:e,title:t,...d,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Za,{items:[`От ${ym(b.min||0)}`,`До ${ym(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Bm(p,h),bm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),hm({rate:x,depositeName:y,isShowDepositeName:l}),Nm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),Bm=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Ri,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Ri,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Rm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},Pm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Dm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Mm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Am({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Am({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Am({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Am({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Lr(i,["minSum","maxSum"],t),Lr(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||Pm,{rate:u}=m,h=Em(u,e),p=i+h,g=t||[Pm];return{...m,...Vr(["minSum","maxSum"],g),...Vr(["minMonths","maxMonths"],g),availableMonths:Rm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},Em=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Am=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Mm=(e,t)=>e+Math.round((t-e)/2),_m=(e="rub")=>"rub"===e,Om=(e,t)=>{const{minMonths:n,maxMonths:i}=Vr(["minMonths","maxMonths"],Lm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:Ya(a,n,i)}},zm=(e,t)=>{const{minSum:n,maxSum:i}=Vr(["minSum","maxSum"],Lm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:Ya(a,n,i)}},Fm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Vm=e=>{const t=_m(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Lm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},qm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Br({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Br({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),jm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?bm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Br({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),jm(e.isShowNewClient),e.isShowNewClient?o(Ri,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},jm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,$m={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Um={text:"₽",key:"rub"},Wm=Ft((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Um],g=l((e=>t=>e?{...t,...Vm(t),...zm(t,e),...Om(t,e),...Fm(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Nr(d,2e4),monthsValue:wr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Um},{normalize:g}),y=x?.("currency")?.value??Um,b=x?.("isNewClient")?.value,v=Lm(h,y),N=Dm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Dr({field:x,defParams:br(v,b),calcParams:N,monthsValue:"minMonths",map:$m})}),[x,h]);a((()=>{!Wr(d)&&v&&I()}),[d,h]);const T=w===br(v,b)?.rate;return o(hr,{className:e,title:t,...m,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[c("div",{className:"flex gap-m",children:[Pr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Hm(y?.key)}),h&&h?.length>1?o(_n,{label:"Валюта",options:p,...x("currency")}):null]}),Sr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),qm({...N,...s},x)]}),hm({rate:w,children:Km(I,T)}),Nm({income:C,finalSum:S,buttons:[...i,Ym(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Hm=(e="")=>_m(e)?1e3:100,Ym=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},Km=(e,t=!1)=>t?null:o(lr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Gm=e=>Xm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Xm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Xm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Jm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Zm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Jm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Gm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Fr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Fr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Gm({row:e,userInputParams:t,paramsViewSettings:n})&&Lr(i+r,["minSum","maxSum"],e)&&Lr(l,["minSumOld","maxSumOld"],e)&&Lr(r,["minSumExtra","maxSumExtra"],e)&&Lr(a,["minMonths","maxMonths"],e)))||Jm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Er(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Qm=Ft((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Zm(s,n,l),h=Rr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(hr,{className:e,title:t,...r,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Pr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Sr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),eu({...m,...l},d),m.isExtraMoney?Pr({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(fr,"@4xl:w-1/2"),children:[o(yr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(yr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(yr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Cr(a)]})]})})})),eu=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Ri,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Ri,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),tu=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Ha(e,{normalize:(e=a)=>n&&i?String(Ya(Number(nu(e)),n,i)):nu(e),format:He(r)}),d=l((e=>t&&t(nu(e))),[t]);return o(fn,{onChange:d,...s,...c})})),nu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),iu=d((e=>o(tu,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),au={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},lu={amount:1500},ru=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(lu),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{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:au[r],children:[o(iu,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(lr,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),su=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),ou="relative h-full",cu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},du=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(hu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:mu(n,{someCardsHighlighted:l}),children:[B(n,i,{className:uu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),hu(n)?su({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},mu=(e,{someCardsHighlighted:t})=>u(ou,t&&(hu(e)?"pt-3xl":"pt-3xl sm:pt-16")),uu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(ou,"min-w-80",cu[i],t&&(hu(e)?"pt-3xl sm:pt-16":"pt-3xl"),rd(n),n&&"h-full"),hu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,pu=Ft((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Dd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?gu(s?.block?.blocks):[],hasBlur:!0,children:du({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),gu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],fu="z-10 border border-solid w-full h-full",xu=u(fu,"absolute hidden @xl:block border-transparent"),yu=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(xu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(xu,"top-6 right-8 bg-green")}),o("div",{className:u(xu,"top-3 right-4 bg-green-light")}),c("div",{className:u(fu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),bu={black:"bg-black",white:"bg-white"},vu=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Nu)]}):null,a?c(Me,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Nu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${bu[e]}`},String(t)),wu=d((({icon:e,...t})=>{const n=pe(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),Cu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?Su(i):null]})}))),Su=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(wu,{...e},String(t))))}),ku=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Iu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=pe()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(a),children:l})})),Tu=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],Bu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>Tu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Ru(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:Pu(s??!1,a??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ru=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Pu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Du=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Iu,{href:a,target:m,className:"h-full",data:ku(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe(qe(l)?o(ne,{image:l}):null,x),buttons:d.length?o(Bu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(Ee,{__html:s,isDotted:r,itemSize:"list-s"}):null,Eu(i,p)]})})}))),Eu=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Au=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},Mu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Au),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[qe(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(aa,{renderFoldableSection:()=>c("div",{children:[x,o(la,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?_u(m?.parent,h,b):null}):o("div",{children:x})]})})),_u=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ou=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),i=Jt();if(!t||!e||!n)return i.assign("/"),()=>{};const a=async()=>{const n=await ta("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&i.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},zu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Fu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(zu,{step:i,showPercentage:!1})]})})}));var Vu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Vu||(Vu={}));const Lu=e=>ea("/user-data/getTaskStatus","POST",e),qu=e=>ta("/user-data/sendSignalToProcess","POST",e),ju=(e,t)=>{const n=s(null),i=l((()=>n.current&&clearInterval(n.current)),[]);return a((()=>(n.current=setInterval((()=>e(i)),t),i)),[e,t]),i},$u=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Ee,{__html:e}),i?.text?o(Ne,{className:"text-primary-main",children:i.text}):null]})]}))),Uu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Bc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Ee,{__html:a}):null]})]})})),Wu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uu,{interval:d,intervalExpireAction:m}):null]}),o(Hu,{title:i,items:a}),o(Hu,{title:l,items:r,countColumns:!0}),n?.__html?o($u,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Hu=({title:e,items:t,countColumns:n=!1})=>{const i=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Jo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Yu(e)},t)))}):null]})]}):null},Yu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Ku=d((()=>o(Wu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Gu=d((({handleExpireTimer:e})=>{const[t]=Hl("leadForm");return o(Wu,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),Xu=d((()=>{const[e]=Hl("leadForm");return o(Wu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ju=d((()=>{const[e]=Hl("leadForm");return o(Wu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Zu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Qu=d((()=>{const[e,t]=i(Vu.process),[n]=Hl("taskId");a((()=>{(async()=>{for(const e of Zu)await qu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Lu({taskId:n});i&&i?.statusCd!==Vu.process&&(e(),t(i.statusCd))}),[n]);ju(r,3e4);return eh(e,(()=>t(Vu.rework)))})),eh=(e,t)=>({IN_PROCESS:o(Gu,{handleExpireTimer:t}),CANCELLED:o(Ku,{}),APPROVED:o(Ju,{}),REVISION:o(Xu,{})}[e]||o(Xu,{})),th=[{paymentSystem:{name:"",type:""},currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],nh=e=>{if(e)try{return new Date(e)}catch(e){return}},ih=e=>(t,n)=>t.filter((e=>e)).map((t=>[ah(n,e),lh(t,e),ch(t,e),rh(t,e),sh(t,e),oh(t,e)].some(Boolean)?{...t,required:!1}:t)),ah=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,lh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,rh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,sh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),oh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),ch=({name:e},t)=>"snils"===e&&dh(t),dh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,mh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($u,{__html:e},`${t}_${n}`))):null},uh=({field:e,inputs:t,params:n})=>t.map(Xo(e,n)),hh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=ih(ph(t))(e,n),o=s.filter((e=>!oh(e,ph(t))));return c("div",{className:u(Jo(a),"grid gap-x-m"),children:[mh(o),Zo(l),uh({field:t,inputs:s,params:i})]},`section-${r}`)})),ph=e=>t=>e(t)?.value,gh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(lr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(lr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),fh=e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:i,codeWord:a}},xh=e=>{const{methodObtain:t,deliveryDate:n=""}=e,i="courier"===t;return i?{courierDeliveryFlg:i,deliveryDate:(a=n,a?new Date(a).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}}:{};var a},yh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},bh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:jt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:jt(g,!0),houseTypeCd:f,participantContacts:Hc({phone:$t(l),email:r}),participantAddresses:Yc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:jt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:Hc({organizationPhone:p&&$t(p)}),participantAddresses:Yc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,childrenDependents:a,totalDependents:i,otherDependents:n,militaryStatusCd:g,participantIncomes:Kc({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Yc({addressCourier:t})}:{}})(t)}},vh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Hl("taskId"),[o]=Hl("profileId"),[c]=Hl("participantId"),d=l((async l=>{const d=ec(ii(ih(wh(l))(t,e)));if(!On(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await yc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...yh(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...bh(a,i)}],...fh(i),...xh(i)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Nh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},Nh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},wh=e=>t=>e[t],Ch=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l})=>{const[r,s]=Hl("leadForm"),d=((e,t)=>({...th[e],...t,limitedBirthday:nh(t?.limitedBirthday),dulIssueDateField:nh(t?.dulIssueDateField),participantDateRegistration:nh(t?.participantDateRegistration),beginDate:nh(t?.beginDate),deliveryDate:nh(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=vh({step:e,inputs:m,onNextStep:i,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return a?o(Qu,{}):c("form",{onSubmit:p,className:"space-y-m",children:[hh({sections:t,field:h,step:e}),o(gh,{step:e,onPrevStep:n})]})})),Sh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],kh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Ih=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Ou,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>Sh[n]),[n]),[x,y]=i(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(Fu,{stepsTitles:kh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Ch,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),Th=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(zu,{step:i,showPercentage:!1})]})})})),Bh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uu,{interval:d,intervalExpireAction:m}):null]}),o(Rh,{title:i,items:a}),o(Rh,{title:l,items:r,countColumns:!0}),n?.__html?o($u,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Rh=({title:e,items:t,countColumns:n=!1})=>{const i=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Jo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Ph(e)},t)))}):null]})]}):null},Ph=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Dh=d((()=>o(Bh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Eh=d((({handleExpireTimer:e})=>{const[t]=Hl("leadForm");return o(Bh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Ah=d((()=>{const[e]=Hl("leadForm");return o(Bh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Mh=d((()=>{const[e]=Hl("leadForm");return o(Bh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),_h=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Oh=d((()=>{const[e,t]=i(Vu.process),[n]=Hl("taskId");a((()=>{(async()=>{for(const e of _h)await qu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Lu({taskId:n});i&&i?.statusCd!==Vu.process&&(e(),t(i.statusCd))}),[n]);ju(r,3e4);return zh(e,(()=>t(Vu.rework)))})),zh=(e,t)=>({IN_PROCESS:o(Eh,{handleExpireTimer:t}),CANCELLED:o(Dh,{}),APPROVED:o(Mh,{}),REVISION:o(Ah,{})}[e]||o(Ah,{})),Fh=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Vh=e=>{if(e)try{return new Date(e)}catch(e){return}},Lh=e=>(t,n)=>t.filter((e=>e)).map((t=>[qh(n,e),jh(t,e),Hh(t,e),$h(t,e),Uh(t,e),Wh(t,e)].some(Boolean)?{...t,required:!1}:t)),qh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,jh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,$h=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Uh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Wh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Hh=({name:e},t)=>"snils"===e&&Yh(t),Yh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Kh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($u,{__html:e},`${t}_${n}`))):null},Gh=({field:e,inputs:t,params:n})=>t.map(Xo(e,n)),Xh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Lh(Jh(t))(e,n);return c("div",{className:u(Jo(a),"grid gap-x-m"),children:[Kh(s),Zo(l),Gh({field:t,inputs:s,params:i})]},`section-${r}`)})),Jh=e=>t=>e(t)?.value,Zh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(lr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(lr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Qh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},ep=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Qh[i?"annuity":"differential"]}},tp=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},np=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:jt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:jt(g,!0),houseTypeCd:f,participantContacts:Hc({phone:$t(l),email:r}),participantAddresses:Yc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:jt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:Hc({organizationPhone:p&&$t(p)}),participantAddresses:Yc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,confirmationIncome:l,wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h,snils:p,armyIdFlg:g,conscription:f}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,childrenDependents:a,militaryStatusCd:f,participantIncomes:Kc({wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h}),snils:p?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:g}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);default:return{}}},ip=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Hl("taskId"),[o]=Hl("profileId"),[c]=Hl("participantId"),d=l((async l=>{const d=ec(ii(Lh(lp(l))(t,e)));if(!On(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await yc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...np(a,i)}],...ep(i),...tp(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));ap(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},ap=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},lp=e=>t=>e[t],rp=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l,programsSource:r})=>{const[s,d]=Hl("leadForm"),[m]=Hl("programId"),u=r?.[m??""],h=((e,t)=>({...Fh[e],...t,limitedBirthday:Vh(t?.limitedBirthday),dulIssueDateField:Vh(t?.dulIssueDateField),participantDateRegistration:Vh(t?.participantDateRegistration),beginDate:Vh(t?.beginDate),deliveryDate:Vh(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=ip({step:e,inputs:p,onNextStep:i,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return a?o(Oh,{}):c("form",{onSubmit:x,className:"space-y-m",children:[Xh({sections:t,field:f,step:e,params:{calcData:u}}),o(Zh,{step:e,onPrevStep:n})]})})),sp=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],op=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],cp=Ft((({className:e,programsSource:t,...n})=>{const[d,m]=i(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);a(Ou,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>sp[d]),[d]),y=0===d,[b,v]=i(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(Th,{stepsTitles:op,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(rp,{step:d,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,programsSource:t},String(d))})]})})})),dp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,mp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),up=1e9,hp={sum:{min:1e4,max:up},period:3},pp=Ft((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Jd(hp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:gp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=fp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Ud,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(iu,{label:i?.title,min:500,max:up,...d("sum",{parse:e=>({min:Number(e),max:up}),format:({min:e})=>String(e)})}),o(Za,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ld,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),gp=e=>Et((e?.paramsSource?.rateRows||[]).filter(dp).flatMap((e=>mp(e.minMonths,e.maxMonths)))),fp=e=>Et(e.flatMap((e=>e||[])).filter(dp).flatMap((e=>mp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],xp=[{key:"10"},{key:"50"},{key:"100"}],yp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:xp,iconVersion:"black"})]})},bp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",vp=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:bp,"aria-label":`Страница ${l}`,children:l},String(t)):null},Np={width:"24",height:"24"},wp=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Cp(1===e),...Np})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:bp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(vp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:bp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Cp(e===n),...Np})})]})},Cp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Sp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(wp,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(yp,{itemCount:i,onItemCountChange:a}):null]}),kp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Ip=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(kp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ll,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ll,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(lr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Tp=(e,t)=>o(am,{...e,iconBgVersion:t,className:"shrink-0"}),Bp=d((({title:e,timestamp:t,publicId:n})=>{const i=pe(),{href:a}=i({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[Tp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:jt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Rp=`${Ut}/depository`,Pp={startDate:void 0,endDate:void 0,query:""},Dp=Ft((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=an(Pp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?jt(i,!0):"",r=a?jt(a,!0):"",s=new URLSearchParams(Rp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=gi(Rp+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Ip,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Bp,{...e},String(e.publicId)))):o(ld,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Sp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Ep=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Ap=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Ep(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(Ne,{version:a?.version,text:a?.text,...a}):null]}))),Mp=`${Ut}/region`;function _p(e="Москва"){return cl().location??{name:e}}function Op(e="Москва"){const t=cl(),n=l((async()=>{if(!t.location){const n=await Pt(Mp);t.location=n??{name:e}}}),[t,e]);return gi(Mp,n),t}var zp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(zp||(zp={}));const Fp=new Intl.NumberFormat("ru",{style:"currency",currency:zp.RUB}),Vp=e=>e?Fp.format(e):"",Lp="text-m font-light text-secondary-text ",qp=`${Lp} text-left`,jp=`${Lp} pl-5xl text-center`,$p=`${Lp} pl-5xl text-right`,Up={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Wp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:qp,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:jp,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:$p,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Hp)})]}))),Hp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:Up[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:Vp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:Vp(e?.buyExchangeRate)})})]},t)},Yp={icon:"GpsIcon"},Kp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(am,{...Yp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Gp=(e,t,n)=>{const i=Number(Xp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Xp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Jp(e){if(!e)throw new Error("Value should be fulfilled");return e}const Zp=e=>t=>{const[,n]=Jp(e.find((([e])=>e(t))));return n(t)},Qp=e=>Zp(e.map((([e,t])=>[e,()=>t])));Qp.if=e=>new eg(void 0,e);class eg{parent;predicate;unit;get entry(){return[Jp(this.predicate),Jp(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new eg(this,e)}then(e){return new eg(this.parent,this.predicate,e)}else(e){return Zp([...tg(this),[()=>!0,e]])}}const tg=e=>[...e?.parent?tg(e.parent):[],e.entry],ng=e=>Qp([[e=>e.value!==zp.RUB&&e.oppositeValue!==zp.RUB,()=>e.handleConvert(e.value,zp.RUB)],[e=>e.value===zp.RUB&&e.oppositeValue===zp.RUB,()=>e.handleConvert(e.value,zp.USD)],[e=>e.value===zp.RUB&&e.oppositeValue===zp.RUB,()=>e.handleConvert(e.value,zp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function ig(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(fn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const ag=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||zp.RUB,selectBuy:n?.[0]?.currency?.currency||zp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[ig({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:lg(r,d,n),value:r.inputSell,setValue:e=>sg(d,n)(e,r.selectSell,r.selectBuy)}),ig({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:rg(r,d,t),value:r.inputBuy,setValue:e=>og(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(Ne,{text:a.text,version:a?.version,...a}):null]})})),lg=(e,t,n)=>i=>{t({selectSell:i}),ng({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{sg(t,n)(e.inputSell,i,a)}})},rg=(e,t,n)=>i=>{t({selectBuy:i}),ng({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>og(t,n)(e.inputBuy,i,a)})},sg=(e,t)=>(n,i,a)=>{e({inputSell:Xp(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Gp(n,l,i===zp.RUB)||"")})},og=(e,t)=>(n,i,a)=>{e({inputBuy:Xp(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Gp(n,l,i===zp.RUB)||"")})},cg=`${Ut}/exchangerates`;const dg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=gi(cg+`?regionCode=${t}`,Dt);return n||{}}(_p()),l=mg(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:zp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:zp.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Wp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Kp,{address:a?.address})]}),o(ag,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),mg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],ug=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(hg(n))})})),hg=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:a||null})},String(i)):null},pg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Md,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Tp(a,t),e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),gg=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",fg=(e=!1)=>e?"MinusIcon":"PlusIcon",xg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",yg=Ft((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(aa,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(la,{className:u("gap-lg",gg(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>bg({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),bg=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?xg(e):fg(e))(a,r);return"accordion"===e?o(pg,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(_d,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},vg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Ng(e)}))),Ng=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(yg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(ug,{items:e.items}):null},String(t)))),wg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Cg)}):null)),Cg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Sg)})]},String(t)),Sg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:kg(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),kg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ig(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Ig=e=>e.replaceAll(/\D/g,""),Tg=d((({className:e="",index:t,text:n,...i})=>{const a=pe(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Bg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Tg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Rg=d((({className:e="",index:t,...n})=>{const i=pe(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Pg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Rg,{index:t,...e},String(t))))}):null]}))),Dg=Ft((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options;const{documents:a,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(vg,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(wg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Bu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Bg,{title:d,links:l}),o(Pg,{links:a,license:h})]})})),Eg=Ft((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(_n,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:ku(l,s?.key),children:f})}):null]})})})),Ag={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},Mg=d((({version:e,text:t,mobileText:n,...i})=>{const a=ke()?n:t;return a?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",Ag["transparent"===e?"transparent":"default"]),...i,children:a}):null})),_g=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=E(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Ic,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):Og(p,r),o(Mg,{version:a,...i})]})})),Og=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,zg={"bg-white":"primary",transparent:"transparent"},Fg=Ft((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=zg[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(_g,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Vg=(e=!1)=>e?{}:{padding:"p-0"},Lg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},qg=Ft((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=E();return o(g,{className:u("relative flex flex-col",Lg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",rd(r)),...Vg(i)}})})}),{childrenTypes:[]}),jg=Ft((e=>o(qg,{...e})),{childrenTypes:[]}),$g=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",cm[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Ug=["байт","Кб","Мб","Гб","Тб","Пб"],Wg=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=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:n,target:i,...fe(l),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",Hg(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Hg=(e,t)=>e||t?o("span",{children:", "}):"",Yg=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Ug[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Gg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Wg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Kg(t),data:n?.data}),o(Ee,{__html:n?.__html})]},String(i))},Kg=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Gg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},Xg=d((({href:e,__html:t,target:n,onClose:i})=>{const a=E(),l=$(a)(e);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:i,children:[t?o(Ee,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:i}),o(lr,{type:"button",version:"secondary",onClick:i,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Jg=d((({text:e,href:t,target:n,__html:i,icon:a})=>{const{open:r}=sn(Xg),s=l((()=>r({__html:i,href:t,target:n})),[i,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Kg(a),o(Me,{font:"font-light",children:e})]}):null})),Zg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Qg=Ft((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=E();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Zg[r]),role:"list",children:a.map(ef(d,l))}):null]})})),ef=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?tf(t)(n,i):Yg(e,t)(n,i)},tf=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Jg,{...i,icon:e,href:nf(t)?t?.href:t?.attachment?.src}),o(Ee,{__html:t?.__html})]},String(n)):null},nf=e=>"href"in e,af=Ft((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(Me,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Ee,{__html:r,itemSize:"list-m"}):null,o(Me,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),lf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",rf=(e=[],t={})=>e.filter((({content:e={}})=>Gd(t,e))).length,sf=(e,t)=>e===t;const of=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(sf,((e=sf)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),cf=[],df={},mf={primary:"bg-white/30",secondary:"bg-main-divider"},uf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},hf=d((({count:e,version:t="secondary"})=>{const n=ke(),i=n?"bg-main-divider":mf[t],a=uf[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:a,children:e})})})),pf=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},gf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},ff={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},xf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},yf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},bf=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",gf[i],n?yf[i]:xf[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?ff[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[pf({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(hf,{count:m,version:lf(n,i)})}):null]})})})),vf=d((e=>o(e?.item?.href?Nf:wf,{...e}))),Nf=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(bf,{...e,tag:"a",item:a,onClick:i})})),wf=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(bf,{item:e,onClick:i,...n})})),Cf=(e,t,n)=>(i,a)=>o(vf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Sf=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Cf(i,a,t))}))),kf={categories:[],extraOptions:[],propertyType:[],stage:[]},If=Ft((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Jd(kf,{block:a.block,page:a.options?.page}),f=l(((e=kf)=>p(e)),[]),x=(({hotFilters:e=cf,filtrationState:t=df,blocks:n=cf,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>of(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:rf(n,t.filter),version:lf(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Sf,{...x}),o(Ud,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Ld,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Tf=(e,t,n)=>{const i=lf("all"===t),a=lf("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(lr,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(lr,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},Bf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ee,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Rf="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Pf=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Ri,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(aa,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Rf,children:s}),o(la,{className:Rf,isUnfolded:e,children:d})]}),renderFoldButton:Df(n,i)})}):null})},Df=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ef()})]}),Ef=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Af=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Mf=()=>{},_f=e=>"all"===e?"block":"hidden",Of=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Mf,renderRemoteWorkplaceCard:r=Mf,getBalloon:s=Mf,getBalloonRemoteWorkplaces:d=Mf,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=La({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:zf([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Oa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Af(h,N),m?Bf(m):null,p&&Tf(t,w,C),o("div",{className:u("pb-3xl",_f(w)),children:Pf(S)})]}),o("div",{className:"h-[600px]",children:o(Ua,{children:o(Xi,{points:b,isLoad:n,className:"h-full"})})})]}),c(Ua,{children:[y.map(l),v.map(r)]})]})})),zf=e=>Object.keys(_a).filter((t=>e.filter((e=>za[t](e))).length)),Ff=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:qf(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:qf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Na,{color:"green",children:qf(s)})})]}),o("div",{className:"hidden sm:block",children:o(da,{className:"flex-wrap",children:m?.map(Lf)})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:o(da,{className:"flex-wrap",children:m?.map(Lf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(d))},Vf=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${qf(t)} №${n}`,body:e.toUpperCase()}),Lf=(e,t)=>o(ra,{...e},String(t)),qf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",jf=[];const $f=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:jf},Uf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Wf={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},Hf=d((({descriptionData:e,className:t})=>{const n=_p(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=gi(`${Ut}/atms?regionCode=${e}`,$f);return{data:t||jf,isLoad:!t&&!n}}(i);return o(Of,{className:t,filterItems:Yf,data:a,isLoad:l,initFilterState:Uf,renderCard:Ff,getBalloon:Vf,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Yf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>Wf[t](e))),n=!i.length||i.some((t=>Wf[t](e)));return t&&n}))},Kf=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Me,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Gf({workScheduleDescription:t})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:Gf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(n)):null,Gf=({workScheduleDescription:e})=>c("div",{children:[c(da,{className:"flex",children:[o(ra,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ra,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(ra,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(ra,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),Xf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Jf={branches:[],remoteWorkplaces:[]};const Zf=async e=>await Pt(e,{method:"GET"})||Jf,Qf=d((({className:e})=>{const t=_p(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=gi(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Zf);return{data:t||Jf,isLoad:!t&&!n}}(n);return o(Of,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ea,renderRemoteWorkplaceCard:Kf,getBalloon:Ma,getBalloonRemoteWorkplaces:Xf,title:`Офисы филиала ${t?.name}`})})),ex=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Qf,{}):o(Hf,{descriptionData:e})})})),tx=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),nx=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(Dd,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Ze,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),ix=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?ax({__html:l,richVersion:r}):null,lx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),lx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),lx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),ax=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ee,{...e,itemSize:"list-s"})}),lx=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:i,children:t})]})]}):null,rx=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ee,{__html:t,richVersion:n})})})),sx=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),Ti,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),ox=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(sx,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(sx,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),cx=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Dn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),dx=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(cx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(cx,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),mx=["От 1 дня","До 365 дней"],ux=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Za,{min:1,max:365,value:e,items:mx,onChange:t})]}))),hx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(cx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(cx,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),px=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(dx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:gx(m)}),o(ux,{days:a,setDays:e=>m({days:e})}),o(hx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:fx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(ox,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),gx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},fx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},xx=d((({days:e,tariffs:t=[]})=>{const n=bx(e,t),i="На рисунке изображена пачка листов\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:[yx("Аренда за",e),yx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),yx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),bx=(e,t)=>{const n=vx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},vx=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},Nx=(e,t)=>e.find((e=>e.branchCode===t)),wx=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Nx(i,n.selectedBranch),d=Cx(s?.safeBoxCaseVolumes),m=Sx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=kx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(px,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(xx,{days:n.days,tariffs:u})]})})),Cx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Sx=(e,t)=>e?.find((e=>e.volume===t)),kx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Ix=`${Ut}/safeboxes`,Tx=[];const Bx=async e=>await Pt(e,{method:"GET"})||Tx,Rx=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=To(),p=Px(m.selectedRegion,h),f=function(e){const{data:t}=gi(e?`${Ix}?regionCode=${e}`:null,Bx);return t||Tx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Nx(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(wx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Xi,{points:y,className:"h-[640px]"}):null]})})),Px=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Dx={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"},Ex=(e,t,n)=>(i,a)=>{const{button:l}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Ax(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Mx(i),l?.text?o(Ne,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},Ax=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=_x(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Ox({step:n,iconVersion:a,i:i,stepVersion:t})})})},Mx=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",Dx.description),children:e.description}):null,o(Ee,{__html:e.__html})]}),_x=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Ox=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return qe(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?Dx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},zx=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(Ex(d,r,l))}):null,je(a,{isVertical:!0})]})})),Fx=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Vx=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{onClick:a,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(rr,{className:"absolute top-1.5 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Lx(e,t,n){a((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const i=n[t];i&&i(e)}}))),[e,t,...Object.values(n)])}const qx=()=>{const[e,{push:t,pop:n,clear:a}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}();return Lx(ue.observable,"dialog",{open:t,close:n,closeAll:a}),[e,{close:n,closeAll:a}]},jx=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const $x=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Ux,{...e},String(t))))})]}):null,Ux=d((({icon:e,...t})=>{const n=pe(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),Wx=(e,t)=>n=>n.name?o(Iu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:ku(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Hx=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(hn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Yx=d((({defaultLocation:e})=>{const t=_p(e),n=pe(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Iu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Kx=d((({foreignOffices:e,branches:t,onClose:n})=>{const a=Op(t?.default),[s,d]=i(""),m=To(),u=r((()=>Xx(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(u,Gx)),[u]),p=l((e=>{a.location=e,n?.()}),[a,n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Yx,{defaultLocation:t?.default}),o(Hx,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&jx(e.toLowerCase())(s.toLowerCase())>=.8)).map(Wx(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(Wx(f,g))]},e)))}),$x(e)]});var g,f})),Gx=e=>e.name?.charAt(0)??"",Xx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Jx=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:i})=>{const l=sn(Kx,n),{name:r}=_p(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&i?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[i]),o(Vx,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:i,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Zx="burgerMenuDialog",Qx=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:i=un})=>{const{open:a}=sn(Jx),[r]=qx(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Zx,r),o=l((()=>a({menuRef:e,locationDialogProps:n,menuItem:t,onClose:i},{id:Zx})),[e,n,t,i]);return[s,{toggle:s?i:o}]},ey=[],ty=Ft((({sticky:e,...t})=>{const{menuItems:n=ey}=e??{},a=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{closeAll:y}=he(),b=l((()=>{p(-1),x(""),y()}),[y]),v=dn(b),N=s(null),[C,{toggle:S}]=Qx({menuRef:N,centralMenuItem:a,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:i,onClose:a})=>{const{open:r,close:s}=he(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:i,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:i[l].title,dialog:o(Vx,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),a?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,i,a])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(ny(T,"left",{activeIndex:h,currentItemPosition:f})),o(Fx,{item:a,isActive:C,onClick:e=>I(e)}),u.map(ny(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),ny=(e,t,n)=>(i,a,l)=>o(Fx,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),iy="hidden sm:flex absolute z-40",ay={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ly=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=vd({itemCount:t?.length||0});return a((()=>ry(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(ud,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ay[l].item,gap:ay[l].gap,children:t.map(Cf(n,i,l))}),s.canScrollLeft?o(kd,{className:u("left-6",iy,ay[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Id,{className:u("right-6",iy,ay[l].buttonTop),onClick:s.scrollRight}):null]})})),ry=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},sy={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},oy=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(sy[t].wrapper,e),children:o(ly,{className:sy[t].component,tabsType:t,...n})}):null,cy=Ft((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=dy(n??{}),p=E(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(hy(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=uy(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[oy({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:my(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(uy)?.filter(Boolean)||[]}),dy=({__id:e,anchor:t})=>t??e??"tabs",my=(e,t)=>t?.length?t:e,uy=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",hy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),py={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},gy=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:py[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),fy=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),xy={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ee,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(fy,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},yy=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return by({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),by=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in xy))return null;return o(xy[n],{...t,...i})},vy=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(yy,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Ny=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),wy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Cy=d((({rows:e})=>{return o(ud,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Ny(a,t)}px)`},children:a?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?wy(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Sy=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Me,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Cy,{rows:t.rowsData})})})]},i)}))}))),ky=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Iy=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(Me,{size:"text-xl",font:"font-light",color:ky(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Ty=Ft((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Iy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Sy,{activeTabIndex:r,items:m}),o(fy,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(fy,{onClick:n,isOpen:!0})]})})),By=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Ty,{...t,onClick:n})}):null]}))),Ry=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(By,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(gy,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(vy,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Py({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(Sd,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(Sd,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Dy=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Py({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Ey=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(Ry,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(aa,{renderFoldableSection:({isUnfolded:e})=>c(Dy,{controls:x,children:[b,o(la,{isUnfolded:e,children:v})]}),renderFoldButton:Od}):o(Dy,{controls:x,children:y})})]})})),Ay=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?My():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?_y(n):null,a?o(Ee,{richVersion:l,__html:a}):null]})]}))),My=()=>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"}),_y=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Oy=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:n})}):null]}))),zy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Oy,{prefix:t,unit:n,suffix:i})})})),Fy={AdTile:Lt,ApplicationForm:cc,ApplicationLeadForm:ad,BankAccountFiltration:em,BenefitsBlock:lm,BonusBenefitsBlock:om,ButtonsBlock:dm,CalculatorBonus:xm,CalculatorBusinessDeposit:Tm,CalculatorCredit:Yr,CalculatorDeposit:Wm,CalculatorRefinancing:Qm,CardTransfer:ru,Carousel:pu,CarouselCard:yu,CarouselCatalogCard:vu,CarouselLinks:Cu,CarouselRecommendationCard:Du,CarouselTariffsCard:Mu,CreditCardForm:Ih,CreditForm:cp,DepositFiltration:pp,Depository:Dp,ErrorBlock:Ap,ExchangeRateTile:dg,Footer:Dg,GrantSupport:Eg,Header:Fg,Headline:k,HorizontalLayout:jg,ImgBlock:$g,LinkDocs:Qg,MobileAppTile:af,MortgageFiltration:If,OfficesAtmsMap:ex,Placeholder:tx,ProductBlock:Vt,ProductGallery:nx,RepresentativeOfficeInfo:ix,RichTextBlock:rx,RollupItem:yg,SafeDepositRental:Rx,StepsBlock:zx,StickyBottomMenu:ty,TabsLayout:cy,TariffsTable:Ey,TextBlock:Ay,UnitBlock:zy,VerticalLayout:qg},Vy=ce((()=>{a((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Ly="cookie",qy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=on();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Ly)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Ly,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ee,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function jy(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const $y=d((()=>{const[e,{close:t}]=qx(),n=Boolean(e.length);return jy(t),a((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:e.map((({dialog:t,id:n},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==e.length-1}),children:t},String(n||i))))}):null})),Uy=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);return Lx(ue.observable,"popup",{open:t,close:n}),jy(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Wy="header",Hy="footer",Yy="sticky-footer",Ky={},Gy=d((({className:e,data:t=Ky,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Ot(s,r);Vy(),Op();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.[Wy]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(a?.[Wy],{...m,slotName:Wy})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(a?.[Hy],{...m,slotName:Hy})]})]}),a?.[Yy]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(a?.[Yy],{...m,slotName:Yy})}):null,o($y,{}),o(Uy,{}),o(qy,{__html:d?.cookieContent?.__html})]})}));Object.assign(Gy,{childrenTypes:[],slots:()=>[Wy,Hy,Yy]});e.Blocks=Fy,e.ContentPage=Gy,e.handlerDecorator=ce,e.joinList=jd,e.locationNavigator=Jt,e.packageVersion="0.14.699",e.projectSettings=M,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=E,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function B(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const R=[],P=(e,{key:t,ancestors:n=R,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||R,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function E(){return E._impl()}E._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),E.setup=e=>{E._impl=e};const A=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:z,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:F,hasPrefix:V});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,M(t),z(t),[_.CDN,q].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const i=t?.startsWith("/");return F(V(t,n)?"":n,i?"/":(a=e.pathname,a?.split("/").slice(0,-1).join("/")),t);var a},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=E(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(F(_.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!M(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=E();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):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","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(i,a)=>(n.current||={},n.current[a]||=n=>e.fire(t,{...n??{},type:a}),n.current[a])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=E(),{closeAll:n}=he();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),ge(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}const ge=(e,t,n)=>{if(!O(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),ye=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=pe()({onClick:r,href:i,...a}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:i,version:n}),children:a})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=E(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Re(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Re=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ee=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:i=!0,children:a})=>e||a?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:a})}):null)),Ae=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Me=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null,"__html"in e?o(Ee,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Oe(n)})]}))),Fe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...t}))),qe=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map($e(n))}):null,$e=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=Ue(a,r),d=Ue(l,r);return i||a?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...a,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>qe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=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(Ke)}):null)),Ke=({label:e,amount:t,unit:n},i)=>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(_e,{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:[He(2)(t)," ",n||"₽"]}):null]},String(i)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,R=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Qe(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ee,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const nt=()=>!0,it=(e,t)=>(...n)=>e(...n)&&t(...n),at=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(lt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class dt extends tt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class ut extends tt{proto=at([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,i=gt)=>ht(t).entries().reduce(((t,[n,a])=>xt(e)(a,t,i.concat(n))),e(n,[i,ht(t)])),yt=pt(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?yt(e.get(i),[a,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(it,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=at([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(i=e,i.slice(0,-1)),kt(t(n),n)]:[e,n];var i}))(e),Bt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Rt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Et=e=>[...new Set(e)],At={},_t=["/portal-resources"],Mt=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Rt(e),[l,r]=i({});return a((()=>{zt(n).then(r)}),[n.join()]),n.length?Mt(e,{...t,...l}):e},zt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Et(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,At[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),i={...t,...n},a=Object.entries(n).flatMap((([,e])=>Rt(e)));return a.length?zt(a,i):i}return t};function Ft(e,t={}){const n=d((t=>{const n=Ot((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=Ft((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>qt(0,t?.length)),[t]),i=t?.[n];return i?o(Vt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),qt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),jt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},$t=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:$t(e)}:{},Ht=(e,t="birthday")=>e?{[t]:jt(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:$t(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)};function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const i=(e=>{const t=Qt();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;i&&n.assign(i,t?.target)}};function tn(){return tn._impl()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=nn,format:i=nn}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})}));function sn(e,t={}){const{open:n,close:i,...a}=he();return{open:l(((a,l={})=>n({dialog:o(e,{...t,...a,onClose:()=>{i(),a.onClose?.()}}),...l})),[e,n,i]),close:i,...a}}function on(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function cn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?hn:"border-error",gn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,fn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=pn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[gn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:i,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);a((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(fn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(i,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Bn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Rn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=i(""),C=_n(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.open({popup:o(Pn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[gn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(r)||h}),En(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(fn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),En=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),_n=(e,t)=>e||0===t,Mn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Dn,{...a,valid:!n,label:mn({label:t,errors:i})}),yn(n)]}))),On=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],Fn=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>Fn(e??Vn),jn=e=>zn((e=>e?.key&&""!==e?.key))(e??Vn),$n=e=>zn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>zn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>zn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>zn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,zn((e=>"string"==typeof e&&t.test(e))))(e);var t},Kn=zn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Gn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Xn=e=>Boolean(e.region&&e.city&&e.house),Jn=()=>zn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d]+$/u,Qn=(e="")=>Zn.test(e),ei=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},ti={typeForm:qn(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:jn(),addressBranch:jn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),limitedBirthday:zn(ei)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:qn("Укажите место рождения"),education:jn("Выберите ваше образование"),housing:jn("Выберите тип жилья"),employment:jn("Выберите информацию о трудоустройстве"),organization:jn("Выберите тип организации"),amountWorkers:jn("Выберите информацию о количестве сотрудников"),employerActivities:jn("Выберите вид деятельности организации"),employerOrganization:jn("Выберите вид организации"),positionOrganization:jn("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>zn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Un(),inn:(e=>zn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:$n("Укажите количество лет стажа"),lastJobExperience:$n("Укажите стаж на последнем месте работы"),experience5Years:$n("Укажите общий стаж за последние 5 лет"),jobsNumber:$n("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:jn(),feedbackMethod:jn(),serviceType:jn(),serviceDirection:jn(),regionRetail:jn("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Kn,annualRevenue:qn(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:jn("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Gn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Kn,sex:qn("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:jn("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:jn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Jn(),cardCategory:qn("Укажите категорию карты"),paymentSystem:qn("Укажите тип платежной системы"),currency:qn("Укажите валюту")};var ni;const ii=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(Mn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=(e,t=di)=>n=>{const i=hi(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l},ui=e=>Boolean(e?.every((e=>Array.isArray(e)?ui(e):!e||"string"==typeof e))),hi=e=>ui(e)?e.toString():"",pi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function gi(e,t,{fallback:n,cache:l}={}){const s=r((()=>fi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await mi(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&pi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function fi(e){return Array.isArray(e)?e:e instanceof Function?fi(e()):[e]}const xi=`${Ut}/branches`,yi=[];const bi=async e=>await Pt(e,{method:"GET"})||yi;function vi(e=!1){const{data:t}=gi(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Ni=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?vi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=gi(e?`${xi}?regionCode=${e}`:null,bi);return t||yi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(Mn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),wi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),Ci=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Si=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.(ki(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),ki=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.house,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Ii=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ti="appearance-none w-5 h-5 border-solid flex-none",Bi=[{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"}],Ri=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ii,{paths:Bi,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Di(i)),onClick:s,children:[o("div",{className:u(Ti,"m-0",a?"rounded-full border-2":Ai(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ei(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Pi(n)]})})})),Pi=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ei=(e=!1)=>e?"radio":"checkbox",Ai=(e=!1)=>u("rounded border",{"bg-primary-main":e}),_i=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Ri,{text:t,value:n,disabled:a,onChange:r},i),yn(l)]}))),Mi=d((({field:e,input:t})=>o(_i,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Oi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),zi="/icons/MapMarkerClusterIcon.svg",Fi="/icons/MapMarkerClusterYellowIcon.svg";function Vi({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=Li("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=Li("workplaces",e,a),r=qi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=qi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=qi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Li=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?zi:Fi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),qi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?zi:Fi,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ji={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},$i={...ji,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Ui=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values($i).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Wi=e=>globalThis[e];function Hi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=Wi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Wi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(Wi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const Yi={...ji,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ki=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Yi).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Gi=[55.753995,37.614069],Xi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=Hi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?Vi({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ji(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Vi({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Oi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ki,{yandexMaps:r}),o(Ki,{yandexMaps:r,direction:"out"})]}),Ui(r,m,u("right-2 top-80",h))]})})),Ji=e=>{const t=[Qi(Zi(e,0)),Qi(Zi(e,1))];return t.every((e=>e))?t:Gi},Zi=(e,t)=>e.map((e=>e.coords?.[t])),Qi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ea=async(e,t,n)=>{try{return(await ta(e,t,n)).json()}catch(e){return console.error(e),null}};async function ta(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...na()},credentials:"include",body:n?JSON.stringify(n):null})}const na=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ia=e=>Number(e.toString().replace(",",".")),aa=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const la=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),ra=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:sa({textItems:l,subText:t,children:n,isPhone:i,...a})})),sa=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||oa(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),oa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${ca(e)}`,children:e.trim()}):e.trim()},String(n)))),ca=e=>e.replace(/\D/g,""),da=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),ma=e=>{const t=ha(e);return o(ra,{label:"Режим работы",value:t,className:"max-w-none"})},ua=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ha=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ua({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),ua({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},pa=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ga=e=>pa.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),fa=e=>{if(!e)return null;const t=xa(e);return c(da,{className:"border-none",children:[o(ra,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ya)})}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},xa=e=>{const t=pa.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},ya=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(_e,{size:"text-xs",children:e})},String(n)),ba=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(ra,{label:"Валюта",value:e.currency}):null,t?o(ra,{label:"Купить",value:String(t)}):null,n?o(ra,{label:"Продать",value:String(n)}):null]},String(i)),va={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"}},Na=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",va[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:va[n].text,children:t})]}))),wa=(new Date).getDay(),Ca=e=>{const[t]=e?.slice(wa-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Na,{color:"green",children:a}):null,n&&l?o(Na,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Na,{color:"red",children:"Выходной"})},Sa=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",ka=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(ra,{label:e,value:t&&n?n:"",subText:Sa({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),Ia=["ArrowDownIcon","ArrowUpIcon"],Ta=["Подробнее","Скрыть"],Ba=({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:Ta[Number(e)]}),o(W,{className:"text-primary-text",name:Ia[Number(e)],width:"16",height:"16"})]}),Ra=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Pa=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Da=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ea=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ga(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(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),Ca(h)]}),o("div",{className:"hidden sm:block",children:Aa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:Aa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(u))},Aa=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ga(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(da,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(ra,{label:"Факс",value:t,isPhone:!0}),o(ra,{label:"Телефон филиала",value:e,isPhone:!0}),o(ra,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(ra,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(ra,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(ra,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(da,{children:o(ra,{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(ka)})})}):c(da,{children:[o(ra,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ya)})}),ma(d)]}),r?.businessScheduleVisibleTag?fa(r?.businessScheduleDescription):null,s?.currencies?.length?o(da,{className:"flex-wrap",children:s?.currencies?.map(ba)}):null]})},_a=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ga(e),n=e?ha(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ra(n):Da(n,i):Pa(n):""})(n)}`;return{header:i,body:l}},Ma={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Oa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},za={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Fa=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>za[t](e)))))},Va=()=>{},La=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Va,getBalloonRemoteWorkplaces:a=Va})=>{const[l,s,o,c]=r((()=>{const l=Fa(e,n),r=Fa(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},qa=e=>{const{data:t,error:n}=gi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ja);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ja=async e=>await Pt(e,{method:"POST"})||[],$a=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Ua=d((({children:e})=>$a?e:null)),Wa=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=qa("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>{const t=await ea("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ia(e.latitude??Gi[0]),gpsLongitude:ia(e.longitude??Gi[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=La({data:n,filtrationState:{},getBalloon:_a}),u=Boolean(s?.key);return c("div",{children:[o(Mn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Ua,{children:o(Xi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Ha=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},Ya=(e,t,n)=>Math.max(t,Math.min(e,n));function Ka(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ga({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=Ka(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const Xa=1,Ja=100,Za=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:Xa),max:s=(a.length?a.length-1:Ja),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=Ha(e,{normalize:(e=0)=>a.length?Qa(a)(e):Ya(e,r,s),format:He()}),f=l((e=>{p&&p(Ka(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ga({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),el(i)]})})),Qa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),el=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),tl=["От 1 000 ₽","До 1 000 000 000 ₽"],nl=d((({field:e})=>o(Za,{title:"Сумма, ₽",items:tl,min:1e3,max:1e9,...e("amount")})));function il(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const al={};function ll(e,t=al){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const rl=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var sl,ol;function cl(e){return ll(rl,e)}sl=rl,ol=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),il(sl,ol),il(ol,sl),sl.bus.watch((({type:e,event:t})=>{null!=t?ol.setItem(e,t):ol.removeItem(e)}));const dl=()=>cl(),ml=Ft((({field:e,source:t,fieldName:n,input:i,placeholder:a="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Mn,{placeholder:a,options:s,...li(e(n),ti[n],i?.required),...r})})),ul=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYEES_NUMBER"),i=dl();return a((()=>{n&&(i.amountWorkers=n)}),[n]),o(ml,{field:e,source:i.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),hl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),pl=d((({field:e,input:t})=>o(_i,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),gl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),fl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),xl=d((({field:e,input:t})=>o(_i,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),yl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=bl(t,e),c=vl(t,l,r);u.push(o("td",{children:o("div",{className:Nl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},bl=(e,t)=>t&&e.toDateString()===t.toDateString(),vl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Nl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),wl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Cl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:wl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:yl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Sl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function kl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Il),l=i.map(((e,t)=>Bl(e)?i.slice(0,t).filter(Bl).length:-1)),r=i.map(((e,t)=>Tl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Il=e=>"_"===e,Tl=e=>/\d/.test(e),Bl=e=>Il(e)||Tl(e),Rl=1940,Pl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Dl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(kl(t,"__.__.____"))},onBlur:()=>{if(El(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Pl})]})})),El=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Rl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Al=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Dl,{onChange:i,disabled:r,onClick:e,value:t&&jt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),_l=Sl.map((e=>({key:e}))),Ml=Array.from({length:(new Date).getFullYear()-Rl+1},((e,t)=>Rl+t)).reverse().map((e=>({key:String(e)}))),Ol=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},zl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Fl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Vl={className:"min-w-32",iconVersion:"black",isBorder:!1},Ll=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Sl.indexOf(e));const t=Ol(r,Sl.indexOf(e));zl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Sl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:_l,yearsOptions:Ml,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[gn(t),c("div",{className:"relative",children:[Al({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Fl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Sl[f]},options:S,...Vl}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Vl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Fl,className:"rotate-90 cursor-pointer"})})]}),o(Cl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),ql=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ll,{label:mn({label:t,errors:i}),valid:Boolean(!n),...a}),yn(n)]}))),jl=d((({field:e,input:t})=>o(ql,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),$l=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...li(e("birthday"),ti.birthday,t?.required)}))),Ul=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ci(e,"birthPlace")}))),Wl=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Hl(e){const t=globalThis.localStorage?.getItem(e),[n,a]=i(t?Wl(t):null);return[n,l((t=>{a((n=>{const i=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(i)),i}))}),[e])]}const Yl=d((({field:e,input:t})=>{const[n,l]=i([]),[r]=Hl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.type;return a((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ea("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Kl(e,s)||c&&c(null)})()}),[d]),o(ml,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Kl=(e,t)=>e.some((e=>e.key===t?.key)),Gl=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...li(e("children"),ti.children,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),Jl=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...li(e("collectionCount"),ti.collectionCount,t?.required)}))),Zl=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Ql=d((({field:e,input:t})=>{const{data:n}=qa("INCOME_CERT_UNITED");return o(ml,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),er=d((({field:e,input:t})=>{const{data:n}=qa("MILITARY_STATUS");return o(ml,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),tr={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function nr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const ir={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"},ar={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},lr=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(nr(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(ir[a],ar[a]),i),type:s,role:d,onClick:m,children:e})})),rr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:a,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),or=d((({src:e,convertToPng:t,onClose:n})=>c(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(lr,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),cr=e=>{const{open:t}=sn(or),n=ke();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ta(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:i})}}),[t,e,n])},dr=d((({className:e,error:t,docId:n,...i})=>{const a=cr(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Ri,{...i}),n?o(Ne,{className:"text-primary-main",onClick:a,children:o(_e,{children:"Ознакомиться"})}):null]}),yn(t)]})})),mr=d((({field:e,input:t})=>t&&t.name?o(dr,{text:tr[t.name]?.text,docId:tr[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),ur=Math.round(29.5),hr=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),pr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",gr="flex flex-col lg:w-1/2 gap-2xl",fr="flex flex-col gap-y-xl min-w-52",xr=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,He(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),yr=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(xr,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),br=(e=[],t=!1)=>vr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),vr=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},Nr=(e,t=0)=>e?.sum?e.sum:t,wr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Cr=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Sr=({min:e=0,max:t=0,availableMonths:n,...i})=>o(Za,{items:[`От ${kr(e)}`,`До ${kr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),kr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ir={horizontal:"@lg:flex-row",vertical:""},Tr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ir[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Ri,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),Br=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(Tr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Rr=e=>Br({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Pr=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(Za,{items:e?[`От ${He(1)(i.min||0)} ${n}`,`До ${He(1)(i.max||0)} ${n}`]:[],step:t,...i}),Dr=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(Ya(t?.[a],n.minMonths,n.maxMonths))},Er=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},Ar=e=>e,_r=(e=Ar)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Mr=_r(),Or=(e=Ar)=>_r((t=>-e(t))),zr=Or(),Fr=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Vr([e,t],i),Vr=([e,t],n=[])=>({[e]:n.length?zr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Mr(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Lr=(e,[t,n],i)=>e>=i[t]&&e<=i[n],qr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},jr=e=>$r({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$r({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&$r({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&$r({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$r=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Ur=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[qr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>jr({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Fr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Fr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>jr({row:e,userInputParams:t,paramsViewSettings:n})&&Lr(i,["minSum","maxSum"],e)&&Lr(a,["minMonths","maxMonths"],e)))||qr)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=Er(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},Wr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Hr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Yr=Ft((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,vr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Nr(s,2e5),monthsValue:wr(s,ur),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});a((()=>{x&&d?.(g)}),[g,x]);const y=Ur(g,n,r),b=Rr({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(Ya(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(Ya(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!Wr(s)&&h&&Dr({field:f,defParams:h,calcParams:y,map:Hr,monthsValue:"minMonths"})}),[n,s]),o(hr,{className:e,title:t,...m,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Sr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Kr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(fr,"@4xl:w-1/2"),children:[o(yr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(yr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Cr(l)]})]})})})),Kr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Ri,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Ri,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Ri,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Gr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Xr=(e,t=!1)=>{const n=t?Jr(Gr):Gr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Jr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Zr="calculator",Qr=d((({field:e,params:t})=>{const n=l((t=>{e(Zr).onChange?.(t)}),[]);return o(Yr,{...t?.calcData,padding:"p-0",defaultParams:Xr(e(Zr).value),onChange:n})})),es=d((({field:e,input:t})=>{const{data:n}=qa("CREDIT_IN_RSHB");return o(ml,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),ts=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Tr,{label:mn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),yn(i)]}))),ns=[{id:"810",text:"Рубли"}],is=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency"),{data:a}=qa("CURRENCY"),l=a?.map((e=>({id:e.key,text:e.value})))??ns;return o(ts,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),as=d((({field:e,input:t})=>o(ql,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),ls=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),rs=d((({field:e,input:t})=>o(ql,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),ss=d((({field:e,input:t})=>o(_i,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),os="dulIssueDateField",cs=d((({field:e,input:t})=>o(ql,{label:"Дата выдачи",...li(e(os),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ci(e,os)}))),ds="dulIssuedBy",ms=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ds),label:"Кем выдан",...t,...li(e(ds),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),us=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),hs=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),ps="dulSubdivisionCode",gs=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ps),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...li(e(ps),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),fs=d((({field:e,input:t})=>{const{data:n}=qa("EDUCATION_LEVEL");return o(ml,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),xs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),ys=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_ACTIVITY_TYPE"),i=dl();return a((()=>{n&&(i.employerActivities=n)}),[n]),o(ml,{field:e,source:i.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),bs=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_KIND"),i=dl();return a((()=>{n&&(i.employerOrganization=n)}),[n]),o(ml,{field:e,source:i.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),vs=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYMENT_INFO_UNITED");return o(ml,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ns=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...li(e("expenses"),ti.expenses,t?.required),...t}))),ws=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),Cs=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ss=d((({field:e,input:t})=>{const{data:n}=qa("MARITAL_STATUS");return o(ml,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),ks=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Is=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ts=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bs=d((({field:e,input:t})=>o(Mn,{label:"Способ получения ответа",options:Ts,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),Rs=d((({field:e,input:t})=>o(kn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),Ps=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ds=d((({field:e,input:t})=>{const{data:n}=qa("HOUSE_TYPE");return o(ml,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Es=e=>t=>e.map((e=>({key:t,text:e.value||""}))).find((e=>e.key===t))??null,As=(e,t,n)=>{const i=n.data?.inn??"",a=Number(n.data?.opf?.code),l=n.data?.okved??"";t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(ki(n.data?.address)),t?.("amountWorkers")?.onChange?.(((e,t)=>{const[n]=[e?.find((e=>Number(t)<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n})(e?.amountWorkers,n.data?.employee_count)),t?.("employerActivities")?.onChange?.(((e,t)=>{if(!t)return null;const n=Es(e),i=+t?.split(".")[0],a=+t?.split(".")[1];switch(i){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(a<22?"GOVERNANCE":22===a?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(i>=10&&i<=33?"INDUSTRY":i>=5&&i<=9?"FUEL_AND_ENERGY":i>=49&&i<=53?"TRANSPORT":"OTHER_SECTORS")}})(e?.employerActivities??[],l)),t?.("organization")?.onChange?.(((e,t,n)=>Es(e)("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL"))(e?.organization??[],a,i)),t?.("employerOrganization")?.onChange?.(((e,t)=>{const n=Es(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")})(e?.employerOrganization??[],a))},_s=d((({field:e,input:t})=>{const n=dl(),i=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),As(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:i})})),Ms=d((({field:e})=>o(_i,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Os=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),zs=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Fs=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Vs=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Ls="limitedBirthday",qs=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...li(e(Ls),ti.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ci(e,Ls)}))),js=`${Ut}/outservice`,$s=[];async function Us(){const e=await Pt(`${js}/outserviceregions`);return e&&Array.isArray(e)?e:$s}const Ws=d((({field:e,input:t})=>{const n=e("region"),i=n?.value?.key,{data:l}=gi("outServiceRegions",Us),r=l?.find((e=>e.code===i))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==i&&e?.("localities")?.onChange?.("")}),[i]),o(Mn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),Hs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),Ys=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Ks=d((({field:e,input:t})=>o(ts,{orientation:"horizontal",items:Ys,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),Gs="middleName",Xs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ci(e,Gs),...li(e(Gs),ti.middleName,t?.required),...t}))),Js=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ci(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),Zs=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Qs=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Zs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),eo=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_TYPE"),i=dl();return a((()=>{n&&(i.organization=n)}),[n]),o(ml,{field:e,source:i.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),to=d((({field:e,input:t})=>{const n=dl(),i=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),As(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:i})})),no=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),io=d((({field:e,input:t})=>o(ql,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),ao="partInBusiness",lo=d((({field:e,input:t})=>{const n=l((t=>{e(ao)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...li(e(ao),ti.partInBusiness,t?.required),...t,onChange:n})})),ro=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),so=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Hl("programId"),[c,d]=i([]);a((()=>{s&&(async()=>{const e=await(async e=>{const t=await ea("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems||[]})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.type===e)))),[c,r]);return o(ts,{label:"Платежная система",orientation:"horizontal",items:oo(c),...li(e("paymentSystem"),ti.paymentSystem,t?.required),value:n?.type,onChange:m})})),oo=e=>e?.map((e=>({id:e.type,text:e.name})))??[],co=e=>"_"===e,mo=e=>/\d/.test(e),uo=e=>co(e)||mo(e),ho=[..."+7 (___) ___-__-__"],po=ho.findIndex(co),go=ho.map(((e,t)=>uo(e)?ho.slice(0,t).filter(uo).length:-1));function fo(e){const t=e.replace(/\D/g,""),n=ho.map(((e,n)=>mo(e)?e:t.charAt(go[n])||e)),i=go.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(po,i)):n).join("")}const xo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(fo(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),yo=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(xo,{"aria-label":t,label:mn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),yn(n)]}))),bo=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(yo,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&Ci(e,n),...t})})),vo=d((({field:e,input:t})=>{const{data:n}=qa("POSITION");return o(ml,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),No=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Zs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),wo=d((({field:e,source:t})=>o(Mn,{placeholder:"Выберите продукт",label:"Продукт",options:Co(t?.productList),...ai(e("product"),ti.product)}))),Co=e=>(e??[]).map((e=>({key:e,value:e}))),So=`${Ut}/outservice/outserviceregions`,ko=`${Ut}/regions`,Io=[];function To(e=ko){const{data:t}=gi(e,Dt);return Array.isArray(t)?t:Io}const Bo=d((({field:e,input:t,params:n})=>{var i;const a=To((i=n?.typeForm,"OUTSERVICE"===i?So:void 0));return o(Mn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...li(e("region"),ti.region,t?.required)})})),Ro=d((({field:e,input:t})=>{const n=vi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Mn,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),Po=d((({field:e,input:t})=>{const{data:n}=qa("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Mn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),Do=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),Eo=d((({field:e})=>{const t=e("secondaryPhone");return o(yo,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),Ao=d((({field:e,input:t})=>o(Mn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Is,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),_o=["male","female"],Mo=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Oo=d((({field:e,input:t})=>{const n=e("name")?.value,{value:i,onChange:l}=e("sex");return a((()=>{n&&!i&&(async()=>{const e=await(async e=>{const t=await ea("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return _o.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(ts,{label:"Пол",orientation:"horizontal",items:Mo,...li(e("sex"),ti.sex,t?.required)})})),zo=d((({field:e,input:t})=>o(_i,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Fo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(kl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Vo=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fo,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),yn(i)]}))),Lo=d((({field:e,input:t})=>o(Vo,{label:"СНИЛС",...li(e("snils"),ti.snils,t?.required),...t}))),qo=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ci(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),jo=["От 1 мес","До 15 лет"],$o=d((({field:e})=>o(Za,{title:"Срок, месяцев",items:jo,min:1,max:180,...e("term")}))),Uo=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Wo=d((({field:e,input:t})=>o(Mn,{label:"Тип обслуживания",options:ks,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ho=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Yo=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Tr,{className:"whitespace-normal",orientation:"horizontal",items:Ho,value:t,onChange:e=>n&&n(e)})})})),Ko=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Go={$ref:"/wcms-resources/outservice-productlist.json"},Xo=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(qo,{field:e,input:n}),name:o(Js,{field:e,input:n}),middleName:o(Xs,{field:e,input:n}),phone:o(bo,{field:e,input:n}),organizationPhone:o(bo,{field:e,input:n}),email:o(xs,{field:e,input:n}),fullName:o(Rs,{field:e,input:n}),inn:o(_s,{field:e,input:n}),legalForm:o(Vs,{field:e,input:n}),organizationName:o(to,{field:e,input:n}),generalSeniority:o(Ps,{field:e,input:n}),lastJobExperience:o(zs,{field:e,input:n}),experience5Years:o(ws,{field:e,input:n}),jobsNumber:o(Os,{field:e,input:n}),beginDate:o(jl,{field:e,input:n}),addressFact:o(wi,{field:e,input:n}),organizationAddress:o(Si,{field:e,input:n}),comment:o(Zl,{field:e,input:n}),addressBranch:o(Ni,{field:e,input:n,isPremium:a}),sex:o(Oo,{field:e,input:n}),birthday:o($l,{field:e,input:n}),limitedBirthday:o(qs,{field:e,input:n}),birthPlace:o(Ul,{field:e,input:n}),desiredMeetingDate:o(rs,{field:e,input:n}),product:o(wo,{field:e,source:Go}),localities:o(Ws,{field:e,input:n}),isClient:o(Ms,{field:e}),partnerComments:o(ro,{field:e,input:n}),collectionCount:o(Jl,{field:e,input:n}),acquiringType:o(si,{field:e,input:n}),onlineCheckout:o(Qs,{field:e}),posTerminal:o(No,{field:e}),serviceType:o(Wo,{field:e,input:n}),term:o($o,{field:e}),amount:o(nl,{field:e}),annualRevenue:o(hl,{field:e,input:n}),vedTypes:o(Yo,{field:e}),feedbackMethod:o(Bs,{field:e,input:n}),serviceDirection:o(Ao,{field:e,input:n}),bankEmpolee:o(fl,{field:e}),secondaryPhone:o(Eo,{field:e}),consentToReceiveMaterials:o(mr,{field:e,input:n}),processPersonalDataFlg:o(mr,{field:e,input:n}),consentProviderFlg:o(mr,{field:e,input:n}),consentOthersFlg:o(mr,{field:e,input:n}),consentInformFlg:o(mr,{field:e,input:n}),consentPfrFlg:o(mr,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(Ro,{field:e}):o(Bo,{field:e,input:n,params:t}),education:o(fs,{field:e,input:n}),housing:o(Ds,{field:e,input:n}),employment:o(vs,{field:e,input:n}),organization:o(eo,{field:e,input:n}),amountWorkers:o(ul,{field:e,input:n}),employerActivities:o(ys,{field:e,input:n}),employerOrganization:o(bs,{field:e,input:n}),positionOrganization:o(vo,{field:e,input:n}),familyStatus:o(Ss,{field:e,input:n}),children:o(Gl,{field:e,input:n}),familyMembers:o(Cs,{field:e,input:n}),dependents:o(ls,{field:e,input:n}),totalIncome:o(Uo,{field:e,input:n}),expenses:o(Ns,{field:e,input:n}),snils:o(Lo,{field:e,input:n}),conscription:o(er,{field:e,input:n}),armyIdFlg:o(pl,{field:e,input:n}),dulSerie:o(hs,{field:e,input:n}),dulNumber:o(us,{field:e,input:n}),dulIssueDateField:o(cs,{field:e,input:n}),dulSubdivisionCode:o(gs,{field:e,input:n}),dulIssuedBy:o(ms,{field:e,input:n}),addressRegistration:o(Si,{field:e,input:n}),addressCourier:o(Si,{field:e,input:n}),participantDateRegistration:o(io,{field:e,input:n}),retirementIncome:o(Do,{field:e,input:n}),otherIncome:o(no,{field:e,input:n}),wages:o(Ko,{field:e,input:n}),mandatoryPayments:o(Hs,{field:e,input:n}),disablePeopleFlg:o(ss,{field:e,input:n}),bankruptcyFlg:o(xl,{field:e,input:n}),shareholderFlg:o(zo,{field:e,input:n}),legalEntityName:o(Fs,{field:e,input:n}),creditInRshbCd:o(es,{field:e,input:n}),bankEmployeeCode:o(gl,{field:e,input:n}),partInBusiness:o(lo,{field:e,input:n}),regionRetail:o(Po,{field:e,input:n}),addressRetail:o(Wa,{field:e,input:n}),addressMatch:o(Mi,{field:e,input:n}),paymentSystem:o(so,{field:e,input:n}),currency:o(is,{field:e,input:n}),cardCategory:o(Yl,{field:e,input:n}),codeWord:o(Xl,{field:e,input:n}),confirmationIncome:o(Ql,{field:e,input:n}),methodObtain:o(Ks,{field:e,input:n}),deliveryDate:o(as,{field:e,input:n}),calculator:o(Qr,{field:e,params:t})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(i)):null},Jo=e=>2===e?"@xl:grid-cols-2":"",Zo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,Qo=d((({responseType:e,typeForm:t,onClose:n})=>{const i="OK"===e,a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:i?"Ваша заявка отправлена":"Не удалось отправить заявку",description:i?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(lr,{type:"button",onClick:n,children:"Хорошо"})]})})})),ec=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],tc=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ic(o),...nc(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},nc=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ic=e=>e?{vedTypes:Object.fromEntries(Ho.map((({id:t})=>[t,t===e])))}:{},ac={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ks[0],feedbackMethod:Ts[0],serviceDirection:Is[0],vedTypes:Ho[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},lc=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),rc=(e,t)=>o(lr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),sc=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Ri,{...e}),o(lc,{link:t})]}),yn(ai(e,Kn).error)]}):o(lc,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),rc(n)]}),oc={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(i,g),...Kt(l,g),...Wt(a),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},cc=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||ac[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=ks[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=sn(Qo),C=l((async(e,t)=>{const i=dc(x,e),a=ec(ii(i));if(!On(a(e)))return console.warn("validation fail");const l=tc({...e,...h}),r=await oc.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&N.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Jo(e.columns),"grid gap-x-m"),children:[Zo(e.title),(e?.inputs||[])?.map(Xo(S,{typeForm:n}))]},`section-${t}`))),sc(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),dc=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)})))),mc=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(aa,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(la,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Xo(n,{typeForm:t}))}),renderFoldButton:uc(c("div",{children:[o(Ri,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),uc=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),hc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=pc(n||[]);return i.length>2?c("div",{children:[a.map(Xo(e,{typeForm:t})),o(mc,{inputs:i,field:e})]}):(n||[])?.map(Xo(e,{typeForm:t}))},pc=e=>({consentInputs:e?.filter((e=>Object.keys(tr).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(tr).includes(e.name||"")))||[]}),gc=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],fc=(e,t)=>o(lr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),xc=e=>ta("/user-data/updateUserProfile","PUT",e),yc=e=>ta("/user-data/updateUserTask","PUT",e),bc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),vc={width:"103",height:"21"},Nc={"bg-white":"color",transparent:"white"},wc={"bg-white":"text-primary-main",transparent:"text-white"},Cc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Nc[e]},className:wc[e],width:n?.width,height:n?.height}),Sc={"bg-white":"text-primary-text",transparent:"text-white"},kc=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[Cc(l,n?.image,vc),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Sc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Ic=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=i(""),[d,m]=i(""),[u,h]=i(!1),p=l((async()=>{const e=await(i={captchaText:d},ta("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>ta(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(g,[]),o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(kc,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(fn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(lr,{onClick:close,version:"secondary",children:"Вернуться"}),o(lr,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Tc=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Bc(e)})))),Bc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Rc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:Pc(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),Pc=(e,t,n=!1)=>{const i=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!i)} rounded-md caret-transparent outline-none`},Dc=d((({isDisabled:e,onClick:t,text:n})=>o(lr,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Ec=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Ac=({values:e,onSuccess:t})=>{const[n,r]=i(""),[s,o]=i(!1),[c,d]=i(0),[m,u]=i(!1),[h,p]=i(0),g=l((()=>r("")),[]),f=Boolean(0===c&&m),x=h>2||f||!e.every(Boolean),y=l((async()=>{try{u(!1),d(0),p((e=>e+1)),o(!0),await(async e=>ea("/sms/checkCode","POST",e).then(Ec))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),g(),t?.(e.join(""))}catch{r(h>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{o(!1)}}),[e,h]);return a((()=>{r(f?"Код просрочен":"")}),[f]),{handleSubmit:y,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:c,isSubmitButtonDisabled:x,setTimeNextReq:d,setIsTimerStarted:u,setAttempts:p}},_c=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=i(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Ac({values:m,onSuccess:s}),w=sn(Ic),C=$t(e),S=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},ea("/sms/sendCode","POST",e).then((t=>!bc(t,e.phoneNumber))))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:S,onClose:d})}),[C,d]);return a((()=>{S()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Rc,{values:m,setValues:u,errorText:g,hasError:p}):null,Oc(x,b,S),c(Ee,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),Mc(y,h),f?o(Oi,{blur:!1}):null]})})})),Mc=(e,t)=>o(Dc,{text:"Далее",isDisabled:e,onClick:t}),Oc=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Tc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),zc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Fc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Vc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Lc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,a]=i(""),[r,s]=i(!1),d=cr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),h=r?Fc:zc;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(Tr,{className:"whitespace-normal",orientation:"horizontal",items:Vc,value:n,onChange:u}),o(lr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),qc=()=>cl(),jc=(e,t)=>l((n=>{const i=n instanceof Function?n(e[t]):n;null!=i?e[t]=i:delete e[t]}),[e,t]),$c=d((({title:e,icon:t,description:n,onClick:i=un})=>c("button",{className:"flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green",type:"button",onClick:i,children:[o(ne,{image:{src:t},width:"78",height:"78"}),c("div",{children:[o(w,{className:"text-left",title:e,headingType:"h5"}),n?o(C,{color:"text-secondary-text",size:"text-m",children:n}):null]})]}))),Uc={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Wc={...Uc,amur_card:"14",owner_card:"13",travel_card:"15"},Hc=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"INCOME_AVERAGE"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,o=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:i,additionalIncome:a,otherIncome:l,otherPayments:r,rentalIncome:s,retirementIncome:o}},Yc=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),i=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:i}},Kc=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,i=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:i}},Gc=e=>e?.key?{key:e.key,text:e.value}:void 0,Xc=d((function({task:e,isFromLead:t=!1,onClose:n=un}){const i=qc(),a=jc(i,"leadForm"),r=Jt(),{participants:s,creditProgram:d,id:m}=e,u=Wc[d.code],h=Boolean(Uc[d.code]),p=h?"/credit-lead":"/credit-card-lead",{name:g,midname:f,id:x,profile:y}=s[0],b=l((()=>{const t=(e=>{const t=e.participants[0],{loanAmount:n,creditPeriod:i,paymentTypeCd:a}=e,{currencyCode:l,paymentSystemTypeCd:r,classCard:s,codeWord:o,birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:B,organizationActivityTypeCd:R,organizationTypeCd:P,organizationKindCd:D,employeesNumberCd:E,opf:A,seniority:_,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:F,maritalStatusCd:V,childrenDependents:L,totalDependents:q,otherDependents:j,militaryStatusCd:$,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,nameLegalEntity:G,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z}=t;return{currency:l?.key,paymentSystem:r,cardCategory:Gc(s),codeWord:o,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDateField:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:Gc(b),participantDateRegistration:v,housing:Gc(N),beginDate:k,employment:Gc(I),organizationName:T,inn:B,employerActivities:Gc(R),organization:Gc(P),employerOrganization:Gc(D),amountWorkers:Gc(E),legalForm:A,generalSeniority:_?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:Gc(F),familyStatus:Gc(V),children:L?.toString(),familyMembers:q?.toString(),dependents:j?.toString(),conscription:Gc($),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,legalEntityName:G,creditInRshbCd:Gc(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:n,monthsValue:i,isAnnuity:"ANNUITY"===a?.key},...Hc(U),...Yc(S),...Kc(C),...(Q=w,Q?.key?{sex:"MAN"===Q.key?"male":"female"}:null)};var Q})(e);i.participantId=x,i.taskId=m,i.profileId=y?.id,i.programId=u,a(t),r.assign(p)}),[]),v=l((()=>{r.assign(h?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]),N=l((()=>{r.assign("/")}),[]);return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:n,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"whitespace-pre-wrap",title:`${g&&f?`${g} ${f}, `:""}мы нашли черновик вашей заявки.\nПродолжите заполнение?`,headingType:"h5"}),o($c,{title:"Перейти к черновику",icon:"api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg",description:"Продолжайте заполнять заявку из черновика",onClick:b}),o($c,{title:t?"Продолжить заполнение текущей заявки":"Заполнить новую заявку",icon:"api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg",onClick:t?n:v}),o(lr,{type:"button",version:"secondary",className:"w-full text-h5",onClick:N,children:"Вернуться на главную"})]})})})),Jc=d((function({onClose:e=un}){const t=Jt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),i=l((()=>{t.assign("/")}),[]);return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(lr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(lr,{type:"button",version:"secondary",className:"w-full",onClick:i,children:"Вернуться на главную"})]})})})),Zc=d((({onClose:e})=>{const t=Jt(),[n,i]=Hl("leadForm"),a=l((async()=>{const e=await(n={redirectUri:t.href},ea("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),r=l((()=>{if(null!==n){const e={...n};Reflect.deleteProperty(e,"esiaAccountTypeCd"),i(e)}e?.()}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:r,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex flex-wrap gap-lg w-full",children:[o(lr,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(lr,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),Qc={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},ed={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},td={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},nd=e=>Object.entries(e).reduce(((e,[t,n])=>t in Qc?[...e,{contactTypeCd:{key:Qc[t]},value:n}]:e),[]),id=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in ed){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:ed[t]},...i}]}return e}),[]),ad=e=>Object.entries(e).reduce(((e,[t,n])=>t in td?[...e,{incomeTypeCd:{key:td[t]},value:Number(n||0)}]:e),[]),ld=({inputs:e,programId:t,nextStepLink:n})=>{const[a,r]=i(""),s=(()=>{const e=qc(),t=jc(e,"leadForm");return l((({participantId:n,taskId:i,profileId:a,formData:l,programId:r})=>{e.participantId=n,e.taskId=i,e.profileId=a,e.programId=r,t(l)}),[])})(),o=(e=>{const{open:t}=sn(Zc),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),c=(e=>{const{open:t}=sn(Lc),n=sn(_c),i=t=>async n=>{try{t&&await xc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},a=(t,a)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:i(a)}):e()};return{open:(n,i)=>t({onSubmit:a(n,i),onClose:e})}})(o),d=sn(_c),m=(()=>{const{open:e}=sn(Xc),{open:t}=sn(Jc);return{open:({task:n,isFromLead:i,onClose:a})=>{n?e({task:n,isFromLead:i,onClose:a}):t({})}}})();return{handleSubmit:l((async n=>{const i=ec(ii(e));var a;if(On(i(n)))try{const e=await(a={profile:{phone:$t(n.phone)}},ea("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{await rd({programId:t,profileId:e,formData:n,saveUserData:s}),d.close(),c.open(n.phone,e)},a=async()=>{try{const n=await(async e=>{const t=await ea("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:e,programId:t});if(n){const e=await(async e=>await ea("/user-data/getTaskById","POST",e)||void 0)({taskId:n});d.close(),m.open({task:e,isFromLead:!0,onClose:i})}else await i()}catch{r("Fail")}},l=Object.keys(tr).filter((e=>n[e])).map((e=>tr[e]?.text));d.open({phone:n?.phone,consents:l,onSuccess:a})}}catch{r("Fail")}}),[]),responseStatus:a}},rd=async({programId:e,profileId:t,formData:n,saveUserData:i})=>{const a=sd(n);await xc(((e,t)=>{const{name:n="",surname:i="",middleName:a="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&jt(l,!0),email:s,phone:$t(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,a));const{taskId:l,participantId:r}=await(async e=>await ea("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await yc((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&jt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:nd({phone:o&&$t(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:r,taskId:l,profileId:t,formData:a}))}catch(e){console.log(e)}i({participantId:r,taskId:l,profileId:t,programId:e,formData:n})},sd=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},od={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ks[0],feedbackMethod:Ts[0],serviceDirection:Is[0],vedTypes:Ho[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:{name:"",type:""},cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},cd=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||od[e.name||""]]))),typeForm:{key:"",text:""}}},dd=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:fo(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:md(a),addressFact:md(l),esiaAccountTypeCd:t?.esiaAccountType}},md=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},ud=(e,t)=>{const n=Jt(),[i,{setTrue:s,setFalse:o}]=on(!1),c=qc(),d=jc(c,"leadForm"),m=r((()=>cd(e,c.leadForm)),[e,c.leadForm]),u=l((async(e,i,a)=>{s();try{const r=await(l={profileId:e,code:i,state:a,redirectUri:globalThis.location?.href},ea("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,...dd(r)}))),n.assign(t)}finally{o()}var l}),[t]);return a((()=>{const e=Wl(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),i=t.get("state");e&&n&&i?u(e,n,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[m,{isLoading:i}]},hd=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",button:l,...s})=>{const d=r((()=>gc?.flatMap((e=>e?.inputs))||[]),[gc]),[m,{isLoading:h}]=ud(d,i),{handleSubmit:p,responseStatus:g}=ld({inputs:d,programId:n,nextStepLink:i}),[,{field:f,onSubmit:x}]=an(m,{onSubmit:p}),y=sn(Qo);return a((()=>{g&&y.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:x,className:"space-y-m relative",children:[h?o(Oi,{blur:!1}):null,gc.map(((e,t)=>c("div",{className:u(Jo(e.columns),"grid gap-x-m"),children:[Zo(e.title),hc({field:f,inputs:e?.inputs})]},`section-${t}`))),fc(l)]})})})),pd=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),gd=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",fd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),xd=10;function yd(e=0){const t=Math.round(e*xd);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const bd=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:yd(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),vd=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Nd=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Cd(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?wd(c,v):{},...N?fd(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(bd,{className:u(m,a?vd[a-1]:"",{"h-full":N},t),style:w?wd(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),wd=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Cd=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Sd={"horizontal-list":"w-6","vertical-list":"h-6"},kd=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Sd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Id=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},Td=e=>t=>e.scrollWidth/t,Bd=e=>(t,n)=>{e.scrollBy({left:n*Td(e)(t),behavior:"smooth"})},Rd=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Or()(a),_r()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Bd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Bd(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Pd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Dd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=Rd({itemCount:s.length}),g=Ed(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Nd,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Id({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Pd[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(kd({activeIndex:t,onClick:f,listType:i}))}):null})),Ed=(e=!1)=>({behavior:e?"auto":"smooth"}),Ad=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),_d=d((e=>o(Ad,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Md=d((e=>o(Ad,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Od="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",zd=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?Fd(t):null,l?o(_d,{className:u(Vd(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Md,{className:u(Vd(a),m?"right-1":"right-0"),onClick:d}):null]})})),Fd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Od,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Od,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Vd=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Ld=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Rd({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Nd,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(zd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Dd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),qd=({blocksToRender:e,...t})=>o(Ld,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",gd(!0)),children:B(e,t)},String(n))})}),jd=e=>e%2!=0,$d=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Ud=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o($d,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("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(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Wd=({isUnfolded:e,onToggle:t})=>o(Ud,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Hd=["ArrowDownIcon","ArrowUpIcon"],Yd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Kd=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Yd),children:[P(l,{...a.options,parent:n}),jd(l.length)?o(Lt,{className:"col-span-6",...a}):null]}),o(aa,{renderFoldableSection:({isUnfolded:e})=>c(la,{className:u(Yd),isUnfolded:e,children:[P(r,{...a.options,parent:n}),jd(r.length)?o(Lt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Ud,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Hd[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Gd=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Xd(n,t),Kd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Xd(n,t),qd({...i,blocksToRender:t})]});default:return null}})),Xd=(e,t)=>e&&!t.length?o(pd,{...e}):null,Jd=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Zd=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(Zs,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),Qd=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset: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-xl",children:[e,Jd(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(em(i)).filter(Boolean))]}),n?o("div",{children:o(lr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),em=e=>([t,n])=>{const i=n?.type;return"array"===i?tm(t,e)(n):null},tm=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Zd,{items:i,multiple:!n?.single,...t(e)})]},e)};function nm(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const im=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,am=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>im(t[e])||im(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>im(t[e])||im(n[e])||lm(t[e])<=lm(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>im(t[e])||im(n[e])||lm(t[e]?.min)>=lm(n[e]?.min)&&lm(t[e]?.min)<=lm(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>im(t[e])||im(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>im(t[e])||im(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),lm=e=>Number(e||0),rm=(e,{block:t,page:n,normalize:i=nn})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>nm(a,a.map((e=>Mt(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=nn)=>e?.filter((([,e])=>am(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},sm={},om={},cm=Ft((({className:e,filtrationSchema:t=sm,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=rm(om,{block:a.block,page:a.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:dm(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>dm(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Qd,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(lr,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Gd,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),dm=e=>nm(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),mm=(e=!1)=>e?"text-left":"text-center",um={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},hm=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",um[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),pm=d((({className:e="",title:t,benefitList:n,...i})=>{const a=ke();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:mm(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(gm)}):null]})})),gm=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(hm,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ee,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),fm=(e,t,n)=>{return o(Ld,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(_e,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(_e,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},xm=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?fm(e,0,t):null]}))),ym={start:"justify-start",center:"justify-center",end:"justify-end"},bm=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",ym[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),vm=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Nm=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),wm=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(vm,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(yr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(Nm,{title:e,...r}),Cm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Sm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},km=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Cm.prefMonthsNum,prefTravelBonusRate:l=Cm.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||Sm,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Im=Ft((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=km(r,n);return o(hr,{className:e,title:t,...l,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Pr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?wm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:fr,children:[f>=0?o(yr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Cr(a)]})]})})})),Tm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Bm=e=>Br({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Rm=" (c капитализацией)",Pm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:fr,children:[o(yr,{title:`Доход в конце срока${l?Rm:""}`,value:e,postfix:n,prefix:"+"}),o(yr,{title:`Сумма в конце срока${l?Rm:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Cr)]}),Dm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Em={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Am=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Dm[e?.rateType]:"",{data:n}=gi(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&_m(s,e)&&Lr(i,["minSum","maxSum"],e)&&Lr(n,["minDays","maxDays"],e)))||Em,{rate:m}=d,u=Mm(m,e),h=i+u,p=c||[Em];return{...d,...Vr(["minSum","maxSum"],p),...Vr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},_m=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Mm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},Om=Ft((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Nr(r,1e5),daysValue:wr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Am(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(hr,{className:e,title:t,...d,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Za,{items:[`От ${Tm(b.min||0)}`,`До ${Tm(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[zm(p,h),Bm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),wm({rate:x,depositeName:y,isShowDepositeName:l}),Pm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),zm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Ri,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Ri,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Fm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},Vm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Lm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?$m(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[jm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),jm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),jm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),jm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Lr(i,["minSum","maxSum"],t),Lr(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||Vm,{rate:u}=m,h=qm(u,e),p=i+h,g=t||[Vm];return{...m,...Vr(["minSum","maxSum"],g),...Vr(["minMonths","maxMonths"],g),availableMonths:Fm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},qm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},jm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],$m=(e,t)=>e+Math.round((t-e)/2),Um=(e="rub")=>"rub"===e,Wm=(e,t)=>{const{minMonths:n,maxMonths:i}=Vr(["minMonths","maxMonths"],Gm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:Ya(a,n,i)}},Hm=(e,t)=>{const{minSum:n,maxSum:i}=Vr(["minSum","maxSum"],Gm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:Ya(a,n,i)}},Ym=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Km=e=>{const t=Um(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Gm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Xm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Br({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Br({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Jm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Bm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Br({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Jm(e.isShowNewClient),e.isShowNewClient?o(Ri,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Jm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Zm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Qm={text:"₽",key:"rub"},eu=Ft((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Qm],g=l((e=>t=>e?{...t,...Km(t),...Hm(t,e),...Wm(t,e),...Ym(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Nr(d,2e4),monthsValue:wr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Qm},{normalize:g}),y=x?.("currency")?.value??Qm,b=x?.("isNewClient")?.value,v=Gm(h,y),N=Lm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Dr({field:x,defParams:br(v,b),calcParams:N,monthsValue:"minMonths",map:Zm})}),[x,h]);a((()=>{!Wr(d)&&v&&I()}),[d,h]);const T=w===br(v,b)?.rate;return o(hr,{className:e,title:t,...m,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[c("div",{className:"flex gap-m",children:[Pr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:tu(y?.key)}),h&&h?.length>1?o(Mn,{label:"Валюта",options:p,...x("currency")}):null]}),Sr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Xm({...N,...s},x)]}),wm({rate:w,children:iu(I,T)}),Pm({income:C,finalSum:S,buttons:[...i,nu(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),tu=(e="")=>Um(e)?1e3:100,nu=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},iu=(e,t=!1)=>t?null:o(lr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),au=e=>lu({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&lu({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),lu=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],ru={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},su=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[ru],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>au({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Fr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Fr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>au({row:e,userInputParams:t,paramsViewSettings:n})&&Lr(i+r,["minSum","maxSum"],e)&&Lr(l,["minSumOld","maxSumOld"],e)&&Lr(r,["minSumExtra","maxSumExtra"],e)&&Lr(a,["minMonths","maxMonths"],e)))||ru)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Er(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},ou=Ft((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=su(s,n,l),h=Rr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(hr,{className:e,title:t,...r,children:c("section",{className:u(pr,e),children:[c("div",{className:gr,children:[Pr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Pr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Sr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),cu({...m,...l},d),m.isExtraMoney?Pr({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(fr,"@4xl:w-1/2"),children:[o(yr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(yr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(yr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(yr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Cr(a)]})]})})})),cu=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Ri,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Ri,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Ri,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),du=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Ha(e,{normalize:(e=a)=>n&&i?String(Ya(Number(mu(e)),n,i)):mu(e),format:He(r)}),d=l((e=>t&&t(mu(e))),[t]);return o(fn,{onChange:d,...s,...c})})),mu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),uu=d((e=>o(du,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),hu={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},pu={amount:1500},gu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(pu),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{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:hu[r],children:[o(uu,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(lr,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),fu=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),xu="relative h-full",yu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},bu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(wu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:vu(n,{someCardsHighlighted:l}),children:[B(n,i,{className:Nu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),wu(n)?fu({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},vu=(e,{someCardsHighlighted:t})=>u(xu,t&&(wu(e)?"pt-3xl":"pt-3xl sm:pt-16")),Nu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(xu,"min-w-80",yu[i],t&&(wu(e)?"pt-3xl sm:pt-16":"pt-3xl"),gd(n),n&&"h-full"),wu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Cu=Ft((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Ld,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?Su(s?.block?.blocks):[],hasBlur:!0,children:bu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Su=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],ku="z-10 border border-solid w-full h-full",Iu=u(ku,"absolute hidden @xl:block border-transparent"),Tu=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Iu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Iu,"top-6 right-8 bg-green")}),o("div",{className:u(Iu,"top-3 right-4 bg-green-light")}),c("div",{className:u(ku,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Bu={black:"bg-black",white:"bg-white"},Ru=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Pu)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Pu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Bu[e]}`},String(t)),Du=d((({icon:e,...t})=>{const n=pe(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),Eu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?Au(i):null]})}))),Au=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Du,{...e},String(t))))}),_u=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Mu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=pe()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(a),children:l})})),Ou=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],zu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>Ou.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Fu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:Vu(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Fu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Vu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Lu=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Mu,{href:a,target:m,className:"h-full",data:_u(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe(qe(l)?o(ne,{image:l}):null,x),buttons:d.length?o(zu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(Ee,{__html:s,isDotted:r,itemSize:"list-s"}):null,qu(i,p)]})})}))),qu=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,ju=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},$u=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(ju),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[qe(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(aa,{renderFoldableSection:()=>c("div",{children:[x,o(la,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Uu(m?.parent,h,b):null}):o("div",{children:x})]})})),Uu=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Wu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),i=Jt();if(!t||!e||!n)return i.assign("/"),()=>{};const a=async()=>{const n=await ta("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&i.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},Hu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Yu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Hu,{step:i,showPercentage:!1})]})})}));var Ku;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Ku||(Ku={}));const Gu=e=>ea("/user-data/getTaskStatus","POST",e),Xu=e=>ta("/user-data/sendSignalToProcess","POST",e),Ju=(e,t)=>{const n=s(null),i=l((()=>n.current&&clearInterval(n.current)),[]);return a((()=>(n.current=setInterval((()=>e(i)),t),i)),[e,t]),i},Zu=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Ee,{__html:e}),i?.text?o(Ne,{className:"text-primary-main",children:i.text}):null]})]}))),Qu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Tc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Ee,{__html:a}):null]})]})})),eh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Qu,{interval:d,intervalExpireAction:m}):null]}),o(th,{title:i,items:a}),o(th,{title:l,items:r,countColumns:!0}),n?.__html?o(Zu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),th=({title:e,items:t,countColumns:n=!1})=>{const i=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Jo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:nh(e)},t)))}):null]})]}):null},nh=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),ih=d((()=>o(eh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),ah=d((({handleExpireTimer:e})=>{const[t]=Hl("leadForm");return o(eh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),lh=d((()=>{const[e]=Hl("leadForm");return o(eh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),rh=d((()=>{const[e]=Hl("leadForm");return o(eh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),sh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],oh=d((()=>{const[e,t]=i(Ku.process),[n]=Hl("taskId");a((()=>{(async()=>{for(const e of sh)await Xu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Gu({taskId:n});i&&i?.statusCd!==Ku.process&&(e(),t(i.statusCd))}),[n]);Ju(r,3e4);return ch(e,(()=>t(Ku.rework)))})),ch=(e,t)=>({IN_PROCESS:o(ah,{handleExpireTimer:t}),CANCELLED:o(ih,{}),APPROVED:o(rh,{}),REVISION:o(lh,{})}[e]||o(lh,{})),dh=[{paymentSystem:{name:"",type:""},currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],mh=e=>{if(e)try{return new Date(e)}catch(e){return}},uh=e=>(t,n)=>t.filter((e=>e)).map((t=>[hh(n,e),ph(t,e),yh(t,e),gh(t,e),fh(t,e),xh(t,e)].some(Boolean)?{...t,required:!1}:t)),hh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,ph=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,gh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,fh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),xh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),yh=({name:e},t)=>"snils"===e&&bh(t),bh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,vh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Zu,{__html:e},`${t}_${n}`))):null},Nh=({field:e,inputs:t,params:n})=>t.map(Xo(e,n)),wh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=uh(Ch(t))(e,n),o=s.filter((e=>!xh(e,Ch(t))));return c("div",{className:u(Jo(a),"grid gap-x-m"),children:[vh(o),Zo(l),Nh({field:t,inputs:s,params:i})]},`section-${r}`)})),Ch=e=>t=>e(t)?.value,Sh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(lr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(lr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),kh=e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:i,codeWord:a}},Ih=e=>{const{methodObtain:t,deliveryDate:n=""}=e,i="courier"===t;return i?{courierDeliveryFlg:i,deliveryDate:(a=n,a?new Date(a).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}}:{};var a},Th=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Bh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:jt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:jt(g,!0),houseTypeCd:f,participantContacts:nd({phone:$t(l),email:r}),participantAddresses:id({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:jt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:nd({organizationPhone:p&&$t(p)}),participantAddresses:id({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,childrenDependents:a,totalDependents:i,otherDependents:n,militaryStatusCd:g,participantIncomes:ad({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:id({addressCourier:t})}:{}})(t)}},Rh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Hl("taskId"),[o]=Hl("profileId"),[c]=Hl("participantId"),d=l((async l=>{const d=ec(ii(uh(Dh(l))(t,e)));if(!On(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await yc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...Th(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Bh(a,i)}],...kh(i),...Ih(i)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Ph(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},Ph=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},Dh=e=>t=>e[t],Eh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l})=>{const[r,s]=Hl("leadForm"),d=((e,t)=>({...dh[e],...t,limitedBirthday:mh(t?.limitedBirthday),dulIssueDateField:mh(t?.dulIssueDateField),participantDateRegistration:mh(t?.participantDateRegistration),beginDate:mh(t?.beginDate),deliveryDate:mh(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=Rh({step:e,inputs:m,onNextStep:i,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return a?o(oh,{}):c("form",{onSubmit:p,className:"space-y-m",children:[wh({sections:t,field:h,step:e}),o(Sh,{step:e,onPrevStep:n})]})})),Ah=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],_h=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Mh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Wu,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>Ah[n]),[n]),[x,y]=i(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(Yu,{stepsTitles:_h,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Eh,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),Oh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Hu,{step:i,showPercentage:!1})]})})})),zh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Qu,{interval:d,intervalExpireAction:m}):null]}),o(Fh,{title:i,items:a}),o(Fh,{title:l,items:r,countColumns:!0}),n?.__html?o(Zu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Fh=({title:e,items:t,countColumns:n=!1})=>{const i=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Jo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Vh(e)},t)))}):null]})]}):null},Vh=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Lh=d((()=>o(zh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),qh=d((({handleExpireTimer:e})=>{const[t]=Hl("leadForm");return o(zh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),jh=d((()=>{const[e]=Hl("leadForm");return o(zh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),$h=d((()=>{const[e]=Hl("leadForm");return o(zh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Uh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Wh=d((()=>{const[e,t]=i(Ku.process),[n]=Hl("taskId");a((()=>{(async()=>{for(const e of Uh)await Xu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Gu({taskId:n});i&&i?.statusCd!==Ku.process&&(e(),t(i.statusCd))}),[n]);Ju(r,3e4);return Hh(e,(()=>t(Ku.rework)))})),Hh=(e,t)=>({IN_PROCESS:o(qh,{handleExpireTimer:t}),CANCELLED:o(Lh,{}),APPROVED:o($h,{}),REVISION:o(jh,{})}[e]||o(jh,{})),Yh=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Kh=e=>{if(e)try{return new Date(e)}catch(e){return}},Gh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Xh(n,e),Jh(t,e),tp(t,e),Zh(t,e),Qh(t,e),ep(t,e)].some(Boolean)?{...t,required:!1}:t)),Xh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Jh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Zh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Qh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),ep=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),tp=({name:e},t)=>"snils"===e&&np(t),np=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,ip=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Zu,{__html:e},`${t}_${n}`))):null},ap=({field:e,inputs:t,params:n})=>t.map(Xo(e,n)),lp=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Gh(rp(t))(e,n);return c("div",{className:u(Jo(a),"grid gap-x-m"),children:[ip(s),Zo(l),ap({field:t,inputs:s,params:i})]},`section-${r}`)})),rp=e=>t=>e(t)?.value,sp=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(lr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(lr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),op={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},cp=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:op[i?"annuity":"differential"]}},dp=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},mp=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:jt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:jt(g,!0),houseTypeCd:f,participantContacts:nd({phone:$t(l),email:r}),participantAddresses:id({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:jt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:nd({organizationPhone:p&&$t(p)}),participantAddresses:id({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,confirmationIncome:l,wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h,snils:p,armyIdFlg:g,conscription:f}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,childrenDependents:a,militaryStatusCd:f,participantIncomes:ad({wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h}),snils:p?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:g}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);default:return{}}},up=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Hl("taskId"),[o]=Hl("profileId"),[c]=Hl("participantId"),d=l((async l=>{const d=ec(ii(Gh(pp(l))(t,e)));if(!On(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await yc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...mp(a,i)}],...cp(i),...dp(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));hp(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},hp=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},pp=e=>t=>e[t],gp=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l,programsSource:r})=>{const[s,d]=Hl("leadForm"),[m]=Hl("programId"),u=r?.[m??""],h=((e,t)=>({...Yh[e],...t,limitedBirthday:Kh(t?.limitedBirthday),dulIssueDateField:Kh(t?.dulIssueDateField),participantDateRegistration:Kh(t?.participantDateRegistration),beginDate:Kh(t?.beginDate),deliveryDate:Kh(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=up({step:e,inputs:p,onNextStep:i,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return a?o(Wh,{}):c("form",{onSubmit:x,className:"space-y-m",children:[lp({sections:t,field:f,step:e,params:{calcData:u}}),o(sp,{step:e,onPrevStep:n})]})})),fp=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],xp=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],yp=Ft((({className:e,programsSource:t,...n})=>{const[d,m]=i(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);a(Wu,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>fp[d]),[d]),y=0===d,[b,v]=i(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(Oh,{stepsTitles:xp,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(gp,{step:d,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,programsSource:t},String(d))})]})})})),bp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,vp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Np=1e9,wp={sum:{min:1e4,max:Np},period:3},Cp=Ft((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=rm(wp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Sp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=kp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Qd,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(uu,{label:i?.title,min:500,max:Np,...d("sum",{parse:e=>({min:Number(e),max:Np}),format:({min:e})=>String(e)})}),o(Za,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Gd,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Sp=e=>Et((e?.paramsSource?.rateRows||[]).filter(bp).flatMap((e=>vp(e.minMonths,e.maxMonths)))),kp=e=>Et(e.flatMap((e=>e||[])).filter(bp).flatMap((e=>vp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Ip=[{key:"10"},{key:"50"},{key:"100"}],Tp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Ip,iconVersion:"black"})]})},Bp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Rp=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:Bp,"aria-label":`Страница ${l}`,children:l},String(t)):null},Pp={width:"24",height:"24"},Dp=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ep(1===e),...Pp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Bp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(Rp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Bp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ep(e===n),...Pp})})]})},Ep=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Ap=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Dp,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(Tp,{itemCount:i,onItemCountChange:a}):null]}),_p=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Mp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(_p,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ll,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ll,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(lr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Op=(e,t)=>o(hm,{...e,iconBgVersion:t,className:"shrink-0"}),zp=d((({title:e,timestamp:t,publicId:n})=>{const i=pe(),{href:a}=i({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[Op({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:jt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Fp=`${Ut}/depository`,Vp={startDate:void 0,endDate:void 0,query:""},Lp=Ft((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=an(Vp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?jt(i,!0):"",r=a?jt(a,!0):"",s=new URLSearchParams(Fp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=gi(Fp+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Mp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(zp,{...e},String(e.publicId)))):o(pd,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Ap,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),qp=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,jp=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:qp(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(Ne,{version:a?.version,text:a?.text,...a}):null]}))),$p=`${Ut}/region`;function Up(e="Москва"){return cl().location??{name:e}}function Wp(e="Москва"){const t=cl(),n=l((async()=>{if(!t.location){const n=await Pt($p);t.location=n??{name:e}}}),[t,e]);return gi($p,n),t}var Hp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Hp||(Hp={}));const Yp=new Intl.NumberFormat("ru",{style:"currency",currency:Hp.RUB}),Kp=e=>e?Yp.format(e):"",Gp="text-m font-light text-secondary-text ",Xp=`${Gp} text-left`,Jp=`${Gp} pl-5xl text-center`,Zp=`${Gp} pl-5xl text-right`,Qp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},eg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Xp,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Jp,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Zp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(tg)})]}))),tg=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:Qp[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:Kp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:Kp(e?.buyExchangeRate)})})]},t)},ng={icon:"GpsIcon"},ig=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(hm,{...ng,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),ag=(e,t,n)=>{const i=Number(lg(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},lg=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function rg(e){if(!e)throw new Error("Value should be fulfilled");return e}const sg=e=>t=>{const[,n]=rg(e.find((([e])=>e(t))));return n(t)},og=e=>sg(e.map((([e,t])=>[e,()=>t])));og.if=e=>new cg(void 0,e);class cg{parent;predicate;unit;get entry(){return[rg(this.predicate),rg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new cg(this,e)}then(e){return new cg(this.parent,this.predicate,e)}else(e){return sg([...dg(this),[()=>!0,e]])}}const dg=e=>[...e?.parent?dg(e.parent):[],e.entry],mg=e=>og([[e=>e.value!==Hp.RUB&&e.oppositeValue!==Hp.RUB,()=>e.handleConvert(e.value,Hp.RUB)],[e=>e.value===Hp.RUB&&e.oppositeValue===Hp.RUB,()=>e.handleConvert(e.value,Hp.USD)],[e=>e.value===Hp.RUB&&e.oppositeValue===Hp.RUB,()=>e.handleConvert(e.value,Hp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function ug(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(fn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const hg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Hp.RUB,selectBuy:n?.[0]?.currency?.currency||Hp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[ug({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:pg(r,d,n),value:r.inputSell,setValue:e=>fg(d,n)(e,r.selectSell,r.selectBuy)}),ug({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:gg(r,d,t),value:r.inputBuy,setValue:e=>xg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(Ne,{text:a.text,version:a?.version,...a}):null]})})),pg=(e,t,n)=>i=>{t({selectSell:i}),mg({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{fg(t,n)(e.inputSell,i,a)}})},gg=(e,t,n)=>i=>{t({selectBuy:i}),mg({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>xg(t,n)(e.inputBuy,i,a)})},fg=(e,t)=>(n,i,a)=>{e({inputSell:lg(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(ag(n,l,i===Hp.RUB)||"")})},xg=(e,t)=>(n,i,a)=>{e({inputBuy:lg(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(ag(n,l,i===Hp.RUB)||"")})},yg=`${Ut}/exchangerates`;const bg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=gi(yg+`?regionCode=${t}`,Dt);return n||{}}(Up()),l=vg(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Hp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Hp.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(eg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(ig,{address:a?.address})]}),o(hg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),vg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Ng=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(wg(n))})})),wg=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:a||null})},String(i)):null},Cg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o($d,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Op(a,t),e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Sg=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",kg=(e=!1)=>e?"MinusIcon":"PlusIcon",Ig=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Tg=Ft((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(aa,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(la,{className:u("gap-lg",Sg(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Bg({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Bg=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Ig(e):kg(e))(a,r);return"accordion"===e?o(Cg,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Ud,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Rg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Pg(e)}))),Pg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Tg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Ng,{items:e.items}):null},String(t)))),Dg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Eg)}):null)),Eg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Ag)})]},String(t)),Ag=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:_g(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),_g=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Mg(t)}`,children:o(_e,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Mg=e=>e.replaceAll(/\D/g,""),Og=d((({className:e="",index:t,text:n,...i})=>{const a=pe(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),zg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Og,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Fg=d((({className:e="",index:t,...n})=>{const i=pe(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Vg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Fg,{index:t,...e},String(t))))}):null]}))),Lg=Ft((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options;const{documents:a,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Rg,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Dg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(zu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(zg,{title:d,links:l}),o(Vg,{links:a,license:h})]})})),qg=Ft((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Mn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:_u(l,s?.key),children:f})}):null]})})})),jg={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},$g=d((({version:e,text:t,mobileText:n,...i})=>{const a=ke()?n:t;return a?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",jg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),Ug=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=E(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(kc,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):Wg(p,r),o($g,{version:a,...i})]})})),Wg=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Hg={"bg-white":"primary",transparent:"transparent"},Yg=Ft((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Hg[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Ug,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Kg=(e=!1)=>e?{}:{padding:"p-0"},Gg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Xg=Ft((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=E();return o(g,{className:u("relative flex flex-col",Gg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",gd(r)),...Kg(i)}})})}),{childrenTypes:[]}),Jg=Ft((e=>o(Xg,{...e})),{childrenTypes:[]}),Zg=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",ym[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Qg=["байт","Кб","Мб","Гб","Тб","Пб"],ef=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=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:n,target:i,...fe(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",tf(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),tf=(e,t)=>e||t?o("span",{children:", "}):"",nf=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Qg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?lf(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(ef,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:af(t),data:n?.data}),o(Ee,{__html:n?.__html})]},String(i))},af=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,lf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},rf=d((({href:e,__html:t,target:n,onClose:i})=>{const a=E(),l=$(a)(e);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:i,children:[t?o(Ee,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:i}),o(lr,{type:"button",version:"secondary",onClick:i,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),sf=d((({text:e,href:t,target:n,__html:i,icon:a})=>{const{open:r}=sn(rf),s=l((()=>r({__html:i,href:t,target:n})),[i,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[af(a),o(_e,{font:"font-light",children:e})]}):null})),of={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},cf=Ft((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=E();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",of[r]),role:"list",children:a.map(df(d,l))}):null]})})),df=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?mf(t)(n,i):nf(e,t)(n,i)},mf=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(sf,{...i,icon:e,href:uf(t)?t?.href:t?.attachment?.src}),o(Ee,{__html:t?.__html})]},String(n)):null},uf=e=>"href"in e,hf=Ft((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Ee,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),pf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",gf=(e=[],t={})=>e.filter((({content:e={}})=>am(t,e))).length,ff=(e,t)=>e===t;const xf=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(ff,((e=ff)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),yf=[],bf={},vf={primary:"bg-white/30",secondary:"bg-main-divider"},Nf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},wf=d((({count:e,version:t="secondary"})=>{const n=ke(),i=n?"bg-main-divider":vf[t],a=Nf[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),Cf=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Sf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},kf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},If={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Tf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Bf=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Sf[i],n?Tf[i]:If[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?kf[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Cf({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(wf,{count:m,version:pf(n,i)})}):null]})})})),Rf=d((e=>o(e?.item?.href?Pf:Df,{...e}))),Pf=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(Bf,{...e,tag:"a",item:a,onClick:i})})),Df=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(Bf,{item:e,onClick:i,...n})})),Ef=(e,t,n)=>(i,a)=>o(Rf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Af=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Ef(i,a,t))}))),_f={categories:[],extraOptions:[],propertyType:[],stage:[]},Mf=Ft((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=rm(_f,{block:a.block,page:a.options?.page}),f=l(((e=_f)=>p(e)),[]),x=(({hotFilters:e=yf,filtrationState:t=bf,blocks:n=yf,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>xf(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:gf(n,t.filter),version:pf(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Af,{...x}),o(Qd,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Gd,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Of=(e,t,n)=>{const i=pf("all"===t),a=pf("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(lr,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(lr,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},zf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ee,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Ff="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Vf=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Ri,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(aa,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Ff,children:s}),o(la,{className:Ff,isUnfolded:e,children:d})]}),renderFoldButton:Lf(n,i)})}):null})},Lf=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:qf()})]}),qf=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),jf=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),$f=()=>{},Uf=e=>"all"===e?"block":"hidden",Wf=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=$f,renderRemoteWorkplaceCard:r=$f,getBalloon:s=$f,getBalloonRemoteWorkplaces:d=$f,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(Ma),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=La({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Hf([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Oa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[jf(h,N),m?zf(m):null,p&&Of(t,w,C),o("div",{className:u("pb-3xl",Uf(w)),children:Vf(S)})]}),o("div",{className:"h-[600px]",children:o(Ua,{children:o(Xi,{points:b,isLoad:n,className:"h-full"})})})]}),c(Ua,{children:[y.map(l),v.map(r)]})]})})),Hf=e=>Object.keys(Ma).filter((t=>e.filter((e=>za[t](e))).length)),Yf=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Xf(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:Xf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Na,{color:"green",children:Xf(s)})})]}),o("div",{className:"hidden sm:block",children:o(da,{className:"flex-wrap",children:m?.map(Gf)})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:o(da,{className:"flex-wrap",children:m?.map(Gf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(d))},Kf=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Xf(t)} №${n}`,body:e.toUpperCase()}),Gf=(e,t)=>o(ra,{...e},String(t)),Xf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Jf=[];const Zf=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:Jf},Qf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ex={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},tx=d((({descriptionData:e,className:t})=>{const n=Up(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=gi(`${Ut}/atms?regionCode=${e}`,Zf);return{data:t||Jf,isLoad:!t&&!n}}(i);return o(Wf,{className:t,filterItems:nx,data:a,isLoad:l,initFilterState:Qf,renderCard:Yf,getBalloon:Kf,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),nx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>ex[t](e))),n=!i.length||i.some((t=>ex[t](e)));return t&&n}))},ix=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:ax({workScheduleDescription:t})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:ax({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(n)):null,ax=({workScheduleDescription:e})=>c("div",{children:[c(da,{className:"flex",children:[o(ra,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ra,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(ra,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(ra,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),lx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),rx={branches:[],remoteWorkplaces:[]};const sx=async e=>await Pt(e,{method:"GET"})||rx,ox=d((({className:e})=>{const t=Up(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=gi(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,sx);return{data:t||rx,isLoad:!t&&!n}}(n);return o(Wf,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ea,renderRemoteWorkplaceCard:ix,getBalloon:_a,getBalloonRemoteWorkplaces:lx,title:`Офисы филиала ${t?.name}`})})),cx=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(ox,{}):o(tx,{descriptionData:e})})})),dx=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),mx=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(Ld,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Ze,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),ux=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?hx({__html:l,richVersion:r}):null,px({label:"Адрес",data:e,iconName:"GeolocationIcon"}),px({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),px({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),hx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ee,{...e,itemSize:"list-s"})}),px=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,gx=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ee,{__html:t,richVersion:n})})})),fx=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),Ti,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),xx=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(fx,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(fx,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),yx=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Dn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),bx=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(yx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(yx,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),vx=["От 1 дня","До 365 дней"],Nx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Za,{min:1,max:365,value:e,items:vx,onChange:t})]}))),wx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(yx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(yx,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Cx=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(bx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:Sx(m)}),o(Nx,{days:a,setDays:e=>m({days:e})}),o(wx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:kx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{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(xx,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Sx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},kx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Ix=d((({days:e,tariffs:t=[]})=>{const n=Bx(e,t),i="На рисунке изображена пачка листов\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:[Tx("Аренда за",e),Tx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),Tx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{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})]}),Bx=(e,t)=>{const n=Rx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Rx=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},Px=(e,t)=>e.find((e=>e.branchCode===t)),Dx=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Px(i,n.selectedBranch),d=Ex(s?.safeBoxCaseVolumes),m=Ax(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=_x(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Cx,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Ix,{days:n.days,tariffs:u})]})})),Ex=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ax=(e,t)=>e?.find((e=>e.volume===t)),_x=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Mx=`${Ut}/safeboxes`,Ox=[];const zx=async e=>await Pt(e,{method:"GET"})||Ox,Fx=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=To(),p=Vx(m.selectedRegion,h),f=function(e){const{data:t}=gi(e?`${Mx}?regionCode=${e}`:null,zx);return t||Ox}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Px(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Dx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Xi,{points:y,className:"h-[640px]"}):null]})})),Vx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Lx={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"},qx=(e,t,n)=>(i,a)=>{const{button:l}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:jx(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[$x(i),l?.text?o(Ne,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},jx=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Ux(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Wx({step:n,iconVersion:a,i:i,stepVersion:t})})})},$x=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",Lx.description),children:e.description}):null,o(Ee,{__html:e.__html})]}),Ux=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Wx=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return qe(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?Lx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},Hx=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(qx(d,r,l))}):null,je(a,{isVertical:!0})]})})),Yx=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Kx=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{onClick:a,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(rr,{className:"absolute top-1.5 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Gx(e,t,n){a((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const i=n[t];i&&i(e)}}))),[e,t,...Object.values(n)])}const Xx=()=>{const[e,{push:t,pop:n,clear:a}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}();return Gx(ue.observable,"dialog",{open:t,close:n,closeAll:a}),[e,{close:n,closeAll:a}]},Jx=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Zx=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(_e,{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(Qx,{...e},String(t))))})]}):null,Qx=d((({icon:e,...t})=>{const n=pe(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),ey=(e,t)=>n=>n.name?o(Mu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:_u(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,ty=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(hn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),ny=d((({defaultLocation:e})=>{const t=Up(e),n=pe(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Mu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),iy=d((({foreignOffices:e,branches:t,onClose:n})=>{const a=Wp(t?.default),[s,d]=i(""),m=To(),u=r((()=>ly(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(u,ay)),[u]),p=l((e=>{a.location=e,n?.()}),[a,n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(ny,{defaultLocation:t?.default}),o(ty,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Jx(e.toLowerCase())(s.toLowerCase())>=.8)).map(ey(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(_e,{size:"text-h6",children:e})}),t.map(ey(f,g))]},e)))}),Zx(e)]});var g,f})),ay=e=>e.name?.charAt(0)??"",ly=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),ry=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:i})=>{const l=sn(iy,n),{name:r}=Up(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&i?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[i]),o(Kx,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:i,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),sy="burgerMenuDialog",oy=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:i=un})=>{const{open:a}=sn(ry),[r]=Xx(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(sy,r),o=l((()=>a({menuRef:e,locationDialogProps:n,menuItem:t,onClose:i},{id:sy})),[e,n,t,i]);return[s,{toggle:s?i:o}]},cy=[],dy=Ft((({sticky:e,...t})=>{const{menuItems:n=cy}=e??{},a=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{closeAll:y}=he(),b=l((()=>{p(-1),x(""),y()}),[y]),v=dn(b),N=s(null),[C,{toggle:S}]=oy({menuRef:N,centralMenuItem:a,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:i,onClose:a})=>{const{open:r,close:s}=he(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:i,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:i[l].title,dialog:o(Kx,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),a?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,i,a])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(my(T,"left",{activeIndex:h,currentItemPosition:f})),o(Yx,{item:a,isActive:C,onClick:e=>I(e)}),u.map(my(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),my=(e,t,n)=>(i,a,l)=>o(Yx,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),uy="hidden sm:flex absolute z-40",hy={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},py=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=Rd({itemCount:t?.length||0});return a((()=>gy(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Nd,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:hy[l].item,gap:hy[l].gap,children:t.map(Ef(n,i,l))}),s.canScrollLeft?o(_d,{className:u("left-6",uy,hy[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Md,{className:u("right-6",uy,hy[l].buttonTop),onClick:s.scrollRight}):null]})})),gy=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},fy={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},xy=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(fy[t].wrapper,e),children:o(py,{className:fy[t].component,tabsType:t,...n})}):null,yy=Ft((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=by(n??{}),p=E(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(wy(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Ny(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[xy({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:vy(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Ny)?.filter(Boolean)||[]}),by=({__id:e,anchor:t})=>t??e??"tabs",vy=(e,t)=>t?.length?t:e,Ny=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",wy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Cy={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Sy=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Cy[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),ky=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),Iy={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ee,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(ky,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},Ty=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return By({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),By=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in Iy))return null;return o(Iy[n],{...t,...i})},Ry=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Ty,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Py=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Dy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Ey=d((({rows:e})=>{return o(Nd,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.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(_e,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Py(a,t)}px)`},children:a?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(_e,{size:"text-xl",children:e.data}):null,e?.cols?Dy(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ay=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{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(Ey,{rows:t.rowsData})})})]},i)}))}))),_y=(e=!1)=>""+(e?"text-white":"text-secondary-text"),My=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:_y(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Oy=Ft((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(My,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ay,{activeTabIndex:r,items:m}),o(ky,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(ky,{onClick:n,isOpen:!0})]})})),zy=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Oy,{...t,onClick:n})}):null]}))),Fy=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(zy,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Sy,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Ry,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Vy({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(Ad,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(Ad,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Ly=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Vy({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),qy=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(Fy,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(aa,{renderFoldableSection:({isUnfolded:e})=>c(Ly,{controls:x,children:[b,o(la,{isUnfolded:e,children:v})]}),renderFoldButton:Wd}):o(Ly,{controls:x,children:y})})]})})),jy=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?$y():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Uy(n):null,a?o(Ee,{richVersion:l,__html:a}):null]})]}))),$y=()=>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"}),Uy=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Wy=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),Hy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Wy,{prefix:t,unit:n,suffix:i})})})),Yy={AdTile:Lt,ApplicationForm:cc,ApplicationLeadForm:hd,BankAccountFiltration:cm,BenefitsBlock:pm,BonusBenefitsBlock:xm,ButtonsBlock:bm,CalculatorBonus:Im,CalculatorBusinessDeposit:Om,CalculatorCredit:Yr,CalculatorDeposit:eu,CalculatorRefinancing:ou,CardTransfer:gu,Carousel:Cu,CarouselCard:Tu,CarouselCatalogCard:Ru,CarouselLinks:Eu,CarouselRecommendationCard:Lu,CarouselTariffsCard:$u,CreditCardForm:Mh,CreditForm:yp,DepositFiltration:Cp,Depository:Lp,ErrorBlock:jp,ExchangeRateTile:bg,Footer:Lg,GrantSupport:qg,Header:Yg,Headline:k,HorizontalLayout:Jg,ImgBlock:Zg,LinkDocs:cf,MobileAppTile:hf,MortgageFiltration:Mf,OfficesAtmsMap:cx,Placeholder:dx,ProductBlock:Vt,ProductGallery:mx,RepresentativeOfficeInfo:ux,RichTextBlock:gx,RollupItem:Tg,SafeDepositRental:Fx,StepsBlock:Hx,StickyBottomMenu:dy,TabsLayout:yy,TariffsTable:qy,TextBlock:jy,UnitBlock:Hy,VerticalLayout:Xg},Ky=ce((()=>{a((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Gy="cookie",Xy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=on();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Gy)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Gy,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ee,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function Jy(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const Zy=d((()=>{const[e,{close:t}]=Xx(),n=Boolean(e.length);return Jy(t),a((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:e.map((({dialog:t,id:n},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==e.length-1}),children:t},String(n||i))))}):null})),Qy=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);return Gx(ue.observable,"popup",{open:t,close:n}),Jy(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),eb="header",tb="footer",nb="sticky-footer",ib={},ab=d((({className:e,data:t=ib,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Ot(s,r);Ky(),Wp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.[eb]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(a?.[eb],{...m,slotName:eb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(a?.[tb],{...m,slotName:tb})]})]}),a?.[nb]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(a?.[nb],{...m,slotName:nb})}):null,o(Zy,{}),o(Qy,{}),o(Xy,{__html:d?.cookieContent?.__html})]})}));Object.assign(ab,{childrenTypes:[],slots:()=>[eb,tb,nb]});e.Blocks=Yy,e.ContentPage=ab,e.handlerDecorator=ce,e.joinList=Jd,e.locationNavigator=Jt,e.packageVersion="0.14.701",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=E,Object.defineProperty(e,"__esModule",{value:!0})}));
|