@redneckz/wildless-cms-uni-blocks 0.14.696 → 0.14.698
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/bin/migrate.js +2 -5
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +28 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/RollupItem/getIconName.d.ts +1 -1
- package/bundle/icons/IconName.d.ts +218 -218
- package/bundle/model/LinkProps.d.ts +3 -3
- package/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/bundle/utils/safeJsonParse.d.ts +1 -0
- package/cosmos-static/icons/sprites.svg +101 -101
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +1 -2
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +1 -2
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/dist/components/RollupItem/getIconName.d.ts +1 -1
- package/dist/components/StepsBlock/renderStep.js +1 -1
- package/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/dist/components/TextBlock/TextBlock.js +2 -2
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.js +2 -3
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/hooks/useLocalStorage.js +2 -1
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/icons/IconName.d.ts +218 -218
- package/dist/icons/IconName.js +217 -217
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/LinkProps.d.ts +3 -3
- package/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +2 -3
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/dist/ui-kit/Input/getValidStyle.js +6 -0
- package/dist/ui-kit/Input/getValidStyle.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/utils/safeJsonParse.d.ts +1 -0
- package/dist/utils/safeJsonParse.js +12 -0
- package/dist/utils/safeJsonParse.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.fixture.mobile.d.ts +5 -0
- package/lib/components/CreditCardForm/CreditCardForm.js +1 -2
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.fixture.mobile.d.ts +5 -0
- package/lib/components/CreditForm/CreditForm.js +1 -2
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/lib/components/RollupItem/getIconName.d.ts +1 -1
- package/lib/components/StepsBlock/renderStep.js +1 -1
- package/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/lib/components/TextBlock/TextBlock.js +2 -2
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.js +2 -3
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/hooks/useLocalStorage.js +2 -1
- package/lib/hooks/useLocalStorage.js.map +1 -1
- package/lib/icons/IconName.d.ts +218 -218
- package/lib/icons/IconName.js +217 -217
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/LinkProps.d.ts +3 -3
- package/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +1 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/lib/ui-kit/Input/getValidStyle.js +3 -0
- package/lib/ui-kit/Input/getValidStyle.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/utils/safeJsonParse.d.ts +1 -0
- package/lib/utils/safeJsonParse.js +9 -0
- package/lib/utils/safeJsonParse.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +29 -19
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/bundle/icons/IconName.d.ts +218 -218
- package/mobile/bundle/model/LinkProps.d.ts +3 -3
- package/mobile/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/bundle/utils/safeJsonParse.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +1 -2
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +1 -2
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/dist/components/StepsBlock/renderStep.js +1 -1
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/dist/components/TextBlock/TextBlock.js +2 -2
- package/mobile/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.js +2 -3
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/hooks/useLocalStorage.js +2 -1
- package/mobile/dist/hooks/useLocalStorage.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +218 -218
- package/mobile/dist/icons/IconName.js +217 -217
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/LinkProps.d.ts +3 -3
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +2 -3
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/getValidStyle.js +6 -0
- package/mobile/dist/ui-kit/Input/getValidStyle.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/utils/safeJsonParse.d.ts +1 -0
- package/mobile/dist/utils/safeJsonParse.js +12 -0
- package/mobile/dist/utils/safeJsonParse.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +1 -2
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +1 -2
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/lib/components/StepsBlock/renderStep.js +1 -1
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/lib/components/TextBlock/TextBlock.js +2 -2
- package/mobile/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.js +2 -3
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/hooks/useLocalStorage.js +2 -1
- package/mobile/lib/hooks/useLocalStorage.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +218 -218
- package/mobile/lib/icons/IconName.js +217 -217
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/LinkProps.d.ts +3 -3
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +1 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/getValidStyle.js +3 -0
- package/mobile/lib/ui-kit/Input/getValidStyle.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/utils/safeJsonParse.d.ts +1 -0
- package/mobile/lib/utils/safeJsonParse.js +9 -0
- package/mobile/lib/utils/safeJsonParse.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -1
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
- package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +1 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +1 -2
- package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
- package/mobile/src/components/StepsBlock/renderStep.tsx +1 -5
- package/mobile/src/components/StepsBlock/renderStepMobile.tsx +1 -5
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/mobile/src/components/TextBlock/TextBlock.tsx +2 -7
- package/mobile/src/content-page-repository/ContentPageRepository.ts +2 -3
- package/mobile/src/hooks/useLocalStorage.ts +2 -1
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/model/LinkProps.ts +3 -3
- package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +1 -5
- package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
- package/mobile/src/ui-kit/Input/Input.tsx +1 -3
- package/mobile/src/ui-kit/Input/getValidStyle.tsx +3 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/mobile/src/utils/safeJsonParse.ts +7 -0
- package/package.json +5 -6
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +15 -23
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -1
- package/src/components/CreditCardForm/CreditCardForm.fixture.mobile.tsx +25 -0
- package/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
- package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +1 -1
- package/src/components/CreditForm/CreditForm.fixture.mobile.tsx +30 -0
- package/src/components/CreditForm/CreditForm.tsx +1 -2
- package/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
- package/src/components/StepsBlock/renderStep.tsx +1 -5
- package/src/components/StepsBlock/renderStepMobile.tsx +1 -5
- package/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/src/components/TextBlock/TextBlock.tsx +2 -7
- package/src/content-page-repository/ContentPageRepository.ts +2 -3
- package/src/hooks/useLocalStorage.ts +2 -1
- package/src/icons/IconName.ts +5 -5
- package/src/model/LinkProps.ts +3 -3
- package/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/src/ui-kit/DialogManager/Dialog.tsx +1 -5
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +2 -2
- package/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
- package/src/ui-kit/Input/Input.tsx +1 -3
- package/src/ui-kit/Input/getValidStyle.tsx +3 -0
- package/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/src/utils/safeJsonParse.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).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 P=[],R=(e,{key:t,ancestors:n=P,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||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(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 M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var q=Object.freeze({__proto__:null,isURL:_,isLocalURL:F,isHash:z,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:O,hasPrefix:V});const L="/api/",j=`${L}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),z(t),[A.CDN,L].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 O(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)(O(A.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(!F(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]}),Re(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Pe(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Pe=e=>u(e?"row-span-2":"@xl:row-span-2"),Re=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((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(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,Ae=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Fe=(e,t)=>["label"in e?_e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(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:Fe(n)})]}))),Oe=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(Fe)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ve:Oe,{...t}))),Le=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=>Le(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(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[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(Ae,{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,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...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:[R?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):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)),Pt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Rt(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)],Mt={},At=["/portal-resources"],_t=(e,t)=>Tt(e,(e=>t?.[e])),Ft=(e,t)=>{const n=Pt(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=>!At.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),i={...t,...n},a=Object.entries(n).flatMap((([,e])=>Pt(e)));return a.length?zt(a,i):i}return t};function Ot(e,t={}){const n=d((t=>{const n=Ft((({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=Ot((({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"]}),qt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Lt(0,t?.length)),[t]),i=t?.[n];return i?o(Vt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Lt=(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 max-w-[978px] 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?o(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,gn=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=fn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[pn(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]})})),fn=e=>e?hn:"border-error",xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(Ae,{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(gn,{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||"",Pn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Rn=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:Pn(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=An(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(Rn,{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:[pn(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",Mn(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(gn,{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"}),Mn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),An=(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)]}))),Fn=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],On=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",qn="Укажите регион, город/населенный пункт, улицу, дом",Ln=e=>On(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)(qn),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:Ln(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:jn(),addressBranch:jn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:Ln("Укажите дату рождения"),limitedBirthday:zn(ei)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Ln("Укажите место рождения"),education:Ln("Выберите ваше образование"),housing:Ln("Выберите тип жилья"),employment:Ln("Выберите информацию о трудоустройстве"),organization:Ln("Выберите тип организации"),amountWorkers:Ln("Выберите информацию о количестве сотрудников"),employerActivities:Ln("Выберите вид деятельности организации"),employerOrganization:Ln("Выберите вид организации"),positionOrganization:Ln("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:Ln("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:Ln("Укажите организацию, выдавшую паспорт"),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:Ln("Укажите ОПФ"),organizationName:Ln("Укажите наименование организации"),generalSeniority:$n("Укажите количество лет стажа"),lastJobExperience:$n("Укажите стаж на последнем месте работы"),experience5Years:$n("Укажите общий стаж за последние 5 лет"),jobsNumber:$n("Укажите количество мест работы за последние 5 лет"),beginDate:Ln("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:Ln(),collectionCount:Ln(),comment:Ln(),acquiringType:jn(),feedbackMethod:jn(),serviceType:jn(),serviceDirection:jn(),regionRetail:jn("Выберите регион"),meetingDay:Ln(),product:Ln(),localities:Ln(),consentDataProcessing:Kn,annualRevenue:Ln(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:Ln("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Gn)(e))("Некорректный номер СНИЛС"),conscription:Ln(),armyIdFlg:Kn,sex:Ln("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(qn),participantDateRegistration:Ln("Укажите дату регистрации"),retirementIncome:Ln(),otherIncome:Ln(),wages:Ln(),mandatoryPayments:Ln(),disablePeopleFlg:Ln(),bankruptcyFlg:Ln(),shareholderFlg:Ln(),legalEntityName:Ln(),bankEmployeeCode:Ln(),partInBusiness:Ln(),addressRetail:jn("Выберите адрес банка"),addressMatch:Ln(),codeWord:(e=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:Ln(),deliveryDate:Ln("Укажите дату доставки"),addressCourier:Jn(),cardCategory:Ln("Укажите категорию карты"),paymentSystem:Ln("Укажите тип платежной системы"),currency:Ln("Укажите валюту")};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 Rt(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"}],Pi=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":Mi(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,Ri(n)]})})})),Ri=e=>e?o("div",{className:"ml-s",children:o(Ae,{size:"text-l",font:"font-light",children:e})}):null,Di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ei=(e=!1)=>e?"radio":"checkbox",Mi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ai=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Pi,{text:t,value:n,disabled:a,onChange:r},i),yn(l)]}))),_i=d((({field:e,input:t})=>o(Ai,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Fi=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",Oi="/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=qi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=qi("workplaces",e,a),r=Li(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Li(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=Li(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 qi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?zi:Oi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Li=(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:Oi,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=${A.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(Fi,{}):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(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||oa(n,s),a?o(Ae,{color:i,size:"text-m",children:a}):null]}),oa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ae,{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(Ae,{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(Ae,{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(Ae,{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"})]}),Pa=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ra=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(Ae,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),Ca(h)]}),o("div",{className:"hidden sm:block",children:Ma({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:Ma({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))},Ma=({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]})},Aa=({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?Pa(n):Da(n,i):Ra(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},Fa={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)},Oa=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>za[t](e)))))},Va=()=>{},qa=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Va,getBalloonRemoteWorkplaces:a=Va})=>{const[l,s,o,c]=r((()=>{const l=Oa(e,n),r=Oa(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}},La=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 Rt(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}=La("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}=qa({data:n,filtrationState:{},getBalloon:Aa}),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(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",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(Ae,{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")}))),il=Ot((({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})})),al=d((({field:e,input:t})=>{const{data:n}=La("EMPLOYEES_NUMBER");return o(il,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),ll=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),rl=d((({field:e,input:t})=>o(Ai,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),sl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),ol=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),cl=d((({field:e,input:t})=>o(Ai,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),dl=({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=ml(t,e),c=ul(t,l,r);u.push(o("td",{children:o("div",{className:hl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ml=(e,t)=>t&&e.toDateString()===t.toDateString(),ul=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),hl=(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"),pl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],gl=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:pl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:dl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),fl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function xl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(yl),l=i.map(((e,t)=>vl(e)?i.slice(0,t).filter(vl).length:-1)),r=i.map(((e,t)=>bl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const yl=e=>"_"===e,bl=e=>/\d/.test(e),vl=e=>yl(e)||bl(e),Nl=1940,wl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Cl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=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(xl(t,"__.__.____"))},onBlur:()=>{if(Sl(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",...wl})]})})),Sl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Nl&&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},kl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Cl,{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")}),Il=fl.map((e=>({key:e}))),Tl=Array.from({length:(new Date).getFullYear()-Nl+1},((e,t)=>Nl+t)).reverse().map((e=>({key:String(e)}))),Bl=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Pl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Rl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Dl={className:"min-w-32",iconVersion:"black",isBorder:!1},El=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(fl.indexOf(e));const t=Bl(r,fl.indexOf(e));Pl({maxDateOfMonth:t,selectedYear:r,selectedMonth:fl.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:Il,yearsOptions:Tl,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:[pn(t),c("div",{className:"relative",children:[kl({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,{...Rl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:fl[f]},options:S,...Dl}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Dl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Rl,className:"rotate-90 cursor-pointer"})})]}),o(gl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Ml=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(El,{label:mn({label:t,errors:i}),valid:Boolean(!n),...a}),yn(n)]}))),Al=d((({field:e,input:t})=>o(Ml,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),_l=d((({field:e,input:t})=>o(Ml,{label:"Дата рождения",...li(e("birthday"),ti.birthday,t?.required)}))),Fl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ci(e,"birthPlace")})));function zl(e){const t=globalThis.localStorage?.getItem(e),[n,a]=i(t?JSON.parse(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 Ol=d((({field:e,input:t})=>{const[n,l]=i([]),[r]=zl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem").value;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),Vl(e,s)||c&&c(null)})()}),[d]),o(il,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Vl=(e,t)=>e.some((e=>e.key===t?.key)),ql=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...li(e("children"),ti.children,t?.required),...t}))),Ll=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)}))),$l=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Ul=d((({field:e,input:t})=>{const{data:n}=La("INCOME_CERT_UNITED");return o(il,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Wl=d((({field:e,input:t})=>{const{data:n}=La("MILITARY_STATUS");return o(il,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Hl={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function Yl({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Kl={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"},Gl={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")},Xl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(Yl(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(Kl[a],Gl[a]),i),type:s,role:d,onClick:m,children:e})})),Jl=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"})}))),Zl=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{className:u("relative min-h-full 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(Jl,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Ql=d((({src:e,convertToPng:t,onClose:n})=>c(Zl,{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(Xl,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),er=e=>{const{open:t}=sn(Ql),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])},tr=d((({className:e,error:t,docId:n,...i})=>{const a=er(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Pi,{...i}),n?o(Ne,{className:"text-primary-main",onClick:a,children:o(Ae,{children:"Ознакомиться"})}):null]}),yn(t)]})})),nr=d((({field:e,input:t})=>t&&t.name?o(tr,{text:Hl[t.name]?.text,docId:Hl[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),ir=Math.round(29.5),ar=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]}))),lr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",rr="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",sr="flex flex-col gap-y-xl min-w-52",or=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(Ae,{size:"text-h3",children:"number"==typeof e?[i,He(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),cr=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(Ae,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(or,{value:n,...a}):o(Ae,{size:"text-h3",children:"-"})]}))),dr=(e=[],t=!1)=>mr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),mr=(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]},ur=(e,t=0)=>e?.sum?e.sum:t,hr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,pr=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,gr=({min:e=0,max:t=0,availableMonths:n,...i})=>o(Za,{items:[`От ${fr(e)}`,`До ${fr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),fr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xr={horizontal:"@lg:flex-row",vertical:""},yr=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(Ae,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",xr[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Pi,{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(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(yr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),vr=e=>br({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Nr=({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}),wr=({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))},Cr=(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)},Sr=e=>e,kr=(e=Sr)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ir=kr(),Tr=(e=Sr)=>kr((t=>-e(t))),Br=Tr(),Pr=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Rr([e,t],i),Rr=([e,t],n=[])=>({[e]:n.length?Br(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ir(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Dr=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Er={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Mr=e=>Ar({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ar({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Ar({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Ar({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ar=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],_r=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[Er],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Mr({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Pr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Pr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>Mr({row:e,userInputParams:t,paramsViewSettings:n})&&Dr(i,["minSum","maxSum"],e)&&Dr(a,["minMonths","maxMonths"],e)))||Er)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=Cr(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},Fr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),zr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Or=Ot((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,mr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:ur(s,2e5),monthsValue:hr(s,ir),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=_r(g,n,r),b=vr({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((()=>{!Fr(s)&&h&&wr({field:f,defParams:h,calcParams:y,map:zr,monthsValue:"minMonths"})}),[n,s]),o(ar,{className:e,title:t,...m,children:c("section",{className:u(lr,e),children:[c("div",{className:rr,children:[Nr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),gr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Vr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(sr,"@4xl:w-1/2"),children:[o(cr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(cr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(cr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),pr(l)]})]})})})),Vr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Pi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Pi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),qr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Lr=(e,t=!1)=>{const n=t?jr(qr):qr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},jr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),$r="calculator",Ur=d((({field:e,params:t})=>{const n=l((t=>{e($r).onChange?.(t)}),[]);return o(Or,{...t?.calcData,defaultParams:Lr(e($r).value),onChange:n})})),Wr=d((({field:e,input:t})=>{const{data:n}=La("CREDIT_IN_RSHB");return o(il,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Hr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(yr,{label:mn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),yn(i)]}))),Yr=[{id:"810",text:"Рубли"}],Kr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency"),{data:a}=La("CURRENCY"),l=a?.map((e=>({id:e.key,text:e.value})))??Yr;return o(Hr,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),Gr=d((({field:e,input:t})=>o(Ml,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),Xr=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),Jr=d((({field:e,input:t})=>o(Ml,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),Zr=d((({field:e,input:t})=>o(Ai,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),Qr="dulIssueDateField",es=d((({field:e,input:t})=>o(Ml,{label:"Дата выдачи",...li(e(Qr),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ci(e,Qr)}))),ts="dulIssuedBy",ns=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,ts),label:"Кем выдан",...t,...li(e(ts),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),is=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)}))),as=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)}))),ls="dulSubdivisionCode",rs=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ls),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...li(e(ls),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),ss=d((({field:e,input:t})=>{const{data:n}=La("EDUCATION_LEVEL");return o(il,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),os=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),cs=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_ACTIVITY_TYPE");return o(il,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),ds=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_KIND");return o(il,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),ms=d((({field:e,input:t})=>{const{data:n}=La("EMPLOYMENT_INFO_UNITED");return o(il,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),us=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...li(e("expenses"),ti.expenses,t?.required),...t}))),hs=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),ps=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)})})),gs=d((({field:e,input:t})=>{const{data:n}=La("MARITAL_STATUS");return o(il,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),fs=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],xs=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ys=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],bs=d((({field:e,input:t})=>o(_n,{label:"Способ получения ответа",options:ys,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),vs=d((({field:e,input:t})=>o(kn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),Ns=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),ws=d((({field:e,input:t})=>{const{data:n}=La("HOUSE_TYPE");return o(il,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Cs=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationAddress")?.onChange?.(ki(t.data?.address)),e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),Ss=d((({field:e})=>o(Ai,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ks=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Is=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Ts=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Bs=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Ps="limitedBirthday",Rs=d((({field:e,input:t})=>o(Ml,{label:"Дата рождения",...li(e(Ps),ti.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ci(e,Ps)}))),Ds=`${Ut}/outservice`,Es=[];async function Ms(){const e=await Rt(`${Ds}/outserviceregions`);return e&&Array.isArray(e)?e:Es}const As=d((({field:e,input:t})=>{const n=e("region"),i=n?.value?.key,{data:l}=gi("outServiceRegions",Ms),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})})),_s=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),Fs=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],zs=d((({field:e,input:t})=>o(Hr,{orientation:"horizontal",items:Fs,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),Os="middleName",Vs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ci(e,Os),...li(e(Os),ti.middleName,t?.required),...t}))),qs=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}))),Ls=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(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),js=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Ls,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),$s=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_TYPE");return o(il,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Us=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),Ws=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),Hs=d((({field:e,input:t})=>o(Ml,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),Ys="partInBusiness",Ks=d((({field:e,input:t})=>{const n=l((t=>{e(Ys)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...li(e(Ys),ti.partInBusiness,t?.required),...t,onChange:n})})),Gs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),Xs=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r]=zl("programId"),[s,c]=i([]);return a((()=>{r&&(async()=>{const e=await(async e=>{const t=await ea("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems?.map((e=>({id:e.type,text:e.name})))??[]})(r);c(e||[])})()}),[]),o(Hr,{label:"Платежная система",orientation:"horizontal",items:s,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),Js=e=>"_"===e,Zs=e=>/\d/.test(e),Qs=e=>Js(e)||Zs(e),eo=[..."+7 (___) ___-__-__"],to=eo.findIndex(Js),no=eo.map(((e,t)=>Qs(e)?eo.slice(0,t).filter(Qs).length:-1));function io(e){const t=e.replace(/\D/g,""),n=eo.map(((e,n)=>Zs(e)?e:t.charAt(no[n])||e)),i=no.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(to,i)):n).join("")}const ao=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(io(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(gn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),lo=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ao,{"aria-label":t,label:mn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),yn(n)]}))),ro=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(lo,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&Ci(e,n),...t})})),so=d((({field:e,input:t})=>{const{data:n}=La("POSITION");return o(il,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),oo=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(Ls,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),co=d((({field:e,source:t})=>o(_n,{placeholder:"Выберите продукт",label:"Продукт",options:mo(t?.productList),...ai(e("product"),ti.product)}))),mo=e=>(e??[]).map((e=>({key:e,value:e}))),uo=`${Ut}/outservice/outserviceregions`,ho=`${Ut}/regions`,po=[];function go(e=ho){const{data:t}=gi(e,Dt);return Array.isArray(t)?t:po}const fo=d((({field:e,input:t,params:n})=>{var i;const a=go((i=n?.typeForm,"OUTSERVICE"===i?uo: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)})})),xo=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)})})),yo=d((({field:e,input:t})=>{const{data:n}=La("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)})})),bo=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})})),vo=d((({field:e})=>{const t=e("secondaryPhone");return o(lo,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),No=d((({field:e,input:t})=>o(_n,{label:"Направление обслуживания",placeholder:"Выберите направление",options:xs,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),wo=["male","female"],Co=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],So=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 wo.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Hr,{label:"Пол",orientation:"horizontal",items:Co,...li(e("sex"),ti.sex,t?.required)})})),ko=d((({field:e,input:t})=>o(Ai,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Io=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(xl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(gn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),To=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(Io,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),yn(i)]}))),Bo=d((({field:e,input:t})=>o(To,{label:"СНИЛС",...li(e("snils"),ti.snils,t?.required),...t}))),Po=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ci(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Ro=["От 1 мес","До 15 лет"],Do=d((({field:e})=>o(Za,{title:"Срок, месяцев",items:Ro,min:1,max:180,...e("term")}))),Eo=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Mo=d((({field:e,input:t})=>o(_n,{label:"Тип обслуживания",options:fs,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ao=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],_o=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(yr,{className:"whitespace-normal",orientation:"horizontal",items:Ao,value:t,onChange:e=>n&&n(e)})})})),Fo=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 zo={$ref:"/wcms-resources/outservice-productlist.json"},Oo=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(Po,{field:e,input:n}),name:o(qs,{field:e,input:n}),middleName:o(Vs,{field:e,input:n}),phone:o(ro,{field:e,input:n}),organizationPhone:o(ro,{field:e,input:n}),email:o(os,{field:e,input:n}),fullName:o(vs,{field:e,input:n}),inn:o(Cs,{field:e,input:n}),legalForm:o(Bs,{field:e,input:n}),organizationName:o(Us,{field:e,input:n}),generalSeniority:o(Ns,{field:e,input:n}),lastJobExperience:o(Is,{field:e,input:n}),experience5Years:o(hs,{field:e,input:n}),jobsNumber:o(ks,{field:e,input:n}),beginDate:o(Al,{field:e,input:n}),addressFact:o(wi,{field:e,input:n}),organizationAddress:o(Si,{field:e,input:n}),comment:o($l,{field:e,input:n}),addressBranch:o(Ni,{field:e,input:n,isPremium:a}),sex:o(So,{field:e,input:n}),birthday:o(_l,{field:e,input:n}),limitedBirthday:o(Rs,{field:e,input:n}),birthPlace:o(Fl,{field:e,input:n}),desiredMeetingDate:o(Jr,{field:e,input:n}),product:o(co,{field:e,source:zo}),localities:o(As,{field:e,input:n}),isClient:o(Ss,{field:e}),partnerComments:o(Gs,{field:e,input:n}),collectionCount:o(jl,{field:e,input:n}),acquiringType:o(si,{field:e,input:n}),onlineCheckout:o(js,{field:e}),posTerminal:o(oo,{field:e}),serviceType:o(Mo,{field:e,input:n}),term:o(Do,{field:e}),amount:o(nl,{field:e}),annualRevenue:o(ll,{field:e,input:n}),vedTypes:o(_o,{field:e}),feedbackMethod:o(bs,{field:e,input:n}),serviceDirection:o(No,{field:e,input:n}),bankEmpolee:o(ol,{field:e}),secondaryPhone:o(vo,{field:e}),consentToReceiveMaterials:o(nr,{field:e,input:n}),processPersonalDataFlg:o(nr,{field:e,input:n}),consentProviderFlg:o(nr,{field:e,input:n}),consentOthersFlg:o(nr,{field:e,input:n}),consentInformFlg:o(nr,{field:e,input:n}),consentPfrFlg:o(nr,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(xo,{field:e}):o(fo,{field:e,input:n,params:t}),education:o(ss,{field:e,input:n}),housing:o(ws,{field:e,input:n}),employment:o(ms,{field:e,input:n}),organization:o($s,{field:e,input:n}),amountWorkers:o(al,{field:e,input:n}),employerActivities:o(cs,{field:e,input:n}),employerOrganization:o(ds,{field:e,input:n}),positionOrganization:o(so,{field:e,input:n}),familyStatus:o(gs,{field:e,input:n}),children:o(ql,{field:e,input:n}),familyMembers:o(ps,{field:e,input:n}),dependents:o(Xr,{field:e,input:n}),totalIncome:o(Eo,{field:e,input:n}),expenses:o(us,{field:e,input:n}),snils:o(Bo,{field:e,input:n}),conscription:o(Wl,{field:e,input:n}),armyIdFlg:o(rl,{field:e,input:n}),dulSerie:o(as,{field:e,input:n}),dulNumber:o(is,{field:e,input:n}),dulIssueDateField:o(es,{field:e,input:n}),dulSubdivisionCode:o(rs,{field:e,input:n}),dulIssuedBy:o(ns,{field:e,input:n}),addressRegistration:o(Si,{field:e,input:n}),addressCourier:o(Si,{field:e,input:n}),participantDateRegistration:o(Hs,{field:e,input:n}),retirementIncome:o(bo,{field:e,input:n}),otherIncome:o(Ws,{field:e,input:n}),wages:o(Fo,{field:e,input:n}),mandatoryPayments:o(_s,{field:e,input:n}),disablePeopleFlg:o(Zr,{field:e,input:n}),bankruptcyFlg:o(cl,{field:e,input:n}),shareholderFlg:o(ko,{field:e,input:n}),legalEntityName:o(Ts,{field:e,input:n}),creditInRshbCd:o(Wr,{field:e,input:n}),bankEmployeeCode:o(sl,{field:e,input:n}),partInBusiness:o(Ks,{field:e,input:n}),regionRetail:o(yo,{field:e,input:n}),addressRetail:o(Wa,{field:e,input:n}),addressMatch:o(_i,{field:e,input:n}),paymentSystem:o(Xs,{field:e,input:n}),currency:o(Kr,{field:e,input:n}),cardCategory:o(Ol,{field:e,input:n}),codeWord:o(Ll,{field:e,input:n}),confirmationIncome:o(Ul,{field:e,input:n}),methodObtain:o(zs,{field:e,input:n}),deliveryDate:o(Gr,{field:e,input:n}),calculator:o(Ur,{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},Vo=e=>2===e?"@xl:grid-cols-2":"",qo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ae,{size:"text-h6",children:e})}):null,Lo=d((({responseType:e,typeForm:t,onClose:n})=>{const i="OK"===e,a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Zl,{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(Xl,{type:"button",onClick:n,children:"Хорошо"})]})})})),jo=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],$o=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,...Wo(o),...Uo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Uo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Wo=e=>e?{vedTypes:Object.fromEntries(Ao.map((({id:t})=>[t,t===e])))}:{},Ho={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:fs[0],feedbackMethod:ys[0],serviceDirection:xs[0],vedTypes:Ao[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Yo=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ae,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Ae,{children:t.text})}):null]}))),Ko=(e,t)=>o(Xl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Go=(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(Pi,{...e}),o(Yo,{link:t})]}),yn(ai(e,Kn).error)]}):o(Yo,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Ko(n)]}),Xo={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}}},Jo=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||Ho[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=fs[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=sn(Lo),C=l((async(e,t)=>{const i=Zo(x,e),a=jo(ii(i));if(!Fn(a(e)))return console.warn("validation fail");const l=$o({...e,...h}),r=await Xo.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(Vo(e.columns),"grid gap-x-m"),children:[qo(e.title),(e?.inputs||[])?.map(Oo(S,{typeForm:n}))]},`section-${t}`))),Go(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]})})),Zo=(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)})))),Qo=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(Oo(n,{typeForm:t}))}),renderFoldButton:ec(c("div",{children:[o(Pi,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),ec=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"})})]}),tc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=nc(n||[]);return i.length>2?c("div",{children:[a.map(Oo(e,{typeForm:t})),o(Qo,{inputs:i,field:e})]}):(n||[])?.map(Oo(e,{typeForm:t}))},nc=e=>({consentInputs:e?.filter((e=>Object.keys(Hl).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Hl).includes(e.name||"")))||[]}),ic=[{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"}]}],ac={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:fs[0],feedbackMethod:ys[0],serviceDirection:xs[0],vedTypes:Ao[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:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},lc=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||ac[e.name||""]]))),typeForm:{key:n,text:""}}},rc=(e,t)=>o(Xl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),sc=e=>ta("/user-data/updateUserProfile","PUT",e),oc=e=>ta("/user-data/updateUserTask","PUT",e),cc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),dc={width:"103",height:"21"},mc={"bg-white":"color",transparent:"white"},uc={"bg-white":"text-primary-main",transparent:"text-white"},hc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:mc[e]},className:uc[e],width:n?.width,height:n?.height}),pc={"bg-white":"text-primary-text",transparent:"text-white"},gc=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:[hc(l,n?.image,dc),r?i??o("div",{className:"ml-s",children:o(Ae,{font:"font-medium",color:pc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),fc=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(Zl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(gc,{}),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(gn,{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(Xl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Xl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),xc=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:yc(e)})))),yc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,bc=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:vc(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),vc=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Nc=d((({isDisabled:e,onClick:t,text:n})=>o(Xl,{type:"button",onClick:t,disabled:e,children:o(Ae,{font:"font-normal",children:n})}))),wc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Cc=({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(wc))({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}},Sc=d((({title:e,description:t,__html:n,code:r=!0,codeLength:s=4,textButton:d="Далее",phoneNumber:m="+79999999999",onSuccess:u=un,onClose:h=un})=>{const[p,g]=i(Array(s).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttempts:S}=Cc({values:p,onSuccess:u}),I=sn(fc),T=l((async()=>{var e;await(e={phoneNumber:m,smsCodesSetName:{key:"AUTHENTICATION"}},ea("/sms/sendCode","POST",e).then((t=>!cc(t,e.phoneNumber))))?(S(0),w(180),C(!0)):I.open({phoneNumber:m,sendCode:T,onClose:h})}),[m,h]);return a((()=>{T()}),[]),o(Zl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:e,description:t,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),r?o(bc,{values:p,setValues:g,errorText:y,hasError:x}):null,Ic(v,w,T),o(Ee,{itemSize:"list-s",__html:n}),kc(d,N,f),b?o(Fi,{blur:!1}):null]})})})),kc=(e,t,n)=>e?o(Nc,{isDisabled:t,onClick:n,text:e}):null,Ic=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(xc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Tc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Bc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Pc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Rc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,a]=i(""),[r,s]=i(!1),d=er(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),h=r?Bc:Tc;return o(Zl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(yr,{className:"whitespace-normal",orientation:"horizontal",items:Pc,value:n,onChange:u}),o(Xl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Dc=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:$t(e),textButton:"Далее",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Ec=d((({onClose:e})=>{const t=Jt(),[n,i]=zl("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(Zl,{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",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Xl,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(Xl,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),Mc={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Ac={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},_c={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Fc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Mc?[...e,{contactTypeCd:{key:Mc[t]},value:n}]:e),[]),zc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Ac){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Ac[t]},...i}]}return e}),[]),Oc=e=>Object.entries(e).reduce(((e,[t,n])=>t in _c?[...e,{incomeTypeCd:{key:_c[t]},value:Number(n||0)}]:e),[]),Vc=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,o]=zl("taskId"),[,c]=zl("profileId"),[,d]=zl("participantId"),[,m]=zl("programId"),u=(e=>{const{open:t}=sn(Ec),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),h=(e=>{const{open:t}=sn(Rc),n=sn(Sc),i=t=>async n=>{try{t&&await sc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},a=(t,a)=>async l=>{"SIGNED"===l&&t?n.open({...Dc(t),onSuccess:i(a)}):e()};return{open:(n,i)=>t({onSubmit:a(n,i),onClose:e})}})(u),p=sn(Sc),g=l((({participantId:e,taskId:t,profileId:n,programId:i})=>{d(e),o(t),c(n),m(i)}),[]);return{handleSubmit:l((async n=>{const i=jo(ii(e));var l;if(Fn(i(n)))try{const e=await(l={profile:{phone:$t(n.phone)}},ea("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await qc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Hl).filter((e=>n[e])).map((e=>Hl[e]?.text));p.open({...Lc(n?.phone,l),onSuccess:i})}}catch{s("Fail")}}),[]),responseStatus:r}},qc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=$c(n);await sc(((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 oc((({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:Fc({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)},Lc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:$t(e),textButton:"Далее",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${jc(t)}`}),jc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,$c=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Uc=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:io(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:Wc(a),addressFact:Wc(l),esiaAccountTypeCd:t?.esiaAccountType}},Wc=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}},Hc=e=>{const t=Jt(),[n,{setTrue:i,setFalse:r}]=on(!1),[,s]=zl("leadForm"),o=l((async(n,a,l)=>{i();try{const i=await(o={profileId:n,code:a,state:l,redirectUri:globalThis.location?.href},ea("/esia/updateProfileEsia","POST",o));i&&s((e=>({...e,...Uc(i)}))),t.assign(e)}finally{r()}var o}),[e]);return a((()=>{const e=JSON.parse(globalThis.localStorage?.getItem("profileId")??"null"),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),i=t.get("state");e&&n&&i?o(e,n,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:n}},Yc=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",button:l,...r})=>{const s=ic?.flatMap((e=>e?.inputs))||[],{isLoading:d}=Hc(i),[m,h]=zl("leadForm"),p=lc(s,m),{handleSubmit:g,responseStatus:f}=Vc({inputs:s,programId:n,nextStepLink:i,saveForm:h}),[,{field:x,onSubmit:y}]=an(p,{onSubmit:g}),b=sn(Lo);return a((()=>{f&&b.open({responseType:f})}),[f]),o(rn,{className:u("container space-y-m",e),title:t,...r,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[d?o(Fi,{blur:!1}):null,ic.map(((e,t)=>c("div",{className:u(Vo(e.columns),"grid gap-x-m"),children:[qo(e.title),tc({field:x,inputs:e?.inputs})]},`section-${t}`))),rc(l)]})})})),Kc=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"})]})})),Gc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Xc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Jc=10;function Zc(e=0){const t=Math.round(e*Jc);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qc=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:Zc(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})})),ed=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],td=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(id(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nd(c,v):{},...N?Xc(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(Qc,{className:u(m,a?ed[a-1]:"",{"h-full":N},t),style:w?nd(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})),nd=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),id=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),ad={"horizontal-list":"w-6","vertical-list":"h-6"},ld=({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?ad[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),rd=({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))},sd=e=>t=>e.scrollWidth/t,od=e=>(t,n)=>{e.scrollBy({left:n*sd(e)(t),behavior:"smooth"})},cd=({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?[Tr()(a),kr()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?od(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?od(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}]},dd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},md=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]=cd({itemCount:s.length}),g=ud(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(td,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",dd[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(ld({activeIndex:t,onClick:f,listType:i}))}):null})),ud=(e=!1)=>({behavior:e?"auto":"smooth"}),hd=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"})}))),pd=d((e=>o(hd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),gd=d((e=>o(hd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),fd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",xd=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?yd(t):null,l?o(pd,{className:u(bd(a),m?"left-1":"left-0"),onClick:s}):null,r?o(gd,{className:u(bd(a),m?"right-1":"right-0"),onClick:d}):null]})})),yd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(fd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(fd,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),bd=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),vd=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]=cd({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(td,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(xd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(md,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Nd=({blocksToRender:e,...t})=>o(vd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Gc(!0)),children:B(e,t)},String(n))})}),wd=e=>e%2!=0,Cd=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]}))),Sd=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Cd,{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(Ae,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),kd=({isUnfolded:e,onToggle:t})=>o(Sd,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Id=["ArrowDownIcon","ArrowUpIcon"],Td="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Bd=({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(Td),children:[R(l,{...a.options,parent:n}),wd(l.length)?o(qt,{className:"col-span-6",...a}):null]}),o(aa,{renderFoldableSection:({isUnfolded:e})=>c(la,{className:u(Td),isUnfolded:e,children:[R(r,{...a.options,parent:n}),wd(r.length)?o(qt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Sd,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Id[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Pd=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Rd(n,t),Bd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Rd(n,t),Nd({...i,blocksToRender:t})]});default:return null}})),Rd=(e,t)=>e&&!t.length?o(Kc,{...e}):null,Dd=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Ed=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(Ls,{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))))),Md=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,Dd(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Ad(i)).filter(Boolean))]}),n?o("div",{children:o(Xl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Ad=e=>([t,n])=>{const i=n?.type;return"array"===i?_d(t,e)(n):null},_d=(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(Ae,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Ed,{items:i,multiple:!n?.single,...t(e)})]},e)};function Fd(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const zd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Od=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>zd(t[e])||zd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>zd(t[e])||zd(n[e])||Vd(t[e])<=Vd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>zd(t[e])||zd(n[e])||Vd(t[e]?.min)>=Vd(n[e]?.min)&&Vd(t[e]?.min)<=Vd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>zd(t[e])||zd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>zd(t[e])||zd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Vd=e=>Number(e||0),qd=(e,{block:t,page:n,normalize:i=nn})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Fd(a,a.map((e=>_t(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=nn)=>e?.filter((([,e])=>Od(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Ld={},jd={},$d=Ot((({className:e,filtrationSchema:t=Ld,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=qd(jd,{block:a.block,page:a.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:Ud(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Ud(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Md,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Xl,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Pd,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Ud=e=>Fd(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Wd=(e=!1)=>e?"text-left":"text-center",Hd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Yd=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",Hd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),Kd=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:Wd(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(Gd)}):null]})})),Gd=({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(Yd,{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(Ae,{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)),Xd=(e,t,n)=>{return o(vd,{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(Ae,{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(Ae,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},Jd=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?Xd(e,0,t):null]}))),Zd={start:"justify-start",center:"justify-center",end:"justify-end"},Qd=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Zd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),em=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Ae,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children: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]})]}))),tm=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),nm=({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(em,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(cr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(tm,{title:e,...r}),im={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},am={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},lm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=im.prefMonthsNum,prefTravelBonusRate:l=im.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||am,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},rm=Ot((({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}=lm(r,n);return o(ar,{className:e,title:t,...l,children:c("section",{className:u(lr,e),children:[c("div",{className:rr,children:[Nr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Nr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?nm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:sr,children:[f>=0?o(cr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),pr(a)]})]})})})),sm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,om=e=>br({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),cm=" (c капитализацией)",dm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:sr,children:[o(cr,{title:`Доход в конце срока${l?cm:""}`,value:e,postfix:n,prefix:"+"}),o(cr,{title:`Сумма в конце срока${l?cm:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(pr)]}),mm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const um={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},hm=(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?mm[e?.rateType]:"",{data:n}=gi(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&pm(s,e)&&Dr(i,["minSum","maxSum"],e)&&Dr(n,["minDays","maxDays"],e)))||um,{rate:m}=d,u=gm(m,e),h=i+u,p=c||[um];return{...d,...Rr(["minSum","maxSum"],p),...Rr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},pm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,gm=(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)},fm=Ot((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:ur(r,1e5),daysValue:hr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=hm(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(ar,{className:e,title:t,...d,children:c("section",{className:u(lr,e),children:[c("div",{className:rr,children:[Nr({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:[`От ${sm(b.min||0)}`,`До ${sm(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[xm(p,h),om({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),nm({rate:x,depositeName:y,isShowDepositeName:l}),dm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),xm=(e,t)=>c("div",{className:"space-y-s",children:[o(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Pi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),ym=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},bm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},vm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Cm(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=>[wm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),wm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),wm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),wm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Dr(i,["minSum","maxSum"],t),Dr(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||bm,{rate:u}=m,h=Nm(u,e),p=i+h,g=t||[bm];return{...m,...Rr(["minSum","maxSum"],g),...Rr(["minMonths","maxMonths"],g),availableMonths:ym(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}},Nm=(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)},wm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Cm=(e,t)=>e+Math.round((t-e)/2),Sm=(e="rub")=>"rub"===e,km=(e,t)=>{const{minMonths:n,maxMonths:i}=Rr(["minMonths","maxMonths"],Pm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:Ya(a,n,i)}},Im=(e,t)=>{const{minSum:n,maxSum:i}=Rr(["minSum","maxSum"],Pm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:Ya(a,n,i)}},Tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Bm=e=>{const t=Sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Pm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Rm=(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]}),Dm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?om({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]}),Dm(e.isShowNewClient),e.isShowNewClient?o(Pi,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Dm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Em={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Mm={text:"₽",key:"rub"},Am=Ot((({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))??[Mm],g=l((e=>t=>e?{...t,...Bm(t),...Im(t,e),...km(t,e),...Tm(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:ur(d,2e4),monthsValue:hr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Mm},{normalize:g}),y=x?.("currency")?.value??Mm,b=x?.("isNewClient")?.value,v=Pm(h,y),N=vm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{wr({field:x,defParams:dr(v,b),calcParams:N,monthsValue:"minMonths",map:Em})}),[x,h]);a((()=>{!Fr(d)&&v&&I()}),[d,h]);const T=w===dr(v,b)?.rate;return o(ar,{className:e,title:t,...m,children:c("section",{className:u(lr,e),children:[c("div",{className:rr,children:[c("div",{className:"flex gap-m",children:[Nr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:_m(y?.key)}),h&&h?.length>1?o(_n,{label:"Валюта",options:p,...x("currency")}):null]}),gr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Rm({...N,...s},x)]}),nm({rate:w,children:zm(I,T)}),dm({income:C,finalSum:S,buttons:[...i,Fm(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),_m=(e="")=>Sm(e)?1e3:100,Fm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},zm=(e,t=!1)=>t?null:o(Xl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Om=e=>Vm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Vm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Vm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],qm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Lm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[qm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Om({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Pr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Pr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Om({row:e,userInputParams:t,paramsViewSettings:n})&&Dr(i+r,["minSum","maxSum"],e)&&Dr(l,["minSumOld","maxSumOld"],e)&&Dr(r,["minSumExtra","maxSumExtra"],e)&&Dr(a,["minMonths","maxMonths"],e)))||qm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Cr(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}},jm=Ot((({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=Lm(s,n,l),h=vr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(ar,{className:e,title:t,...r,children:c("section",{className:u(lr,e),children:[c("div",{className:rr,children:[Nr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Nr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),gr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),$m({...m,...l},d),m.isExtraMoney?Nr({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(sr,"@4xl:w-1/2"),children:[o(cr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(cr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(cr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(cr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),pr(a)]})]})})})),$m=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Pi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Um=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(Wm(e)),n,i)):Wm(e),format:He(r)}),d=l((e=>t&&t(Wm(e))),[t]);return o(gn,{onChange:d,...s,...c})})),Wm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Hm=d((e=>o(Um,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Ym={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Km={amount:1500},Gm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Km),[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:Ym[r],children:[o(Hm,{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(Xl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Xm=({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})]}),Jm="relative h-full",Zm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Qm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(nu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:eu(n,{someCardsHighlighted:l}),children:[B(n,i,{className:tu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),nu(n)?Xm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},eu=(e,{someCardsHighlighted:t})=>u(Jm,t&&(nu(e)?"pt-3xl":"pt-3xl sm:pt-16")),tu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Jm,"min-w-80",Zm[i],t&&(nu(e)?"pt-3xl sm:pt-16":"pt-3xl"),Gc(n),n&&"h-full"),nu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,iu=Ot((({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(vd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?au(s?.block?.blocks):[],hasBlur:!0,children:Qm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),au=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],lu="z-10 border border-solid w-full h-full",ru=u(lu,"absolute hidden @xl:block border-transparent"),su=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(ru,"top-9 right-12 bg-green-dark")}),o("div",{className:u(ru,"top-6 right-8 bg-green")}),o("div",{className:u(ru,"top-3 right-4 bg-green-light")}),c("div",{className:u(lu,"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})]})]})}))),ou={black:"bg-black",white:"bg-white"},cu=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(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(du)]}):null,a?c(Ae,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),du=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ou[e]}`},String(t)),mu=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})),uu=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?hu(i):null]})}))),hu=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(mu,{...e},String(t))))}),pu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),gu=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})})),fu=[{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"}}],xu=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=>fu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(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},yu(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:bu(s??!1,a??!1,n),buttonClassName:h})}),r?o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),yu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",bu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),vu=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(gu,{href:a,target:m,className:"h-full",data:pu(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(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(xu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(qe,{benefits:f}),s?o(Ee,{__html:s,isDotted:r,itemSize:"list-s"}):null,Nu(i,p)]})})}))),Nu=(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,wu=(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(Ae,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(Ae,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},Cu=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(wu),[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:[Le(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?Su(m?.parent,h,b):null}):o("div",{children:x})]})})),Su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&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"})]}),ku=()=>{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)},Iu=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]})]}))),Tu=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(Iu,{step:i,showPercentage:!1})]})})}));var Bu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Bu||(Bu={}));const Pu=e=>ea("/user-data/getTaskStatus","POST",e),Ru=e=>ta("/user-data/sendSignalToProcess","POST",e),Du=(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},Eu=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]})]}))),Mu=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(xc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Ee,{__html:a}):null]})]})})),Au=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(Mu,{interval:d,intervalExpireAction:m}):null]}),o(_u,{title:i,items:a}),o(_u,{title:l,items:r,countColumns:!0}),n?.__html?o(Eu,{__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]}))),_u=({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(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Vo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Fu(e)},t)))}):null]})]}):null},Fu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),zu=d((()=>o(Au,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Ou=d((({handleExpireTimer:e})=>{const[t]=zl("leadForm");return o(Au,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),Vu=d((()=>{const[e]=zl("leadForm");return o(Au,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),qu=d((()=>{const[e]=zl("leadForm");return o(Au,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Lu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ju=d((()=>{const[e,t]=i(Bu.process),[n]=zl("taskId");a((()=>{(async()=>{for(const e of Lu)await Ru({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Pu({taskId:n});i&&i?.statusCd!==Bu.process&&(e(),t(i.statusCd))}),[n]);Du(r,3e4);return $u(e,(()=>t(Bu.rework)))})),$u=(e,t)=>({IN_PROCESS:o(Ou,{handleExpireTimer:t}),CANCELLED:o(zu,{}),APPROVED:o(qu,{}),REVISION:o(Vu,{})}[e]||null),Uu=[{paymentSystem:"",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}],Wu=e=>{if(e)try{return new Date(e)}catch(e){return}},Hu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Yu(n,e),Ku(t,e),Zu(t,e),Gu(t,e),Xu(t,e),Ju(t,e)].some(Boolean)?{...t,required:!1}:t)),Yu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ku=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Gu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ju=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Zu=({name:e},t)=>"snils"===e&&Qu(t),Qu=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,eh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Eu,{__html:e},`${t}_${n}`))):null},th=({field:e,inputs:t,params:n})=>t.map(Oo(e,n)),nh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Hu(ih(t))(e,n),o=s.filter((e=>!Ju(e,ih(t))));return c("div",{className:u(Vo(a),"grid gap-x-m"),children:[eh(o),qo(l),th({field:t,inputs:s,params:i})]},`section-${r}`)})),ih=e=>t=>e(t)?.value,ah=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Xl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),lh=e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:i,codeWord:a}},rh=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},sh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},oh=(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:Fc({phone:$t(l),email:r}),participantAddresses:zc({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:Fc({organizationPhone:p&&$t(p)}),participantAddresses:zc({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:Oc({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:zc({addressCourier:t})}:{}})(t)}},ch=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=zl("taskId"),[o]=zl("profileId"),[c]=zl("participantId"),d=l((async l=>{const d=jo(ii(Hu(mh(l))(t,e)));if(!Fn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await oc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...sh(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...oh(a,i)}],...lh(i),...rh(i)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));dh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},dh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},mh=e=>t=>e[t],uh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l})=>{const[r,s]=zl("leadForm"),d=((e,t)=>({...Uu[e],...t,limitedBirthday:Wu(t?.limitedBirthday),dulIssueDateField:Wu(t?.dulIssueDateField),participantDateRegistration:Wu(t?.participantDateRegistration),beginDate:Wu(t?.beginDate),deliveryDate:Wu(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=ch({step:e,inputs:m,onNextStep:i,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return a?o(ju,{}):c("form",{onSubmit:p,className:"space-y-m",children:[nh({sections:t,field:h,step:e}),o(ah,{step:e,onPrevStep:n})]})})),hh=[[{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"]}}]}]],ph=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],gh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(ku,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>hh[n]),[n]),[y,b]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(Tu,{stepsTitles:ph,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(uh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),fh=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(Iu,{step:i,showPercentage:!1})]})})})),xh=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(Mu,{interval:d,intervalExpireAction:m}):null]}),o(yh,{title:i,items:a}),o(yh,{title:l,items:r,countColumns:!0}),n?.__html?o(Eu,{__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]}))),yh=({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(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Vo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:bh(e)},t)))}):null]})]}):null},bh=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),vh=d((()=>o(xh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Nh=d((({handleExpireTimer:e})=>{const[t]=zl("leadForm");return o(xh,{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?"Аннуитетный":"Дифференцированный"}]})})),wh=d((()=>{const[e]=zl("leadForm");return o(xh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ch=d((()=>{const[e]=zl("leadForm");return o(xh,{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"],kh=d((()=>{const[e,t]=i(Bu.process),[n]=zl("taskId");a((()=>{(async()=>{for(const e of Sh)await Ru({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Pu({taskId:n});i&&i?.statusCd!==Bu.process&&(e(),t(i.statusCd))}),[n]);Du(r,3e4);return Ih(e,(()=>t(Bu.rework)))})),Ih=(e,t)=>({IN_PROCESS:o(Nh,{handleExpireTimer:t}),CANCELLED:o(vh,{}),APPROVED:o(Ch,{}),REVISION:o(wh,{})}[e]||null),Th=[{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}],Bh=e=>{if(e)try{return new Date(e)}catch(e){return}},Ph=e=>(t,n)=>t.filter((e=>e)).map((t=>[Rh(n,e),Dh(t,e),_h(t,e),Eh(t,e),Mh(t,e),Ah(t,e)].some(Boolean)?{...t,required:!1}:t)),Rh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Dh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Eh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Mh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ah=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),_h=({name:e},t)=>"snils"===e&&Fh(t),Fh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,zh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Eu,{__html:e},`${t}_${n}`))):null},Oh=({field:e,inputs:t,params:n})=>t.map(Oo(e,n)),Vh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Ph(qh(t))(e,n);return c("div",{className:u(Vo(a),"grid gap-x-m"),children:[zh(s),qo(l),Oh({field:t,inputs:s,params:i})]},`section-${r}`)})),qh=e=>t=>e(t)?.value,Lh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Xl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Xl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),jh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},$h=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:jh[i?"annuity":"differential"]}},Uh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Wh=(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:Fc({phone:$t(l),email:r}),participantAddresses:zc({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:Fc({organizationPhone:p&&$t(p)}),participantAddresses:zc({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:Oc({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{}}},Hh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=zl("taskId"),[o]=zl("profileId"),[c]=zl("participantId"),d=l((async l=>{const d=jo(ii(Ph(Kh(l))(t,e)));if(!Fn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await oc((({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:"Заемщик"},...Wh(a,i)}],...$h(i),...Uh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Yh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},Yh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},Kh=e=>t=>e[t],Gh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l,programsSource:r})=>{const[s,d]=zl("leadForm"),[m]=zl("programId"),u=r?.[m??""],h=((e,t)=>({...Th[e],...t,limitedBirthday:Bh(t?.limitedBirthday),dulIssueDateField:Bh(t?.dulIssueDateField),participantDateRegistration:Bh(t?.participantDateRegistration),beginDate:Bh(t?.beginDate),deliveryDate:Bh(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=Hh({step:e,inputs:p,onNextStep:i,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return a?o(kh,{}):c("form",{onSubmit:x,className:"space-y-m",children:[Vh({sections:t,field:f,step:e,params:{calcData:u}}),o(Lh,{step:e,onPrevStep:n})]})})),Xh=[[{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"}]}]],Jh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Zh=Ot((({className:e,programsSource:t,...n})=>{const[d,m]=i(0),h=s(null),p=l((()=>h?.current?.scrollIntoView({behavior:"smooth"})),[h]);a(ku,[]);const f=l((()=>{m((e=>Math.min(e+1,5))),p()}),[]),x=l((()=>{m((e=>Math.max(e-1,0))),p()}),[]),y=r((()=>Xh[d]),[d]),b=0===d,[v,N]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...n,children:c("div",{ref:h,className:"container grid grid-cols-12",children:[b||v?null:o(fh,{stepsTitles:Jh,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Gh,{step:d,sections:y,onNextStep:f,onPrevStep:x,isFormFinished:v,finishForm:N,programsSource:t},String(d))})]})})})),Qh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,ep=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),tp=1e9,np={sum:{min:1e4,max:tp},period:3},ip=Ot((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=qd(np,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:ap(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=lp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Md,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Hm,{label:i?.title,min:500,max:tp,...d("sum",{parse:e=>({min:Number(e),max:tp}),format:({min:e})=>String(e)})}),o(Za,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Pd,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),ap=e=>Et((e?.paramsSource?.rateRows||[]).filter(Qh).flatMap((e=>ep(e.minMonths,e.maxMonths)))),lp=e=>Et(e.flatMap((e=>e||[])).filter(Qh).flatMap((e=>ep(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],rp=[{key:"10"},{key:"50"},{key:"100"}],sp=({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:rp,iconVersion:"black"})]})},op="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",cp=(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:op,"aria-label":`Страница ${l}`,children:l},String(t)):null},dp={width:"24",height:"24"},mp=({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:up(1===e),...dp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:op,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(cp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:op,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:up(e===n),...dp})})]})},up=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",hp=({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(mp,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(sp,{itemCount:i,onItemCountChange:a}):null]}),pp=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})]})})),gp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(pp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(El,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(El,{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(Xl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),fp=(e,t)=>o(Yd,{...e,iconBgVersion:t,className:"shrink-0"}),xp=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:[fp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Ae,{size:"text-m","font-weight":"font-light",children:jt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),yp=`${Ut}/depository`,bp={startDate:void 0,endDate:void 0,query:""},vp=Ot((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=an(bp),{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(yp);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(yp+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(gp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(xp,{...e},String(e.publicId)))):o(Kc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(hp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Np=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,wp=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:Np(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]})));function Cp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const Sp={};function kp(e,t=Sp){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 Ip=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 Tp,Bp;function Pp(e){return kp(Ip,e)}Tp=Ip,Bp=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),Cp(Tp,Bp),Cp(Bp,Tp),Tp.bus.watch((({type:e,event:t})=>{null!=t?Bp.setItem(e,t):Bp.removeItem(e)}));const Rp=`${Ut}/region`;function Dp(e="Москва"){return Pp().location??{name:e}}function Ep(e="Москва"){const t=Pp(),n=l((async()=>{if(!t.location){const n=await Rt(Rp);t.location=n??{name:e}}}),[t,e]);return gi(Rp,n),t}var Mp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Mp||(Mp={}));const Ap=new Intl.NumberFormat("ru",{style:"currency",currency:Mp.RUB}),_p=e=>e?Ap.format(e):"",Fp="text-m font-light text-secondary-text ",zp=`${Fp} text-left`,Op=`${Fp} pl-5xl text-center`,Vp=`${Fp} pl-5xl text-right`,qp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Lp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:zp,children:o(Ae,{size:"text-m",children:"Валюта"})}),o("th",{className:Op,children:o(Ae,{size:"text-m",children:"Купить"})}),o("th",{className:Vp,children:o(Ae,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(jp)})]}))),jp=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(Ae,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ae,{size:"text-h6",children:_p(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ae,{size:"text-h6",children:_p(e?.buyExchangeRate)})})]},t)},$p={icon:"GpsIcon"},Up=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Yd,{...$p,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:"Курс указан для заданного офиса"})]})]}))),Wp=(e,t,n)=>{const i=Number(Hp(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)},Hp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Yp(e){if(!e)throw new Error("Value should be fulfilled");return e}const Kp=e=>t=>{const[,n]=Yp(e.find((([e])=>e(t))));return n(t)},Gp=e=>Kp(e.map((([e,t])=>[e,()=>t])));Gp.if=e=>new Xp(void 0,e);class Xp{parent;predicate;unit;get entry(){return[Yp(this.predicate),Yp(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Xp(this,e)}then(e){return new Xp(this.parent,this.predicate,e)}else(e){return Kp([...Jp(this),[()=>!0,e]])}}const Jp=e=>[...e?.parent?Jp(e.parent):[],e.entry],Zp=e=>Gp([[e=>e.value!==Mp.RUB&&e.oppositeValue!==Mp.RUB,()=>e.handleConvert(e.value,Mp.RUB)],[e=>e.value===Mp.RUB&&e.oppositeValue===Mp.RUB,()=>e.handleConvert(e.value,Mp.USD)],[e=>e.value===Mp.RUB&&e.oppositeValue===Mp.RUB,()=>e.handleConvert(e.value,Mp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Qp(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(gn,{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 eg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Mp.RUB,selectBuy:n?.[0]?.currency?.currency||Mp.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:[Qp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:tg(r,d,n),value:r.inputSell,setValue:e=>ig(d,n)(e,r.selectSell,r.selectBuy)}),Qp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:ng(r,d,t),value:r.inputBuy,setValue:e=>ag(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(Ne,{text:a.text,version:a?.version,...a}):null]})})),tg=(e,t,n)=>i=>{t({selectSell:i}),Zp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{ig(t,n)(e.inputSell,i,a)}})},ng=(e,t,n)=>i=>{t({selectBuy:i}),Zp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>ag(t,n)(e.inputBuy,i,a)})},ig=(e,t)=>(n,i,a)=>{e({inputSell:Hp(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(Wp(n,l,i===Mp.RUB)||"")})},ag=(e,t)=>(n,i,a)=>{e({inputBuy:Hp(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(Wp(n,l,i===Mp.RUB)||"")})},lg=`${Ut}/exchangerates`;const rg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=gi(lg+`?regionCode=${t}`,Dt);return n||{}}(Dp()),l=sg(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Mp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Mp.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(Lp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Up,{address:a?.address})]}),o(eg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),sg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],og=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(cg(n))})})),cg=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},dg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Cd,{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:[fp(a,t),e?o(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),mg=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",ug=(e=!1)=>e?"MinusIcon":"PlusIcon",hg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",pg=Ot((({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",mg(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>gg({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),gg=({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?hg(e):ug(e))(a,r);return"accordion"===e?o(dg,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Sd,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},fg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:xg(e)}))),xg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(pg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(og,{items:e.items}):null},String(t)))),yg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(bg)}):null)),bg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(vg)})]},String(t)),vg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Ng(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Ng=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${wg(t)}`,children:o(Ae,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},wg=e=>e.replaceAll(/\D/g,""),Cg=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}`})})),Sg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ae,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Cg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),kg=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}`})})),Ig=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(kg,{index:t,...e},String(t))))}):null]}))),Tg=Ot((({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(fg,{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(yg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(xu,{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(Sg,{title:d,links:l}),o(Ig,{links:a,license:h})]})})),Bg=Ot((({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 max-w-[978px] 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:pu(l,s?.key),children:f})}):null]})})})),Pg={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"},Rg=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",Pg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),Dg=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(gc,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):Eg(p,r),o(Rg,{version:a,...i})]})})),Eg=(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,Mg={"bg-white":"primary",transparent:"transparent"},Ag=Ot((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Mg[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(Dg,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),_g=(e=!1)=>e?{}:{padding:"p-0"},Fg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},zg=Ot((({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",Fg[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",Gc(r)),..._g(i)}})})}),{childrenTypes:[]}),Og=Ot((e=>o(zg,{...e})),{childrenTypes:[]}),Vg=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Zd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),qg=["байт","Кб","Мб","Гб","Тб","Пб"],Lg=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(Ae,{size:"text-l",font:"font-light",children:[t," ",jg(d,m),o(Ae,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),jg=(e,t)=>e||t?o("span",{children:", "}):"",$g=(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?Wg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Lg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Ug(t),data:n?.data}),o(Ee,{__html:n?.__html})]},String(i))},Ug=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,Wg=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},Hg=d((({href:e,__html:t,target:n,onClose:i})=>{const a=E(),l=$(a)(e);return c(Zl,{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(Xl,{type:"button",version:"secondary",onClick:i,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Yg=d((({text:e,href:t,target:n,__html:i,icon:a})=>{const{open:r}=sn(Hg),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:[Ug(a),o(Ae,{font:"font-light",children:e})]}):null})),Kg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Gg=Ot((({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",Kg[r]),role:"list",children:a.map(Xg(d,l))}):null]})})),Xg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Jg(t)(n,i):$g(e,t)(n,i)},Jg=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(Yg,{...i,icon:e,href:Zg(t)?t?.href:t?.attachment?.src}),o(Ee,{__html:t?.__html})]},String(n)):null},Zg=e=>"href"in e,Qg=Ot((({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(Ae,{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(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),ef=(e,t)=>e&&"underlined"!==t?"primary":"secondary",tf=(e=[],t={})=>e.filter((({content:e={}})=>Od(t,e))).length,nf=(e,t)=>e===t;const af=(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)))}(nf,((e=nf)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),lf=[],rf={},sf={primary:"bg-white/30",secondary:"bg-main-divider"},of={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},cf=d((({count:e,version:t="secondary"})=>{const n=ke(),i=n?"bg-main-divider":sf[t],a=of[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(Ae,{size:"text-xs",color:a,children:e})})})),df=({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})]})]})},mf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},uf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},hf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},pf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},gf=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",mf[i],n?pf[i]:hf[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?uf[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[df({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(cf,{count:m,version:ef(n,i)})}):null]})})})),ff=d((e=>o(e?.item?.href?xf:yf,{...e}))),xf=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(gf,{...e,tag:"a",item:a,onClick:i})})),yf=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(gf,{item:e,onClick:i,...n})})),bf=(e,t,n)=>(i,a)=>o(ff,{isActive:i===e,onClick:t,type:n,item:i},String(a)),vf=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(bf(i,a,t))}))),Nf={categories:[],extraOptions:[],propertyType:[],stage:[]},wf=Ot((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=qd(Nf,{block:a.block,page:a.options?.page}),f=l(((e=Nf)=>p(e)),[]),x=(({hotFilters:e=lf,filtrationState:t=rf,blocks:n=lf,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>af(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:tf(n,t.filter),version:ef(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(vf,{...x}),o(Md,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Pd,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Cf=(e,t,n)=>{const i=ef("all"===t),a=ef("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(Xl,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Xl,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},Sf=({__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(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,kf="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",If=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Pi,{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:kf,children:s}),o(la,{className:kf,isUnfolded:e,children:d})]}),renderFoldButton:Tf(n,i)})}):null})},Tf=(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:Bf()})]}),Bf=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Pf=(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(Ae,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Rf=()=>{},Df=e=>"all"===e?"block":"hidden",Ef=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Rf,renderRemoteWorkplaceCard:r=Rf,getBalloon:s=Rf,getBalloonRemoteWorkplaces:d=Rf,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=qa({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Mf([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Fa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Pf(h,N),m?Sf(m):null,p&&Cf(t,w,C),o("div",{className:u("pb-3xl",Df(w)),children:If(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)]})]})})),Mf=e=>Object.keys(_a).filter((t=>e.filter((e=>za[t](e))).length)),Af=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:zf(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(Ae,{size:"text-h4",children:zf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Na,{color:"green",children:zf(s)})})]}),o("div",{className:"hidden sm:block",children:o(da,{className:"flex-wrap",children:m?.map(Ff)})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:o(da,{className:"flex-wrap",children:m?.map(Ff)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(d))},_f=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${zf(t)} №${n}`,body:e.toUpperCase()}),Ff=(e,t)=>o(ra,{...e},String(t)),zf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Of=[];const Vf=async e=>{const t=await Rt(e,{method:"GET"});return Array.isArray(t)?t:Of},qf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Lf={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)},jf=d((({descriptionData:e,className:t})=>{const n=Dp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=gi(`${Ut}/atms?regionCode=${e}`,Vf);return{data:t||Of,isLoad:!t&&!n}}(i);return o(Ef,{className:t,filterItems:$f,data:a,isLoad:l,initFilterState:qf,renderCard:Af,getBalloon:_f,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),$f=(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=>Lf[t](e))),n=!i.length||i.some((t=>Lf[t](e)));return t&&n}))},Uf=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ae,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Wf({workScheduleDescription:t})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:Wf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(n)):null,Wf=({workScheduleDescription:e})=>c("div",{children:[c(da,{className:"flex",children:[o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание банковских карт"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Инвестиционное и накопительное страхование"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]}),Hf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Yf={branches:[],remoteWorkplaces:[]};const Kf=async e=>await Rt(e,{method:"GET"})||Yf,Gf=d((({className:e})=>{const t=Dp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=gi(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Kf);return{data:t||Yf,isLoad:!t&&!n}}(n);return o(Ef,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ea,renderRemoteWorkplaceCard:Uf,getBalloon:Aa,getBalloonRemoteWorkplaces:Hf,title:`Офисы филиала ${t?.name}`})})),Xf=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(Gf,{}):o(jf,{descriptionData:e})})})),Jf=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,{})]}))),Zf=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(vd,{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))))})}))),Qf=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:[Le(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?ex({__html:l,richVersion:r}):null,tx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),tx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),tx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),ex=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ee,{...e,itemSize:"list-s"})}),tx=({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(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ae,{size:"text-xl",color:i,children:t})]})]}):null,nx=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ee,{__html:t,richVersion:n})})})),ix=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(Ae,{color:"text-primary-text",children:t}):null]})}))),ax=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(ix,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(ix,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),lx=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})})),rx=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(lx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(lx,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),sx=["От 1 дня","До 365 дней"],ox=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Za,{min:1,max:365,value:e,items:sx,onChange:t})]}))),cx=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(lx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(lx,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),dx=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(rx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:mx(m)}),o(ox,{days:a,setDays:e=>m({days:e})}),o(cx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:ux(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(ax,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),mx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},ux=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},hx=d((({days:e,tariffs:t=[]})=>{const n=gx(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:[px("Аренда за",e),px("Цена",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})})]})]})})),px=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),gx=(e,t)=>{const n=fx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},fx=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},xx=(e,t)=>e.find((e=>e.branchCode===t)),yx=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=xx(i,n.selectedBranch),d=bx(s?.safeBoxCaseVolumes),m=vx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Nx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(dx,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(hx,{days:n.days,tariffs:u})]})})),bx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],vx=(e,t)=>e?.find((e=>e.volume===t)),Nx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,wx=`${Ut}/safeboxes`,Cx=[];const Sx=async e=>await Rt(e,{method:"GET"})||Cx,kx=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=go(),p=Ix(m.selectedRegion,h),f=function(e){const{data:t}=gi(e?`${wx}?regionCode=${e}`:null,Sx);return t||Cx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=xx(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(yx,{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]})})),Ix=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Tx={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"},Bx=(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:Px(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Rx(i),l?.text?o(Ne,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},Px=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Dx(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:Ex({step:n,iconVersion:a,i:i,stepVersion:t})})})},Rx=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",Tx.description),children:e.description}):null,o(Ee,{__html:e.__html})]}),Dx=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Ex=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Le(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?Tx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},Mx=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(Bx(d,r,l))}):null,je(a,{isVertical:!0})]})})),Ax=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||""]}))),_x=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{onClick:a,className:u("relative min-h-full 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(Jl,{className:"absolute top-1.5 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Fx(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 zx=()=>{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 Fx(ue.observable,"dialog",{open:t,close:n,closeAll:a}),[e,{close:n,closeAll:a}]},Ox=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 Vx=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(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(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),Lx=(e,t)=>n=>n.name?o(gu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:pu(e,n.name),children:o(Ae,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,jx=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"})]}))),$x=d((({defaultLocation:e})=>{const t=Dp(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(gu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Ux=d((({foreignOffices:e,branches:t,onClose:n})=>{const a=Ep(t?.default),[s,d]=i(""),m=go(),u=r((()=>Hx(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,Wx)),[u]),p=l((e=>{a.location=e,n?.()}),[a,n]);return c(Zl,{className:"pb-20",head:c("div",{children:[o(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o($x,{defaultLocation:t?.default}),o(jx,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Ox(e.toLowerCase())(s.toLowerCase())>=.8)).map(Lx(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(Ae,{size:"text-h6",children:e})}),t.map(Lx(f,g))]},e)))}),Vx(e)]});var g,f})),Wx=e=>e.name?.charAt(0)??"",Hx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Yx=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:i})=>{const l=sn(Ux,n),{name:r}=Dp(),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(_x,{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})})})})),Kx="burgerMenuDialog",Gx=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:i=un})=>{const{open:a}=sn(Yx),[r]=zx(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Kx,r),o=l((()=>a({menuRef:e,locationDialogProps:n,menuItem:t,onClose:i},{id:Kx})),[e,n,t,i]);return[s,{toggle:s?i:o}]},Xx=[],Jx=Ot((({sticky:e,...t})=>{const{menuItems:n=Xx}=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}]=Gx({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(_x,{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(Zx(T,"left",{activeIndex:h,currentItemPosition:f})),o(Ax,{item:a,isActive:C,onClick:e=>I(e)}),u.map(Zx(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Zx=(e,t,n)=>(i,a,l)=>o(Ax,{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)),Qx="hidden sm:flex absolute z-40",ey={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ty=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=cd({itemCount:t?.length||0});return a((()=>ny(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(td,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ey[l].item,gap:ey[l].gap,children:t.map(bf(n,i,l))}),s.canScrollLeft?o(pd,{className:u("left-6",Qx,ey[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(gd,{className:u("right-6",Qx,ey[l].buttonTop),onClick:s.scrollRight}):null]})})),ny=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},iy={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ay=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(iy[t].wrapper,e),children:o(ty,{className:iy[t].component,tabsType:t,...n})}):null,ly=Ot((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=ry(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(cy(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=oy(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:[ay({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:sy(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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(oy)?.filter(Boolean)||[]}),ry=({__id:e,anchor:t})=>t??e??"tabs",sy=(e,t)=>t?.length?t:e,oy=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",cy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),dy={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},my=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:dy[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),uy=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}))),hy={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(Ae,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Ae,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(uy,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},py=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 gy({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),gy=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in hy))return null;return o(hy[n],{...t,...i})},fy=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(py,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),xy=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),yy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,by=d((({rows:e})=>{return o(td,{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(Ae,{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(-${xy(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(Ae,{size:"text-xl",children:e.data}):null,e?.cols?yy(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),vy=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(Ae,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(by,{rows:t.rowsData})})})]},i)}))}))),Ny=(e=!1)=>""+(e?"text-white":"text-secondary-text"),wy=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(Ae,{size:"text-xl",font:"font-light",color:Ny(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]}))),Cy=Ot((({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(wy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(vy,{activeTabIndex:r,items:m}),o(uy,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ae,{size:"text-h6",children:"Данных нет"}),o(uy,{onClick:n,isOpen:!0})]})})),Sy=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(Cy,{...t,onClick:n})}):null]}))),ky=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(Sy,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(my,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(fy,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Iy({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(hd,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(hd,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Ty=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,Iy({...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]})})),By=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(ky,{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(Ty,{controls:x,children:[b,o(la,{isUnfolded:e,children:v})]}),renderFoldButton:kd}):o(Ty,{controls:x,children:y})})]})})),Py=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?Ry():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Dy(n):null,a?o(Ee,{richVersion:l,__html:a}):null]})]}))),Ry=()=>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"}),Dy=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ey=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:n})}):null]}))),My=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ey,{prefix:t,unit:n,suffix:i})})})),Ay={AdTile:qt,ApplicationForm:Jo,ApplicationLeadForm:Yc,BankAccountFiltration:$d,BenefitsBlock:Kd,BonusBenefitsBlock:Jd,ButtonsBlock:Qd,CalculatorBonus:rm,CalculatorBusinessDeposit:fm,CalculatorCredit:Or,CalculatorDeposit:Am,CalculatorRefinancing:jm,CardTransfer:Gm,Carousel:iu,CarouselCard:su,CarouselCatalogCard:cu,CarouselLinks:uu,CarouselRecommendationCard:vu,CarouselTariffsCard:Cu,CreditCardForm:gh,CreditForm:Zh,DepositFiltration:ip,Depository:vp,ErrorBlock:wp,ExchangeRateTile:rg,Footer:Tg,GrantSupport:Bg,Header:Ag,Headline:k,HorizontalLayout:Og,ImgBlock:Vg,LinkDocs:Gg,MobileAppTile:Qg,MortgageFiltration:wf,OfficesAtmsMap:Xf,Placeholder:Jf,ProductBlock:Vt,ProductGallery:Zf,RepresentativeOfficeInfo:Qf,RichTextBlock:nx,RollupItem:pg,SafeDepositRental:kx,StepsBlock:Mx,StickyBottomMenu:Jx,TabsLayout:ly,TariffsTable:By,TextBlock:Py,UnitBlock:My,VerticalLayout:zg},_y=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 Fy="cookie",zy=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(Fy)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Fy,"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(Jl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function Oy(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const Vy=d((()=>{const[e,{close:t}]=zx(),n=Boolean(e.length);return Oy(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 Fx(ue.observable,"popup",{open:t,close:n}),Oy(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})),Ly="header",jy="footer",$y="sticky-footer",Uy={},Wy=d((({className:e,data:t=Uy,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Ft(s,r);_y(),Ep();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?.[Ly]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.[Ly],{...m,slotName:Ly})}):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"}}),R(a?.[jy],{...m,slotName:jy})]})]}),a?.[$y]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.[$y],{...m,slotName:$y})}):null,o(Vy,{}),o(qy,{}),o(zy,{__html:d?.cookieContent?.__html})]})}));Object.assign(Wy,{childrenTypes:[],slots:()=>[Ly,jy,$y]});e.Blocks=Ay,e.ContentPage=Wy,e.handlerDecorator=ce,e.joinList=Dd,e.locationNavigator=Jt,e.packageVersion="0.14.695",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=q,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 P=[],R=(e,{key:t,ancestors:n=P,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||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(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 M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var q=Object.freeze({__proto__:null,isURL:_,isLocalURL:F,isHash:z,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:O,hasPrefix:V});const L="/api/",j=`${L}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),z(t),[A.CDN,L].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 O(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)(O(A.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(!F(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]}),Re(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Pe(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Pe=e=>u(e?"row-span-2":"@xl:row-span-2"),Re=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((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(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,Ae=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Fe=(e,t)=>["label"in e?_e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(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:Fe(n)})]}))),Oe=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(Fe)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ve:Oe,{...t}))),Le=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=>Le(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(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[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(Ae,{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,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...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:[R?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):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)),Pt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Rt(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)],Mt={},At=["/portal-resources"],_t=(e,t)=>Tt(e,(e=>t?.[e])),Ft=(e,t)=>{const n=Pt(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=>!At.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),i={...t,...n},a=Object.entries(n).flatMap((([,e])=>Pt(e)));return a.length?zt(a,i):i}return t};function Ot(e,t={}){const n=d((t=>{const n=Ft((({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=Ot((({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"]}),qt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Lt(0,t?.length)),[t]),i=t?.[n];return i?o(Vt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Lt=(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 max-w-[978px] 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(Ae,{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(Ae,{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||"",Pn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Rn=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:Pn(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=An(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(Rn,{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",Mn(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"}),Mn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),An=(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)]}))),Fn=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],On=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",qn="Укажите регион, город/населенный пункт, улицу, дом",Ln=e=>On(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)(qn),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:Ln(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:jn(),addressBranch:jn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:Ln("Укажите дату рождения"),limitedBirthday:zn(ei)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Ln("Укажите место рождения"),education:Ln("Выберите ваше образование"),housing:Ln("Выберите тип жилья"),employment:Ln("Выберите информацию о трудоустройстве"),organization:Ln("Выберите тип организации"),amountWorkers:Ln("Выберите информацию о количестве сотрудников"),employerActivities:Ln("Выберите вид деятельности организации"),employerOrganization:Ln("Выберите вид организации"),positionOrganization:Ln("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:Ln("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:Ln("Укажите организацию, выдавшую паспорт"),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:Ln("Укажите ОПФ"),organizationName:Ln("Укажите наименование организации"),generalSeniority:$n("Укажите количество лет стажа"),lastJobExperience:$n("Укажите стаж на последнем месте работы"),experience5Years:$n("Укажите общий стаж за последние 5 лет"),jobsNumber:$n("Укажите количество мест работы за последние 5 лет"),beginDate:Ln("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:Ln(),collectionCount:Ln(),comment:Ln(),acquiringType:jn(),feedbackMethod:jn(),serviceType:jn(),serviceDirection:jn(),regionRetail:jn("Выберите регион"),meetingDay:Ln(),product:Ln(),localities:Ln(),consentDataProcessing:Kn,annualRevenue:Ln(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:Ln("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Gn)(e))("Некорректный номер СНИЛС"),conscription:Ln(),armyIdFlg:Kn,sex:Ln("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(qn),participantDateRegistration:Ln("Укажите дату регистрации"),retirementIncome:Ln(),otherIncome:Ln(),wages:Ln(),mandatoryPayments:Ln(),disablePeopleFlg:Ln(),bankruptcyFlg:Ln(),shareholderFlg:Ln(),legalEntityName:Ln(),bankEmployeeCode:Ln(),partInBusiness:Ln(),addressRetail:jn("Выберите адрес банка"),addressMatch:Ln(),codeWord:(e=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:Ln(),deliveryDate:Ln("Укажите дату доставки"),addressCourier:Jn(),cardCategory:Ln("Укажите категорию карты"),paymentSystem:Ln("Укажите тип платежной системы"),currency:Ln("Укажите валюту")};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 Rt(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"}],Pi=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":Mi(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,Ri(n)]})})})),Ri=e=>e?o("div",{className:"ml-s",children:o(Ae,{size:"text-l",font:"font-light",children:e})}):null,Di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ei=(e=!1)=>e?"radio":"checkbox",Mi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ai=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Pi,{text:t,value:n,disabled:a,onChange:r},i),yn(l)]}))),_i=d((({field:e,input:t})=>o(Ai,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Fi=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",Oi="/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=qi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=qi("workplaces",e,a),r=Li(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Li(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=Li(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 qi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?zi:Oi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Li=(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:Oi,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=${A.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(Fi,{}):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(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||oa(n,s),a?o(Ae,{color:i,size:"text-m",children:a}):null]}),oa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ae,{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(Ae,{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(Ae,{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(Ae,{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"})]}),Pa=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ra=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(Ae,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),Ca(h)]}),o("div",{className:"hidden sm:block",children:Ma({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:Ma({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))},Ma=({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]})},Aa=({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?Pa(n):Da(n,i):Ra(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},Fa={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)},Oa=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>za[t](e)))))},Va=()=>{},qa=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Va,getBalloonRemoteWorkplaces:a=Va})=>{const[l,s,o,c]=r((()=>{const l=Oa(e,n),r=Oa(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}},La=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 Rt(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}=La("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}=qa({data:n,filtrationState:{},getBalloon:Aa}),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(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",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(Ae,{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")}))),il=Ot((({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})})),al=d((({field:e,input:t})=>{const{data:n}=La("EMPLOYEES_NUMBER");return o(il,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),ll=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),rl=d((({field:e,input:t})=>o(Ai,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),sl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),ol=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),cl=d((({field:e,input:t})=>o(Ai,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),dl=({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=ml(t,e),c=ul(t,l,r);u.push(o("td",{children:o("div",{className:hl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ml=(e,t)=>t&&e.toDateString()===t.toDateString(),ul=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),hl=(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"),pl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],gl=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:pl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:dl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),fl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function xl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(yl),l=i.map(((e,t)=>vl(e)?i.slice(0,t).filter(vl).length:-1)),r=i.map(((e,t)=>bl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const yl=e=>"_"===e,bl=e=>/\d/.test(e),vl=e=>yl(e)||bl(e),Nl=1940,wl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Cl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=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(xl(t,"__.__.____"))},onBlur:()=>{if(Sl(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",...wl})]})})),Sl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Nl&&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},kl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Cl,{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")}),Il=fl.map((e=>({key:e}))),Tl=Array.from({length:(new Date).getFullYear()-Nl+1},((e,t)=>Nl+t)).reverse().map((e=>({key:String(e)}))),Bl=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Pl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Rl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Dl={className:"min-w-32",iconVersion:"black",isBorder:!1},El=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(fl.indexOf(e));const t=Bl(r,fl.indexOf(e));Pl({maxDateOfMonth:t,selectedYear:r,selectedMonth:fl.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:Il,yearsOptions:Tl,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:[kl({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,{...Rl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:fl[f]},options:S,...Dl}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Dl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Rl,className:"rotate-90 cursor-pointer"})})]}),o(gl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Ml=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(El,{label:mn({label:t,errors:i}),valid:Boolean(!n),...a}),yn(n)]}))),Al=d((({field:e,input:t})=>o(Ml,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),_l=d((({field:e,input:t})=>o(Ml,{label:"Дата рождения",...li(e("birthday"),ti.birthday,t?.required)}))),Fl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ci(e,"birthPlace")}))),zl=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Ol(e){const t=globalThis.localStorage?.getItem(e),[n,a]=i(t?zl(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 Vl=d((({field:e,input:t})=>{const[n,l]=i([]),[r]=Ol("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem").value;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),ql(e,s)||c&&c(null)})()}),[d]),o(il,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),ql=(e,t)=>e.some((e=>e.key===t?.key)),Ll=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...li(e("children"),ti.children,t?.required),...t}))),jl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),$l=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...li(e("collectionCount"),ti.collectionCount,t?.required)}))),Ul=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Wl=d((({field:e,input:t})=>{const{data:n}=La("INCOME_CERT_UNITED");return o(il,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Hl=d((({field:e,input:t})=>{const{data:n}=La("MILITARY_STATUS");return o(il,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Yl={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function Kl({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Gl={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"},Xl={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")},Jl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(Kl(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(Gl[a],Xl[a]),i),type:s,role:d,onClick:m,children:e})})),Zl=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"})}))),Ql=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(Zl,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),er=d((({src:e,convertToPng:t,onClose:n})=>c(Ql,{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(Jl,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),tr=e=>{const{open:t}=sn(er),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])},nr=d((({className:e,error:t,docId:n,...i})=>{const a=tr(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Pi,{...i}),n?o(Ne,{className:"text-primary-main",onClick:a,children:o(Ae,{children:"Ознакомиться"})}):null]}),yn(t)]})})),ir=d((({field:e,input:t})=>t&&t.name?o(nr,{text:Yl[t.name]?.text,docId:Yl[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),ar=Math.round(29.5),lr=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]}))),rr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",sr="flex flex-col lg:w-1/2 gap-2xl",or="flex flex-col gap-y-xl min-w-52",cr=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(Ae,{size:"text-h3",children:"number"==typeof e?[i,He(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),dr=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(Ae,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(cr,{value:n,...a}):o(Ae,{size:"text-h3",children:"-"})]}))),mr=(e=[],t=!1)=>ur([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),ur=(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]},hr=(e,t=0)=>e?.sum?e.sum:t,pr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,gr=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,fr=({min:e=0,max:t=0,availableMonths:n,...i})=>o(Za,{items:[`От ${xr(e)}`,`До ${xr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),xr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,yr={horizontal:"@lg:flex-row",vertical:""},br=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(Ae,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",yr[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Pi,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),vr=({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(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(br,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Nr=e=>vr({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),wr=({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}),Cr=({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))},Sr=(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)},kr=e=>e,Ir=(e=kr)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Tr=Ir(),Br=(e=kr)=>Ir((t=>-e(t))),Pr=Br(),Rr=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dr([e,t],i),Dr=([e,t],n=[])=>({[e]:n.length?Pr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Tr(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Er=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Mr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ar=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],Fr=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[Mr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Rr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Rr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:n})&&Er(i,["minSum","maxSum"],e)&&Er(a,["minMonths","maxMonths"],e)))||Mr)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=Sr(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},zr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Or={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Vr=Ot((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,ur([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:hr(s,2e5),monthsValue:pr(s,ar),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=Fr(g,n,r),b=Nr({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((()=>{!zr(s)&&h&&Cr({field:f,defParams:h,calcParams:y,map:Or,monthsValue:"minMonths"})}),[n,s]),o(lr,{className:e,title:t,...m,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),fr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),qr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(or,"@4xl:w-1/2"),children:[o(dr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(dr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(dr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),gr(l)]})]})})})),qr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Pi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Pi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Lr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},jr=(e,t=!1)=>{const n=t?$r(Lr):Lr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},$r=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Ur="calculator",Wr=d((({field:e,params:t})=>{const n=l((t=>{e(Ur).onChange?.(t)}),[]);return o(Vr,{...t?.calcData,padding:"p-0",defaultParams:jr(e(Ur).value),onChange:n})})),Hr=d((({field:e,input:t})=>{const{data:n}=La("CREDIT_IN_RSHB");return o(il,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Yr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(br,{label:mn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),yn(i)]}))),Kr=[{id:"810",text:"Рубли"}],Gr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency"),{data:a}=La("CURRENCY"),l=a?.map((e=>({id:e.key,text:e.value})))??Kr;return o(Yr,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),Xr=d((({field:e,input:t})=>o(Ml,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),Jr=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),Zr=d((({field:e,input:t})=>o(Ml,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),Qr=d((({field:e,input:t})=>o(Ai,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),es="dulIssueDateField",ts=d((({field:e,input:t})=>o(Ml,{label:"Дата выдачи",...li(e(es),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ci(e,es)}))),ns="dulIssuedBy",is=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,ns),label:"Кем выдан",...t,...li(e(ns),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),as=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)}))),ls=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)}))),rs="dulSubdivisionCode",ss=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,rs),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...li(e(rs),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),os=d((({field:e,input:t})=>{const{data:n}=La("EDUCATION_LEVEL");return o(il,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),cs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),ds=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_ACTIVITY_TYPE");return o(il,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),ms=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_KIND");return o(il,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),us=d((({field:e,input:t})=>{const{data:n}=La("EMPLOYMENT_INFO_UNITED");return o(il,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),hs=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...li(e("expenses"),ti.expenses,t?.required),...t}))),ps=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),gs=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)})})),fs=d((({field:e,input:t})=>{const{data:n}=La("MARITAL_STATUS");return o(il,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),xs=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],ys=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],bs=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],vs=d((({field:e,input:t})=>o(_n,{label:"Способ получения ответа",options:bs,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),Ns=d((({field:e,input:t})=>o(kn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),ws=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Cs=d((({field:e,input:t})=>{const{data:n}=La("HOUSE_TYPE");return o(il,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ss=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationAddress")?.onChange?.(ki(t.data?.address)),e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),ks=d((({field:e})=>o(Ai,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Is=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Ts=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Bs=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Ps=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Rs="limitedBirthday",Ds=d((({field:e,input:t})=>o(Ml,{label:"Дата рождения",...li(e(Rs),ti.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ci(e,Rs)}))),Es=`${Ut}/outservice`,Ms=[];async function As(){const e=await Rt(`${Es}/outserviceregions`);return e&&Array.isArray(e)?e:Ms}const _s=d((({field:e,input:t})=>{const n=e("region"),i=n?.value?.key,{data:l}=gi("outServiceRegions",As),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})})),Fs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),zs=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Os=d((({field:e,input:t})=>o(Yr,{orientation:"horizontal",items:zs,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),Vs="middleName",qs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ci(e,Vs),...li(e(Vs),ti.middleName,t?.required),...t}))),Ls=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}))),js=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(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),$s=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(js,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Us=d((({field:e,input:t})=>{const{data:n}=La("ORGANIZATION_TYPE");return o(il,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Ws=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),Hs=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),Ys=d((({field:e,input:t})=>o(Ml,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),Ks="partInBusiness",Gs=d((({field:e,input:t})=>{const n=l((t=>{e(Ks)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...li(e(Ks),ti.partInBusiness,t?.required),...t,onChange:n})})),Xs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),Js=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r]=Ol("programId"),[s,c]=i([]);return a((()=>{r&&(async()=>{const e=await(async e=>{const t=await ea("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems?.map((e=>({id:e.type,text:e.name})))??[]})(r);c(e||[])})()}),[]),o(Yr,{label:"Платежная система",orientation:"horizontal",items:s,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),Zs=e=>"_"===e,Qs=e=>/\d/.test(e),eo=e=>Zs(e)||Qs(e),to=[..."+7 (___) ___-__-__"],no=to.findIndex(Zs),io=to.map(((e,t)=>eo(e)?to.slice(0,t).filter(eo).length:-1));function ao(e){const t=e.replace(/\D/g,""),n=to.map(((e,n)=>Qs(e)?e:t.charAt(io[n])||e)),i=io.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(no,i)):n).join("")}const lo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(ao(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})})),ro=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(lo,{"aria-label":t,label:mn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),yn(n)]}))),so=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(ro,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&Ci(e,n),...t})})),oo=d((({field:e,input:t})=>{const{data:n}=La("POSITION");return o(il,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),co=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(js,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),mo=d((({field:e,source:t})=>o(_n,{placeholder:"Выберите продукт",label:"Продукт",options:uo(t?.productList),...ai(e("product"),ti.product)}))),uo=e=>(e??[]).map((e=>({key:e,value:e}))),ho=`${Ut}/outservice/outserviceregions`,po=`${Ut}/regions`,go=[];function fo(e=po){const{data:t}=gi(e,Dt);return Array.isArray(t)?t:go}const xo=d((({field:e,input:t,params:n})=>{var i;const a=fo((i=n?.typeForm,"OUTSERVICE"===i?ho: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)})})),yo=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)})})),bo=d((({field:e,input:t})=>{const{data:n}=La("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)})})),vo=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})})),No=d((({field:e})=>{const t=e("secondaryPhone");return o(ro,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),wo=d((({field:e,input:t})=>o(_n,{label:"Направление обслуживания",placeholder:"Выберите направление",options:ys,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),Co=["male","female"],So=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],ko=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 Co.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Yr,{label:"Пол",orientation:"horizontal",items:So,...li(e("sex"),ti.sex,t?.required)})})),Io=d((({field:e,input:t})=>o(Ai,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),To=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(xl(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})})),Bo=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(To,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),yn(i)]}))),Po=d((({field:e,input:t})=>o(Bo,{label:"СНИЛС",...li(e("snils"),ti.snils,t?.required),...t}))),Ro=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ci(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Do=["От 1 мес","До 15 лет"],Eo=d((({field:e})=>o(Za,{title:"Срок, месяцев",items:Do,min:1,max:180,...e("term")}))),Mo=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Ao=d((({field:e,input:t})=>o(_n,{label:"Тип обслуживания",options:xs,...li(e("serviceType"),ti.serviceType,t?.required)}))),_o=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Fo=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(br,{className:"whitespace-normal",orientation:"horizontal",items:_o,value:t,onChange:e=>n&&n(e)})})})),zo=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 Oo={$ref:"/wcms-resources/outservice-productlist.json"},Vo=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(Ro,{field:e,input:n}),name:o(Ls,{field:e,input:n}),middleName:o(qs,{field:e,input:n}),phone:o(so,{field:e,input:n}),organizationPhone:o(so,{field:e,input:n}),email:o(cs,{field:e,input:n}),fullName:o(Ns,{field:e,input:n}),inn:o(Ss,{field:e,input:n}),legalForm:o(Ps,{field:e,input:n}),organizationName:o(Ws,{field:e,input:n}),generalSeniority:o(ws,{field:e,input:n}),lastJobExperience:o(Ts,{field:e,input:n}),experience5Years:o(ps,{field:e,input:n}),jobsNumber:o(Is,{field:e,input:n}),beginDate:o(Al,{field:e,input:n}),addressFact:o(wi,{field:e,input:n}),organizationAddress:o(Si,{field:e,input:n}),comment:o(Ul,{field:e,input:n}),addressBranch:o(Ni,{field:e,input:n,isPremium:a}),sex:o(ko,{field:e,input:n}),birthday:o(_l,{field:e,input:n}),limitedBirthday:o(Ds,{field:e,input:n}),birthPlace:o(Fl,{field:e,input:n}),desiredMeetingDate:o(Zr,{field:e,input:n}),product:o(mo,{field:e,source:Oo}),localities:o(_s,{field:e,input:n}),isClient:o(ks,{field:e}),partnerComments:o(Xs,{field:e,input:n}),collectionCount:o($l,{field:e,input:n}),acquiringType:o(si,{field:e,input:n}),onlineCheckout:o($s,{field:e}),posTerminal:o(co,{field:e}),serviceType:o(Ao,{field:e,input:n}),term:o(Eo,{field:e}),amount:o(nl,{field:e}),annualRevenue:o(ll,{field:e,input:n}),vedTypes:o(Fo,{field:e}),feedbackMethod:o(vs,{field:e,input:n}),serviceDirection:o(wo,{field:e,input:n}),bankEmpolee:o(ol,{field:e}),secondaryPhone:o(No,{field:e}),consentToReceiveMaterials:o(ir,{field:e,input:n}),processPersonalDataFlg:o(ir,{field:e,input:n}),consentProviderFlg:o(ir,{field:e,input:n}),consentOthersFlg:o(ir,{field:e,input:n}),consentInformFlg:o(ir,{field:e,input:n}),consentPfrFlg:o(ir,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(yo,{field:e}):o(xo,{field:e,input:n,params:t}),education:o(os,{field:e,input:n}),housing:o(Cs,{field:e,input:n}),employment:o(us,{field:e,input:n}),organization:o(Us,{field:e,input:n}),amountWorkers:o(al,{field:e,input:n}),employerActivities:o(ds,{field:e,input:n}),employerOrganization:o(ms,{field:e,input:n}),positionOrganization:o(oo,{field:e,input:n}),familyStatus:o(fs,{field:e,input:n}),children:o(Ll,{field:e,input:n}),familyMembers:o(gs,{field:e,input:n}),dependents:o(Jr,{field:e,input:n}),totalIncome:o(Mo,{field:e,input:n}),expenses:o(hs,{field:e,input:n}),snils:o(Po,{field:e,input:n}),conscription:o(Hl,{field:e,input:n}),armyIdFlg:o(rl,{field:e,input:n}),dulSerie:o(ls,{field:e,input:n}),dulNumber:o(as,{field:e,input:n}),dulIssueDateField:o(ts,{field:e,input:n}),dulSubdivisionCode:o(ss,{field:e,input:n}),dulIssuedBy:o(is,{field:e,input:n}),addressRegistration:o(Si,{field:e,input:n}),addressCourier:o(Si,{field:e,input:n}),participantDateRegistration:o(Ys,{field:e,input:n}),retirementIncome:o(vo,{field:e,input:n}),otherIncome:o(Hs,{field:e,input:n}),wages:o(zo,{field:e,input:n}),mandatoryPayments:o(Fs,{field:e,input:n}),disablePeopleFlg:o(Qr,{field:e,input:n}),bankruptcyFlg:o(cl,{field:e,input:n}),shareholderFlg:o(Io,{field:e,input:n}),legalEntityName:o(Bs,{field:e,input:n}),creditInRshbCd:o(Hr,{field:e,input:n}),bankEmployeeCode:o(sl,{field:e,input:n}),partInBusiness:o(Gs,{field:e,input:n}),regionRetail:o(bo,{field:e,input:n}),addressRetail:o(Wa,{field:e,input:n}),addressMatch:o(_i,{field:e,input:n}),paymentSystem:o(Js,{field:e,input:n}),currency:o(Gr,{field:e,input:n}),cardCategory:o(Vl,{field:e,input:n}),codeWord:o(jl,{field:e,input:n}),confirmationIncome:o(Wl,{field:e,input:n}),methodObtain:o(Os,{field:e,input:n}),deliveryDate:o(Xr,{field:e,input:n}),calculator:o(Wr,{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},qo=e=>2===e?"@xl:grid-cols-2":"",Lo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ae,{size:"text-h6",children:e})}):null,jo=d((({responseType:e,typeForm:t,onClose:n})=>{const i="OK"===e,a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Ql,{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(Jl,{type:"button",onClick:n,children:"Хорошо"})]})})})),$o=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Uo=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,...Ho(o),...Wo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Wo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ho=e=>e?{vedTypes:Object.fromEntries(_o.map((({id:t})=>[t,t===e])))}:{},Yo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:xs[0],feedbackMethod:bs[0],serviceDirection:ys[0],vedTypes:_o[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Ko=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ae,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Ae,{children:t.text})}):null]}))),Go=(e,t)=>o(Jl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xo=(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(Pi,{...e}),o(Ko,{link:t})]}),yn(ai(e,Kn).error)]}):o(Ko,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Go(n)]}),Jo={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}}},Zo=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||Yo[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=xs[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=sn(jo),C=l((async(e,t)=>{const i=Qo(x,e),a=$o(ii(i));if(!Fn(a(e)))return console.warn("validation fail");const l=Uo({...e,...h}),r=await Jo.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(qo(e.columns),"grid gap-x-m"),children:[Lo(e.title),(e?.inputs||[])?.map(Vo(S,{typeForm:n}))]},`section-${t}`))),Xo(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]})})),Qo=(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)})))),ec=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(Vo(n,{typeForm:t}))}),renderFoldButton:tc(c("div",{children:[o(Pi,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),tc=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"})})]}),nc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=ic(n||[]);return i.length>2?c("div",{children:[a.map(Vo(e,{typeForm:t})),o(ec,{inputs:i,field:e})]}):(n||[])?.map(Vo(e,{typeForm:t}))},ic=e=>({consentInputs:e?.filter((e=>Object.keys(Yl).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Yl).includes(e.name||"")))||[]}),ac=[{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"}]}],lc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:xs[0],feedbackMethod:bs[0],serviceDirection:ys[0],vedTypes:_o[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:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},rc=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||lc[e.name||""]]))),typeForm:{key:n,text:""}}},sc=(e,t)=>o(Jl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),oc=e=>ta("/user-data/updateUserProfile","PUT",e),cc=e=>ta("/user-data/updateUserTask","PUT",e),dc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),mc={width:"103",height:"21"},uc={"bg-white":"color",transparent:"white"},hc={"bg-white":"text-primary-main",transparent:"text-white"},pc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:uc[e]},className:hc[e],width:n?.width,height:n?.height}),gc={"bg-white":"text-primary-text",transparent:"text-white"},fc=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:[pc(l,n?.image,mc),r?i??o("div",{className:"ml-s",children:o(Ae,{font:"font-medium",color:gc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),xc=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(Ql,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(fc,{}),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(Jl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Jl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),yc=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")}`,vc=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:Nc(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),Nc=(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`},wc=d((({isDisabled:e,onClick:t,text:n})=>o(Jl,{type:"button",onClick:t,disabled:e,children:o(Ae,{font:"font-normal",children:n})}))),Cc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Sc=({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(Cc))({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}},kc=d((({title:e,description:t,__html:n,code:r=!0,codeLength:s=4,textButton:d="Далее",phoneNumber:m="+79999999999",onSuccess:u=un,onClose:h=un})=>{const[p,g]=i(Array(s).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttempts:S}=Sc({values:p,onSuccess:u}),I=sn(xc),T=l((async()=>{var e;await(e={phoneNumber:m,smsCodesSetName:{key:"AUTHENTICATION"}},ea("/sms/sendCode","POST",e).then((t=>!dc(t,e.phoneNumber))))?(S(0),w(180),C(!0)):I.open({phoneNumber:m,sendCode:T,onClose:h})}),[m,h]);return a((()=>{T()}),[]),o(Ql,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:e,description:t,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),r?o(vc,{values:p,setValues:g,errorText:y,hasError:x}):null,Tc(v,w,T),o(Ee,{itemSize:"list-s",__html:n}),Ic(d,N,f),b?o(Fi,{blur:!1}):null]})})})),Ic=(e,t,n)=>e?o(wc,{isDisabled:t,onClick:n,text:e}):null,Tc=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(yc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Bc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Pc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Rc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Dc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,a]=i(""),[r,s]=i(!1),d=tr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),h=r?Pc:Bc;return o(Ql,{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(br,{className:"whitespace-normal",orientation:"horizontal",items:Rc,value:n,onChange:u}),o(Jl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Ec=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:$t(e),textButton:"Далее",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Mc=d((({onClose:e})=>{const t=Jt(),[n,i]=Ol("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(Ql,{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(Jl,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(Jl,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),Ac={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},_c={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Fc={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},zc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Ac?[...e,{contactTypeCd:{key:Ac[t]},value:n}]:e),[]),Oc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in _c){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:_c[t]},...i}]}return e}),[]),Vc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Fc?[...e,{incomeTypeCd:{key:Fc[t]},value:Number(n||0)}]:e),[]),qc=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,o]=Ol("taskId"),[,c]=Ol("profileId"),[,d]=Ol("participantId"),[,m]=Ol("programId"),u=(e=>{const{open:t}=sn(Mc),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),h=(e=>{const{open:t}=sn(Dc),n=sn(kc),i=t=>async n=>{try{t&&await oc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},a=(t,a)=>async l=>{"SIGNED"===l&&t?n.open({...Ec(t),onSuccess:i(a)}):e()};return{open:(n,i)=>t({onSubmit:a(n,i),onClose:e})}})(u),p=sn(kc),g=l((({participantId:e,taskId:t,profileId:n,programId:i})=>{d(e),o(t),c(n),m(i)}),[]);return{handleSubmit:l((async n=>{const i=$o(ii(e));var l;if(Fn(i(n)))try{const e=await(l={profile:{phone:$t(n.phone)}},ea("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await Lc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Yl).filter((e=>n[e])).map((e=>Yl[e]?.text));p.open({...jc(n?.phone,l),onSuccess:i})}}catch{s("Fail")}}),[]),responseStatus:r}},Lc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=Uc(n);await oc(((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 cc((({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:zc({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)},jc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:$t(e),textButton:"Далее",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${$c(t)}`}),$c=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Uc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Wc=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:ao(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:Hc(a),addressFact:Hc(l),esiaAccountTypeCd:t?.esiaAccountType}},Hc=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}},Yc=e=>{const t=Jt(),[n,{setTrue:i,setFalse:r}]=on(!1),[,s]=Ol("leadForm"),o=l((async(n,a,l)=>{i();try{const i=await(o={profileId:n,code:a,state:l,redirectUri:globalThis.location?.href},ea("/esia/updateProfileEsia","POST",o));i&&s((e=>({...e,...Wc(i)}))),t.assign(e)}finally{r()}var o}),[e]);return a((()=>{const e=zl(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),i=t.get("state");e&&n&&i?o(e,n,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:n}},Kc=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",button:l,...r})=>{const s=ac?.flatMap((e=>e?.inputs))||[],{isLoading:d}=Yc(i),[m,h]=Ol("leadForm"),p=rc(s,m),{handleSubmit:g,responseStatus:f}=qc({inputs:s,programId:n,nextStepLink:i,saveForm:h}),[,{field:x,onSubmit:y}]=an(p,{onSubmit:g}),b=sn(jo);return a((()=>{f&&b.open({responseType:f})}),[f]),o(rn,{className:u("container space-y-m",e),title:t,...r,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[d?o(Fi,{blur:!1}):null,ac.map(((e,t)=>c("div",{className:u(qo(e.columns),"grid gap-x-m"),children:[Lo(e.title),nc({field:x,inputs:e?.inputs})]},`section-${t}`))),sc(l)]})})})),Gc=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"})]})})),Xc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Jc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Zc=10;function Qc(e=0){const t=Math.round(e*Zc);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const ed=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:Qc(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})})),td=["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(ad(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?id(c,v):{},...N?Jc(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(ed,{className:u(m,a?td[a-1]:"",{"h-full":N},t),style:w?id(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})),id=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ad=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),ld={"horizontal-list":"w-6","vertical-list":"h-6"},rd=({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?ld[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),sd=({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))},od=e=>t=>e.scrollWidth/t,cd=e=>(t,n)=>{e.scrollBy({left:n*od(e)(t),behavior:"smooth"})},dd=({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?[Br()(a),Ir()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?cd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?cd(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}]},md={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ud=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]=dd({itemCount:s.length}),g=hd(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(sd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",md[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(rd({activeIndex:t,onClick:f,listType:i}))}):null})),hd=(e=!1)=>({behavior:e?"auto":"smooth"}),pd=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"})}))),gd=d((e=>o(pd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),fd=d((e=>o(pd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),xd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",yd=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?bd(t):null,l?o(gd,{className:u(vd(a),m?"left-1":"left-0"),onClick:s}):null,r?o(fd,{className:u(vd(a),m?"right-1":"right-0"),onClick:d}):null]})})),bd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(xd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(xd,"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)]"),Nd=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]=dd({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(yd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(ud,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),wd=({blocksToRender:e,...t})=>o(Nd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Xc(!0)),children:B(e,t)},String(n))})}),Cd=e=>e%2!=0,Sd=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]}))),kd=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Sd,{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(Ae,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Id=({isUnfolded:e,onToggle:t})=>o(kd,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Td=["ArrowDownIcon","ArrowUpIcon"],Bd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Pd=({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(Bd),children:[R(l,{...a.options,parent:n}),Cd(l.length)?o(qt,{className:"col-span-6",...a}):null]}),o(aa,{renderFoldableSection:({isUnfolded:e})=>c(la,{className:u(Bd),isUnfolded:e,children:[R(r,{...a.options,parent:n}),Cd(r.length)?o(qt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(kd,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Td[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Rd=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Dd(n,t),Pd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Dd(n,t),wd({...i,blocksToRender:t})]});default:return null}})),Dd=(e,t)=>e&&!t.length?o(Gc,{...e}):null,Ed=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Md=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(js,{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))))),Ad=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,Ed(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(_d(i)).filter(Boolean))]}),n?o("div",{children:o(Jl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),_d=e=>([t,n])=>{const i=n?.type;return"array"===i?Fd(t,e)(n):null},Fd=(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(Ae,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Md,{items:i,multiple:!n?.single,...t(e)})]},e)};function zd(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Od=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Vd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>Od(t[e])||Od(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Od(t[e])||Od(n[e])||qd(t[e])<=qd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>Od(t[e])||Od(n[e])||qd(t[e]?.min)>=qd(n[e]?.min)&&qd(t[e]?.min)<=qd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>Od(t[e])||Od(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Od(t[e])||Od(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),qd=e=>Number(e||0),Ld=(e,{block:t,page:n,normalize:i=nn})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>zd(a,a.map((e=>_t(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=nn)=>e?.filter((([,e])=>Vd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},jd={},$d={},Ud=Ot((({className:e,filtrationSchema:t=jd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Ld($d,{block:a.block,page:a.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:Wd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Wd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Ad,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Jl,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Rd,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Wd=e=>zd(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Hd=(e=!1)=>e?"text-left":"text-center",Yd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Kd=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",Yd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),Gd=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:Hd(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(Xd)}):null]})})),Xd=({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(Kd,{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(Ae,{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)),Jd=(e,t,n)=>{return o(Nd,{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(Ae,{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(Ae,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},Zd=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?Jd(e,0,t):null]}))),Qd={start:"justify-start",center:"justify-center",end:"justify-end"},em=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Qd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),tm=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Ae,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children: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(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),im=({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(tm,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(dr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(nm,{title:e,...r}),am={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},lm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},rm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=am.prefMonthsNum,prefTravelBonusRate:l=am.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||lm,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},sm=Ot((({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}=rm(r,n);return o(lr,{className:e,title:t,...l,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),wr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?im({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:or,children:[f>=0?o(dr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),gr(a)]})]})})})),om=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,cm=e=>vr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),dm=" (c капитализацией)",mm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:or,children:[o(dr,{title:`Доход в конце срока${l?dm:""}`,value:e,postfix:n,prefix:"+"}),o(dr,{title:`Сумма в конце срока${l?dm:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(gr)]}),um={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const hm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},pm=(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?um[e?.rateType]:"",{data:n}=gi(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&gm(s,e)&&Er(i,["minSum","maxSum"],e)&&Er(n,["minDays","maxDays"],e)))||hm,{rate:m}=d,u=fm(m,e),h=i+u,p=c||[hm];return{...d,...Dr(["minSum","maxSum"],p),...Dr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},gm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,fm=(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)},xm=Ot((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:hr(r,1e5),daysValue:pr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=pm(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(lr,{className:e,title:t,...d,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({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:[`От ${om(b.min||0)}`,`До ${om(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[ym(p,h),cm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),im({rate:x,depositeName:y,isShowDepositeName:l}),mm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),ym=(e,t)=>c("div",{className:"space-y-s",children:[o(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Pi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),bm=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:""},Nm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Sm(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=>[Cm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Cm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Cm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Cm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Er(i,["minSum","maxSum"],t),Er(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||vm,{rate:u}=m,h=wm(u,e),p=i+h,g=t||[vm];return{...m,...Dr(["minSum","maxSum"],g),...Dr(["minMonths","maxMonths"],g),availableMonths:bm(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}},wm=(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)},Cm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Sm=(e,t)=>e+Math.round((t-e)/2),km=(e="rub")=>"rub"===e,Im=(e,t)=>{const{minMonths:n,maxMonths:i}=Dr(["minMonths","maxMonths"],Rm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:Ya(a,n,i)}},Tm=(e,t)=>{const{minSum:n,maxSum:i}=Dr(["minSum","maxSum"],Rm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:Ya(a,n,i)}},Bm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Pm=e=>{const t=km(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Rm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Dm=(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?vr({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?vr({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Em(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?cm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},vr({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Em(e.isShowNewClient),e.isShowNewClient?o(Pi,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Em=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Mm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Am={text:"₽",key:"rub"},_m=Ot((({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))??[Am],g=l((e=>t=>e?{...t,...Pm(t),...Tm(t,e),...Im(t,e),...Bm(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:hr(d,2e4),monthsValue:pr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Am},{normalize:g}),y=x?.("currency")?.value??Am,b=x?.("isNewClient")?.value,v=Rm(h,y),N=Nm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Cr({field:x,defParams:mr(v,b),calcParams:N,monthsValue:"minMonths",map:Mm})}),[x,h]);a((()=>{!zr(d)&&v&&I()}),[d,h]);const T=w===mr(v,b)?.rate;return o(lr,{className:e,title:t,...m,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[c("div",{className:"flex gap-m",children:[wr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Fm(y?.key)}),h&&h?.length>1?o(_n,{label:"Валюта",options:p,...x("currency")}):null]}),fr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Dm({...N,...s},x)]}),im({rate:w,children:Om(I,T)}),mm({income:C,finalSum:S,buttons:[...i,zm(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Fm=(e="")=>km(e)?1e3:100,zm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},Om=(e,t=!1)=>t?null:o(Jl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Vm=e=>qm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&qm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),qm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Lm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},jm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Lm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Vm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Rr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Rr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Vm({row:e,userInputParams:t,paramsViewSettings:n})&&Er(i+r,["minSum","maxSum"],e)&&Er(l,["minSumOld","maxSumOld"],e)&&Er(r,["minSumExtra","maxSumExtra"],e)&&Er(a,["minMonths","maxMonths"],e)))||Lm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Sr(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}},$m=Ot((({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=jm(s,n,l),h=Nr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(lr,{className:e,title:t,...r,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),wr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),fr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Um({...m,...l},d),m.isExtraMoney?wr({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(or,"@4xl:w-1/2"),children:[o(dr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(dr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(dr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(dr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),gr(a)]})]})})})),Um=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Pi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Wm=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(Hm(e)),n,i)):Hm(e),format:He(r)}),d=l((e=>t&&t(Hm(e))),[t]);return o(fn,{onChange:d,...s,...c})})),Hm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ym=d((e=>o(Wm,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Km={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Gm={amount:1500},Xm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Gm),[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:Km[r],children:[o(Ym,{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(Jl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Jm=({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})]}),Zm="relative h-full",Qm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},eu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(iu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:tu(n,{someCardsHighlighted:l}),children:[B(n,i,{className:nu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),iu(n)?Jm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},tu=(e,{someCardsHighlighted:t})=>u(Zm,t&&(iu(e)?"pt-3xl":"pt-3xl sm:pt-16")),nu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Zm,"min-w-80",Qm[i],t&&(iu(e)?"pt-3xl sm:pt-16":"pt-3xl"),Xc(n),n&&"h-full"),iu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,au=Ot((({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(Nd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?lu(s?.block?.blocks):[],hasBlur:!0,children:eu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),lu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],ru="z-10 border border-solid w-full h-full",su=u(ru,"absolute hidden @xl:block border-transparent"),ou=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(su,"top-9 right-12 bg-green-dark")}),o("div",{className:u(su,"top-6 right-8 bg-green")}),o("div",{className:u(su,"top-3 right-4 bg-green-light")}),c("div",{className:u(ru,"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})]})]})}))),cu={black:"bg-black",white:"bg-white"},du=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(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(mu)]}):null,a?c(Ae,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),mu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cu[e]}`},String(t)),uu=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})),hu=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?pu(i):null]})}))),pu=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(uu,{...e},String(t))))}),gu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),fu=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})})),xu=[{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"}}],yu=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=>xu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(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},bu(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(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),bu=(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":""),Nu=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(fu,{href:a,target:m,className:"h-full",data:gu(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(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(yu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(qe,{benefits:f}),s?o(Ee,{__html:s,isDotted:r,itemSize:"list-s"}):null,wu(i,p)]})})}))),wu=(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,Cu=(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(Ae,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(Ae,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},Su=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(Cu),[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:[Le(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?ku(m?.parent,h,b):null}):o("div",{children:x})]})})),ku=(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"})]}),Iu=()=>{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)},Tu=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]})]}))),Bu=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(Tu,{step:i,showPercentage:!1})]})})}));var Pu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Pu||(Pu={}));const Ru=e=>ea("/user-data/getTaskStatus","POST",e),Du=e=>ta("/user-data/sendSignalToProcess","POST",e),Eu=(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},Mu=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]})]}))),Au=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(yc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Ee,{__html:a}):null]})]})})),_u=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(Au,{interval:d,intervalExpireAction:m}):null]}),o(Fu,{title:i,items:a}),o(Fu,{title:l,items:r,countColumns:!0}),n?.__html?o(Mu,{__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]}))),Fu=({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(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",qo(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:zu(e)},t)))}):null]})]}):null},zu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Ou=d((()=>o(_u,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Vu=d((({handleExpireTimer:e})=>{const[t]=Ol("leadForm");return o(_u,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),qu=d((()=>{const[e]=Ol("leadForm");return o(_u,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Lu=d((()=>{const[e]=Ol("leadForm");return o(_u,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ju=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],$u=d((()=>{const[e,t]=i(Pu.process),[n]=Ol("taskId");a((()=>{(async()=>{for(const e of ju)await Du({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Ru({taskId:n});i&&i?.statusCd!==Pu.process&&(e(),t(i.statusCd))}),[n]);Eu(r,3e4);return Uu(e,(()=>t(Pu.rework)))})),Uu=(e,t)=>({IN_PROCESS:o(Vu,{handleExpireTimer:t}),CANCELLED:o(Ou,{}),APPROVED:o(Lu,{}),REVISION:o(qu,{})}[e]||o(qu,{})),Wu=[{paymentSystem:"",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}],Hu=e=>{if(e)try{return new Date(e)}catch(e){return}},Yu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Ku(n,e),Gu(t,e),Qu(t,e),Xu(t,e),Ju(t,e),Zu(t,e)].some(Boolean)?{...t,required:!1}:t)),Ku=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Gu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Xu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ju=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Zu=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Qu=({name:e},t)=>"snils"===e&&eh(t),eh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,th=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Mu,{__html:e},`${t}_${n}`))):null},nh=({field:e,inputs:t,params:n})=>t.map(Vo(e,n)),ih=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Yu(ah(t))(e,n),o=s.filter((e=>!Zu(e,ah(t))));return c("div",{className:u(qo(a),"grid gap-x-m"),children:[th(o),Lo(l),nh({field:t,inputs:s,params:i})]},`section-${r}`)})),ah=e=>t=>e(t)?.value,lh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Jl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Jl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),rh=e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:i,codeWord:a}},sh=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},oh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},ch=(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:zc({phone:$t(l),email:r}),participantAddresses:Oc({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:zc({organizationPhone:p&&$t(p)}),participantAddresses:Oc({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:Vc({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:Oc({addressCourier:t})}:{}})(t)}},dh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Ol("taskId"),[o]=Ol("profileId"),[c]=Ol("participantId"),d=l((async l=>{const d=$o(ii(Yu(uh(l))(t,e)));if(!Fn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await cc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...oh(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...ch(a,i)}],...rh(i),...sh(i)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));mh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},mh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},uh=e=>t=>e[t],hh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l})=>{const[r,s]=Ol("leadForm"),d=((e,t)=>({...Wu[e],...t,limitedBirthday:Hu(t?.limitedBirthday),dulIssueDateField:Hu(t?.dulIssueDateField),participantDateRegistration:Hu(t?.participantDateRegistration),beginDate:Hu(t?.beginDate),deliveryDate:Hu(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=dh({step:e,inputs:m,onNextStep:i,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return a?o($u,{}):c("form",{onSubmit:p,className:"space-y-m",children:[ih({sections:t,field:h,step:e}),o(lh,{step:e,onPrevStep:n})]})})),ph=[[{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"]}}]}]],gh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],fh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Iu,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>ph[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(Bu,{stepsTitles:gh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(hh,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),xh=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(Tu,{step:i,showPercentage:!1})]})})})),yh=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(Au,{interval:d,intervalExpireAction:m}):null]}),o(bh,{title:i,items:a}),o(bh,{title:l,items:r,countColumns:!0}),n?.__html?o(Mu,{__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]}))),bh=({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(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",qo(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(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Nh=d((()=>o(yh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),wh=d((({handleExpireTimer:e})=>{const[t]=Ol("leadForm");return o(yh,{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?"Аннуитетный":"Дифференцированный"}]})})),Ch=d((()=>{const[e]=Ol("leadForm");return o(yh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Sh=d((()=>{const[e]=Ol("leadForm");return o(yh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),kh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ih=d((()=>{const[e,t]=i(Pu.process),[n]=Ol("taskId");a((()=>{(async()=>{for(const e of kh)await Du({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Ru({taskId:n});i&&i?.statusCd!==Pu.process&&(e(),t(i.statusCd))}),[n]);Eu(r,3e4);return Th(e,(()=>t(Pu.rework)))})),Th=(e,t)=>({IN_PROCESS:o(wh,{handleExpireTimer:t}),CANCELLED:o(Nh,{}),APPROVED:o(Sh,{}),REVISION:o(Ch,{})}[e]||o(Ch,{})),Bh=[{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}],Ph=e=>{if(e)try{return new Date(e)}catch(e){return}},Rh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Dh(n,e),Eh(t,e),Fh(t,e),Mh(t,e),Ah(t,e),_h(t,e)].some(Boolean)?{...t,required:!1}:t)),Dh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Eh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Mh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ah=({name:e},t)=>"addressFact"===e&&t("addressMatch"),_h=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Fh=({name:e},t)=>"snils"===e&&zh(t),zh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Oh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Mu,{__html:e},`${t}_${n}`))):null},Vh=({field:e,inputs:t,params:n})=>t.map(Vo(e,n)),qh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Rh(Lh(t))(e,n);return c("div",{className:u(qo(a),"grid gap-x-m"),children:[Oh(s),Lo(l),Vh({field:t,inputs:s,params:i})]},`section-${r}`)})),Lh=e=>t=>e(t)?.value,jh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Jl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Jl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),$h={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Uh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:$h[i?"annuity":"differential"]}},Wh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Hh=(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:zc({phone:$t(l),email:r}),participantAddresses:Oc({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:zc({organizationPhone:p&&$t(p)}),participantAddresses:Oc({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:Vc({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{}}},Yh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Ol("taskId"),[o]=Ol("profileId"),[c]=Ol("participantId"),d=l((async l=>{const d=$o(ii(Rh(Gh(l))(t,e)));if(!Fn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await cc((({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:"Заемщик"},...Hh(a,i)}],...Uh(i),...Wh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Kh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},Kh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},Gh=e=>t=>e[t],Xh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l,programsSource:r})=>{const[s,d]=Ol("leadForm"),[m]=Ol("programId"),u=r?.[m??""],h=((e,t)=>({...Bh[e],...t,limitedBirthday:Ph(t?.limitedBirthday),dulIssueDateField:Ph(t?.dulIssueDateField),participantDateRegistration:Ph(t?.participantDateRegistration),beginDate:Ph(t?.beginDate),deliveryDate:Ph(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=Yh({step:e,inputs:p,onNextStep:i,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return a?o(Ih,{}):c("form",{onSubmit:x,className:"space-y-m",children:[qh({sections:t,field:f,step:e,params:{calcData:u}}),o(jh,{step:e,onPrevStep:n})]})})),Jh=[[{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"}]}]],Zh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Qh=Ot((({className:e,programsSource:t,...n})=>{const[d,m]=i(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);a(Iu,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Jh[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(xh,{stepsTitles:Zh,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Xh,{step:d,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,programsSource:t},String(d))})]})})})),ep=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,tp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),np=1e9,ip={sum:{min:1e4,max:np},period:3},ap=Ot((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Ld(ip,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:lp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=rp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Ad,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Ym,{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(Rd,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),lp=e=>Et((e?.paramsSource?.rateRows||[]).filter(ep).flatMap((e=>tp(e.minMonths,e.maxMonths)))),rp=e=>Et(e.flatMap((e=>e||[])).filter(ep).flatMap((e=>tp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],sp=[{key:"10"},{key:"50"},{key:"100"}],op=({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:sp,iconVersion:"black"})]})},cp="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",dp=(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:cp,"aria-label":`Страница ${l}`,children:l},String(t)):null},mp={width:"24",height:"24"},up=({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:hp(1===e),...mp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:cp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(dp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:cp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:hp(e===n),...mp})})]})},hp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",pp=({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(up,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(op,{itemCount:i,onItemCountChange:a}):null]}),gp=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})]})})),fp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(gp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(El,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(El,{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(Jl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),xp=(e,t)=>o(Kd,{...e,iconBgVersion:t,className:"shrink-0"}),yp=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:[xp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Ae,{size:"text-m","font-weight":"font-light",children:jt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),bp=`${Ut}/depository`,vp={startDate:void 0,endDate:void 0,query:""},Np=Ot((({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(bp);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(bp+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(fp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(yp,{...e},String(e.publicId)))):o(Gc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(pp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),wp=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,Cp=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:wp(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]})));function Sp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const kp={};function Ip(e,t=kp){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 Tp=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 Bp,Pp;function Rp(e){return Ip(Tp,e)}Bp=Tp,Pp=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),Sp(Bp,Pp),Sp(Pp,Bp),Bp.bus.watch((({type:e,event:t})=>{null!=t?Pp.setItem(e,t):Pp.removeItem(e)}));const Dp=`${Ut}/region`;function Ep(e="Москва"){return Rp().location??{name:e}}function Mp(e="Москва"){const t=Rp(),n=l((async()=>{if(!t.location){const n=await Rt(Dp);t.location=n??{name:e}}}),[t,e]);return gi(Dp,n),t}var Ap;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Ap||(Ap={}));const _p=new Intl.NumberFormat("ru",{style:"currency",currency:Ap.RUB}),Fp=e=>e?_p.format(e):"",zp="text-m font-light text-secondary-text ",Op=`${zp} text-left`,Vp=`${zp} pl-5xl text-center`,qp=`${zp} pl-5xl text-right`,Lp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},jp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Op,children:o(Ae,{size:"text-m",children:"Валюта"})}),o("th",{className:Vp,children:o(Ae,{size:"text-m",children:"Купить"})}),o("th",{className:qp,children:o(Ae,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map($p)})]}))),$p=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:Lp[t]},width:"24",height:"24"}):null,o(Ae,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ae,{size:"text-h6",children:Fp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ae,{size:"text-h6",children:Fp(e?.buyExchangeRate)})})]},t)},Up={icon:"GpsIcon"},Wp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Kd,{...Up,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:"Курс указан для заданного офиса"})]})]}))),Hp=(e,t,n)=>{const i=Number(Yp(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)},Yp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Kp(e){if(!e)throw new Error("Value should be fulfilled");return e}const Gp=e=>t=>{const[,n]=Kp(e.find((([e])=>e(t))));return n(t)},Xp=e=>Gp(e.map((([e,t])=>[e,()=>t])));Xp.if=e=>new Jp(void 0,e);class Jp{parent;predicate;unit;get entry(){return[Kp(this.predicate),Kp(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Jp(this,e)}then(e){return new Jp(this.parent,this.predicate,e)}else(e){return Gp([...Zp(this),[()=>!0,e]])}}const Zp=e=>[...e?.parent?Zp(e.parent):[],e.entry],Qp=e=>Xp([[e=>e.value!==Ap.RUB&&e.oppositeValue!==Ap.RUB,()=>e.handleConvert(e.value,Ap.RUB)],[e=>e.value===Ap.RUB&&e.oppositeValue===Ap.RUB,()=>e.handleConvert(e.value,Ap.USD)],[e=>e.value===Ap.RUB&&e.oppositeValue===Ap.RUB,()=>e.handleConvert(e.value,Ap.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function eg(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 tg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Ap.RUB,selectBuy:n?.[0]?.currency?.currency||Ap.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:[eg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:ng(r,d,n),value:r.inputSell,setValue:e=>ag(d,n)(e,r.selectSell,r.selectBuy)}),eg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:ig(r,d,t),value:r.inputBuy,setValue:e=>lg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(Ne,{text:a.text,version:a?.version,...a}):null]})})),ng=(e,t,n)=>i=>{t({selectSell:i}),Qp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{ag(t,n)(e.inputSell,i,a)}})},ig=(e,t,n)=>i=>{t({selectBuy:i}),Qp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>lg(t,n)(e.inputBuy,i,a)})},ag=(e,t)=>(n,i,a)=>{e({inputSell:Yp(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(Hp(n,l,i===Ap.RUB)||"")})},lg=(e,t)=>(n,i,a)=>{e({inputBuy:Yp(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(Hp(n,l,i===Ap.RUB)||"")})},rg=`${Ut}/exchangerates`;const sg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=gi(rg+`?regionCode=${t}`,Dt);return n||{}}(Ep()),l=og(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Ap.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Ap.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(jp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Wp,{address:a?.address})]}),o(tg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),og=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],cg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(dg(n))})})),dg=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},mg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Sd,{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:[xp(a,t),e?o(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),ug=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",hg=(e=!1)=>e?"MinusIcon":"PlusIcon",pg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",gg=Ot((({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",ug(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>fg({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),fg=({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?pg(e):hg(e))(a,r);return"accordion"===e?o(mg,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(kd,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},xg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:yg(e)}))),yg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(gg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(cg,{items:e.items}):null},String(t)))),bg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(vg)}):null)),vg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Ng)})]},String(t)),Ng=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:wg(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),wg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Cg(t)}`,children:o(Ae,{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})}},Cg=e=>e.replaceAll(/\D/g,""),Sg=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}`})})),kg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ae,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Sg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Ig=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}`})})),Tg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Ig,{index:t,...e},String(t))))}):null]}))),Bg=Ot((({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(xg,{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(bg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(yu,{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(kg,{title:d,links:l}),o(Tg,{links:a,license:h})]})})),Pg=Ot((({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 max-w-[978px] 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:gu(l,s?.key),children:f})}):null]})})})),Rg={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"},Dg=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",Rg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),Eg=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(fc,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):Mg(p,r),o(Dg,{version:a,...i})]})})),Mg=(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,Ag={"bg-white":"primary",transparent:"transparent"},_g=Ot((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Ag[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(Eg,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Fg=(e=!1)=>e?{}:{padding:"p-0"},zg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Og=Ot((({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",zg[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",Xc(r)),...Fg(i)}})})}),{childrenTypes:[]}),Vg=Ot((e=>o(Og,{...e})),{childrenTypes:[]}),qg=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Qd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Lg=["байт","Кб","Мб","Гб","Тб","Пб"],jg=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(Ae,{size:"text-l",font:"font-light",children:[t," ",$g(d,m),o(Ae,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),$g=(e,t)=>e||t?o("span",{children:", "}):"",Ug=(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))} ${Lg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Hg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(jg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Wg(t),data:n?.data}),o(Ee,{__html:n?.__html})]},String(i))},Wg=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,Hg=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},Yg=d((({href:e,__html:t,target:n,onClose:i})=>{const a=E(),l=$(a)(e);return c(Ql,{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(Jl,{type:"button",version:"secondary",onClick:i,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Kg=d((({text:e,href:t,target:n,__html:i,icon:a})=>{const{open:r}=sn(Yg),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:[Wg(a),o(Ae,{font:"font-light",children:e})]}):null})),Gg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Xg=Ot((({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",Gg[r]),role:"list",children:a.map(Jg(d,l))}):null]})})),Jg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Zg(t)(n,i):Ug(e,t)(n,i)},Zg=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(Kg,{...i,icon:e,href:Qg(t)?t?.href:t?.attachment?.src}),o(Ee,{__html:t?.__html})]},String(n)):null},Qg=e=>"href"in e,ef=Ot((({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(Ae,{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(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),tf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",nf=(e=[],t={})=>e.filter((({content:e={}})=>Vd(t,e))).length,af=(e,t)=>e===t;const lf=(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)))}(af,((e=af)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),rf=[],sf={},of={primary:"bg-white/30",secondary:"bg-main-divider"},cf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},df=d((({count:e,version:t="secondary"})=>{const n=ke(),i=n?"bg-main-divider":of[t],a=cf[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(Ae,{size:"text-xs",color:a,children:e})})})),mf=({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})]})]})},uf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},hf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},pf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},gf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ff=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",uf[i],n?gf[i]:pf[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?hf[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[mf({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(df,{count:m,version:tf(n,i)})}):null]})})})),xf=d((e=>o(e?.item?.href?yf:bf,{...e}))),yf=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(ff,{...e,tag:"a",item:a,onClick:i})})),bf=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(ff,{item:e,onClick:i,...n})})),vf=(e,t,n)=>(i,a)=>o(xf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Nf=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(vf(i,a,t))}))),wf={categories:[],extraOptions:[],propertyType:[],stage:[]},Cf=Ot((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Ld(wf,{block:a.block,page:a.options?.page}),f=l(((e=wf)=>p(e)),[]),x=(({hotFilters:e=rf,filtrationState:t=sf,blocks:n=rf,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>lf(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:nf(n,t.filter),version:tf(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(Nf,{...x}),o(Ad,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Rd,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Sf=(e,t,n)=>{const i=tf("all"===t),a=tf("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(Jl,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Jl,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},kf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(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(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,If="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Tf=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Pi,{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:If,children:s}),o(la,{className:If,isUnfolded:e,children:d})]}),renderFoldButton:Bf(n,i)})}):null})},Bf=(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:Pf()})]}),Pf=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Rf=(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(Ae,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Df=()=>{},Ef=e=>"all"===e?"block":"hidden",Mf=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Df,renderRemoteWorkplaceCard:r=Df,getBalloon:s=Df,getBalloonRemoteWorkplaces:d=Df,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=qa({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Af([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Fa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Rf(h,N),m?kf(m):null,p&&Sf(t,w,C),o("div",{className:u("pb-3xl",Ef(w)),children:Tf(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)]})]})})),Af=e=>Object.keys(_a).filter((t=>e.filter((e=>za[t](e))).length)),_f=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Of(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(Ae,{size:"text-h4",children:Of(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Na,{color:"green",children:Of(s)})})]}),o("div",{className:"hidden sm:block",children:o(da,{className:"flex-wrap",children:m?.map(zf)})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:o(da,{className:"flex-wrap",children:m?.map(zf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(d))},Ff=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Of(t)} №${n}`,body:e.toUpperCase()}),zf=(e,t)=>o(ra,{...e},String(t)),Of=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Vf=[];const qf=async e=>{const t=await Rt(e,{method:"GET"});return Array.isArray(t)?t:Vf},Lf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},jf={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)},$f=d((({descriptionData:e,className:t})=>{const n=Ep(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=gi(`${Ut}/atms?regionCode=${e}`,qf);return{data:t||Vf,isLoad:!t&&!n}}(i);return o(Mf,{className:t,filterItems:Uf,data:a,isLoad:l,initFilterState:Lf,renderCard:_f,getBalloon:Ff,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Uf=(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=>jf[t](e))),n=!i.length||i.some((t=>jf[t](e)));return t&&n}))},Wf=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ae,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Hf({workScheduleDescription:t})}),o(aa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(la,{isUnfolded:e,children:Hf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ba({isUnfolded:e,onToggle:t})})]},String(n)):null,Hf=({workScheduleDescription:e})=>c("div",{children:[c(da,{className:"flex",children:[o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание банковских карт"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Инвестиционное и накопительное страхование"})}),o(ra,{label:"Операции для физических лиц",children:o(Ae,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(ra,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]}),Yf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Kf={branches:[],remoteWorkplaces:[]};const Gf=async e=>await Rt(e,{method:"GET"})||Kf,Xf=d((({className:e})=>{const t=Ep(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=gi(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Gf);return{data:t||Kf,isLoad:!t&&!n}}(n);return o(Mf,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ea,renderRemoteWorkplaceCard:Wf,getBalloon:Aa,getBalloonRemoteWorkplaces:Yf,title:`Офисы филиала ${t?.name}`})})),Jf=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(Xf,{}):o($f,{descriptionData:e})})})),Zf=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,{})]}))),Qf=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(Nd,{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))))})}))),ex=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:[Le(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?tx({__html:l,richVersion:r}):null,nx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),nx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),nx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),tx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ee,{...e,itemSize:"list-s"})}),nx=({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(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ae,{size:"text-xl",color:i,children:t})]})]}):null,ix=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Ee,{__html:t,richVersion:n})})})),ax=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(Ae,{color:"text-primary-text",children:t}):null]})}))),lx=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(ax,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(ax,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),rx=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})})),sx=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(rx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(rx,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),ox=["От 1 дня","До 365 дней"],cx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Za,{min:1,max:365,value:e,items:ox,onChange:t})]}))),dx=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(rx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(rx,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),mx=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(sx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:ux(m)}),o(cx,{days:a,setDays:e=>m({days:e})}),o(dx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:hx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(lx,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),ux=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},hx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},px=d((({days:e,tariffs:t=[]})=>{const n=fx(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:[gx("Аренда за",e),gx("Цена",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})})]})]})})),gx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),fx=(e,t)=>{const n=xx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},xx=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},yx=(e,t)=>e.find((e=>e.branchCode===t)),bx=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=yx(i,n.selectedBranch),d=vx(s?.safeBoxCaseVolumes),m=Nx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=wx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(mx,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(px,{days:n.days,tariffs:u})]})})),vx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Nx=(e,t)=>e?.find((e=>e.volume===t)),wx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Cx=`${Ut}/safeboxes`,Sx=[];const kx=async e=>await Rt(e,{method:"GET"})||Sx,Ix=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=fo(),p=Tx(m.selectedRegion,h),f=function(e){const{data:t}=gi(e?`${Cx}?regionCode=${e}`:null,kx);return t||Sx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=yx(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(bx,{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]})})),Tx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Bx={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"},Px=(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:Rx(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Dx(i),l?.text?o(Ne,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},Rx=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Ex(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:Mx({step:n,iconVersion:a,i:i,stepVersion:t})})})},Dx=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",Bx.description),children:e.description}):null,o(Ee,{__html:e.__html})]}),Ex=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Mx=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Le(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?Bx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},Ax=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(Px(d,r,l))}):null,je(a,{isVertical:!0})]})})),_x=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||""]}))),Fx=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(Zl,{className:"absolute top-1.5 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function zx(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 Ox=()=>{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 zx(ue.observable,"dialog",{open:t,close:n,closeAll:a}),[e,{close:n,closeAll:a}]},Vx=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 qx=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Lx,{...e},String(t))))})]}):null,Lx=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(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),jx=(e,t)=>n=>n.name?o(fu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:gu(e,n.name),children:o(Ae,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,$x=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"})]}))),Ux=d((({defaultLocation:e})=>{const t=Ep(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(fu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Wx=d((({foreignOffices:e,branches:t,onClose:n})=>{const a=Mp(t?.default),[s,d]=i(""),m=fo(),u=r((()=>Yx(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,Hx)),[u]),p=l((e=>{a.location=e,n?.()}),[a,n]);return c(Ql,{className:"pb-20",head:c("div",{children:[o(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Ux,{defaultLocation:t?.default}),o($x,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Vx(e.toLowerCase())(s.toLowerCase())>=.8)).map(jx(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(Ae,{size:"text-h6",children:e})}),t.map(jx(f,g))]},e)))}),qx(e)]});var g,f})),Hx=e=>e.name?.charAt(0)??"",Yx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Kx=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:i})=>{const l=sn(Wx,n),{name:r}=Ep(),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(Fx,{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})})})})),Gx="burgerMenuDialog",Xx=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:i=un})=>{const{open:a}=sn(Kx),[r]=Ox(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Gx,r),o=l((()=>a({menuRef:e,locationDialogProps:n,menuItem:t,onClose:i},{id:Gx})),[e,n,t,i]);return[s,{toggle:s?i:o}]},Jx=[],Zx=Ot((({sticky:e,...t})=>{const{menuItems:n=Jx}=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}]=Xx({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(Fx,{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(Qx(T,"left",{activeIndex:h,currentItemPosition:f})),o(_x,{item:a,isActive:C,onClick:e=>I(e)}),u.map(Qx(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Qx=(e,t,n)=>(i,a,l)=>o(_x,{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)),ey="hidden sm:flex absolute z-40",ty={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ny=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=dd({itemCount:t?.length||0});return a((()=>iy(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:ty[l].item,gap:ty[l].gap,children:t.map(vf(n,i,l))}),s.canScrollLeft?o(gd,{className:u("left-6",ey,ty[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(fd,{className:u("right-6",ey,ty[l].buttonTop),onClick:s.scrollRight}):null]})})),iy=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},ay={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ly=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ay[t].wrapper,e),children:o(ny,{className:ay[t].component,tabsType:t,...n})}):null,ry=Ot((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=sy(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(dy(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=cy(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:[ly({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:oy(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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(cy)?.filter(Boolean)||[]}),sy=({__id:e,anchor:t})=>t??e??"tabs",oy=(e,t)=>t?.length?t:e,cy=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",dy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),my={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},uy=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:my[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),hy=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}))),py={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(Ae,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Ae,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(hy,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},gy=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 fy({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),fy=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in py))return null;return o(py[n],{...t,...i})},xy=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(gy,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),yy=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),by=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,vy=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(Ae,{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(-${yy(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(Ae,{size:"text-xl",children:e.data}):null,e?.cols?by(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ny=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(Ae,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(vy,{rows:t.rowsData})})})]},i)}))}))),wy=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Cy=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(Ae,{size:"text-xl",font:"font-light",color:wy(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]}))),Sy=Ot((({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(Cy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ny,{activeTabIndex:r,items:m}),o(hy,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ae,{size:"text-h6",children:"Данных нет"}),o(hy,{onClick:n,isOpen:!0})]})})),ky=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(Sy,{...t,onClick:n})}):null]}))),Iy=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(ky,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(uy,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(xy,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Ty({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(pd,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(pd,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const By=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,Ty({...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]})})),Py=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(Iy,{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(By,{controls:x,children:[b,o(la,{isUnfolded:e,children:v})]}),renderFoldButton:Id}):o(By,{controls:x,children:y})})]})})),Ry=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?Dy():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Ey(n):null,a?o(Ee,{richVersion:l,__html:a}):null]})]}))),Dy=()=>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"}),Ey=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),My=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:n})}):null]}))),Ay=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(My,{prefix:t,unit:n,suffix:i})})})),_y={AdTile:qt,ApplicationForm:Zo,ApplicationLeadForm:Kc,BankAccountFiltration:Ud,BenefitsBlock:Gd,BonusBenefitsBlock:Zd,ButtonsBlock:em,CalculatorBonus:sm,CalculatorBusinessDeposit:xm,CalculatorCredit:Vr,CalculatorDeposit:_m,CalculatorRefinancing:$m,CardTransfer:Xm,Carousel:au,CarouselCard:ou,CarouselCatalogCard:du,CarouselLinks:hu,CarouselRecommendationCard:Nu,CarouselTariffsCard:Su,CreditCardForm:fh,CreditForm:Qh,DepositFiltration:ap,Depository:Np,ErrorBlock:Cp,ExchangeRateTile:sg,Footer:Bg,GrantSupport:Pg,Header:_g,Headline:k,HorizontalLayout:Vg,ImgBlock:qg,LinkDocs:Xg,MobileAppTile:ef,MortgageFiltration:Cf,OfficesAtmsMap:Jf,Placeholder:Zf,ProductBlock:Vt,ProductGallery:Qf,RepresentativeOfficeInfo:ex,RichTextBlock:ix,RollupItem:gg,SafeDepositRental:Ix,StepsBlock:Ax,StickyBottomMenu:Zx,TabsLayout:ry,TariffsTable:Py,TextBlock:Ry,UnitBlock:Ay,VerticalLayout:Og},Fy=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 zy="cookie",Oy=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(zy)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(zy,"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(Zl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function Vy(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const qy=d((()=>{const[e,{close:t}]=Ox(),n=Boolean(e.length);return Vy(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})),Ly=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);return zx(ue.observable,"popup",{open:t,close:n}),Vy(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})),jy="header",$y="footer",Uy="sticky-footer",Wy={},Hy=d((({className:e,data:t=Wy,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Ft(s,r);Fy(),Mp();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?.[jy]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.[jy],{...m,slotName:jy})}):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"}}),R(a?.[$y],{...m,slotName:$y})]})]}),a?.[Uy]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.[Uy],{...m,slotName:Uy})}):null,o(qy,{}),o(Ly,{}),o(Oy,{__html:d?.cookieContent?.__html})]})}));Object.assign(Hy,{childrenTypes:[],slots:()=>[jy,$y,Uy]});e.Blocks=_y,e.ContentPage=Hy,e.handlerDecorator=ce,e.joinList=Ed,e.locationNavigator=Jt,e.packageVersion="0.14.697",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=q,e.useRouter=E,Object.defineProperty(e,"__esModule",{value:!0})}));
|