@redneckz/wildless-cms-uni-blocks 0.14.989 → 0.14.991
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/api/LeadServiceAPI.d.ts +10 -3
- package/bundle/api/getSubmitBody.d.ts +201 -97
- package/bundle/api/sendFile.d.ts +16 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +566 -51
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/bundle/components/ApplicationForm/constants.d.ts +7 -0
- package/bundle/components/ApplicationForm/handlers.d.ts +3 -2
- package/bundle/hooks/useDragAndDrop.d.ts +16 -0
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/bundle/model/InputTypes.d.ts +1 -1
- package/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/bundle/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/bundle/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/constants.d.ts +3 -0
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/bundle/ui-kit/Input/InputFile.d.ts +2 -0
- package/bundle/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/bundle/ui-kit/Input/InputProps.d.ts +6 -1
- package/bundle/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/bundle/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/bundle/ui-kit/Input/constants.d.ts +6 -0
- package/bundle/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/bundle/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/bundle/ui-kit/Input/styles.d.ts +2 -0
- package/bundle/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/bundle/ui-kit/PreventableEvent.d.ts +4 -0
- package/bundle/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/bundle/utils/animateStepWithMinDuration.d.ts +8 -0
- package/bundle/utils/isDateValid.d.ts +4 -0
- package/dist/api/LeadServiceAPI.d.ts +10 -3
- package/dist/api/LeadServiceAPI.js +20 -9
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/api/getSubmitBody.d.ts +201 -97
- package/dist/api/getSubmitBody.js +13 -6
- package/dist/api/getSubmitBody.js.map +1 -1
- package/dist/api/sendFile.d.ts +16 -0
- package/dist/api/sendFile.js +78 -0
- package/dist/api/sendFile.js.map +1 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +5 -6
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/dist/components/ApplicationForm/constants.d.ts +7 -0
- package/dist/components/ApplicationForm/constants.js +29 -0
- package/dist/components/ApplicationForm/constants.js.map +1 -0
- package/dist/components/ApplicationForm/handlers.d.ts +3 -2
- package/dist/components/ApplicationForm/handlers.js +3 -3
- package/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/dist/hooks/useDragAndDrop.d.ts +16 -0
- package/dist/hooks/useDragAndDrop.js +29 -0
- package/dist/hooks/useDragAndDrop.js.map +1 -0
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/model/InputTypes.d.ts +1 -1
- package/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/dist/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/AverageGradeField.js +9 -0
- package/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/dist/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/FileIdField.js +7 -0
- package/dist/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.js +14 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.js +23 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +23 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/dist/ui-kit/FormField/Fields/SelectField.js +7 -0
- package/dist/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/TextField.js +7 -0
- package/dist/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/dist/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/dist/ui-kit/FormField/InputsMap.js +119 -0
- package/dist/ui-kit/FormField/InputsMap.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/constants.d.ts +3 -0
- package/dist/ui-kit/FormField/constants.js +27 -1
- package/dist/ui-kit/FormField/constants.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +2 -94
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +15 -1
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/ui-kit/FormField/validators.js +4 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +2 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputFile.d.ts +2 -0
- package/dist/ui-kit/Input/InputFile.js +75 -0
- package/dist/ui-kit/Input/InputFile.js.map +1 -0
- package/dist/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/dist/ui-kit/Input/InputFileControl.js +10 -0
- package/dist/ui-kit/Input/InputFileControl.js.map +1 -0
- package/dist/ui-kit/Input/InputProps.d.ts +6 -1
- package/dist/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFIleExtension.js +12 -0
- package/dist/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.js +20 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.js +25 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFileSize.js +13 -0
- package/dist/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/dist/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/dist/ui-kit/Input/checks/getFileSignature.js +19 -0
- package/dist/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/dist/ui-kit/Input/constants.d.ts +6 -0
- package/dist/ui-kit/Input/constants.js +9 -0
- package/dist/ui-kit/Input/constants.js.map +1 -0
- package/dist/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/dist/ui-kit/Input/renderFileInput.js +33 -0
- package/dist/ui-kit/Input/renderFileInput.js.map +1 -0
- package/dist/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/dist/ui-kit/Input/renderInfoText.js +14 -0
- package/dist/ui-kit/Input/renderInfoText.js.map +1 -0
- package/dist/ui-kit/Input/styles.d.ts +2 -0
- package/dist/ui-kit/Input/styles.js +5 -0
- package/dist/ui-kit/Input/styles.js.map +1 -0
- package/dist/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/dist/ui-kit/Input/useVerifyFile.js +64 -0
- package/dist/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/dist/ui-kit/PreventableEvent.d.ts +4 -0
- package/dist/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/dist/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/utils/animateStepWithMinDuration.d.ts +8 -0
- package/dist/utils/animateStepWithMinDuration.js +26 -0
- package/dist/utils/animateStepWithMinDuration.js.map +1 -0
- package/dist/utils/isDateValid.d.ts +4 -0
- package/dist/utils/isDateValid.js +24 -0
- package/dist/utils/isDateValid.js.map +1 -0
- package/lib/api/LeadServiceAPI.d.ts +10 -3
- package/lib/api/LeadServiceAPI.js +20 -9
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/api/getSubmitBody.d.ts +201 -97
- package/lib/api/getSubmitBody.js +13 -6
- package/lib/api/getSubmitBody.js.map +1 -1
- package/lib/api/sendFile.d.ts +16 -0
- package/lib/api/sendFile.js +75 -0
- package/lib/api/sendFile.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +2 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +5 -6
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/lib/components/ApplicationForm/constants.d.ts +7 -0
- package/lib/components/ApplicationForm/constants.js +27 -0
- package/lib/components/ApplicationForm/constants.js.map +1 -0
- package/lib/components/ApplicationForm/handlers.d.ts +3 -2
- package/lib/components/ApplicationForm/handlers.js +3 -3
- package/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/hooks/useDragAndDrop.d.ts +16 -0
- package/lib/hooks/useDragAndDrop.js +26 -0
- package/lib/hooks/useDragAndDrop.js.map +1 -0
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/model/InputTypes.d.ts +1 -1
- package/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/lib/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/AverageGradeField.js +7 -0
- package/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/lib/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/FileIdField.js +5 -0
- package/lib/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.js +12 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.js +21 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +21 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/lib/ui-kit/FormField/Fields/SelectField.js +5 -0
- package/lib/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/TextField.js +5 -0
- package/lib/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/lib/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/lib/ui-kit/FormField/InputsMap.js +117 -0
- package/lib/ui-kit/FormField/InputsMap.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/constants.d.ts +3 -0
- package/lib/ui-kit/FormField/constants.js +26 -0
- package/lib/ui-kit/FormField/constants.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +1 -93
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +16 -2
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/lib/ui-kit/FormField/validators.js +2 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +1 -1
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputFile.d.ts +2 -0
- package/lib/ui-kit/Input/InputFile.js +73 -0
- package/lib/ui-kit/Input/InputFile.js.map +1 -0
- package/lib/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/lib/ui-kit/Input/InputFileControl.js +8 -0
- package/lib/ui-kit/Input/InputFileControl.js.map +1 -0
- package/lib/ui-kit/Input/InputProps.d.ts +6 -1
- package/lib/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFIleExtension.js +9 -0
- package/lib/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.js +17 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.js +22 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFileSize.js +10 -0
- package/lib/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/lib/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/lib/ui-kit/Input/checks/getFileSignature.js +16 -0
- package/lib/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/lib/ui-kit/Input/constants.d.ts +6 -0
- package/lib/ui-kit/Input/constants.js +7 -0
- package/lib/ui-kit/Input/constants.js.map +1 -0
- package/lib/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/lib/ui-kit/Input/renderFileInput.js +30 -0
- package/lib/ui-kit/Input/renderFileInput.js.map +1 -0
- package/lib/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/lib/ui-kit/Input/renderInfoText.js +11 -0
- package/lib/ui-kit/Input/renderInfoText.js.map +1 -0
- package/lib/ui-kit/Input/styles.d.ts +2 -0
- package/lib/ui-kit/Input/styles.js +3 -0
- package/lib/ui-kit/Input/styles.js.map +1 -0
- package/lib/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/lib/ui-kit/Input/useVerifyFile.js +61 -0
- package/lib/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/lib/ui-kit/PreventableEvent.d.ts +4 -0
- package/lib/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/lib/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/lib/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/utils/animateStepWithMinDuration.d.ts +8 -0
- package/lib/utils/animateStepWithMinDuration.js +23 -0
- package/lib/utils/animateStepWithMinDuration.js.map +1 -0
- package/lib/utils/isDateValid.d.ts +4 -0
- package/lib/utils/isDateValid.js +21 -0
- package/lib/utils/isDateValid.js.map +1 -0
- package/mobile/bundle/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/bundle/api/getSubmitBody.d.ts +201 -97
- package/mobile/bundle/api/sendFile.d.ts +16 -0
- package/mobile/bundle/bundle.umd.js +566 -51
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/bundle/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/bundle/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/bundle/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/model/InputTypes.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/bundle/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/bundle/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/bundle/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/bundle/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/bundle/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/bundle/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/bundle/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/bundle/utils/isDateValid.d.ts +4 -0
- package/mobile/dist/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/dist/api/LeadServiceAPI.js +20 -9
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/api/getSubmitBody.d.ts +201 -97
- package/mobile/dist/api/getSubmitBody.js +13 -6
- package/mobile/dist/api/getSubmitBody.js.map +1 -1
- package/mobile/dist/api/sendFile.d.ts +16 -0
- package/mobile/dist/api/sendFile.js +78 -0
- package/mobile/dist/api/sendFile.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +5 -6
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/dist/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/dist/components/ApplicationForm/constants.js +29 -0
- package/mobile/dist/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/dist/components/ApplicationForm/handlers.js +3 -3
- package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/dist/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/dist/hooks/useDragAndDrop.js +29 -0
- package/mobile/dist/hooks/useDragAndDrop.js.map +1 -0
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/model/InputTypes.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js +9 -0
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js +14 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.js +23 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +23 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.js +119 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/dist/ui-kit/FormField/constants.js +27 -1
- package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +2 -94
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +15 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/validators.js +4 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +2 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/InputFile.js +75 -0
- package/mobile/dist/ui-kit/Input/InputFile.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.js +10 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.js +12 -0
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.js +20 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.js +25 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.js +13 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.js +19 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/mobile/dist/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/dist/ui-kit/Input/constants.js +9 -0
- package/mobile/dist/ui-kit/Input/constants.js.map +1 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.js +33 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.js.map +1 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.js +14 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.js.map +1 -0
- package/mobile/dist/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/styles.js +5 -0
- package/mobile/dist/ui-kit/Input/styles.js.map +1 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.js +64 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/mobile/dist/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/mobile/dist/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/dist/utils/animateStepWithMinDuration.js +26 -0
- package/mobile/dist/utils/animateStepWithMinDuration.js.map +1 -0
- package/mobile/dist/utils/isDateValid.d.ts +4 -0
- package/mobile/dist/utils/isDateValid.js +24 -0
- package/mobile/dist/utils/isDateValid.js.map +1 -0
- package/mobile/lib/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/lib/api/LeadServiceAPI.js +20 -9
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/api/getSubmitBody.d.ts +201 -97
- package/mobile/lib/api/getSubmitBody.js +13 -6
- package/mobile/lib/api/getSubmitBody.js.map +1 -1
- package/mobile/lib/api/sendFile.d.ts +16 -0
- package/mobile/lib/api/sendFile.js +75 -0
- package/mobile/lib/api/sendFile.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +5 -6
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/lib/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/lib/components/ApplicationForm/constants.js +27 -0
- package/mobile/lib/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/lib/components/ApplicationForm/handlers.js +3 -3
- package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/lib/hooks/useDragAndDrop.js +26 -0
- package/mobile/lib/hooks/useDragAndDrop.js.map +1 -0
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/model/InputTypes.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js +7 -0
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js +12 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.js +21 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +21 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.js +117 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/lib/ui-kit/FormField/constants.js +26 -0
- package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +1 -93
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +16 -2
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js +2 -0
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +1 -1
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/InputFile.js +73 -0
- package/mobile/lib/ui-kit/Input/InputFile.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.js +8 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.js +9 -0
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.js +17 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.js +22 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.js +10 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.js +16 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/mobile/lib/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/lib/ui-kit/Input/constants.js +7 -0
- package/mobile/lib/ui-kit/Input/constants.js.map +1 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.js +30 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.js.map +1 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.js +11 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.js.map +1 -0
- package/mobile/lib/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/styles.js +3 -0
- package/mobile/lib/ui-kit/Input/styles.js.map +1 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.js +61 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/mobile/lib/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/mobile/lib/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/lib/utils/animateStepWithMinDuration.js +23 -0
- package/mobile/lib/utils/animateStepWithMinDuration.js.map +1 -0
- package/mobile/lib/utils/isDateValid.d.ts +4 -0
- package/mobile/lib/utils/isDateValid.js +21 -0
- package/mobile/lib/utils/isDateValid.js.map +1 -0
- package/mobile/src/api/LeadServiceAPI.ts +37 -10
- package/mobile/src/api/getSubmitBody.ts +28 -7
- package/mobile/src/api/sendFile.ts +97 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +192 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +22 -16
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +16 -2
- package/mobile/src/components/ApplicationForm/constants.ts +33 -0
- package/mobile/src/components/ApplicationForm/handlers.ts +5 -3
- package/mobile/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/mobile/src/hooks/useDragAndDrop.ts +48 -0
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/mobile/src/model/InputTypes.ts +1 -1
- package/mobile/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/mobile/src/ui-kit/FormField/Fields/AddressBranchField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/AverageGradeField.tsx +14 -0
- package/mobile/src/ui-kit/FormField/Fields/BirthdayField.tsx +12 -7
- package/mobile/src/ui-kit/FormField/Fields/CommentField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/FileIdField.tsx +7 -0
- package/mobile/src/ui-kit/FormField/Fields/FileUpload.tsx +22 -0
- package/mobile/src/ui-kit/FormField/Fields/InternshipEndDateField.tsx +38 -0
- package/mobile/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +38 -0
- package/mobile/src/ui-kit/FormField/Fields/SelectField.tsx +12 -0
- package/mobile/src/ui-kit/FormField/Fields/TextField.tsx +7 -0
- package/mobile/src/ui-kit/FormField/InputsMap.tsx +133 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +17 -1
- package/mobile/src/ui-kit/FormField/constants.tsx +29 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +1 -105
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +16 -1
- package/mobile/src/ui-kit/FormField/validators.ts +4 -0
- package/mobile/src/ui-kit/Input/Input.tsx +1 -2
- package/mobile/src/ui-kit/Input/InputFile.tsx +132 -0
- package/mobile/src/ui-kit/Input/InputFileControl.tsx +22 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +10 -1
- package/mobile/src/ui-kit/Input/checks/checkFIleExtension.ts +9 -0
- package/mobile/src/ui-kit/Input/checks/checkFileMimeType.ts +20 -0
- package/mobile/src/ui-kit/Input/checks/checkFileSignature.ts +30 -0
- package/mobile/src/ui-kit/Input/checks/checkFileSize.ts +10 -0
- package/mobile/src/ui-kit/Input/checks/getFileSignature.ts +16 -0
- package/mobile/src/ui-kit/Input/constants.ts +6 -0
- package/mobile/src/ui-kit/Input/renderFileInput.tsx +87 -0
- package/mobile/src/ui-kit/Input/renderInfoText.tsx +15 -0
- package/mobile/src/ui-kit/Input/styles.ts +2 -0
- package/mobile/src/ui-kit/Input/useVerifyFile.ts +100 -0
- package/mobile/src/ui-kit/PreventableEvent.ts +5 -0
- package/mobile/src/ui-kit/ProgressBar/ProgressBar.tsx +7 -2
- package/mobile/src/utils/animateStepWithMinDuration.ts +38 -0
- package/mobile/src/utils/isDateValid.ts +33 -0
- package/package.json +2 -2
- package/src/api/LeadServiceAPI.ts +37 -10
- package/src/api/getSubmitBody.ts +28 -7
- package/src/api/sendFile.ts +97 -0
- package/src/components/ApplicationForm/ApplicationForm.example.json +192 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +132 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +22 -16
- package/src/components/ApplicationForm/ApplicationFormContent.ts +16 -2
- package/src/components/ApplicationForm/constants.ts +33 -0
- package/src/components/ApplicationForm/handlers.ts +5 -3
- package/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/src/hooks/useDragAndDrop.ts +48 -0
- package/src/model/FormTypeFieldDef.ts +2 -1
- package/src/model/InputTypes.ts +1 -1
- package/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/src/ui-kit/FormField/Fields/AddressBranchField.tsx +1 -1
- package/src/ui-kit/FormField/Fields/AverageGradeField.tsx +14 -0
- package/src/ui-kit/FormField/Fields/BirthdayField.tsx +12 -7
- package/src/ui-kit/FormField/Fields/CommentField.tsx +1 -1
- package/src/ui-kit/FormField/Fields/FileIdField.tsx +7 -0
- package/src/ui-kit/FormField/Fields/FileUpload.tsx +22 -0
- package/src/ui-kit/FormField/Fields/InternshipEndDateField.tsx +38 -0
- package/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +38 -0
- package/src/ui-kit/FormField/Fields/SelectField.tsx +12 -0
- package/src/ui-kit/FormField/Fields/TextField.tsx +7 -0
- package/src/ui-kit/FormField/InputsMap.tsx +133 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +17 -1
- package/src/ui-kit/FormField/constants.tsx +29 -0
- package/src/ui-kit/FormField/getField.tsx +1 -105
- package/src/ui-kit/FormField/getObjectValidator.tsx +16 -1
- package/src/ui-kit/FormField/validators.ts +4 -0
- package/src/ui-kit/Input/Input.tsx +1 -2
- package/src/ui-kit/Input/InputFile.tsx +132 -0
- package/src/ui-kit/Input/InputFileControl.tsx +22 -0
- package/src/ui-kit/Input/InputProps.ts +10 -1
- package/src/ui-kit/Input/checks/checkFIleExtension.ts +9 -0
- package/src/ui-kit/Input/checks/checkFileMimeType.ts +20 -0
- package/src/ui-kit/Input/checks/checkFileSignature.ts +30 -0
- package/src/ui-kit/Input/checks/checkFileSize.ts +10 -0
- package/src/ui-kit/Input/checks/getFileSignature.ts +16 -0
- package/src/ui-kit/Input/constants.ts +6 -0
- package/src/ui-kit/Input/renderFileInput.tsx +87 -0
- package/src/ui-kit/Input/renderInfoText.tsx +15 -0
- package/src/ui-kit/Input/styles.ts +2 -0
- package/src/ui-kit/Input/useVerifyFile.ts +100 -0
- package/src/ui-kit/PreventableEvent.ts +5 -0
- package/src/ui-kit/ProgressBar/ProgressBar.tsx +7 -2
- package/src/utils/animateStepWithMinDuration.ts +38 -0
- package/src/utils/isDateValid.ts +33 -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),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>x(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),x=(e,t)=>[e].concat(t>0?x(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const r=v[n]||"h3";return o(r,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),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:a,description:i,align:r="text-center",as:l,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:[a?o(w,{className:u("whitespace-normal",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=I,blocksRegistry:l={},ancestors:s=T}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const E=[],D=(e,{key:t,ancestors:n=E,slotName:a=null,extraProps:i,renderProps:r=R,...l})=>{const s=i?(e,t)=>R(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||E,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?D(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function P(){return P._impl()}P._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),P.setup=e=>{P._impl=e};const O=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return O.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),A=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:M,isLocalURL:A,isHash:F,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,W=[B.CDN,$],q=e=>(t,n)=>{if(U(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U=e=>!e||M(e)||F(e)||W.some(z(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},K={small:"16",medium:"24",large:"48",xl:"78"},Y=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&K[l],height:d=s})=>{const m=P(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(L(B.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:G(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(J,{className:e,children:c("svg",{className:u(H[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),G=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},J=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(X.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=P();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog"),fe="/",ye=["/api"];function be(){const e=P(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Q(X.SITE_URL);xe(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const xe=(e,t,n)=>A(e,t)&&![...ye,...X.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Se=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ke=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=be()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Se({className:e,rounded:a,version:n}),children:i})));function Re({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ke,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ee=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},De={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},_e=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&De[n],t),children:e}):null,Pe=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...b})=>{const x=Ee(),v=P(),N=r((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!x;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Re({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[_e(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[Oe(h,y),Me(_({...b,extraProps:{className:"@container-normal"}})),_e(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Oe=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Me=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Fe=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Le=(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,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Le(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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?Ae(n.icon,t):null,o("div",{children:$e(n)})]}))),We=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(je,{benefitsVersion:t,...e},String(n))))}):null)),qe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap($e)}):null)),Ue=d((({isTabularBenefits:e,...t})=>o(e?qe:We,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ke=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(Ye(n))}):null,Ye=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ge(i,l),d=Ge(r,l);return a||i?.icon?o(ke,{className:u("basis-full @lg:basis-auto",e),appendLeft:Je({...i,iconVersion:c}),appendRight:Je({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ge=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Je=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Xe=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Qe=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(Ze)}):null)),Ze=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{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:[Xe(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:b,imageOptions:{imageAlign:x="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ie,{image:b,imageClassName:C}):null,E=o(k,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Pe,{className:e,padding:t,defaultPadding:n,...p?{title:E}:{insetTitle:E},...ot(R,v),isImageSecondary:w,imageAlign:x,isImageAlwaysOnRight:N,buttons:Ke(y),backwardButton:S,...T,children:st(it(D,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(Ue,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Qe,{priceList:e}):null,st=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),ht=(...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 pt=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!pt(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class bt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(pt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class xt extends dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=ht([e=>pt(this._)||"number"==typeof e,()=>bt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>xt.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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},St=[],kt=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=St)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Rt=Ct(((e,t)=>t.reduce(Tt.fn,e))),Et=e=>It(((e,[t,n])=>Dt(n)?[...e,[t,yt(n)]]:e))(e,[]),Dt=e=>0===e.size();Ct(((e,t=St)=>t.reduce(((e,t)=>e.get(t)),e)));const _t=Ct(((e,[t,...n])=>n.length?e.set(t,_t(e.get(t),n)):e.filter((([e])=>e!==t)))),Pt=(Ot=["$ref"]).map(((e,t)=>n=>kt(e)(n[t+n.length-Ot.length]))).reduceRight(ut,mt);var Ot;const Bt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Mt,e),Mt=ht([pt,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),At=(e,t)=>((e,t={})=>n=>Rt(t,Et(n).map((t=>e(t)))))((([e,n])=>{return Pt(e)?[(a=e,a.slice(0,-1)),Bt(t(n),n)]:[e,n];var a}))(e),Ft=e=>Et(e).filter(((e=ft)=>([t])=>e(t))(Pt)),Lt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},Wt=["/portal-resources"],qt=(e,t)=>At(e,(e=>t?.[e])),Ut=(e,t)=>{const n=Lt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?qt(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!Wt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Lt(e)));return i.length?Ht(i,a):a}return t};function Kt(e,t={}){const n=d((t=>{const n=Ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Yt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Yt)||"";return e&&globalThis.sessionStorage?.setItem(Yt,e),e}const Jt=(e={},t=[],n="")=>{const{queryParam:a,value:i}=e,r=((e,t)=>new URLSearchParams(t).get(e))(a??"utm_source",Gt()),l=t.find((e=>e?.id?.toLowerCase()===r?.toLowerCase()))?.value;return l?n?.replace(String(i),l):n},Xt=Kt((({className:e,padding:t,defaultPadding:n,dynamicQueryParamText:a={},dynamicTextSource:i,description:r,title:l,...s})=>{const{textType:c}=a,d=Jt(a,i?.list,"title"===c?l:r),m={title:"title"===c?d:l,description:"description"===c?d:r};return o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...s,children:o(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...m,...s})})})),Qt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Zt(0,t?.length)),[t]),a=t?.[n];return a?o(Xt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Zt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function en(){return en._impl()}en._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),en.setup=e=>{en._impl=e};const tn=async e=>{const t=e.target?.closest("a"),n=en();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Gt();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function nn(){return nn._impl()}function an(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}nn._impl=()=>({forwardQuery:tn}),nn.setup=e=>{nn._impl=e};const rn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],ln=e=>!e?.length,sn=e=>t=>n=>e(n)?[]:[t],on={},cn=[];const dn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function mn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=dn(i,r)?i:r;return!dn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),h=s(un(e)),[p,{setTrue:g,setFalse:f}]=an(!1),y=s({}),[b,{isValid:x,errors:v}]=function(e,t){const n=l((()=>t?.(e)??on),[t,e]),a=l((()=>rn(n)(e)??cn),[n,e]),i=ln(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=p||y.current?.[String(e)],s=t?.validator??b[e],o=l&&s?s(r):[];return{setFieldRef:t=>{h.current&&(h.current[e]=t)},fieldRef:h.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,p,b,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),S=r((e=>{if(e.preventDefault(),x)t&&C(),d?.(m,e);else{const e=hn(m,b);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,x,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:S}]}const un=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),hn=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},pn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function gn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const fn=/^[а-яё-]*$/i,yn=sn((e=>null!=e&&""!==e)),bn="Некорректно заполненное поле",xn=e=>yn(e??bn),vn=e=>sn((e=>e?.key&&""!==e?.key))(e??bn),Nn=e=>sn((e=>"string"==typeof e&&e.length>1&&((e="")=>fn.test(e))(e)))(e??bn),wn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Cn=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Sn=e=>sn(wn)(e),kn=sn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),In=e=>"string"==typeof e&&(10===e.length||12===e.length),Tn={fullName:xn(),addressBranch:vn(),desiredMeetingDate:xn(),product:xn(),localities:xn(),partnerComments:xn(),collectionCount:xn(),acquiringType:vn(),serviceType:vn(),annualRevenue:xn(),feedbackMethod:vn(),serviceDirection:vn(),secondaryPhone:Sn("Укажите номер телефона"),region:vn(),situationDescription:xn(),sufferedFrom:xn(),applierType:xn(),surname:Nn("Укажите свою фамилию на кириллице"),name:Nn("Укажите своё имя на кириллице (без сокращений)"),middleName:Nn("Укажите своё отчество на кириллице"),birthday:xn("Укажите дату рождения"),phone:Sn("Укажите номер телефона"),email:(Rn="Укажите электронную почту",sn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Rn)),inn:(e=>sn((e=>In(e)))(e))("Укажите ИНН"),comment:xn(),typeForm:xn(),consentToReceiveMaterials:kn,consentDataProcessing:kn,partnerSymbolCode:xn("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>sn((e=>Boolean(e?.text)&&In(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:xn("Укажите наименование организации"),callbackTime:xn(),questionProduct:xn(),russianPhone:(e=>sn(Cn)(e))("Укажите номер телефона")};var Rn;const En=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...Tn,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(Dn(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Dn(a)).filter(_n(e)).map((({name:e})=>[e,a[e??""]]))):r},Dn=(e={})=>({name:t})=>Boolean(e[t??""]),_n=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),Pn=()=>{},On={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Bn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Mn=u("bg-main-gray text-main-disabled cursor-not-allowed"),An=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Pn})=>{const y=r("tab"!==c?me(f):f,[c,f]),b=l((()=>ve(m)),[m]),x="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[On[n]]:!s&&!i,[Bn]:i,[Mn]:s},i?"justify-between":"justify-center",i||x?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":x},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...b,onClick:y,children:p})})),Fn=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(Y,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Ln={sm:"max-w-sm top-1/3",lg:"max-w-lg","4xl":"max-w-4xl",none:"mt-0"},zn={center:"relative mx-auto",corner:"absolute bottom-0 right-0"},Vn=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=Ee();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",Ln[t],zn[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Fn,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),$n=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(Vn,{maxWidth:"lg",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?i:r,headlineVersion:"XS",isEmbedded:!0}),o(An,{type:"button",onClick:n,children:"Хорошо"})]})})})),jn=[{key:"ULTRASERVICE",text:"Ультра"}],Wn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],qn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Un="client",Hn=[{key:Un,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],Kn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Yn=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"}],Gn=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],Jn=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],Xn=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Qn=({label:e,required:t=!1})=>e&&t?`${e}*`:e,Zn=e=>o("div",{className:"min-h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),ea=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},ta=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null;function na(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function aa(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return na(globalThis.document,"click",n),t}const ia="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",ra=e=>e?ia:"border-error",la=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:b=!1,children:x,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=x?"pr-3xl":"",I=ra(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[ta(d),y?o("textarea",{className:u("block resize-y min-h-24",sa,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",sa,k,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:b,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),x]})})),sa="w-full border rounded-md text-primary-text outline-none p-m",oa=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,required:y,onChange:b=Pn,...x})=>{const v=aa(f),N=r((e=>{const t=m&&e.length>m;!p&&g(),t||b(ca(e,s))}),[p,b]);return c("div",{className:u("shrink-0 w-full",e),ref:v,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(la,{type:l||"text","aria-label":t,label:Qn({label:t,required:y}),valid:Boolean(!a),onChange:N,placeholder:da({placeholder:d,errors:i,label:t}),value:n,...x})}),Zn(a)]})})),ca=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,da=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ma=d((e=>{const[t,{setFalse:n,setTrue:a}]=an();return o(oa,{isOpen:t,onOpen:a,onClose:n,...e})})),ua=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ma,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),ha=(e,t)=>o(Y,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),pa=e=>e?.text||e?.key||"",ga=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:pa(n)||a,fa=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=Pn,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:h="black",options:p=[]})=>{const g=ya(l,p,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:ga({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":ha(a,h)]})},ya=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,ba=()=>ue(pe.emitter,"popup"),xa=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,va=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=Na,query:l,onChangeQuery:s,disableFilterOptions:d})=>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:xa(t,l,d).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&(s?.(""),i(e))},children:[r(e),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),Na=e=>o("span",{className:"min-h-6",children:pa(e)});const wa=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:h=!1,disabled:p=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=Pn,inputProps:b,disableFilterOptions:x=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:S}]=an(),[k,I]=a(""),T=p||!h&&0===n.length,R=l((()=>ea((e=>y(e)),300)),[y]),E=r((()=>{T||S()}),[T]),D=r((()=>{!m&&I(""),C()}),[h]),_=r((e=>{I(e),h&&f?.({key:e,text:e}),R?.(e)}),[h,f,R]),P={query:k,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},O=function({isOpen:e,options:t,value:n,query:a,onChange:l=Pn,onClose:c=Pn,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=Pn,renderOptions:h}){const p=ba(),g=r((()=>{p.close(),c()}),[c]),f=r((e=>{g(),l(e)}),[g,l]),y=s(null),b=aa(g);return i((()=>{if(!e||!y.current)return;const i=y.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();p.open({popup:o(va,{popupRef:b,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:f,onChangeQuery:u,renderOptions:h}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,f]),y}({onChange:f,onClose:D,disableFilterOptions:x,onChangeQuery:I,...P});return c("div",{className:u("space-y-xs",e),children:[ta(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:O,children:[fa({isDisabled:T,onClose:D,onOpen:E,isManualInput:h,...P,...N}),m&&w?ua({query:k,isDisabled:T,inputProps:b,onChangeQuery:_}):null]})]})})),Ca=d((({className:e="",label:t,error:n,required:a,...i})=>c("div",{className:e,children:[o(wa,{...i,valid:!n,label:Qn({label:t,required:a})}),Zn(n)]}))),Sa=d((({field:e,input:t})=>o(Ca,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Kn,...e(t?.name??""),...t}))),ka=(e="")=>Boolean("trade"===e||"all"===e),Ia=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,isPremium:p,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,b=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${ka(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,x={...y,...Da(o),...Ea(c),...d&&{inn:d},...b?{partnerComments:b}:{},...s?{typeForm:s}:{},...Ra(m?.text,u),...Ta(h),..._a([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(x)?.map((([e,t])=>[e,t?.key||t])))},Ta=e=>e?.key?{isClient:e?.key===Un}:{},Ra=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Ea=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Da=e=>e?{vedTypes:Object.fromEntries(Xn.map((({id:t})=>[t,t===e])))}:{},_a=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),Pa={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Kn[0],serviceType:jn[0],feedbackMethod:qn[0],serviceDirection:Wn[0],vedTypes:Xn[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Oa=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Ba="/api/v1",Ma=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Aa=e=>e?.replace(/[^+\d]/g,""),Fa=(e,t,n)=>{const{typeForm:a,region:i,phone:r="",email:l,birthday:s,desiredMeetingDate:o,inn:c,fullRegion:d,addressBranch:m,secondaryPhone:u="",bankEmpolee:h,applicationDate:p,partnerName:g,russianPhone:f,partnerSymbolCode:y,...b}=e;return{typeForm:a,...Va(i,t),...$a(l,t),...La(r),...La(f),...za(o,"desiredMeetingDate"),...t?za(s):{inn:c},..."FEEDBACK"===a?{}:{addressBranch:m,bankEmpolee:h,applicationDate:p,...ja(u)},...qa(a,n),...Wa(a,{fullRegion:d,partnerName:g,partnerSymbolCode:y}),...b}},La=e=>e?{phone:Aa(e)}:{},za=(e,t="birthday")=>e?{[t]:Ma(e)}:{},Va=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),$a=(e,t=!0)=>({[t?"email":"mail"]:e}),ja=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Aa(e)}:{},Wa=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},qa=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{};function Ua(){return{send:async function(e,t,n=!1){const{serviceDirection:a}=e,i=n&&"Юридическое лицо / ИП"!==a,r=`${Ba}${i?"/lead":"/sendcorporatelead"}`,l=Fa(e,i,t);try{const e=await Ha(r,l);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...La(e)}))(e);try{const e=Ha(`${Ba}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n}){const a={requestId:e,confimationCode:t,leadRequest:Fa(n,!1)};try{const e=await Ha(`${Ba}/confirmCorporateLead`,a);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t=!1){const n=Fa(e,t),a=Ka(n);try{const e=await Ha(`${Ba}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Ha=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),Ka=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:Oa()}},Ya=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},Ga=Ua(),Ja=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),Xa=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(An,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(Ja,{blur:!0,size:"small"}):null,n]}))),Qa=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Za=[{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"}],ei=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Qa,{paths:Za,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",ni(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":ii(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ai(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ti(n)]})})})),ti=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,ni=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ai=(e=!1)=>e?"radio":"checkbox",ii=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ri=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},li={primary:On.primary,secondary:On.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:On.secondary,transparent:"","":""},si=d((e=>{const t=be(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[li[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:p,...ve(m),children:h??oi(r,l)})})),oi=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,ci=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(si,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),di=({consentDataProcessing:e,link:t,button:n,typeForm:a})=>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(ei,{...e}),o(ci,{link:t})]}),Zn(ri(e,kn).error)]}):o(ci,{text:"PF"===a?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(Xa,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),mi=e=>null!=e,ui=new Map,hi=(e,t=ui)=>n=>{const a=gi(n),i=t.get(a);if(a&&mi(i))return i;const r=e(...n);return a&&mi(r)&&t.set(a,Promise.resolve(r)),r},pi=e=>Boolean(e?.every((e=>Array.isArray(e)?pi(e):!e||"string"==typeof e))),gi=e=>pi(e)?e.toString():"",fi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function yi(e,t,{fallback:n,cache:r}={}){const s=l((()=>bi(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(mi))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await hi(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&fi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function bi(e){return Array.isArray(e)?e:e instanceof Function?bi(e()):[e]}const xi=`${Ba}/branches`,vi=[];const Ni=async e=>await zt(e,{method:"GET"})||vi;function wi(e=!1){const{data:t}=yi(`${Ba}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const Ci=(e="")=>"ULTRASERVICE"===e,Si=d((({field:e,input:t,params:n})=>{const a=Ci(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?wi(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=yi(e?`${xi}?regionCode=${e}`:null,Ni);return t||vi}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Ca,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0,...t})})),ki=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ii=(e,t,n)=>Math.max(t,Math.min(e,n));function Ti(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ri({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:r,onChange:t=>{const n=Ti(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const Ei=1,Di=100,_i=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:Ei),max:s=(i.length?i.length-1:Di),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=ki(e,{normalize:(e=0)=>i.length?Pi(i)(e):Ii(e,l,s),format:Xe()}),f=r((e=>{p&&p(Ti(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",ia,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Ri({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),Oi(a)]})})),Pi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Oi=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Bi=["От 1 000 ₽","До 1 000 000 000 ₽"],Mi=d((({field:e,input:t})=>o(_i,{title:"Сумма, ₽",items:Bi,min:1e3,max:1e9,...e(t?.name??""),...t}))),Ai=d((({field:e,input:t})=>o(ma,{label:"Годовая выручка, ₽",...e(t?.name??""),...t}))),Fi=d((({field:e,input:t})=>o(ma,{label:"Дата и время обращения в Банк",...t,...e(t?.name??"")}))),Li=d((({field:e,input:t})=>o(Ca,{label:"Тип обратившегося",...t,options:Hn,...e("applierType")}))),zi=d((({field:e,input:t})=>o(ma,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??""),...t}))),Vi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,weekends:s,onDateClick:c})=>{const d=[];let m=1;for(let u=0;u<6;u++){const h=[];for(let d=0;d<7;d++)if(0===u&&d<t)h.push(o("td",{},`empty-${d}`));else if(m>n)h.push(o("td",{},`empty-${d}`));else{const t=new Date(i,a,m),n=$i(t,e),d=ji(t,r,l),u=Wi(t,s),p=d||u;h.push(o("td",{children:o("div",{className:qi(n,p),onClick:()=>!p&&c(t),children:m})},`day-${m}`)),m++}d.push(o("tr",{children:h},`row-${u}`))}return d},$i=(e,t)=>t&&e.toDateString()===t.toDateString(),ji=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Wi=(e,t)=>{if(!t||0===t.length)return!1;const n=0===e.getDay()?7:e.getDay();return t.includes(n)},qi=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Ui=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Hi=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,weekends:r,onDateSelect:s=Pn})=>{const{firstDayOfWeek:d,totalDays:m}=l((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Ui.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Vi({firstDayOfWeek:d,today:e,totalDays:m,currentYear:n,currentMonth:t,min:a,max:i,weekends:r,onDateClick:s})})]})})),Ki=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Yi(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Gi),r=a.map(((e,t)=>Xi(e)?a.slice(0,t).filter(Xi).length:-1)),l=a.map(((e,t)=>Ji(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Gi=e=>"_"===e,Ji=e=>/\d/.test(e),Xi=e=>Gi(e)||Ji(e),Qi=1940,Zi={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},er=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{nr({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Yi(t,"__.__.____"))},onBlur:()=>{tr(p)?nr({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(Y,{className:"mr-s",...Zi})]})})),tr=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Qi&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},nr=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(tr(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},ar=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(er,{onChange:a,disabled:l,onClick:e,value:t&&Ma(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),ir=Ki.map((e=>({key:e}))),rr=Array.from({length:(new Date).getFullYear()-Qi+1},((e,t)=>Qi+t)).reverse().map((e=>({key:String(e)}))),lr=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},sr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},or={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},cr={className:"min-w-32",iconVersion:"black",isBorder:!1},dr=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,weekends:h,onChange:p})=>{const[g,{setValue:f,setFalse:y}]=an(!1),[b,x]=a(n?.getMonth()||(new Date).getMonth()),[v,N]=a(n?.getFullYear()??(new Date).getFullYear()),w=r((e=>{p?.(e),y()}),[p]),{handlePrevMonth:C,handleNextMonth:S,handleSelectMonth:k,handleSelectYear:I,monthsOptions:T,yearsOptions:R,handleChangeVisibleCalendar:E,ref:D}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=aa(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Ki.indexOf(e));const t=lr(l,Ki.indexOf(e));sr({maxDateOfMonth:t,selectedYear:l,selectedMonth:Ki.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ir,yearsOptions:rr,ref:c}})({onYearSelect:N,onMonthSelect:x,onShowCalendar:f,selectedYear:v,selectedMonth:b,showCalendar:g,onChange:p,value:n}),_=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(D,370);return c("div",{className:u("space-y-xs",e),ref:D,children:[ta(t),c("div",{className:"relative",children:[ar({handleChangeVisibleCalendar:E,value:n,valid:l,onChange:p,disabled:m,setSelectedMonth:x,setSelectedYear:N}),g&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":_}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:C,children:o(Y,{...or,className:"-rotate-90 cursor-pointer"})}),o(wa,{onChange:k,value:{key:Ki[b]},options:T,...cr}),o(wa,{onChange:I,value:{key:String(v)},options:R,...cr}),o("div",{className:"my-auto",onClick:S,children:o(Y,{...or,className:"rotate-90 cursor-pointer"})})]}),o(Hi,{today:n,currentMonth:b,currentYear:v,min:s,max:d,weekends:h,onDateSelect:w})]}):null]})]})})),mr=d((({className:e,label:t,error:n,required:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(dr,{label:Qn({label:t,required:a}),valid:Boolean(!n),...i}),Zn(n)]}))),ur=d((({field:e,input:t})=>o(mr,{label:t?.label||"Дата рождения",...e(t?.name??""),...t}))),hr=d((({field:e,input:t})=>o(Ca,{label:"Когда перезвонить?",...t,options:Yn,...e(t?.name??"")}))),pr=d((({field:e,input:t})=>o(ma,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??""),...t}))),gr=d((({field:e,input:t})=>o(ma,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0,...t})));function fr(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const yr=e=>({value:e?.value||""}),br=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=yr,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(s)},xr=async e=>(await br({url:"suggest/party",query:e})).map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),vr={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},Nr={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},wr=d((({field:e,input:t={}})=>{const n=t.name??"",i=vr[n].linkedFieldName,r=e(i).value,s=r?.data;fr((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=Cr(r),{fullName:a,address:l,inn:s}=t,o=kr(t,i),c=xr(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");fr((async()=>{const e=xr(m);return d(await e),c}),[m]);const h=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[vr[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(Ca,{...t,...Nr[n],options:h,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:Sr})})),Cr=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),Sr=e=>c("span",{children:[o(ze,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(ze,{size:"text-s",font:"font-light",children:e?.key}),o(ze,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),kr=(e,t)=>e?.[vr[t].linkedFieldValue],Ir=d((({field:e,input:t})=>o(mr,{label:"Желаемая дата встречи",...e(t?.name??""),...t}))),Tr=d((({field:e,input:t})=>o(ma,{label:"Электронная почта",...e(t?.name??""),...t}))),Rr=d((({field:e,input:t})=>o(Ca,{label:"Способ получения ответа",options:qn,...e(t?.name??""),...t}))),Er=d((({field:e,input:t})=>o(ma,{label:"ФИО",...e(t?.name??""),...t}))),Dr=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=wi(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(Ca,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??""),...t})})),_r=d((({field:e,input:t})=>o(ma,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),Pr=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(ei,{text:t,value:n,disabled:i,onChange:l},a),Zn(r)]}))),Or=d((({field:e,input:t})=>o(Pr,{...e(t?.name??""),...t,text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Br=`${Ba}/outservice`,Mr=[];async function Ar(){const e=await zt(`${Br}/outserviceregions`);return e&&Array.isArray(e)?e:Mr}const Fr=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=yi("outServiceRegions",Ar),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Ca,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...t,...e(t?.name??""),isSearch:!0})})),Lr=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,zr=d((({field:e,input:t})=>o(ma,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Lr(e,t),...e(t?.name??""),...t}))),Vr=d((({field:e,input:t})=>o(ma,{label:"Имя",maxLength:60,disabled:Lr(e,t),...e(t?.name??""),...t}))),$r=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),jr=d((({field:e,input:t})=>ka(e("acquiringType")?.value?.key)?o($r,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??""),...t}):null)),Wr=d((({field:e,input:t})=>o(ma,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),qr=Kt((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=Ur(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ma,{...e(t.name??""),...t,type:"hidden"})})),Ur=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",Hr=Kt((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ma,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),Kr=e=>"_"===e,Yr=e=>/\d/.test(e),Gr=e=>Kr(e)||Yr(e),Jr=[..."+7 (___) ___-__-__"],Xr=Jr.findIndex(Kr),Qr=Jr.map(((e,t)=>Gr(e)?Jr.slice(0,t).filter(Gr).length:-1));function Zr(e){const t=e.replace(/\D/g,""),n=Jr.map(((e,n)=>Yr(e)?e:t.charAt(Qr[n])||e)),a=Qr.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Xr,a)):n).join("")}const el=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Zr(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(la,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),tl=d((({className:e,label:t,required:n,disabled:a,error:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(el,{"aria-label":t,label:Qn({label:t,required:n}),valid:Boolean(!i),disabled:a,placeholder:"+7 (___) ___-__-__",...r}),Zn(i)]}))),nl=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(tl,{label:"Телефон",disabled:Lr(e,t,n),...e(n),...t})})),al=d((({field:e})=>ka(e("acquiringType")?.value?.key)?o($r,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),il=Kt((({field:e,input:t,source:n})=>o(Ca,{placeholder:"Выберите продукт",label:"Продукт",options:rl(n?.productList),...e(t?.name??""),...t}))),rl=e=>(e??[]).map((e=>({key:e,value:e}))),ll=d((({field:e,input:t})=>o(Ca,{label:"Какой у вас вопрос?",options:Gn,...e(t?.name??""),...t}))),sl=`${Ba}/regions`,ol=[];function cl(e=sl){const{data:t}=yi(e,Vt);return Array.isArray(t)?t:ol}const dl=`${Ba}/outservice/outserviceregions`,ml=d((({field:e,input:t,params:n})=>{var a;const i=cl((a=n?.typeForm,"OUTSERVICE"===a?dl:void 0));return o(Ca,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??""),...t})})),ul=d((({field:e,input:t})=>o(ma,{label:"ФИО представителя",...t,...e("representativeName")}))),hl=d((({field:e})=>{const t=e("secondaryPhone");return o(tl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ri(t,Tn.secondaryPhone):t})})),pl=d((({field:e,input:t})=>o(Ca,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Wn,...e(t?.name??""),...t}))),gl=d((({field:e,input:t})=>o(ma,{label:"Описание ситуации",...t,...e("situationDescription")}))),fl=d((({field:e,input:t})=>o(Ca,{label:"Пострадал в",...t,options:Jn,...e("sufferedFrom")}))),yl=d((({field:e,input:t})=>o(ma,{label:"Фамилия",maxLength:60,disabled:Lr(e,t),...e(t?.name??""),...t}))),bl=["От 1 мес","До 15 лет"],xl=d((({field:e})=>o(_i,{title:"Срок, месяцев",items:bl,min:1,max:180,...e("term")}))),vl=d((({field:e,input:t})=>o(Ca,{label:"Тип обслуживания",options:jn,...e(t?.name??""),...t}))),Nl={horizontal:"@lg:flex-row",vertical:""},wl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Nl[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ei,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),Cl=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(wl,{className:"whitespace-normal",orientation:"horizontal",items:Xn,...e(t?.name??"",{onChange:n}),...t})})})),Sl=d((({field:e,input:t})=>o(ei,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??""),...t}))),kl=d((({onFieldRef:e=Pn,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const Il={$ref:"/wcms-resources/outservice-productlist.json"},Tl={$ref:"/wcms-resources/agenty-dlya-rko.json"},Rl={fullName:Er,addressBranch:Si,desiredMeetingDate:Ir,product:e=>o(il,{...e,source:Il}),localities:Fr,isClient:Or,partnerComments:Wr,collectionCount:pr,acquiringType:Sa,onlineCheckout:jr,posTerminal:al,serviceType:vl,term:xl,amount:Mi,annualRevenue:Ai,vedTypes:Cl,feedbackMethod:Rr,serviceDirection:pl,bankEmpolee:zi,secondaryPhone:hl,applicationDate:Fi,region:e=>Ci(e?.params?.typeForm)?o(Dr,{...e}):o(ml,{...e}),consentToReceiveMaterials:Sl,sufferedFrom:fl,situationDescription:gl,representativeName:ul,applierType:Li,surname:yl,name:Vr,middleName:zr,birthday:ur,phone:nl,email:Tr,inn:_r,comment:gr,fullRegion:Dr,partnerSymbolCode:e=>o(Hr,{...e,source:Tl}),partnerName:e=>o(qr,{...e,source:Tl}),dadataPartyNameSelect:wr,dadataPartyInnSelect:wr,questionProduct:ll,callbackTime:hr,russianPhone:nl},El=(e,t,n={})=>(a,i)=>{const r={...Rl,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o(kl,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:a,params:t})},String(i)):null},Dl=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",_l=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,Pl=(e,t,{typeForm:n,additionalParams:a})=>e.map(((e,i)=>c("div",{className:u(Dl(e.columns),"grid"),children:[_l(e.title),(e?.inputs||[])?.map(El(t,{typeForm:n,...a}))]},`section-${i}`))),Ol=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function Bl({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=Ol(l,t);return r((e=>{i.current=e,o()}),[])}const Ml=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),p=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Al(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Al=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${ra(!n||!a)} rounded-md caret-transparent outline-none`},Fl=d((({disabled:e=!1,onClick:t,text:n})=>o(An,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),Ll=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),zl=d((({className:e,seconds:t})=>o("span",{className:e,children:Vl(t)}))),Vl=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),$l=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:h})=>o(Vn,{maxWidth:"lg",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[jl(u),o(Ml,{values:l,setValues:s,errorText:d,hasError:m}),ql(a,r),e,Wl(n,i),t?o(Ja,{blur:!1}):null]})}))),jl=e=>o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),Wl=(e,t)=>o(Fl,{text:"Далее",disabled:e,onClick:t}),ql=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(zl,{seconds:e})]}):o(An,{embedded:!0,onClick:t,children:o(Ll,{children:"Получить новый код"})}),Ul=e=>180-Math.floor((Date.now()-e)/1e3),Hl=Ua(),Kl=Ua(),Yl=d((({phone:e,onSuccess:t=Pn,onClose:n=Pn,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:h,errorText:p,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:b,setErrorText:x}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(Ul(Date.now()),0),[s,o]=a(""),[c,{setTrue:d,setFalse:m}]=an(!1),[u,h]=a(l),p=r((()=>o("")),[]),g=!e.every(Boolean);return{handleSubmit:r((async()=>{try{d();const a=await Hl.checkCode({code:e.join(""),body:n,reqId:i});if(a?.errorDesc)return void o(a?.errorDesc);h(0),p(),t?.(e.join(""))}catch{o("Неверный код")}finally{m()}}),[e]),hasError:Boolean(s),errorText:s,isLoading:c,timeNextReq:u,isSubmitButtonDisabled:g,setTimeNextReq:h,setErrorText:o}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=Aa(e),N=Bl({seconds:f,onTick:b}),w=r((async()=>{const e=await Kl.sendCode({phone:v});e&&(b(180),N(180),x(""),m(String(e)))}),[v,N,n]);return o($l,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:p,hasError:h,onClose:n})})),Gl={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l})=>{const{phone:s}=e,o=await Ga.sendCode({phone:String(s)});o?a.open({phone:s,formatData:e,reqId:String(o),onSuccess:()=>{a.close(),n.open({ok:!0,typeForm:t}),Ya({aspectsAttributes:i,aspects:r,ev:l})}}):n.open({ok:Boolean(o),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=Pn})=>{const s=await Ga.sendPhoneCallRequest(e);l(),"success"===s?.status?(r.open({ok:!0,typeForm:i}),Ya({aspectsAttributes:t,aspects:n,ev:a})):"error"===s?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(s)}),s&&Ya({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l,withSnowplow:s})=>{const o=await Ga.send(e,i,"lead"===l),c=Boolean(o);if(r.open({ok:c}),c){const{requestId:r}=o,{phone:l}=e,c=i.pathname.split("?")[1],d=JSON.stringify({id:r,phone:String(l),utm:c}),m=s?[...t??[],{aspectName:"snowplowEvent",params:{eventAction:"clickdepapl",eventJSON:d}}]:t;Ya({aspectsAttributes:m,aspects:n,ev:a})}}},Jl=Kt((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,withSnowplow:h,isContacts:p,data:g,onSuccess:f,...y})=>{const b=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Pa[e.name||""]]))),typeForm:{key:t,text:""}}))(b,n)),[b,n]),v=P(),N=nn(),C=l((()=>En(b)),[b]),S=gn($n),k=gn(Yl),I=r((async(e,t)=>{const a=Ia({...e,...m});await Xl(d??"default",{formatData:a,ev:t,typeForm:n,data:g,aspects:N,router:v,responseTypeDialog:S,verifyPhoneDialog:k,onSuccess:f,endpoint:d,withSnowplow:h})}),[n]),[,{field:T,onSubmit:R}]=mn(x,{resetOnSubmit:!0,formValidator:C,onSubmit:I}),E=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(b)?.name,D=E?T("consentDataProcessing"):void 0;return c(pn,{className:u("container space-y-m",e),title:t,...y,children:[c("form",{onSubmit:R,children:[Pl(a,T,{typeForm:n,additionalParams:m}),di({consentDataProcessing:D,link:s,button:i,typeForm:n})]}),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(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Xl=async(e,t)=>{const n=Gl[e]||Gl.default;await n(t)},Ql={creditCard:"кредитной карты",debitCard:"дебетовой карты",credit:"кредита"},Zl=d((({attempts:e,productType:t,onClose:n=Pn})=>{const a=en(),i=e>1,l=r((()=>{a.assign("/natural")}),[]),s=r((()=>{i?l():n()}),[i]);return o(Vn,{onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(C,{align:"text-center",children:"Уважаемый клиент!"}),o(C,{align:"text-center",children:`Для получения ${Ql[t]} Вам необходимо обратиться в офис Банка`}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(An,{type:"button",version:"secondary",onClick:l,children:"Завершить"}),i?null:o(An,{type:"button",onClick:n,children:"Продолжить"})]})]})})}));function es(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function ts(e,t){return es(e,t),es(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class ns{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class as{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const is={};function rs(e,t=is){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const ls=new as;function ss(){return rs(ls)}ts(ls,new ns(globalThis?.sessionStorage));const os=e=>globalThis[e];function cs(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=os(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(os(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(os(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const ds=()=>globalThis.location!==globalThis?.top?.location,ms=()=>{const e=ds(),t=globalThis.document?.body?.scrollHeight,n=ss(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},us="Некорректно заполненное поле",hs="Укажите регион, город/населенный пункт, улицу, дом",ps=/^[0-9а-яё]*$/i,gs=/^[\u0400-\u04FF-\s]+$/u,fs=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,ys=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),bs=()=>sn(ys)(hs),xs=e=>sn((e=>"string"==typeof e&&e.length>1&&gs.test(e)))(e??us),vs=e=>sn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??us),Ns=(e,t,n=!1)=>sn((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??us),ws=e=>sn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),Cs=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},Ss=e=>Is(18,e)("Укажите дату заключения трудового договора"),ks=e=>Is(0,e)("Укажите дату регистрации"),Is=(e,t)=>sn((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),Ts=(e=!1)=>sn((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),Rs=(e=!1)=>sn((t=>In(t)&&Boolean(e)))("Укажите ИНН"),Es={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Ds=e=>ws(Es[e]),_s={processPersonalDataFlg:kn,consentProviderFlg:kn,consentInformFlg:kn,consentPfrFlg:kn,consentOthersFlg:kn,consentFATCA:kn},Ps={addressCourier:bs(),paymentSystem:xn("Укажите тип платежной системы"),currency:xn("Укажите валюту"),cardCategory:xn("Укажите категорию карты"),codeWord:(e=>sn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ps.test(e)))(e??us))("Необходимо ввести кодовое слово"),confirmationIncome:vn(),methodObtain:xn(),deliveryDate:(e=>sn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},Os={organization:vn("Выберите тип организации"),organizationAddress:sn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(hs),organizationPhone:Sn("Укажите номер телефона"),organizationName:xn("Укажите наименование организации"),legalForm:xn("Укажите ОПФ"),lastJobExperience:vs("Укажите стаж на последнем месте работы"),experience5Years:vs("Укажите общий стаж за последние 5 лет"),jobsNumber:vs("Укажите количество мест работы за последние 5 лет"),addressFact:bs(),addressRegistration:bs(),addressRetail:vn("Выберите адрес банка"),addressMatch:xn(),sex:xn("Укажите свой пол"),birthPlace:xn("Укажите место рождения"),education:vn("Выберите ваше образование"),housing:vn("Выберите тип жилья"),amountWorkers:vn("Выберите информацию о количестве сотрудников"),employment:vn("Выберите информацию о трудоустройстве"),employerActivities:vn("Выберите вид деятельности организации"),employerOrganization:vn("Выберите вид организации"),positionOrganization:vn("Выберите вашу должность"),familyStatus:vn("Выберите семейное положение"),familyMembers:Ns(2,"Укажите количество членов семьи"),children:Ns(2,"Укажите количество детей"),dependents:Ns(2,"Укажите количество иждивенцев"),snils:(e=>sn(Cs)(e))("Некорректный номер СНИЛС"),conscription:xn(),armyIdFlg:kn,dulSerie:Ns(4,"Укажите серию паспорта",!0),dulNumber:Ns(6,"Укажите номер паспорта",!0),dulSubdivisionCode:Ns(7,"Укажите код подразделения",!0),dulIssuedBy:xn("Укажите организацию, выдавшую паспорт"),retirementIncome:xn(),otherIncome:xn(),wages:xn(),mandatoryPayments:Ns(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:xn(),shareholderFlg:xn(),legalEntityName:xn(),bankEmployeeCode:xn(),partInBusiness:xn(),regionRetail:vn("Выберите регион"),latinSurname:xn("Укажите фамилию"),surname:xs("Укажите свою фамилию на кириллице"),name:xs("Укажите своё имя на кириллице"),middleName:xs("Укажите своё отчество на кириллице")},Bs={...Os,...Ps,..._s},Ms={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var As;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(As||(As={}));const Fs=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice");return Boolean(e)},Ls="/light-api-cash/v1",zs="/api/credit-application",Vs=async(e,t,n)=>{try{return(await $s(e,t,n)).json()}catch(e){return console.error(e),null}};async function $s(e,t,n){const a=Fs(),i=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`${a?zs:Ls}${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":i,"X-B3-Traceid":i,...js()},credentials:"include",body:n?JSON.stringify(n):null})}const js=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Ws=d((({onChangeEsiaStatus:e,productType:t})=>{const n=en(),a=ss().frameLocation,i=r((async()=>{try{const e=await(async e=>{const t=Fs();return await Vs((t?"/user-data":"")+"/esia/getLink","POST",e)})({redirectUri:a||globalThis.location.origin+globalThis.location.pathname});e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(As.Error)}}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?": ":"")}),c("ul","debitCard"===t?{className:"list-disc list-inside",children:[o("li",{children:"значительно сократит время оформления заявки"}),o("li",{children:"доступна курьерская доставка в г. Москва (в пределах МКАД)"})]}:{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(An,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),qs={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},Us={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=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:qs,addressFact:qs,organizationAddress:qs,addressCourier:qs},Hs=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const Ks=d((({value:e="",onChange:t=Pn,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...h})=>{const[p,{setFalse:g,setTrue:f}]=an(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=ba(),y=Us[n],b=r((()=>{h.current=t,f.close()}),[t]),x=r((e=>{b(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[b,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await br({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>ea(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Hs,{options:p,container:n,value:t,onChange:x}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,x]),v}({isOpen:p&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),b=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(oa,{value:e,onChange:b,inputRef:y,isOpen:p,onOpen:f,onClose:g,...h})})),Ys=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Gs(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Ks,{disabled:Lr(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Gs=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house,...Js(e)}),Js=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Xs(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Xs=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",Qs=Kt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Gs(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Ks,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Zs=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(Gs(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Ks,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),eo=d((({field:e,input:t})=>o(Pr,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),to=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:no({textItems:r,subText:t,children:n,isPhone:a,...i})})),no=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||ao(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),ao=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${io(e)}`,children:e.trim()}):e.trim()},String(n)))),io=e=>e.replace(/\D/g,""),ro=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}))),lo=d((({isUnfolded:e,...t})=>o(Y,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),so=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(An,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Ll,{children:a}),o(lo,{isUnfolded:t,iconVersion:i?"color":""})]}))),oo=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const co=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),mo=d((({children:e})=>{const[t,{toggle:n}]=an(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(oo,{className:"block sm:hidden",children:[o(co,{isUnfolded:t,children:e}),o(so,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),uo=e=>{const t=po(e);return o(to,{label:"Режим работы",value:t,className:"max-w-none"})},ho=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",po=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ho({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),ho({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},go=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],fo=e=>go.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),yo=e=>{if(!e)return null;const t=bo(e);return c(ro,{className:"border-none",children:[o(to,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(xo)})}),o(to,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},bo=e=>{const t=go.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},xo=({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(ze,{size:"text-xs",children:e})},String(n)),vo=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(to,{label:"Валюта",value:e.currency}):null,t?o(to,{label:"Купить",value:String(t)}):null,n?o(to,{label:"Продать",value:String(n)}):null]},String(a)),No={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"}},wo=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",No[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:No[n].text,children:t})]}))),Co=(new Date).getDay(),So=e=>{const[t]=e?.slice(Co-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(wo,{color:"green",children:i}):null,n&&r?o(wo,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(wo,{color:"red",children:"Выходной"})},ko=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Io=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(to,{label:e,value:t&&n?n:"",subText:ko({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),To=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ro=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Eo=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Do=(e,t)=>{if(!e.workSchedule)return null;const n=fo(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),So(n)]}),o(mo,{children:_o(e)})]},String(t))},_o=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=fo(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ro,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(to,{label:"Факс",value:t,isPhone:!0}),o(to,{label:"Телефон филиала",value:e,isPhone:!0}),o(to,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(to,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(to,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(to,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(ro,{children:o(to,{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(Io)})})}):c(ro,{children:[o(to,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(xo)})}),uo(d)]}),l?.businessScheduleVisibleTag?yo(l?.businessScheduleDescription):null,s?.currencies?.length?o(ro,{className:"flex-wrap",children:s?.currencies?.map(vo)}):null]})},Po=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=fo(e),n=e?po(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?To(n):Eo(n,a):Ro(n):""})(n)}`;return{header:a,body:r}},Oo={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},Bo={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},Mo={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},Ao=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Mo[t](e)))))},Fo=()=>{},Lo=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Fo,getBalloonRemoteWorkplaces:i=Fo})=>{const[r,s,o,c]=l((()=>{const r=Ao(e,n),l=Ao(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},zo=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Vo=d((({children:e})=>zo?e:null)),$o="/icons/MapMarkerClusterIcon.svg",jo="/icons/MapMarkerClusterYellowIcon.svg";function Wo({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=qo("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=qo("workplaces",e,i),l=Uo(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Uo(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=Uo(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const qo=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?$o:jo,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Uo=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?$o:jo,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Ho={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ko={...Ho,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Yo=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ko).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Go={...Ho,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Jo=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Go).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:n,width:"20",height:"16"})})})),Xo=[55.753995,37.614069],Qo=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=cs("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?Wo({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Zo(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Wo({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(Ja,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Jo,{yandexMaps:l}),o(Jo,{yandexMaps:l,direction:"out"})]}),Yo(l,m,u("right-2 top-80",h))]})})),Zo=e=>{const t=[tc(ec(e,0)),tc(ec(e,1))];return t.every((e=>e))?t:Xo},ec=(e,t)=>e.map((e=>e.coords?.[t])),tc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,nc=e=>Number(e.toString().replace(",",".")),ac=e=>{const t=Fs(),{data:n,error:a}=yi(`${t?`${zs}/public-data`:Ls}/dictionary?dictionaryType=${encodeURIComponent(e)}`,ic);return n&&"errorMessage"in n?{error:a}:{data:n,error:a}},ic=async e=>await zt(e,{method:"POST"})||[],rc=new as;function lc(e){return rs(rc,e)}ts(rc,new ns(globalThis?.localStorage));const sc=()=>lc(),oc=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=ac("REGION_RF"),{programId:s}=sc(),d="38"===s,m=e("regionRetail")?.value||{},u=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await Vs("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:nc(e.latitude??Xo[0]),gpsLongitude:nc(e.longitude??Xo[1])})))||[]})(m?.key??"");r(e)})()}),[m.key]);const{points:h}=Lo({data:n,filtrationState:{},getBalloon:Po});return c("div",{children:[o(Ca,{label:"Адрес отделения",placeholder:"Выберите отделение",disabled:d,options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...u,isSearch:!0}),o("div",{className:"h-[600px]",children:o(Vo,{children:o(Qo,{points:h,isLoad:!l,className:"h-full",selectedAddress:u?.value?.text})})})]})})),cc=Kt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,onChange:r,...l})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Ca,{placeholder:a,options:s,...e(n),...l,onChange:r??e(n)?.onChange})})),dc=d((({field:e,input:t})=>{const n=sc();return o(cc,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",...t})})),mc=d((({field:e,input:t})=>o(Pr,{text:"Наличие военного билета",...e(t?.name??"")}))),uc=d((({className:e,label:t,required:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(wl,{label:Qn({label:t,required:n}),...i}),Zn(a)]}))),hc=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],pc=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(uc,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:hc,value:n,onChange:l}),"true"===n?o(Ks,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),gc=d((({field:e,input:t})=>o(Pr,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),fc=d((({field:e,input:t})=>o(mr,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Lr(e,t),maxDate:new Date}))),yc=d((({field:e,input:t})=>o(Ks,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Lr(e,t)})));function bc(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const xc=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:a?o(ie,{image:a,className:"block w-max"}):o(Y,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),vc=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=bc("programId"),{productType:m,leadForm:u}=sc(),h="debitCard"===m,p=Boolean(e("esiaAccountTypeCd")?.value?.key),{value:g,onChange:f}=e("cardCategory"),y=e("paymentSystem")?.value?.key,b="office"===u?.methodObtain,x=e("cardCategory")?.value?.text?.toLowerCase()?.includes("неимен"),v=r((e=>0!==e.length?{key:e[0].key,text:e[0].value}:null),[y]),N=r((t=>{f?.(t),e("isMomentDebitCard")?.onChange?.(t?.text?.toLowerCase()?.includes("неимен"))}),[]);i((()=>{y&&d&&(async()=>{const t=await(async(e,t)=>{const n=await Vs("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(y,d),n=!h||p&&!b?t:wc(t);s(n),Nc(n,g)||f?.(v(n)),h&&e("isMomentDebitCard")?.onChange?.(x)})()}),[y,v,x]);const w=l((()=>n?.find((e=>e.key===g?.key))?.description),[n,g]);return c("div",{children:[o(cc,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",...t,onChange:N}),w?o(xc,{__html:w}):null]})})),Nc=(e,t)=>e.some((e=>e.key===t?.key)),wc=e=>e.filter((e=>e.value&&e.value.toLowerCase().includes(" именная"))),Cc=d((({field:e,input:t})=>o(Ks,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),Sc=d((({field:e,input:t})=>o(Ks,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t}))),kc=d((({field:e,input:t})=>{const{data:n}=ac("INCOME_CERT_UNITED"),a=Lr(e,t);return c("div",{className:"space-y-xl",children:[a?o(xc,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(cc,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",...t,disabled:a})]})})),Ic=d((({field:e,input:t})=>{const{data:n}=ac("MILITARY_STATUS");return o(cc,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",...t})})),Tc=()=>lc(),Rc=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Ee();return c(Vn,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(An,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Ec=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=an(!1),{open:l}=gn(Rc),s=Ee();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=await $s(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},Dc=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=Ec(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ei,{...a}),n?c(An,{embedded:!0,onClick:i,children:[o(Ll,{children:"Ознакомиться"}),r?o(Ja,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),Zn(t)]})})),_c=d((({field:e,input:t})=>{const{productType:n}=Tc(),a=Ms[n??""];return t&&t.name?o(Dc,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),Pc=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Oc="flex flex-col justify-between lg:flex-row gap-4xl",Bc="flex flex-col lg:w-1/2 gap-2xl",Mc="flex flex-col gap-y-xl min-w-52",Ac=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Xe(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Fc=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Ac,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),Lc=e=>Vc([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),zc=(e=[],t=!1,n=[])=>({...Vc([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),Vc=(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]},$c=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,jc=({min:e=0,max:t=0,availableMonths:n,...a})=>o(_i,{items:[`От ${Wc(e)}`,`До ${Wc(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Wc=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,qc=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(wl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Uc=e=>qc({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Hc=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(_i,{items:e?[`От ${Xe(1)(a.min||0)} ${n}`,`До ${Xe(1)(a.max||0)} ${n}`]:[],step:t,...a}),Kc=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(Ii(t?.[i],n.minMonths,n.maxMonths))},Yc=Math.round(29.5),Gc=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Jc=e=>e,Xc=(e=Jc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Qc=Xc(),Zc=(e=Jc)=>Xc((t=>-e(t))),ed=Zc(),td=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:nd([e,t],a),nd=([e,t],n=[])=>({[e]:n.length?ed(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Qc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ad=(e,[t,n],a)=>e>=a[t]&&e<=a[n],id={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},rd=e=>ld({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ld({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&ld({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&ld({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ld=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],sd=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[id],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>rd({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=td(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=td(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>rd({row:e,userInputParams:t,paramsViewSettings:n})&&ad(a,["minSum","maxSum"],e)&&ad(i,["minMonths","maxMonths"],e)))||id)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Gc(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},od=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),cd=(e,t=0)=>e?.sum?e.sum:t,dd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,md=e=>({moneyValue:cd(e,2e5),monthsValue:dd(e,Yc),monthlyPayment:0,rate:0,isAnnuity:Boolean(e?.isAnnuity),isInsurance:Boolean(e?.isEnableInsurance),isSalaryClient:Boolean(e?.isEnableSalaryClient),isPensionClient:Boolean(e?.isEnablePensionClient),isStateEmployee:Boolean(e?.isEnableStateEmployee)}),ud={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},hd=Kt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=Lc(n?.rateRows),g=r((e=>{const t=sd(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=mn(md(d),{onChange:g}),b=sd(f,n,s),x=Uc({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(Ii(f.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Ii(f.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!od(d)&&p&&Kc({field:y,defParams:p,calcParams:b,map:ud,monthsValue:"minMonths"})}),[n,d]),o(Pc,{className:e,title:t,...h,children:c("section",{className:u(Oc,e),children:[c("div",{className:Bc,children:[Hc({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...y("moneyValue"),value:b.moneyValue}),jc({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...y("monthsValue"),value:b.monthsValue}),pd({...b,...s},y),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(Mc,"@4xl:w-1/2"),children:[o(Fc,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Fc,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(Fc,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),Ke(a,{isVertical:!0}),$c(l)]})]})})})),pd=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ei,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ei,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ei,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ei,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),gd="calculator",fd=d((({field:e,params:t})=>{const[n,l]=a(),s=e(gd)?.value,c=r((t=>{e(gd).onChange?.(t)}),[]);return i((()=>{t?.calcData?.defaultParams&&l(s?bd(e(gd).value):t?.calcData?.defaultParams)}),[t?.calcData?.defaultParams]),i((()=>{n&&c(md(n))}),[n]),n?o(hd,{...t?.calcData,defaultParams:n,padding:"p-0",onChange:c}):o(Ja,{})})),yd={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},bd=(e,t=!1)=>{const n=t?xd(yd):yd;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},xd=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),vd=d((({field:e,input:t})=>{const{data:n}=ac("CREDIT_IN_RSHB");return o(cc,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Nd={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},wd=[{id:"810",text:"Рубли"}],Cd=d((({field:e,input:t})=>{const{data:n}=ac("CURRENCY"),{programId:a}=Tc(),i=l((()=>!Object.keys(Nd).includes(a||"")||"38"===a),[]),r=l((()=>i?wd:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(uc,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??""),...t})})),Sd=(e,t)=>{if(!t)return null;const n=Rd(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},kd=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Id=(e,t)=>{const n=Rd(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Td=(e,t,n)=>{const a=Rd(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Rd=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Ed={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},Dd=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=_d(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Gs(n.data?.address));const s={amountWorkers:kd(e?.amountWorkers,n.data?.employee_count),employerActivities:Sd(e?.employerActivities??[],a),organization:Td(e?.organization??[],i,r),employerOrganization:Id(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},_d=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Pd=d((({field:e,input:t})=>{const n=sc(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,h=e?.("esiaAccountTypeCd")?.value,p=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{Dd(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{const n=Fs();await Promise.all(Object.entries(e).map((e=>{const[a,i]=e;Vs(`${n?"/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(i)}`,"POST").then((e=>{t[a]=e}))})))})(Ed,n)})()}),[]),i((()=>{h&&p&&Od(n)&&(async()=>{const t=await(async e=>{const t=await br({url:"suggest/party",query:e});return t?.[0]})(p);t&&Dd(n,e,t)})()}),[c,d,m,u]);const b=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Ks,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:Lr(e,t),onChange:b,error:l||e("inn")?.error})})),Od=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},Bd=new Date(Date.now()+864e5),Md=d((({field:e,input:t})=>{const{productType:n}=sc(),a="debitCard"===n,i=a?Bd:new Date,{data:r}=ac("DAYS_DELIVERY_SETTINGS"),s=l((()=>{const e=r?.find((e=>"WEEKEND"===e.key));return e&&e.value?e.value.split(",").map(Number):[]}),[r]);return o(mr,{label:"Дата доставки",...e(t?.name??""),minDate:i,weekends:a?s:[]})})),Ad=d((({field:e,input:t})=>{const{productType:n}=sc(),a="debitCard"===n,{data:i}=ac("COURIER_DELIVERY_TIME"),r=["TIME_1","TIME_2","TIME_3"],s=["TIME_4","TIME_5"],c=l((()=>{const e=a?s:r;return(i||[]).filter((t=>t.key&&e.includes(t.key))).map((e=>({id:e.key,text:e.value})))}),[i,a]);return o(uc,{label:"Время доставки",className:"flex-row",items:c,...e(t?.name??"")})})),Fd=d((({field:e,input:t})=>o(Ks,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Ld=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(mr,{label:"Дата выдачи",...e(t?.name??""),disabled:Lr(e,t),minDate:a,maxDate:new Date,...t})})),zd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(Ks,{disabled:Lr(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),Vd=d((({field:e,input:t})=>o(Ks,{disabled:Lr(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??""),...t}))),$d=d((({field:e,input:t})=>o(Ks,{disabled:Lr(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??""),...t}))),jd=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(Yi(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(Ks,{disabled:Lr(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Wd=d((({field:e,input:t})=>{const{data:n}=ac("EDUCATION_LEVEL");return o(cc,{field:e,source:n,label:"Образование",fieldName:"education",...t})})),qd=d((({field:e,input:t})=>{const n=r((t=>{(fs.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o(Ks,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),Ud=d((({field:e,input:t})=>{const n=sc();return o(cc,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",...t})})),Hd=d((({field:e,input:t})=>{const n=sc();return o(cc,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Kd=d((({field:e,input:t})=>{const{data:n}=ac("EMPLOYMENT_INFO_UNITED");return o(cc,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",...t})})),Yd=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,5)))),[]);return o(Ks,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Lr(e,t)})})),Gd=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Ks,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,...t,onChange:a})})),Jd=d((({field:e,input:t})=>{const{data:n}=ac("MARITAL_STATUS");return o(cc,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",...t})})),Xd=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(Ks,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Lr(e,t)})})),Qd=d((({field:e,input:t})=>{const{data:n}=ac("HOUSE_TYPE");return o(cc,{field:e,source:n,label:"Тип жилья",fieldName:"housing",...t})})),Zd=d((({input:e})=>o(xc,{__html:e?.label}))),em=d((({field:e,input:t})=>o(Pr,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),tm=d((({field:e,input:t})=>o(Ks,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Lr(e,t)}))),nm=d((({field:e,input:t})=>o(Ks,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Lr(e,t)}))),am=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,im=(e="",t="")=>am.test(e)&&t.length<20&&e.length+t.length<=20,rm={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "},lm=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>rm[e.toLowerCase()].toUpperCase()||"")),sm=(e,t)=>{let n=lm(e);const a=lm(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},om=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=sm(a,l);s?.(e)}),[]);const c=r((e=>{(im(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ma,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),cm=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=sm(a,l);s?.(e)}),[]);const c=r((e=>{(im(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ma,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),dm=d((({field:e,input:t})=>o(Ks,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),mm=d((({field:e,input:t})=>o(Ks,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),um=d((({field:e,input:t})=>o(mr,{label:"Дата рождения",...e(t?.name??""),...t,disabled:Lr(e,t)}))),hm=d((({field:e,input:t})=>o(Ks,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),pm=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],gm=d((({field:e,input:t})=>o(uc,{orientation:"horizontal",items:pm,...e(t?.name??"")}))),fm=d((({field:e,input:t})=>{const n=r((t=>{(gs.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(Ks,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Lr(e,t),...e(t?.name??""),...t,onChange:n})})),ym=d((({field:e,input:t})=>{const n=r((t=>{(gs.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(Ks,{label:"Имя",maxLength:40,disabled:Lr(e,t),...e(t?.name??""),...t,onChange:n})})),bm=d((({field:e,input:t})=>{const n=sc();return o(cc,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),xm=d((({field:e,input:t})=>{const n=sc(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{Dd(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(Ks,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Lr(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),vm=d((({field:e,input:t})=>o(Ks,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Nm=d((({field:e,input:t})=>o(mr,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date,...t}))),wm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Ii(Number(n),0,100)))),[]);return o(Ks,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),Cm=e=>e.map((e=>({key:e.type,text:e.name}))),Sm=e=>e?.key,km=[{key:"PAYMENT_SYSTEM_TYPE_3",text:"UnionPay"}],Im=d((({field:e,input:t})=>{const[n,i]=a([]),r=lc(),s=ss();fr((async()=>{const{programId:e}=r,{claimChannelCode:t}=s;if(e){const n=t?km:await(async e=>{const t=await Vs("/public-data/creditProgramConditions","POST",{creditProgramId:e});return Cm(t?.paymentSystems||[])})(e);i(n??[])}}),[]);const c=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(uc,{label:"Платежная система",orientation:"horizontal",items:c,...e(t?.name??"",{format:Sm,parse:e=>n?.find((t=>t.key===e))}),...t})})),Tm=d((({field:e,input:t})=>{const{data:n}=ac("POSITION");return o(cc,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",...t})})),Rm=async()=>await Vs("/public-data/regionsCardDelivery","GET")||void 0,Em={key:"REGION_77",text:"Москва и Московская область"},Dm={key:"3041100",text:"Аэропорт Шереметьево, МО, г.Химки, Шереметьевское шоссе, вл39с1"},_m={key:"REGION_77",text:"Москва и Московская область"},Pm={key:"3",text:"г. Москва, Пресненская наб., д. 10, стр. 2"},Om=d((({field:e,input:t})=>{const{programId:n,productType:a,leadForm:l}=sc(),s=l?.regionRetail,{data:c}=ac("REGION_RF"),{data:d}=yi("regionsDelivery",Rm),{data:m}=ac(Bm(a)),u=ss(),h="debitCard"===a,p="38"===n,g=Boolean(e("esiaAccountTypeCd")?.value?.key),f=c?.map((({key:e,value:t})=>({key:e,text:t}))),y="true"===m?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,b=e("regionRetail")?.onChange,x=e("addressRetail")?.onChange,v=e("regionHasDelivery")?.onChange,N=e("methodObtain")?.onChange,w=r((e=>(!h||g&&!p)&&y&&d?.find((t=>t.regionCode===e.key))?.deliveryFlg),[y,d]),C=r((e=>{const t=w(e);v?.(t),N?.(t?"courier":"office"),b?.(e),x?.("")}),[d,y,g]);return i((()=>{if(u.claimChannelCode)b?.(Em),x?.(Dm),v?.(w(Em)),N?.("office");else if(p)b?.(_m),x?.(Pm),N?.("office");else if(s){const e=w(s);v?.(e),N?.(e?"courier":"office"),b?.(s)}}),[w]),o(Ca,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,disabled:p,options:f,...e(t?.name??""),...t,onChange:C})})),Bm=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Mm=d((({field:e,input:t})=>o(Ks,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),Am=["male","female"],Fm=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Lm=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await br({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Am.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(uc,{label:"Пол",orientation:"horizontal",items:Fm,...e(t?.name??""),...t})})),zm=d((({field:e,input:t})=>o(Pr,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Vm=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(Yi(e,"___-___-___ __")):t?.(Yi(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(la,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),$m=d((({className:e,label:t,required:n,value:a,error:i,onChange:r,onBlur:l,...s})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Vm,{"aria-label":t,label:Qn({label:t,required:n}),valid:Boolean(!i),value:a,onChange:r,onBlur:l,placeholder:"___-___-___ __",...s}),Zn(i)]}))),jm=d((({field:e,input:t})=>o($m,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Wm=d((({field:e,input:t})=>{const n=r((t=>{(gs.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(Ks,{label:"Фамилия",maxLength:40,disabled:Lr(e,t),...e(t?.name??""),...t,onChange:n})})),qm=d((({field:e,input:t})=>o(Ks,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Lr(e,t)}))),Um={$ref:"/wcms-resources/delivery-cities-data.json"},Hm={limitedBirthday:um,name:ym,surname:Wm,middleName:fm,email:qd},Km={processPersonalDataFlg:_c,consentProviderFlg:_c,consentOthersFlg:_c,consentInformFlg:_c,consentPfrFlg:_c,consentFATCA:_c},Ym={organization:bm,organizationAddress:Ys,organizationPhone:nl,organizationName:xm,legalForm:mm,generalSeniority:Xd,lastJobExperience:nm,experience5Years:Yd,jobsNumber:tm,beginDate:fc,addressFact:Zs,addressRegistration:Ys,addressRetail:oc,addressMatch:eo,sex:Lm,birthPlace:yc,education:Wd,housing:Qd,amountWorkers:dc,employment:Kd,employerActivities:Ud,employerOrganization:Hd,positionOrganization:Tm,familyStatus:Jd,familyMembers:Gd,children:Cc,dependents:Fd,snils:jm,conscription:Ic,armyIdFlg:mc,dulSerie:$d,dulNumber:Vd,dulIssueDate:Ld,dulSubdivisionCode:jd,dulIssuedBy:zd,participantDateRegistration:Nm,retirementIncome:Mm,otherIncome:vm,wages:qm,mandatoryPayments:hm,bankruptcyFlg:gc,initiateBankruptcyFlg:em,shareholderFlg:zm,legalEntityName:dm,creditInRshbCd:vd,bankEmployeeCode:pc,partInBusiness:wm,regionRetail:Om,infoCard:Zd,calculator:fd,confirmationIncome:kc,inn:Pd,...Hm},Gm={addressCourier:e=>o(Qs,{...e,source:Um}),paymentSystem:Im,currency:Cd,cardCategory:vc,codeWord:Sc,methodObtain:gm,deliveryDate:Md,latinName:om,latinSurname:cm,deliveryTime:Ad},Jm="Согласие на все документы",Xm=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ri(t(e?.name),kn).error)))),[e]),[d,{toggle:m}]=an(!0);return o("div",{className:"w-fit",children:c(oo,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ei,{text:Jm,value:a,onChange:i},n),Zn(s?"Отметьте все обязательные соглашения":"")]}),o(An,{embedded:!0,ariaLabel:Jm,onClick:m,children:o(lo,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(co,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(El(t,{},Km))})]})})})),Qm=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=Zm(t||[],n);return a.length>2?c("div",{children:[i.map(El(e,{},{...Hm})),o(Xm,{inputs:a,field:e})]}):(t||[])?.map(El(e,{},{...Hm}))},Zm=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(Ms[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(Ms[t]).includes(String(e))))}),eu=(e,t=!1)=>o(Xa,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),tu=async e=>await Vs("/user-data/createDraftTask","POST",e)||{},nu=e=>$s("/referal/saveReferalInfo","POST",e),au=e=>$s("/user-data/updateUserProfile","PUT",e),iu=e=>$s("/user-data/updateUserTask","PUT",e),ru={width:"103",height:"21"},lu={"bg-white":"color",transparent:"white"},su={"bg-white":"text-primary-main",transparent:"text-white"},ou=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:lu[e]},className:su[e],width:n?.width,height:n?.height}),cu={"bg-white":"text-primary-text",transparent:"text-white"},du=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ve(s),children:[ou(r,n?.image,ru),l?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:cu[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),mu=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=an(!1),{closeAll:y}=ge(),b=r((async()=>{g();await(async e=>{const t=Fs();return await $s((t?"/user-data":"")+"/sms/checkCaptcha","POST",{captchaText:e.captchaText,...t&&{phoneNumber:e?.phoneNumber}}).then((e=>e.text())).then((e=>"ERROR"!==e))})({captchaText:d,phoneNumber:e})?(n?.(),t?.()):h(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(async e=>{const t=Fs();return await $s(`${t?"/user-data":""}/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob))})(e)))})()}),[]);return i(x,[]),o(Vn,{head:o(du,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(An,{className:"w-8",embedded:!0,onClick:x,children:o(Y,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(la,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(An,{version:"secondary",onClick:y,children:"Вернуться"}),o(Xa,{version:"secondary",disabled:!d,onClick:b,children:"Отправить"})]}),p?o(Ja,{blur:!1}):null]})})})),uu=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},hu=({values:e,phoneNumber:t,onSuccess:n,onFail:l})=>{const s=ss(),o=s.smsCode?.attempts||0,c=Math.max(Ul(s.smsCode?.sendTime||Date.now()),0),[d,m]=a(""),[u,{setTrue:h,setFalse:p}]=an(!1),[g,f]=a(c),y=r((()=>m("")),[]),b=Boolean(0===g&&s.smsCode?.sendTime),x=o>2||b||!e.every(Boolean),v=r((async()=>{s.smsCode={...s.smsCode,attempts:o+1},h();const a=await(async e=>{const t=Fs();return await $s((t?"/user-data":"")+"/sms/checkCode","POST",{smsText:e.smsText,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName,...t&&{phoneNumber:e?.phoneNumber}})})({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"},phoneNumber:t});if(a.ok){const t=await a.json();uu(t),f(0),y(),s.smsCode=null,n?.(e.join(""))}else 403===a.status?m(o>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):l();p()}),[e,o]);return i((()=>{b?m("Код просрочен"):o>2&&m("Исчерпан лимит ввода смс-кода")}),[b]),{handleSubmit:v,hasError:Boolean(d),errorText:d,isLoading:u,timeNextReq:g,isSubmitButtonDisabled:x,setTimeNextReq:f,setErrorText:m}},pu=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=Pn,onClose:s=Pn,onFail:c=Pn})=>{const[d,m]=a(Array(4).fill("")),u=ss(),h=Aa(e),{handleSubmit:p,hasError:g,errorText:f,isLoading:y,timeNextReq:b,isSubmitButtonDisabled:x,setTimeNextReq:v,setErrorText:N}=hu({values:d,phoneNumber:h,onSuccess:l,onFail:c}),w=gn(mu),C=Bl({seconds:b,onTick:v}),S=r((async()=>{const e=await(async e=>{const t=Fs();return await $s((t?"/user-data":"")+"/sms/sendCode","POST",{phoneNumber:e.phoneNumber,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName})})({phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}});e.ok?(v(180),C(180),N(""),u.smsCode=gu(h)):429===e.status?w.open({phoneNumber:h,sendCode:S}):c()}),[h,C]);return i((()=>{u.smsCode?.sendTime&&u.smsCode?.phoneNumber===h||S()}),[]),o($l,{isSubmitButtonDisabled:x,onSubmit:p,onSendCode:S,timeNextReq:b,values:d,onChange:m,phone:e,isLoading:y,errorText:f,hasError:g,onClose:s,children:fu(n,t)})})),gu=e=>({sendTime:Date.now(),attempts:0,phoneNumber:e}),fu=(e,t=!1)=>t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,yu={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},bu={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},xu=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],vu=d((({onSubmit:e=Pn,onClose:t=Pn})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=Ec(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?bu:yu;return o(Vn,{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(wl,{className:"whitespace-normal",orientation:"horizontal",items:xu,value:n,onChange:u}),o(An,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Nu={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},wu={...Nu,amur_card:"14",owner_card:"13",travel_card:"15",amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},Cu=d((({title:e,icon:t,description:n,onClick:a=Pn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(ze,{font:"font-medium",size:"text-s",children:e}):null,n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),Su={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},ku={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Iu={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Tu=e=>Object.entries(e).reduce(((e,[t,n])=>t in Su?[...e,{contactTypeCd:{key:Su[t]},value:n}]:e),[]),Ru=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in ku){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{...a,addressType:{key:ku[t]}}]}return e}),[]),Eu=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:Du(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in Iu?[...e,{incomeTypeCd:{key:Iu[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},Du=(e,t)=>(Number(e??0)+Number(t??0)).toString(),_u={WORK:"Работаю",RETIREE:"Пенсионер"},Pu=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Du(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},Ou=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},Bu=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},Mu=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,Au=(e=!1,t=!1)=>e?{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"}:t?{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"}:{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"},Fu=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=Pn,onClose:i=Pn}){const l=sc(),s=en(),{participants:d,creditProgram:m,createdDate:u="",id:h}=e,p=wu[m.code],g=Boolean(Nu[m.code]),f=Au(n,g),{id:y,profile:b}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,educationLevelCd:x,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:_,employeesNumberCd:P,opf:O,seniority:B,generalSeniority:M,jobsNumber:A,lastWorkDuration:F,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:W,participantIncomes:q,snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,nameLegalEntity:G,creditInRshbCd:J,payrollCardRshbFlg:X,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:Mu(i),cardCategory:Mu(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,education:Mu(x),participantDateRegistration:v,housing:Mu(N),beginDate:k,employment:Mu(I,_u),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:Mu(E),organization:Mu(D),employerOrganization:Mu(_),amountWorkers:Mu(P),legalForm:O,generalSeniority:B?.toString(),experience5Years:M?.toString(),jobsNumber:A?.toString(),lastJobExperience:F?.toString(),positionOrganization:Mu(L),familyStatus:Mu(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:Mu(W),snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,legalEntityName:G,creditInRshbCd:Mu(J),calculator:{isInsurance:X,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Pu(q),...Ou(S),...Bu(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);l.participantId=y??null,l.taskId=h,l.profileId=b?.id??null,l.programId=p,l.leadForm=t,b?.id&&a(b.id,h),s.assign(f.nextStepLink)}),[]),v=r((()=>{s.assign(f.newTaskLink)}),[]);return o(Vn,{onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Cu,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${Ma(new Date(u))}`:"",onClick:x}),o(Cu,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:f.description,onClick:t?i:v})]})]})})})),Lu=d((function({isDebit:e,onClose:t=Pn}){const n=en(),a=Au(e),i=r((()=>{n.assign(a.newTaskLink)}),[]),l=r((()=>{n.assign("/")}),[]);return o(Vn,{onClose:t,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(An,{type:"button",className:"w-full",onClick:i,children:"Заполнить новую заявку"}),o(An,{type:"button",version:"secondary",className:"w-full",onClick:l,children:"Вернуться на главную"})]})})})),zu=({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i,consents:r})=>{const l=$u(i?.utm_source),s=Vu({participantId:e,profileId:n,formData:a,consents:r}),{crshbFileIds:o}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:l,id:t,...n?{participants:[s]}:{participant:s},marketingInfo:i},crshbFileIds:o}},Vu=({participantId:e,profileId:t,formData:n,consents:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=n;return{birthDate:s&&Ma(s,!0),id:e,midname:l,name:i,surname:r,...t&&{profile:{id:t}},participantContacts:Tu({phone:o&&Aa(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"},...a}},$u=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},ju=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Wu=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i,isNewMicroservice:l})=>{const[s,{setTrue:o,setFalse:c}]=an(!1),d=(()=>{const e=Tc();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),m=ss(),u=Tc(),h=(({data:e})=>{const t=nn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Ya({aspectsAttributes:ju(e,i),aspects:t,ev:{}})}),[e])})({data:a}),p=en(),g=r((()=>{p.assign(t)}),[]),f=(e=>{const{open:t}=gn(vu),n=gn(pu),a=(t,n,a)=>async i=>{try{t?await au({profile:{id:t,consentBkiFlg:!0,smsConsentBki:i}}):n&&a&&await iu({task:{id:n,participant:{id:a,consentBkiFlg:!0,smsConsentBki:i}},sendToBank:!1,taskKind:"SHORT"}),e()}catch(e){console.log(e)}},i=({phone:t,profileId:i,onFail:r,taskId:l,participantId:s})=>async o=>{"SIGNED"===o&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i,l,s),onFail:r}):e()};return{open:({phone:n,profileId:a,onFail:r,taskId:l,participantId:s})=>t({onSubmit:i({phone:n,profileId:a,onFail:r,taskId:l,participantId:s}),onClose:e})}})(g),y=gn(pu),b=(()=>{const{open:e}=gn(Fu),{open:t}=gn(Lu);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({isDebit:i})}}})(),x=()=>{y.close(),i(!1)},v=r((async t=>{try{o();const i=Yu(t),r=await(a={profile:{phone:Aa(i.phone)}},Vs("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{await Uu({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:s,saveUserData:d,sendAspects:h}),y.close(),"debitCard"===n?g():f.open({phone:i.phone,profileId:r,onFail:x})},p=async()=>{try{const t=await(async e=>{const t=await Vs("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await Vs("/user-data/getTaskById","POST",e)||void 0)({taskId:t});y.close(),b.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:h,onClose:c})}else await c()}catch{x()}},v=qu(i,n);y.open({phone:i.phone,consents:v,onSuccess:p,onFail:x})}catch{x()}finally{c()}var a}),[]),N=r((async t=>{try{o();const i=Yu(t),r=await(a={phone:Aa(i.phone),email:i.email},Vs("/public-data/createParticipant","POST",a).then((e=>e?.participantId||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{const t=await Hu({programId:e,participantId:r,formData:i,referalData:l,productType:n,marketingInfo:s,saveUserData:d,sendAspects:h});y.close(),f.open({phone:i.phone,taskId:t,participantId:r,onFail:x})},p=async()=>{try{await c()}catch{x()}},g=qu(i,n);y.open({phone:i.phone,consents:g,onSuccess:p,onFail:x})}catch{x()}finally{c()}var a}),[]);return{isSending:s,handleSubmit:l?N:v}},qu=(e,t)=>{const n=Ms[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},Uu=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=Ku(n,a);await au(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&Ma(l,!0),email:o,phone:Aa(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async()=>{const e=await Vs("/claim-channel/","GET").then((e=>{const t=globalThis.location.href,n=e?.find((e=>e&&t.includes(e.key)))?.code;return globalThis.sessionStorage.setItem("claimChannelCode",n??""),n})).catch((()=>{}));return e})(),a=await(async e=>await Vs("/user-data/createUserTaskDebit","PUT",e)||{})((({formData:e,programId:t,marketingInfo:n,claimChannelCode:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=e;return{task:{taskSource:$u(n?.utm_source),creditProgram:{code:Nd[t]},participants:[{birthDate:s&&Ma(s,!0),midname:l,name:i,surname:r,participantContacts:Tu({phone:o&&Aa(o),email:c})}],marketingInfo:n},claimChannelCode:a}})({formData:n,programId:e,marketingInfo:r,claimChannelCode:t}));o=a.taskId,c=a.participantId}else{const a=await tu({profileId:t,programId:e});o=a.taskId,c=a.participantId,await iu(zu({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await nu({taskId:o,...i}),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},Hu=async({programId:e,participantId:t,formData:n,referalData:a,productType:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o;const c=Ku(n,i);try{return o=(await tu({participantId:t,programId:e})).taskId,await iu(zu({participantId:t,taskId:o,formData:n,marketingInfo:r,consents:c})),a?.referalCode&&await nu({taskId:o,...a}),s(t,o),l({participantId:t,taskId:o,programId:e,formData:n}),o}catch(e){throw console.log(e),new Error}},Ku=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentFATCA:s}=e;let o;return o="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentPhotoFlg:!1}:{consentFATCA:s,consentPhotoFlg:n},{...o,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Yu=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Gu=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=en();if(!n||!t||!a&&!e)return i.assign("/"),()=>{};const r=async()=>{const e=await $s("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&i.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&r();const l=setInterval(r,24e4);return()=>clearInterval(l)},Ju={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},Xu=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Ju[e.name||""]])))}},Qu=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...js()},credentials:"include",body:a}).then((e=>e.json())))},Zu=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=(e,t)=>e?`${t} ${e}`:void 0,u=[t,n,i||r,m(l,"ул"),m(s,"д"),m(c,"к"),m(o,"стр"),m(d,"кв")].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key??a,fullAddress:u}},eh=e=>Math.floor(e/12),th=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>Qu(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},nh=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},ah=(e,t)=>{const{esiaAdditionalDocument:n,crshbFileIds:a}=e,i=[n?.pdfFilePayout,n?.pdfFileWorkbook,n?.pdfFileSigPayout,n?.xmlFilePayout,n?.xmlFileSigPayout,n?.xmlFileWorkbook],r=t?Boolean(a?.length):i.every(Boolean);return[n?.inn,n?.averageMonthlyIncome?.toString(),n?.startWorkDate,n?.workLengthInFiveYears?.toString(),n?.workLength?.toString(),n?.workLengthLastJob?.toString(),n?.jobsNumberInFiveYears?.toString()].every(Boolean)&&r},ih=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a,isNewMicroservice:s})=>{const o=Tc(),c=r((e=>{const t=e instanceof Function?e(d[m]):e;null!=t?d[m]=t:delete d[m]}),[d=o,m="leadForm"]);var d,m;const u=ss(),h=globalThis.sessionStorage?.getItem(Yt);(()=>{const e=Tc(),t=nn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});Ya({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const p=l((()=>Xu(e,o.leadForm,a)),[e,o.leadForm]),g=r((async(e,a)=>{n(As.Pending);try{const i=await(async e=>{const t=Fs();return await Vs((t?"/user-data":"")+"/esia/requestProfile","POST",e).then((e=>(e?.access_token&&e?.refresh_token&&(uu(e),Gu(!0)),e)))})({code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0});if(i){const e=await(async(e,t=!1,n=!1)=>{nh(e);const a=!t&&ah(e,n),{profile:i,addInfo:r,document:l,addressRegistration:s,addressFact:o,esiaAdditionalDocument:c,crshbFileIds:d}=e;let m=[];return a&&!n&&(m=await th(c)),{...{name:i.name,surname:i.surname,middleName:i.midname,limitedBirthday:i.birthDate,phone:Zr(i.phone),email:i.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:r.birthPlace,addressRegistration:Zu(s),esiaAccountTypeCd:t?i.esiaAccountType:{key:""},...o&&{addressFact:Zu(o)}},...a&&{snils:r.snils,inn:c.inn,wages:Math.floor(c.averageMonthlyIncome)?.toString(),beginDate:c.startWorkDate,experience5Years:eh(c.workLengthInFiveYears).toString(),generalSeniority:eh(c.workLength).toString(),lastJobExperience:eh(c.workLengthLastJob).toString(),jobsNumber:c.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:i.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:m,crshbFileIds:d}}})(i,"debitCard"===t,s);c((t=>({...t,...e}))),n(As.Success)}}catch{n(As.Error)}}),[]);return i((()=>{o.productType=t,u.marketingInfo=rh(h,u),u.isNewMicroservice=s||null}),[h]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?g(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),p},rh=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},lh=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,isNewMicroservice:p=!1,...g})=>{const[f,y]=a(),[b,x]=a(),[v,N]=a(0),w=s(null),C=l((()=>(e=>{const t=Ms[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),S=l((()=>sh(C)),[C]),k=gn(Zl),I=ds();ms();const T=l((()=>oh(m)),[m]),R=l((()=>En(S,T)),[S,T]),E=(e=!1)=>{x(e)},D=ih({inputs:S,nextStepLink:r,productType:m,setEsiaStatus:y,esiaAuthSuccess:f===As.Success,isNewMicroservice:p}),{isSending:_,handleSubmit:P}=Wu({programId:n,nextStepLink:r,productType:m,data:h,changeSubmitFormStatus:E,isNewMicroservice:p}),[,{field:O,onSubmit:B,reset:M}]=mn(D,{formValidator:R,onSubmit:P}),A=gn($n);return i((()=>{!1===b&&A.open({ok:b,onClose:()=>E(!0)})}),[b]),i((()=>{f&&w?.current&&w.current.scrollIntoView({block:"start"}),f===As.Success&&M()}),[w?.current,f]),c(pn,{className:u("container space-y-m",e),title:t,...g,children:[f||I?null:o(Ws,{onChangeEsiaStatus:y,productType:m}),c("form",{onSubmit:e=>{O("processPersonalDataFlg")?.value||(N((e=>e+1)),v>0&&k.open({productType:m,attempts:v})),B?.(e)},className:"space-y-m relative",ref:w,children:[f===As.Pending?o(Ja,{blur:!1}):null,C.map(((e,t)=>c("div",{className:u(Dl(e.columns),"grid gap-x-m"),children:[_l(e.title),Qm({field:O,inputs:e?.inputs},m)]},`section-${t}`))),eu(d,_),f===As.Error?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),sh=e=>e?.flatMap((e=>e?.inputs))||[],oh=e=>({...Bs,limitedBirthday:Ds(e)}),ch=d((({title:e,description:t})=>{const n=Ee();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),dh=e=>e%2!=0,mh="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",uh=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=an(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(mh),children:[D(r,{...i.options,parent:n}),dh(r.length)?o(Qt,{className:"col-span-6",...i}):null]}),c(oo,{children:[c(co,{className:u(mh),isUnfolded:s,children:[D(l,{...i.options,parent:n}),dh(l.length)?o(Qt,{className:"col-span-6",...i}):null]}),o(so,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),hh=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ph=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),gh=10;function fh(e=0){const t=Math.round(e*gh);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const yh=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:fh(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}(r((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),bh=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],xh=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},b=s([]),x=r(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(Nh(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?vh(c,v):{},...N?ph(h):{},gap:`${l}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(yh,{className:u(m,i?bh[i-1]:"",{"h-full":N},t),style:w?vh(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:x,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),vh=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Nh=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wh={"horizontal-list":"w-6","vertical-list":"h-6"},Ch=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?wh[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Sh=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},kh=e=>t=>e.scrollWidth/t,Ih=e=>(t,n)=>{e.scrollBy({left:n*kh(e)(t),behavior:"smooth"})},Th=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Zc()(i),Xc()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?Ih(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?Ih(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Rh={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Eh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ee(),[h,p]=Th({itemCount:s.length}),g=Dh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(xh,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Sh({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Rh[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(Ch({activeIndex:t,onClick:f,listType:a}))}):null})),Dh=(e=!1)=>({behavior:e?"auto":"smooth"}),_h=d((({className:e,name:t,...n})=>o(An,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(Y,{name:t,iconVersion:"",size:"small"})}))),Ph=d((e=>o(_h,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),Oh=d((e=>o(_h,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Bh="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Mh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Ah(t):null,r?o(Ph,{wcmsIgnore:!0,className:u(Fh(i),m?"left-1":"left-0"),onClick:s}):null,l?o(Oh,{wcmsIgnore:!0,className:u(Fh(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ah=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Bh,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Bh,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Fh=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Lh=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const b=Array.isArray(g)?g.length:0,[x,v]=Th({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(xh,{containerRef:x,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Mh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(Eh,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:r,version:t,navButtons:y,containerRef:x,containerScroll:v})]})})),zh=({blocksToRender:e,...t})=>o(Lh,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:D(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",hh(!0)),children:R(e,t)},String(n))})}),Vh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[$h(n,t),o(uh,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[$h(n,t),zh({...a,blocksToRender:t})]});default:return null}})),$h=(e,t)=>e&&!t.length?o(ch,{...e}):null,jh=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Wh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o($r,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),qh=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,jh(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Uh(a)).filter(Boolean))]}),n?o("div",{children:o(An,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Uh=e=>([t,n])=>{const a=n?.type;return"array"===a?Hh(t,e)(n):null},Hh=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Wh,{items:a,multiple:!n?.single,...t(e)})]},e)},Kh=e=>e;function Yh(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Gh=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Jh=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Gh(t[e])||Gh(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Gh(t[e])||Gh(n[e])||Xh(t[e])<=Xh(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Gh(t[e])||Gh(n[e])||Xh(t[e]?.min)>=Xh(n[e]?.min)&&Xh(t[e]?.min)<=Xh(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Gh(t[e])||Gh(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Gh(t[e])||Gh(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Xh=e=>Number(e||0),Qh=(e,{block:t,page:n,normalize:a=Kh})=>{const i=t?.blocks||[],[r,s]=mn(e),o=l((()=>Yh(i,i.map((e=>qt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=Kh)=>e?.filter((([,e])=>Jh(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Zh={},ep={},tp=Kt((({className:e,filtrationSchema:t=Zh,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Qh(ep,{block:i.block,page:i.options?.page}),d=o(wa,{className:"w-64",label:n?.title,options:np(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>np(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(qh,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(An,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Vh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),np=e=>Yh(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),ap=(e=!1)=>e?"text-left":"text-center",ip={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},rp=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",ip[t],e),style:{width:r,height:r},role:"figure",children:o(Y,{name:a,width:"54%",...i})}):null})),lp=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ee();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:ap(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(sp)}):null]})})),sp=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(rp,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),op=(e,t,n)=>{return o(Lh,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(ze,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(ze,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},cp=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(k,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?op(e,0,t):null]}))),dp={start:"justify-start",center:"justify-center",end:"justify-end"},mp=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",dp[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ke(e)})})),up=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Xe(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),hp=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),pp=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(up,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(Fc,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(hp,{title:e,...l}),gp={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},fp={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},yp=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=gp.prefMonthsNum,prefTravelBonusRate:r=gp.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||fp,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},bp=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=mn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=yp(l,n);return o(Pc,{className:e,title:t,...r,children:c("section",{className:u(Oc,e),children:[c("div",{className:Bc,children:[Hc({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Hc({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?pp({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Mc,children:[f>=0?o(Fc,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ke(a,{isVertical:!0}),$c(i)]})]})})})),xp=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,vp=e=>qc({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Np=" (c капитализацией)",wp=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Mc,children:[o(Fc,{title:`Доход в конце срока${r?Np:""}`,value:e,postfix:n,prefix:"+"}),o(Fc,{title:`Сумма в конце срока${r?Np:""}`,value:t,postfix:n}),Ke(a,{isVertical:!0}),i?.map($c)]}),Cp={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Sp={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},kp=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Cp[e?.rateType]:"",{data:n}=yi(t?`${Ba}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Ip(s,e)&&ad(a,["minSum","maxSum"],e)&&ad(n,["minDays","maxDays"],e)))||Sp,{rate:m}=d,u=Tp(m,e),h=a+u,p=c||[Sp];return{...d,...nd(["minSum","maxSum"],p),...nd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Ip=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Tp=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Rp=Kt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=mn({moneyValue:cd(l,1e5),daysValue:dd(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=kp(m,s),{income:g,finalSum:f,rate:y,depositeName:b}=p;return o(Pc,{className:e,title:t,...d,children:c("section",{className:u(Oc,e),children:[c("div",{className:Bc,children:[Hc({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(x={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(_i,{items:[`От ${xp(x.min||0)}`,`До ${xp(x.max||0)}`],step:1,...x})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Ep(p,h),vp({...h("isMonthlyInterestPayment")})]})]}),pp({rate:y,depositeName:b,isShowDepositeName:r}),wp({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var x})),Ep=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ei,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ei,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Dp=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},_p={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Pp=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?Mp(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Bp({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Bp({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Bp({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),Bp({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,ad(a,["minSum","maxSum"],t),ad(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||_p,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Op(p,e),f=a+g,y=t||[_p];return{...m,...nd(["minSum","maxSum"],y),...nd(["minMonths","maxMonths"],y),availableMonths:Dp(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},Op=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Bp=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Mp=(e,t)=>e+Math.round((t-e)/2),Ap=(e="rub")=>"rub"===e,Fp=(e,t)=>{const{minMonths:n,maxMonths:a}=nd(["minMonths","maxMonths"],$p(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ii(i,n,a)}},Lp=(e,t)=>{const{minSum:n,maxSum:a}=nd(["minSum","maxSum"],$p(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ii(i,n,a)}},zp=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Vp=e=>{const t=Ap(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},$p=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},jp=(e,t=!1)=>t?qc({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Wp=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[qp(t("isReplenish"),e,a),Up(t("isWithdrawn"),e,a),Hp(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?vp(t("isMonthlyInterestPayment")):null,jp(t("isRemoteRegistration"),e.isShowRemoteRegistration),Kp(t("extraPercent"),n),e.isShowNewClient?o(ei,{text:"Новый сберегатель",...t("isNewClient")}):null]})},qp=(e,t,n=!1)=>t.isShowReplenish?qc({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,Up=(e,t,n=!1)=>t.isShowWithdrawn?qc({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,Hp=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,Kp=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(wa,{options:t,...e})]}):null,Yp={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Gp={text:"₽",key:"rub"},Jp={text:"Без учета надбавки",key:"0"},Xp=Kt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Gp],g=r((e=>t=>e?{...t,...Vp(t),...Lp(t,e),...Fp(t,e),...zp(t,e)}:t)(h),[h]),[f,{field:y}]=mn({moneyValue:cd(d,2e4),monthsValue:dd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Gp,extraPercent:d?.extraPercent??Jp},{normalizer:g}),b=ng(y),x=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=$p(h,b),w=Pp(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Kc({field:y,defParams:zc(N,x,v),calcParams:w,monthsValue:"minMonths",map:Yp})}),[y,h,v]);i((()=>{!od(d)&&N&&T()}),[d,h]);const R=y?.("extraPercent")?.value?.key,E=tg(C,R),D=C===zc(N,x)?.rate&&R===v?.at(-1)?.key;return o(Pc,{className:e,title:t,...m,children:c("section",{className:u(Oc,e),children:[c("div",{className:Bc,children:[c("div",{className:"flex gap-m",children:[Hc({className:"w-full",title:`Сумма, ${b?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:b?.text,step:Qp(b?.key)}),h&&h?.length>1?o(Ca,{label:"Валюта",options:p,...y("currency")}):null]}),jc({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Wp({...w,...s},y,v)]}),pp({rate:E,children:eg(T,D)}),wp({income:S,finalSum:k,buttons:[...a,Zp(n?.buttons,I)],footnotes:[l],postfix:b?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Qp=(e="")=>Ap(e)?1e3:100,Zp=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},eg=(e,t=!1)=>t?null:o(An,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),tg=(e,t)=>Number(e)+Number(t??0),ng=e=>e?.("currency")?.value??Gp,ag=e=>ig({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ig({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ig=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],rg={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},lg=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[rg],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ag({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=td(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=td(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>ag({row:e,userInputParams:t,paramsViewSettings:n})&&ad(a+l,["minSum","maxSum"],e)&&ad(r,["minSumOld","maxSumOld"],e)&&ad(l,["minSumExtra","maxSumExtra"],e)&&ad(i,["minMonths","maxMonths"],e)))||rg)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Gc(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},sg=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=mn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=lg(d,n,r),p=l((()=>Lc(n?.rateRows)?.rate),[n?.rateRows]),g=Uc({...m("isAnnuity")});return o(Pc,{className:e,title:t,...s,children:c("section",{className:u(Oc,e),children:[c("div",{className:Bc,children:[Hc({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),Hc({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),jc({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),og({...h,...r},m),h.isExtraMoney?Hc({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Mc,"@4xl:w-1/2"),children:[o(Fc,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Fc,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(Fc,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(Fc,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ke(a,{isVertical:!0}),$c(i)]})]})})})),og=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ei,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ei,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ei,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),cg=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=ki(e,{normalize:(e=i)=>n&&a?String(Ii(Number(dg(e)),n,a)):dg(e),format:Xe(l)}),d=r((e=>t&&t(dg(e))),[t]);return o(la,{onChange:d,...s,...c})})),dg=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),mg=d((e=>o(cg,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),ug={private:"p2p/registerP2P",business:"b2c/registerB2C"},hg=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Vn,{maxWidth:"lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},pg=e=>{const t=gn(hg),n=ss(),a=en(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=en(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Ba}/payment/${ug[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},gg={amount:1500},fg=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=pg(i),[{amount:s},{field:d,onSubmit:m}]=mn(gg,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(mg,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(Xa,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),yg=({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(Y,{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})]}),bg="relative h-full",xg={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},vg=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(Cg),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:Ng(n,{someCardsHighlighted:r}),children:[R(n,a,{className:wg(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),Cg(n)?yg({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ng=(e,{someCardsHighlighted:t})=>u(bg,t&&(Cg(e)?"pt-3xl":"pt-16")),wg=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(bg,"min-w-80",xg[a],t&&(Cg(e)?"pt-16":"pt-3xl"),hh(n),n&&"h-full"),Cg=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Sg=Kt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Lh,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?kg(s?.block?.blocks):[],hasBlur:!0,children:vg({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),kg=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Ig={black:"bg-black",white:"bg-white"},Tg=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Pe,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Ke([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(Rg)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Rg=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Ig[e]}`},String(t)),Eg=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=be()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),Dg=[{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"}}],_g=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>Dg.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Pg(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Ke(m,{className:Og(s??!1,i??!1,n),buttonClassName:h})}),l?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),Pg=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Og=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Bg=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:b=false,isImageSecondary:x=!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(Eg,{href:i,target:m,className:"h-full",data:ju(v),children:c(Pe,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(_g,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:x,imageAlign:"center",children:[o(Ue,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,Mg(a,p)]})})}))),Mg=(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,Ag=new he,Fg=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ke(i)}):null]},String(t))},Lg=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const b=l((()=>h.map(Fg)),[h]),[x,v]=l((()=>m>0?[b.slice(0,m),b.slice(m)]:[b,[]]),[m,b]),[N,C]=a(!1);i((()=>Ag.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=r((()=>{Ag.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(ke,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(oo,{children:[c("div",{children:[x,o(co,{isUnfolded:N,children:v})]}),h.length>=m?o(so,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:x})]})})),zg=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:Xe()(t)})]}))),Vg=d((({cashbacks:e})=>{const{mounth:t,year:n}=$g(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(w,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Fe,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(zg,{text:"Баллов в месяц",value:t}),o(zg,{text:"Баллов в год",value:n})]})]})})),$g=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),jg=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],Wg=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],qg=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Ug(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(wa,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:Hg(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(An,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(wa,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(_i,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Ug=e=>e?.[(new Date).getTime().toString().slice(-1)],Hg=(e,t)=>e?[]:t?jg:Wg,Kg=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],Yg={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},Gg=["5","10","15"],Jg=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=Yg,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:h,onChangeCashback:p,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=ac("CASHBACK_CATEGORY"),[t,n]=a(Kg);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Kg)}})(),b=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(k,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(qg,{categories:m,cashback:t,showIncreasedPercents:Qg(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:p},String(t.id)))),Xg(d.length,h,y),o(Vg,{cashbacks:d}),o(xc,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(ke,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),b]})]})})),Xg=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(An,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(An,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),Qg=(e,t)=>Gg.includes(e.percent.key)||!t.some((e=>Gg.includes(e.percent.key))),Zg=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),ef=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Zg,{step:a,showPercentage:!1})]})})}));var tf;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND",e.clientFound="CLIENT_FOUND",e.newClient="NEW_CLIENT"}(tf||(tf={}));const nf=e=>Vs("/user-data/getTaskStatus","POST",e),af=async e=>{const t=await Vs("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},rf=d((({title:e,interval:t=0,onEnd:n=Pn})=>{const[i,r]=a(t);Bl({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(k,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(zl,{seconds:i})})]})]})})),lf=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Pn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(rf,{interval:s,onEnd:d}):null]}),o(sf,{title:n,items:a}),o(sf,{title:i,items:r,countColumns:!0}),l?o(si,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),sf=({title:e,items:t,countColumns:n=!1})=>{const a=Ee();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(ze,{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",Dl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:of(e)},t)))}):null]})]}):null},of=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),cf=d((()=>o(lf,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),df=d((({onExpire:e})=>{const{statusInfo:t}=sc();return o(lf,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),mf=d((()=>{const{statusInfo:e}=sc(),t="courier"===e?.methodObtain;return o(lf,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),uf=d((()=>{const{statusInfo:e}=sc();return o(lf,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:hf(e),buttonText:"Вернуться на главную"})})),hf=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Ma(e?.deliveryDate)}]):t},pf=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],gf=d((()=>{const[e,t]=a(tf.process),{taskId:n}=sc();i((()=>{(async()=>{for(const e of pf)await af({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await nf({taskId:n});a&&a?.statusCd!==tf.process&&(e(),t(a.statusCd))}),[n]);Ol(l,3e4);const s=r((()=>t(tf.rework)),[]);return ff(e,s)})),ff=(e,t)=>({IN_PROCESS:o(df,{onExpire:t}),CANCELLED:o(cf,{}),FAILED:o(cf,{}),DRAFT:o(cf,{}),APPROVED:o(uf,{}),PRE_DECISION:o(uf,{}),REVISION:o(mf,{})}[e]||o(mf,{})),yf=e=>t=>t.filter((e=>e)).map((t=>[bf(t,e),wf(t,e),xf(t,e),vf(t,e),Nf(t,e)].some(Boolean)?{...t,required:!1}:t)),bf=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,xf=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,vf=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Nf=({condition:e},t)=>e?.name&&e?.values?.every((n=>{const a=t(e?.name);return n!==(a?.key??a)})),wf=({name:e},t)=>"snils"===e&&!t("snils")&&Cf(t),Cf=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Sf={...Ym,...Gm},kf=({field:e,inputs:t,params:n})=>t.map(El(e,n,Sf)),If=({sections:e,field:t,params:n})=>e?.map((({inputs:e=[],columns:a,title:i,condition:r},l)=>{const s=yf(Tf(t))(e),c=[Nf({condition:r},Tf(t))?null:_l(i),...kf({field:t,inputs:s,params:n})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return c.length?o("div",{className:u(Dl(a),"grid gap-x-m"),children:c},`section-${l}`):null})),Tf=e=>t=>e(t)?.value,Rf=({formState:e,inputs:t,productType:n})=>{return En(yf((t=>e[t]))(t),{...Bs,limitedBirthday:Ds(n),dulIssueDate:(i=e.limitedBirthday,Is(14,i)("Укажите дату выдачи паспорта")),generalSeniority:(a=e.lastJobExperience,sn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!a||Number(e)>=Number(a))))("Укажите количество лет стажа")),beginDate:Ss(e.limitedBirthday),participantDateRegistration:ks(e.limitedBirthday),organizationName:Ts(e.isDadataOrganization),inn:Rs(e.isDadataOrganization)})(e);var a,i},Ef=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Xa,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Df=(e,t,n)=>({...n[e],...t,limitedBirthday:_f(t?.limitedBirthday),dulIssueDate:_f(t?.dulIssueDate),participantDateRegistration:_f(t?.participantDateRegistration),beginDate:_f(t?.beginDate),deliveryDate:_f(t?.deliveryDate)}),_f=e=>{try{return e?new Date(e):void 0}catch(e){return}},Pf=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",isDadataOrganization:!1,organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],Of=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...Pf(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Bf=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Mf=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return"RETIREE"===n?.key?{employmentTypeCd:n}:{employmentContractDate:Ma(t||"",!0),employmentTypeCd:{key:"WORK"},organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:Tu({organizationPhone:p&&Aa(p)}),participantAddresses:Ru({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},Af=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:h,addressMatch:p}=e;return{birthDate:Ma(t,!0),birthPlace:a,dulIssueDate:Ma(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?Ma(d,!0):void 0,homeMatchFlg:p,houseTypeCd:m,participantAddresses:Ru({addressRegistration:u,addressFact:p?u:h}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},Ff=e=>e?new Date(e).toISOString().split(".")[0]:"",Lf=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:Ff(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},zf=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Vf=(e,t)=>{switch(e){case 0:default:return{};case 1:return Af(t);case 2:return Mf(t);case 3:return Eu(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Ru({addressCourier:t})}:{}})(t)}},$f=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=5===e,c=sc(),d=l((()=>Df(e,c.leadForm,Of)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await iu((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...zf(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Vf(i,a)}],...Bf(a),...Lf(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},jf=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ms();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((e=>Rf({formState:e,inputs:s,productType:"creditCard"})),[s]),[m,u,h]=$f({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=mn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[If({sections:t,field:p}),o(Ef,{isSending:h,step:e,onPrevStep:n})]})})),Wf=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],qf=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...Wf,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"employerActivities",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"generalSeniority",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"lastJobExperience",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"experience5Years",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"positionOrganization",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],Uf=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Hf=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Gu,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=qf[n],[f,{setTrue:y}]=an(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(ef,{stepsTitles:Uf,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(gf,{}):o(jf,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),Kf=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Zg,{step:a,showPercentage:!1})]})})})),Yf=async e=>{await $s("/camunda/send/message","POST",e)},Gf=d((()=>o(lf,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Jf=e=>"11"===e?{name:"Потребительский кредит на рефинансирование",description:"Погашение основного долга по кредиту, иные цели и оплату страхования"}:{name:"Кредит на любые цели",description:"На любые цели"},Xf=d((({onExpire:e})=>{const{statusInfo:t,programId:n}=sc(),a=Jf(n);return o(lf,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:a.name},{label:"Цель кредита",description:a.description},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Qf=d((()=>{const{statusInfo:e}=sc();return o(lf,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Zf=d((()=>{const{statusInfo:e,programId:t}=sc(),n=Jf(t);return o(lf,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:n.name},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ey=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ty=["CREATE_APPLICATION_SHORT_MESSAGE"],ny=d((()=>{const e=Fs(),[t,n]=a(tf.process),{taskId:l}=sc();i((()=>{(async()=>{if(e)for(const e of ty)await Yf({messageName:e,taskId:l});else for(const e of ey)await af({signalType:e,taskId:l})})()}),[l]);const s=r((async e=>{const t=await nf({taskId:l});t&&t?.statusCd!==tf.process&&(e(),n(t.statusCd))}),[l]);Ol(s,3e4);const o=r((()=>n(tf.rework)),[]);return ay(t,o)})),ay=(e,t)=>({IN_PROCESS:o(Xf,{onExpire:t}),CANCELLED:o(Gf,{}),FAILED:o(Gf,{}),DRAFT:o(Gf,{}),APPROVED:o(Zf,{}),PRE_DECISION:o(Zf,{}),REVISION:o(Qf,{})}[e]||o(Qf,{})),iy=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(Xa,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),ry={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},ly=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:ry[a?"annuity":"differential"]}},sy=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},oy=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return Af(t);case 2:return Mf(t);case 3:return Eu(t);default:return{}}},cy=[{calculator:void 0},...Pf(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],dy=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=4===e,c=sc(),d=l((()=>Df(e,c.leadForm,cy)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i){const t=await iu((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>{const r=Fs(),l={id:e,...!r&&{profile:{id:n}},roleCd:{key:"BORROWER",value:"Заемщик"},...oy(i,a)};return{sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,...r?{participant:l}:{participants:[l]},...ly(a),...sy(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}})({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},my=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=sc();ms();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((e=>Rf({formState:e,inputs:u,productType:"credit"})),[u]),[p,g,f]=dy({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:b}]=mn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:b,className:"space-y-m",children:[If({sections:t,field:y,params:{calcData:m}}),o(iy,{step:e,isSending:f,onPrevStep:a})]})})),uy=[[{columns:1,inputs:[{name:"calculator"}]}],[...Wf,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],hy=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],py=Kt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Gu,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=uy[l],y=0===l,[b,{setTrue:x}]=an(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(Kf,{stepsTitles:hy,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:b?o(ny,{}):o(my,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:x},String(l))})]})})})),gy=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(Zg,{step:a,showPercentage:!1})]})})),fy=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("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"})}),o(yy,{items:n}),a?o(ke,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(ke,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(ke,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),yy=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{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 gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:by(e)},t)))}):null]})]}):null,by=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),xy=d((()=>{const{leadForm:e}=sc();return o(fy,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:Ma(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),vy=d((()=>o(fy,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),Ny=d((()=>o(fy,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),wy=d((()=>o(fy,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),Cy=d((({isOffice:e})=>o(fy,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),Sy=d((()=>{const[e,t]=a(tf.process),{taskId:n,statusInfo:r,programId:l}=sc(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await af({signalType:"FIND_PERSON_SIGNAL",taskId:n});await af({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||tf.notFound)})()}),[n]),ky(e,o,s)})),ky=(e,t,n)=>({IN_PROCESS:o(Ny,{}),NOT_FOUND:o(vy,{}),CLIENT_NOT_OK:o(vy,{}),NEW_CLIENT:o(Cy,{isOffice:t}),CLIENT_FOUND:o(Cy,{isOffice:t}),DBO_CLIENT:o(n?wy:xy,{}),PRE_DECISION:o(Cy,{isOffice:t})}[e]||o(Cy,{isOffice:t})),Iy=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(An,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Xa,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),Ty=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},isMomentDebitCard:!0,currency:"810",codeWord:"",latinName:"",latinSurname:""}],Ry=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:Ff(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},Ey=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},Dy=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Ru({addressCourier:t})}:{}})(t);case 1:return Af(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},_y=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=2===e,c=sc(),d=l((()=>Df(e,c.leadForm,Ty)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:Nd[a]},...Ey(n),participants:[{id:e,residentOtherCountry:!1,...Dy(i,n)}],...Bf(n),...Ry(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),$s("/user-data/updateUserTaskDebit","PUT",r)),o?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},Py=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{ms();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((e=>Rf({formState:e,inputs:s,productType:"debitCard"})),[s]),[m,u,h]=_y({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=mn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[If({sections:t,field:p}),o(Iy,{step:e,isSending:h,onPrevStep:n})]})})),Oy=[[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...Wf,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг."}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[],condition:{name:"isMomentDebitCard",values:[!1]}},{columns:2,inputs:[{name:"latinName",condition:{name:"isMomentDebitCard",values:[!1]}},{name:"latinSurname",required:!0,condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения.",condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.",condition:{name:"isMomentDebitCard",values:[!1]}}]}]],By=["","Персональные данные","Платежная система"],My=Kt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Gu,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=Oy[n],f=0===n,[y,{setTrue:b}]=an(!1),x=r((()=>{b(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(gy,{stepsTitles:By,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(Sy,{}):o(Py,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Ay=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Fy=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ly=1e9,zy={sum:{min:1e4,max:Ly},period:3},Vy=Kt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Qh(zy,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:$y(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=jy(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(qh,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(mg,{label:a?.title,min:500,max:Ly,...d("sum",{parse:e=>({min:Number(e),max:Ly}),format:({min:e})=>String(e)})}),o(_i,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Vh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),$y=e=>$t((e?.paramsSource?.rateRows||[]).filter(Ay).flatMap((e=>Fy(e.minMonths,e.maxMonths)))),jy=e=>$t(e.flatMap((e=>e||[])).filter(Ay).flatMap((e=>Fy(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Wy=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,qy=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:Wy(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ke,{version:i?.version,text:i?.text,...i}):null]}))),Uy=`${Ba}/region`;function Hy(e="Москва"){return lc().location??{name:e}}function Ky(e="Москва"){const t=lc(),n=r((async()=>{if(!t.location){const n=await zt(Uy);t.location=n??{name:e}}}),[t,e]);return yi(Uy,n),t}var Yy;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Yy||(Yy={}));const Gy=new Intl.NumberFormat("ru",{style:"currency",currency:Yy.RUB}),Jy=e=>e?Gy.format(e):"",Xy="text-m font-light text-secondary-text ",Qy=`${Xy} text-left`,Zy=`${Xy} pl-5xl text-center`,eb=`${Xy} pl-5xl text-right`,tb={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},nb=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Qy,children:o(ze,{size:"text-m",children:"Валюта"})}),o("th",{className:Zy,children:o(ze,{size:"text-m",children:"Купить"})}),o("th",{className:eb,children:o(ze,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(ab)})]}))),ab=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(ie,{image:{icon:tb[t]},width:"24",height:"24"}):null,o(ze,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(ze,{size:"text-h6",children:Jy(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(ze,{size:"text-h6",children:Jy(e?.buyExchangeRate)})})]},t)},ib={icon:"GpsIcon"},rb=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(rp,{...ib,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:"Курс указан для заданного офиса"})]})]}))),lb=(e,t,n)=>{const a=Number(sb(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},sb=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function ob(e){if(!e)throw new Error("Value should be fulfilled");return e}const cb=e=>t=>{const[,n]=ob(e.find((([e])=>e(t))));return n(t)},db=e=>cb(e.map((([e,t])=>[e,()=>t])));db.if=e=>new mb(void 0,e);class mb{parent;predicate;unit;get entry(){return[ob(this.predicate),ob(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new mb(this,e)}then(e){return new mb(this.parent,this.predicate,e)}else(e){return cb([...ub(this),[()=>!0,e]])}}const ub=e=>[...e?.parent?ub(e.parent):[],e.entry],hb=e=>db([[e=>e.value!==Yy.RUB&&e.oppositeValue!==Yy.RUB,()=>e.handleConvert(e.value,Yy.RUB)],[e=>e.value===Yy.RUB&&e.oppositeValue===Yy.RUB,()=>e.handleConvert(e.value,Yy.USD)],[e=>e.value===Yy.RUB&&e.oppositeValue===Yy.RUB,()=>e.handleConvert(e.value,Yy.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function pb(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(la,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(wa,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const gb=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Yy.RUB,selectBuy:n?.[0]?.currency?.currency||Yy.USD}),d=r((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:[pb({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:fb(l,d,n),value:l.inputSell,onChange:e=>bb(d,n)(e,l.selectSell,l.selectBuy)}),pb({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:yb(l,d,t),value:l.inputBuy,onChange:e=>xb(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(ke,{text:i.text,version:i?.version,...i}):null]})})),fb=(e,t,n)=>a=>{t({selectSell:a}),hb({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{bb(t,n)(e.inputSell,a,i)}})},yb=(e,t,n)=>a=>{t({selectBuy:a}),hb({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>xb(t,n)(e.inputBuy,a,i)})},bb=(e,t)=>(n,a,i)=>{e({inputSell:sb(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(lb(n,r,a===Yy.RUB)||"")})},xb=(e,t)=>(n,a,i)=>{e({inputBuy:sb(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(lb(n,r,a===Yy.RUB)||"")})},vb=`${Ba}/exchangerates`;const Nb=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=yi(vb+`?regionCode=${t}`,Vt);return n||{}}(Hy()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=wb(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Yy.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Yy.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Pe,{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(nb,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(rb,{address:i?.address})]}),o(gb,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),wb=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Cb=d((({className:e,items:t})=>{const n=be();return o("ul",{className:u("w-full",e),children:t?.map(Sb(n))})})),Sb=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},kb=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Ib(e)}))),Ib=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Tb,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Tb=d((({className:e,item:t})=>{const[n,{toggle:a}]=an(!1);return c(oo,{className:e,role:"menuitem",children:[c(An,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(Ll,{children:[o(rp,{className:"shrink-0",...t.icon}),o(ze,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(lo,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(co,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Cb,{items:t.items}):null})]})})),Rb=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Eb)}):null)),Eb=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Db)})]},String(t)),Db=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:_b(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),_b=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Pb(t)}`,children:o(ze,{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})}},Pb=e=>e.replaceAll(/\D/g,""),Ob=d((({className:e="",index:t,text:n,...a})=>{const i=be(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),Bb=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(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Ob,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),Mb=d((({className:e="",index:t,...n})=>{const a=be(),{href:i,target:r,text:l,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Ab=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{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(Mb,{index:t,...e},String(t))))}):null]}))),Fb=Kt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:r,contacts:l,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(kb,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Rb,{items:l}),m?o(ke,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(_g,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),o("div",{className:"flex gap-m xl:gap-xs flex-wrap",children:p.map(((e,t)=>o(si,{className:"text-s font-light",...e},`${e.href}_${t}`)))})]})]}),o(Bb,{title:d,links:r}),o(Ab,{links:i,license:h})]})})),Lb=(e=!1)=>e?{}:{padding:"p-0"},zb={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Vb=[1,2,3,4],$b={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},jb=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=(e=>{const[t,n]=a(e.blocks??[]),r=ss(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",zb[n],e),padding:t,version:s,isTheme:c,...h,children:_({...h,block:{...m,blocks:p},renderProps:Wb({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>$b,allowRemoveChild:e=>(e?.blocks??[]).length>5}),Wb=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>R(n,{...a,blockDecorator:qb(a.blockDecorator,i)},{className:u("w-full",hh(t)),...Lb(e)}),qb=(e,t=0)=>(n,a)=>e?.({...n,render:e=>Hb(t)({...n,...e},a)},`wrap_${a}`)??Hb(t)(n,a),Ub=e=>Number(e)<5?"":"hidden",Hb=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return Vb.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(Eg,{...r.content?.link,className:u(Ub(e),(l=e,Vb.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},Kb=Kt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Ca,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(si,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:ju(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Yb={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Gb=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:h="",ref:p})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Yb[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...Jb(h),...ve(s),ref:p,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Jb=e=>e?{"data-test-id":e}:null,Xb=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=an(!1),d=nn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(Gb,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),Qb={text:"Отправить заявку",version:"primary"},Zb={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},ex=({onClose:e=Pn})=>o(Vn,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(Jl,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:Qb,link:Zb,onSuccess:e})})})}),tx=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=ax,handlers:r,onItemClick:l})=>{const s=Ee();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},nx=d((({isActive:e,...t})=>{const n=be(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),ax=({item:e,i:t,activeItem:n})=>o(nx,{isActive:e===n,...e},e?.text??String(t));const ix=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:l="large"})=>{const[c,{setFalse:d,toggle:m}]=an(!1),h=lx(B.QUICK_ACTIONS??[]),p=sx(),g=Ee(),f=function({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=ba();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),h=s(null),p=s(null),g=aa(u),f=l?p:g;return i((()=>{if(!a||!h.current||!e?.length)return;const n=h.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(tx,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),h}({items:h,onClose:d,isOpen:c,onHover:!g,renderDropdownItem:rx,handlers:p});return i((()=>{if(!g)return f.current?.addEventListener("mouseenter",m),f.current?.addEventListener("mouseleave",d),()=>{f.current?.removeEventListener("mouseenter",m),f.current?.removeEventListener("mouseleave",d)}}),[]),o("div",{ref:f,children:o(Gb,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:l,isGrayBg:!0,version:a,className:u(c?"shadow-blue-gray":"",t),onClick:m})})})),rx=({item:e,handlers:t,closeDropdown:n=Pn})=>{const a={call:{handler:e=>{t?.call(e),n()},text:"Заказать звонок"},chat:{handler:e=>{t?.chat(e),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},lx=e=>e.map((e=>({text:e}))),sx=()=>{const e=gn(ex),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=nn();return{call:t,chat:r((e=>{const t=n.openChatBot;t&&e&&t&&t(e).finally()}),[])}},ox={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"},cx=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ee()?n:t;return i?o(ke,{className:u("py-s px-lg font-light whitespace-nowrap",ox["transparent"===e?"transparent":"default"]),...a,children:i}):null})),dx=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=P(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(du,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):mx(g,l),ux({version:i,iconVersion:m,internetBankButton:a})]})})),mx=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(Y,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,ux=({version:e,iconVersion:t,internetBankButton:n})=>c("div",{className:"flex gap-lg items-center",children:[B.QUICK_ACTIONS?o(ix,{version:e,iconVersion:t}):null,B.CHAT_BOT&&!B.QUICK_ACTIONS?o(Xb,{version:e,iconVersion:t,buttonSize:"medium"}):null,o(cx,{version:e,...n})]}),hx={"bg-white":"primary",transparent:"transparent"},px=Kt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=hx[e],portal:a,logo:i={},...r})=>{const{backwardButton:l,logo:s={}}=r.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...r,children:o("div",{className:"container px-lg py-2xs box-border",children:o(dx,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),gx=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=P();return o(g,{className:u("relative flex flex-col",zb[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",hh(l)),...Lb(a)}})})}),{childrenTypes:[]}),fx=Kt((e=>o(gx,{...e})),{childrenTypes:[]}),yx=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",dp[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),bx=["байт","Кб","Мб","Гб","Тб","Пб"],xx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ve(r),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",vx(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),vx=(e,t)=>e||t?o("span",{children:", "}):"",Nx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${bx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?Cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(xx,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:wx(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},wx=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Cx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},Sx=d((({href:e,__html:t,target:n,onClose:a})=>c(Vn,{maxWidth:"lg",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(si,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(An,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),kx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=gn(Sx),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[wx(i),o(ze,{font:"font-light",children:e})]}):null})),Ix={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Tx=Kt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=P();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",Ix[l]),role:"list",children:i.map(Rx(d,r))}):null]})})),Rx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Ex(t)(n,a):Nx(e,t)(n,a)},Ex=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(kx,{...a,icon:e,href:Dx(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},Dx=e=>"href"in e,_x=Kt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"p-m min-w-32":"min-w-24",b=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Pe,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Ke(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(ze,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),Px="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ox=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],Bx=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],Mx=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],Ax=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(ei,{text:i[e],...t(e)},e))),[l,s,d]=Fx({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=an(!1);return o("div",{children:e?.length?o("div",{children:c(oo,{children:[o("div",{children:o("div",{className:Px,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(so,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(An,{embedded:!0,onClick:n,children:[o(Ll,{children:"Очистить фильтр"}),o(Y,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c(co,{isUnfolded:m,children:[Vx("Драгоценные металлы",s),Vx("Специальные возможности",d)]})})]})}):null})})),Fx=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?Lx(t):zx(t),Lx=e=>{const t=[],n=[],a=[];for(const i of e)Ox.includes(i.key)&&t.push(i),Bx.includes(i.key)&&n.push(i),Mx.includes(i.key)&&a.push(i);return[t,n,a]},zx=e=>[e.slice(0,6),e.slice(6)],Vx=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(ze,{children:e}),o("div",{className:Px,children:t})]}):null}),$x=(e,t)=>e&&"underlined"!==t?"primary":"secondary",jx=(e,t,n)=>{const a=$x("all"===t),i=$x("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(An,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(An,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},Wx=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(qx)}):null]}):null,qx=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),Ux=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,Hx=()=>{},Kx=e=>"all"===e?"block":"hidden",Yx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Hx,renderRemoteWorkplaceCard:l=Hx,getBalloon:s=Hx,initFilterState:d=Oo,getBalloonRemoteWorkplaces:m=Hx,descriptionData:h,title:p})=>{const g=p?.includes("Офис"),[f,{field:y,reset:b}]=mn(d),{filteredItems:x,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=Lo({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[Ux(p,w),h?Wx(h):null,g&&jx(t,C,S),o("div",{className:u("pb-3xl",Kx(C)),children:o(Ax,{filters:Gx([...t,...i]),field:{field:y,reset:b},onlyOffice:g,labels:Bo})})]}),o("div",{className:"h-[600px]",children:o(Vo,{children:o(Qo,{points:v,isLoad:n,className:"h-full"})})})]}),c(Vo,{children:[x.map(r),N.map(l)]})]})})),Gx=e=>Object.keys(Oo).filter((t=>e.filter((e=>Mo[t](e))).length)),Jx=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Xx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Jx(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:Jx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(wo,{color:"green",children:Jx(s)})})]}),o(mo,{children:o(ro,{className:"flex-wrap",children:m?.map(((e,t)=>o(to,{...e},String(t))))})})]},String(d))},Qx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Jx(t)} №${n}`,body:e.toUpperCase()}),Zx=[];const ev=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:Zx},tv={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},nv=d((({descriptionData:e,className:t})=>{const n=Hy(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=yi(`${Ba}/atms?regionCode=${e}`,ev);return{data:t||Zx,isLoad:!t&&!n}}(a);return o(Yx,{className:t,data:i,isLoad:r,initFilterState:tv,renderCard:Xx,getBalloon:Qx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),av=({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(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(mo,{children:iv(t)})]},String(n)):null,iv=e=>c("div",{children:[c(ro,{className:"flex",children:[o(to,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(to,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(to,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(to,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(to,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),rv=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),lv={branches:[],remoteWorkplaces:[]};const sv=async e=>await zt(e,{method:"GET"})||lv,ov=d((({className:e})=>{const t=Hy(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=yi(`${Ba}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,sv);return{data:t||lv,isLoad:!t&&!n}}(n);return o(Yx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Do,renderRemoteWorkplaceCard:av,getBalloon:Po,getBalloonRemoteWorkplaces:rv,title:`Офисы филиала ${t?.name}`})})),cv=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(ov,{}):o(nv,{descriptionData:e})})})),dv=Kt((e=>{const{__html:t,dynamicQueryParamText:n={},dynamicTextSource:a,richVersion:i="",...r}=e,l=Jt(n,a?.list,t);return o(g,{defaultPadding:"p-0",...r,children:o(Fe,{__html:l,richVersion:i})})})),mv=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",uv=Kt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Ee(),[m,{toggle:h}]=an(t),p=o(co,{className:u("gap-lg",mv(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(so,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:l,...s,children:c(oo,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),hv={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"},pv=(e,t,n)=>(a,i)=>{const{button:r}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:gv(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[fv(a),r?.text?o(ke,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},gv=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=yv(e,r),s=r?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",l),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:bv({step:n,iconVersion:i,i:a,stepVersion:t})})})},fv=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",hv.description),children:e.description}):null,o(Fe,{__html:e.__html})]}),yv=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",bv=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return He(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?hv.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},xv=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:r="gray",version:l="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:l,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(pv(d,l,r))}):null,Ke(i,{isVertical:!0})]})})),vv=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(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Nv=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("absolute bg-white p-0 rounded-xl bottom-0 top-32 w-full",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Fn,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function wv(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Cv=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return wv(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Sv=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const kv=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(ze,{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(Iv,{...e},String(t))))})]}):null,Iv=d((({icon:e,...t})=>{const n=be(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Tv=(e,t)=>n=>n.name?o(Eg,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:ju(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Rv=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(ia,"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"})]}))),Ev=d((({defaultLocation:e})=>{const t=Hy(e),n=be(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Eg,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Dv=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ky(t?.default),[s,d]=a(""),m=cl(),u=l((()=>Ov(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,Pv)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(Vn,{maxWidth:"none",head:_v(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Sv(e.toLowerCase())(s.toLowerCase())>=.8)).map(Tv(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(ze,{size:"text-h6",children:e})}),t.map(Tv(f,g))]},e)))}),kv(e)]});var g,f})),_v=(e,t,n)=>c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Ev,{defaultLocation:n?.default}),o(Rv,{onSearch:t,searchTerm:e})]}),Pv=e=>e.name?.charAt(0)??"",Ov=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Bv=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=gn(Dv,n),{name:s}=Hy(),c=e?.current?.getBoundingClientRect(),d=r((()=>{const e=globalThis?.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px";const n=Q(X.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[X.SITE_URL]);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:s},"*")}),[s]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Nv,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:d,src:t?.src,width:c?.width||0})})})})),Mv="burgerMenuDialog",Av=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Pn})=>{const{open:i}=gn(Bv),[l]=Cv(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Mv,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Mv})),[e,n,t,a]);return[s,{toggle:s?a:o}]},Fv=[],Lv=Kt((({sticky:e,...t})=>{const{menuItems:n=Fv}=e??{},i=n.find((e=>"Меню"===e.title)),l=n.filter((e=>"Меню"!==e.title)),d=Math.floor(l.length/2),m=l.slice(0,d),u=l.slice(d),[h,p]=a(-1),[f,y]=a(""),{closeAll:b}=ge(),x=r((()=>{p(-1),y(""),b()}),[b]),v=aa(x),N=s(null),[C,{toggle:S}]=Av({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:x}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=ge(),c=r((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return r(((r,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();l({id:"left"===d?n[r].title:a[r].title,dialog:o(Nv,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[r].description||m[r].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[r]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:x}),I=r((e=>{e.stopPropagation(),x(),S()}),[x,S]),T=r(((e,t)=>{y(t),p(e),b(),k(e,t)}),[b,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(zv(T,"left",{activeIndex:h,currentItemPosition:f})),o(vv,{item:i,isActive:C,onClick:e=>I(e)}),u.map(zv(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),zv=(e,t,n)=>(a,i,r)=>o(vv,{item:a,isActive:r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:l=>{r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||l.stopPropagation(),e(i,t)}},a.title||String(i)),Vv={primary:"bg-white/30",secondary:"bg-main-divider"},$v={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},jv=d((({count:e,version:t="secondary"})=>{const n=Ee(),a=n?"bg-main-divider":Vv[t],i=$v[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),Wv=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},qv={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Uv={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Hv={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Kv={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Yv=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",qv[a],n?Kv[a]:Hv[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Uv[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Wv({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(jv,{count:m,version:$x(n,a)})}):null]})})})),Gv=d((e=>o(e?.item?.href?Jv:Xv,{...e}))),Jv=d((e=>{const t=be(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Yv,{...e,tag:"a",item:i,onClick:a})})),Xv=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(Yv,{item:e,onClick:a,...n})})),Qv="hidden sm:flex absolute z-40",Zv={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},eN=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=Th({itemCount:t?.length||0});return i((()=>tN(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(xh,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Zv[r].item,gap:Zv[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(Gv,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(Ph,{wcmsIgnore:!0,className:u("left-6",Qv,Zv[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Oh,{wcmsIgnore:!0,className:u("right-6",Qv,Zv[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),tN=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},nN={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},aN=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(nN[t].wrapper,e),children:o(eN,{className:nN[t].component,tabsType:t,...n})}):null,iN="sticky top-1 z-20",rN=Kt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=sN(n||{}),h=P(),p=ds(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),b=dN(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=x.findIndex((e=>Boolean(e?.selected))),N=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===b)),w=b?N:v,[C,S]=a(lN(w)),k=x[C],I=cN(x[C],C),T=r((e=>{const t=x.indexOf(e),n=x[t];S(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),h.replace(`${h.pathname}?${y}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[iN]:[s,f,!p].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[aN({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[iN]:[s,!f,!p].every(Boolean)}),items:oN(t,x),activeItem:k,tabsType:i,onChange:T}),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])=>D(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(cN)?.filter(Boolean)||[]}),lN=e=>e&&-1!==e?e:0,sN=({__id:e,anchor:t})=>t??e??"tabs",oN=(e,t)=>t?.length?t:e,cN=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",dN=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),mN=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),uN={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},hN=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:uN[t],children:e})}))),pN=d((({className:e="",isOpen:t,onClick:n})=>o(so,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),gN=e=>e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,fN=e=>e?o("div",{className:"text-l font-light",children:o(ze,{color:"text-secondary-text",children:e})}):null,yN=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,bN=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(pN,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[gN(e),fN(t),yN({__html:n,isDotted:a}),Ke(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),xN=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),vN=(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(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,NN=d((({rows:e})=>{return o(xh,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,r=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${xN(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(ze,{size:"text-xl",children:e.data}):null,e?.cols?vN(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),wN=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(ze,{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(NN,{rows:t.rowsData})})})]},a)}))}))),CN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),SN=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:CN(t===n),children:e||t+1})},e)))}):null,t?o(ke,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),kN=Kt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(SN,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(wN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(ze,{size:"text-h6",children:"Данных нет"})})})),IN=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(kN,{...t,onClick:n})}):null]}))),TN=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(IN,{tableInner:i,...n,children:[mN(e),t?.length?o(hN,{version:"tariff",children:t.map(((e,t)=>o(bN,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),RN=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),EN=Kt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(TN,{row:e,...l},String(t)))),[h,p]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=an(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(oo,{children:[c(RN,{children:[h,o(co,{isUnfolded:f,isOverflowVisible:!0,children:p})]}),o(so,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(RN,{children:m})})]})})),DN=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?_N():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?PN(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),_N=()=>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"}),PN=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),ON={AdTile:Qt,ApplicationForm:Jl,BankAccountFiltration:tp,BenefitsBlock:lp,BonusBenefitsBlock:cp,ButtonsBlock:mp,CalculatorBonus:bp,CalculatorBusinessDeposit:Rp,CalculatorCredit:hd,CalculatorDeposit:Xp,CalculatorRefinancing:sg,CardTransfer:fg,Carousel:Sg,CarouselCatalogCard:Tg,CarouselRecommendationCard:Bg,CarouselTariffsCard:Lg,DepositFiltration:Vy,ErrorBlock:qy,ExchangeRateTile:Nb,Footer:Fb,GalleryLayout:jb,GrantSupport:Kb,Header:px,Headline:k,HorizontalLayout:fx,ImgBlock:yx,LinkDocs:Tx,MobileAppTile:_x,OfficesAtmsMap:cv,ProductBlock:Xt,RichTextBlock:dv,RollupItem:uv,StepsBlock:xv,StickyBottomMenu:Lv,TabsLayout:rN,TariffsTable:EN,TextBlock:DN,VerticalLayout:gx,ApplicationLeadForm:lh,CreditCardForm:Hf,CreditForm:py,DebitForm:My,CashbackCalculator:Jg},BN=me((()=>{i((()=>{Gt()}),[]);const e=nn();na(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Ya({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const MN="cookie",AN=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=an();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(MN)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(MN,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Fe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Fn,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function FN(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);na(globalThis.document,"keydown",t)}const LN=d((()=>{const[e,{close:t}]=Cv(),n=Boolean(e.length);return FN(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),zN=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return wv(pe.observable,"popup",{open:t,close:n}),FN(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),VN="header",$N="footer",jN="sticky-footer",WN={},qN=d((({className:e,data:t=WN,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Ut(s,l),m=ds();BN(),Ky();const h={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[VN]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:D(i?.[VN],{...h,slotName:VN})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[_({block:t,options:h,extraProps:{className:"scroll-mt-12"}}),!m&&D(i?.[$N],{...h,slotName:$N})]})]}),i?.[jN]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:D(i?.[jN],{...h,slotName:jN})}):null,o(LN,{}),o(zN,{}),m?null:o(AN,{__html:d?.cookieContent?.__html})]})}));Object.assign(qN,{childrenTypes:[],slots:()=>[VN,$N,jN]});e.Blocks=ON,e.ContentPage=qN,e.handlerDecorator=me,e.joinList=jh,e.locationNavigator=en,e.packageVersion="0.14.988",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=P,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>p(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),p=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),h={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},h[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>x(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),x=(e,t)=>[e].concat(t>0?x(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const r=v[n]||"h3";return o(r,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),k={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:r="text-center",as:l,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const p=k[n],h={marginTop:p.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-normal",r),...p?.title,as:l||p?.title.as,title:a}):null,i?o(C,{size:p.descriptionSize,font:p.descriptionWeight,align:r,...h,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=I,blocksRegistry:l={},ancestors:s=T}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const E=[],D=(e,{key:t,ancestors:n=E,slotName:a=null,extraProps:i,renderProps:r=R,...l})=>{const s=i?(e,t)=>R(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||E,[l.parent,a]]:n},i)))};function _({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?D(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function P(){return P._impl()}P._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),P.setup=e=>{P._impl=e};const O=["CDN","BASE_PATH"],B=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return O.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),A=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:M,isLocalURL:A,isHash:F,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,W=[B.CDN,$],q=e=>(t,n)=>{if(U(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${j}/${t}/attachment`;const a=t?.startsWith("/");return L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U=e=>!e||M(e)||F(e)||W.some(z(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},K={small:"16",medium:"24",large:"48",xl:"78"},Y=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&K[l],height:d=s})=>{const m=P(),p="normal"===r?`${n}.svg`:`sprites.svg#${n}`,h=q(m)(L(B.CDN,"/icons/",p));return"normal"===r?o("img",{className:e,style:G(e,d),src:h,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(J,{className:e,children:c("svg",{className:u(H[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),G=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},J=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(X.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=P();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class pe{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 he=new pe,ge=()=>ue(he.emitter,"dialog"),fe="/",ye=["/api"];function be(){const e=P(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Q(X.SITE_URL);xe(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const xe=(e,t,n)=>A(e,t)&&![...ye,...X.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ke=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Se=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=be()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ke({className:e,rounded:a,version:n}),children:i})));function Re({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Se,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ee=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},De={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},_e=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&De[n],t),children:e}):null,Pe=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:p,isImageAlwaysOnRight:h=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...b})=>{const x=Ee(),v=P(),N=r((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!x;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Re({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[_e(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-auto"),children:[Oe(p,y),Me(_({...b,extraProps:{className:"@container-normal"}})),_e(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(h)]:l,"col-start-2 self-center":h,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Oe=(e,t)=>e||t?c("div",{className:"space-y-lg",children:[e,t]}):null,Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Me=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Fe=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Le=(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,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Le(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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?Ae(n.icon,t):null,o("div",{children:$e(n)})]}))),We=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(je,{benefitsVersion:t,...e},String(n))))}):null)),qe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap($e)}):null)),Ue=d((({isTabularBenefits:e,...t})=>o(e?qe:We,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ke=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(Ye(n))}):null,Ye=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ge(i,l),d=Ge(r,l);return a||i?.icon?o(Se,{className:u("basis-full @lg:basis-auto",e),appendLeft:Je({...i,iconVersion:c}),appendRight:Je({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ge=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Je=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Xe=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Qe=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(Ze)}):null)),Ze=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{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:[Xe(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:p,isFullWidthTitle:h,priceList:g=[],tags:f=[],buttons:y,image:b,imageOptions:{imageAlign:x="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const R=b?.src?o(ie,{image:b,imageClassName:C}):null,E=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Pe,{className:e,padding:t,defaultPadding:n,...h?{title:E}:{insetTitle:E},...ot(R,v),isImageSecondary:w,imageAlign:x,isImageAlwaysOnRight:N,buttons:Ke(y),backwardButton:k,...T,children:st(it(D,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:p,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(Ue,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Qe,{priceList:e}):null,st=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),pt=(...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 ht=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!ht(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class bt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(ht(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class xt extends dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=pt([e=>ht(this._)||"number"==typeof e,()=>bt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>xt.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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},kt=[],St=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=kt)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Rt=Ct(((e,t)=>t.reduce(Tt.fn,e))),Et=e=>It(((e,[t,n])=>Dt(n)?[...e,[t,yt(n)]]:e))(e,[]),Dt=e=>0===e.size();Ct(((e,t=kt)=>t.reduce(((e,t)=>e.get(t)),e)));const _t=Ct(((e,[t,...n])=>n.length?e.set(t,_t(e.get(t),n)):e.filter((([e])=>e!==t)))),Pt=(Ot=["$ref"]).map(((e,t)=>n=>St(e)(n[t+n.length-Ot.length]))).reduceRight(ut,mt);var Ot;const Bt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Mt,e),Mt=pt([ht,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),At=(e,t)=>((e,t={})=>n=>Rt(t,Et(n).map((t=>e(t)))))((([e,n])=>{return Pt(e)?[(a=e,a.slice(0,-1)),Bt(t(n),n)]:[e,n];var a}))(e),Ft=e=>Et(e).filter(((e=ft)=>([t])=>e(t))(Pt)),Lt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},Wt=["/portal-resources"],qt=(e,t)=>At(e,(e=>t?.[e])),Ut=(e,t)=>{const n=Lt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?qt(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!Wt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Lt(e)));return i.length?Ht(i,a):a}return t};function Kt(e,t={}){const n=d((t=>{const n=Ut((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Yt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Yt)||"";return e&&globalThis.sessionStorage?.setItem(Yt,e),e}const Jt=(e={},t=[],n="")=>{const{queryParam:a,value:i}=e,r=((e,t)=>new URLSearchParams(t).get(e))(a??"utm_source",Gt()),l=t.find((e=>e?.id?.toLowerCase()===r?.toLowerCase()))?.value;return l?n?.replace(String(i),l):n},Xt=Kt((({className:e,padding:t,defaultPadding:n,dynamicQueryParamText:a={},dynamicTextSource:i,description:r,title:l,...s})=>{const{textType:c}=a,d=Jt(a,i?.list,"title"===c?l:r),m={title:"title"===c?d:l,description:"description"===c?d:r};return o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...s,children:o(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...m,...s})})})),Qt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Zt(0,t?.length)),[t]),a=t?.[n];return a?o(Xt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Zt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e);function en(){return en._impl()}en._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),en.setup=e=>{en._impl=e};const tn=async e=>{const t=e.target?.closest("a"),n=en();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Gt();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function nn(){return nn._impl()}function an(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}nn._impl=()=>({forwardQuery:tn}),nn.setup=e=>{nn._impl=e};const rn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],ln=e=>!e?.length,sn=e=>t=>n=>e(n)?[]:[t],on={},cn=[];const dn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function mn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=dn(i,r)?i:r;return!dn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),p=s(un(e)),[h,{setTrue:g,setFalse:f}]=an(!1),y=s({}),[b,{isValid:x,errors:v}]=function(e,t){const n=l((()=>t?.(e)??on),[t,e]),a=l((()=>rn(n)(e)??cn),[n,e]),i=ln(a);return[n,{isValid:i,errors:a}]}(m,n),N=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||y.current?.[String(e)],s=t?.validator??b[e],o=l&&s?s(r):[];return{setFieldRef:t=>{p.current&&(p.current[e]=t)},fieldRef:p.current?.[e],value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{y.current||={},y.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,b,u]),w=r((e=>{y.current=e,u(e)}),[u]),C=r((()=>{y.current={},f(),u(e)}),[e,u]),k=r((e=>{if(e.preventDefault(),x)t&&C(),d?.(m,e);else{const e=pn(m,b);g(),N(e).fieldRef?.scrollIntoView({behavior:"smooth"})}}),[t,m,x,C,d]);return[m,{errors:v,field:N,update:w,reset:C,onSubmit:k}]}const un=e=>Object.keys(e).reduce(((e,t)=>({...e,[t]:null})),{}),pn=(e,t={})=>{const[n=""]=Object.entries(e).find((([e,n])=>t[e]?.(n)?.length))??[];return n},hn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function gn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const fn=/^[а-яё-]*$/i,yn=(e,t)=>{if(!e||isNaN(e.getTime()))return!1;const{minLimit:n,maxLimit:a}=t,i=e.getTime();return bn(i,n)&&xn(i,a)},bn=(e,t)=>!(t&&!isNaN(t.getTime()))||e>t.getTime(),xn=(e,t)=>!(t&&!isNaN(t.getTime()))||e<t.getTime(),vn=sn((e=>null!=e&&""!==e)),Nn="Некорректно заполненное поле",wn=e=>vn(e??Nn),Cn=e=>sn((e=>e?.key&&""!==e?.key))(e??Nn),kn=e=>sn((e=>"string"==typeof e&&e.length>1&&((e="")=>fn.test(e))(e)))(e??Nn),Sn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),In=e=>/^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Tn=e=>sn(Sn)(e),Rn=sn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),En=e=>"string"==typeof e&&(10===e.length||12===e.length),Dn={fullName:wn(),addressBranch:Cn(),desiredMeetingDate:wn(),product:wn(),localities:wn(),partnerComments:wn(),collectionCount:wn(),acquiringType:Cn(),serviceType:Cn(),annualRevenue:wn(),feedbackMethod:Cn(),serviceDirection:Cn(),secondaryPhone:Tn("Укажите номер телефона"),region:Cn(),situationDescription:wn(),sufferedFrom:wn(),applierType:wn(),surname:kn("Укажите свою фамилию на кириллице"),name:kn("Укажите своё имя на кириллице (без сокращений)"),middleName:kn("Укажите своё отчество на кириллице"),birthday:(_n="Укажите дату рождения",sn((e=>yn(e,{maxLimit:new Date})))(_n)),phone:Tn("Укажите номер телефона"),email:(e=>sn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),inn:(e=>sn((e=>En(e)))(e))("Укажите ИНН"),comment:wn(),typeForm:wn(),consentToReceiveMaterials:Rn,consentDataProcessing:Rn,partnerSymbolCode:wn("Укажите идентификатор партнёра"),dadataPartyInnSelect:(e=>sn((e=>Boolean(e?.text)&&En(e.text)))(e))("Укажите ИНН"),dadataPartyNameSelect:wn("Укажите наименование организации"),callbackTime:wn(),questionProduct:wn(),russianPhone:(e=>sn(In)(e))("Укажите номер телефона"),cityOfResidence:wn(),internshipStartDate:wn(),internshipEndDate:wn(),university:wn(),fieldOfStudy:wn(),courseYear:wn(),graduationYear:wn(),averageGrade:wn(),skillsAndKnowledge:wn(),educationLevel:Cn(),motivationForInternship:wn(),workExperience:wn(),internshipDirection:wn(),workingHours:wn()};var _n;const Pn=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...Dn,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(On(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(On(a)).filter(Bn(e)).map((({name:e})=>[e,a[e??""]]))):r},On=(e={})=>({name:t})=>Boolean(e[t??""]),Bn=e=>t=>!t?.condition||t.condition.values.some((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),Mn=()=>{},An={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Fn=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Ln=u("bg-main-gray text-main-disabled cursor-not-allowed"),zn=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:p,children:h,wcmsIgnore:g,onClick:f=Mn})=>{const y=r("tab"!==c?me(f):f,[c,f]),b=l((()=>ve(m)),[m]),x="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[An[n]]:!s&&!i,[Fn]:i,[Ln]:s},i?"justify-between":"justify-center",i||x?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":x},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":p,"data-wcms-ignore":g,...b,onClick:y,children:h})})),Vn=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(Y,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),$n={sm:"max-w-sm top-1/3",lg:"max-w-lg","4xl":"max-w-4xl",none:"mt-0"},jn={center:"relative mx-auto",corner:"absolute bottom-0 right-0"},Wn=d((({head:e,maxWidth:t="4xl",children:n,onClose:a,onClick:i,position:r="center"})=>{const l=Ee();return c("div",{className:u("bg-white p-lg pb-6xl my-6xl rounded-lg w-full",$n[t],jn[r],{"mr-3xl":!l&&"corner"===r},{"mb-12":l}),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Vn,{className:"absolute top-0 right-0 z-10",onClose:a}),o("div",{className:"container",children:e})]}),o("div",{className:"container",children:n})]})})),qn=d((({ok:e,typeForm:t,onClose:n,errorMessage:a})=>{const i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся",r=a||"Пожалуйста, повторите позднее";return o(Wn,{maxWidth:"lg",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?i:r,headlineVersion:"XS",isEmbedded:!0}),o(zn,{type:"button",onClick:n,children:"Хорошо"})]})})})),Un=[{key:"ULTRASERVICE",text:"Ультра"}],Hn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Kn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Yn="client",Gn=[{key:Yn,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],Jn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Xn=[{key:"Перезвонить сейчас",text:"Перезвонить сейчас"}],Qn=[{key:"Вопрос по действующему продукту",text:"Вопрос по действующему продукту"},{key:"Оформление нового продукта",text:"Оформление нового продукта"}],Zn=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],ea=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ta=[{key:"economics",text:"Экономика и финансы"},{key:"audit",text:"Аудит"},{key:"law",text:"Юриспруденция"},{key:"it",text:"ИТ"},{key:"marketing",text:"Маркетинг"},{key:"hr",text:"HR"},{key:"analytics",text:"Аналитика"},{key:"management",text:"Менеджмент"},{key:"administration",text:"ГМУ"},{key:"design",text:"Дизайн"},{key:"journalism",text:"Журналистика"},{key:"contact",text:"Контакт-центр"},{key:"other",text:"Другое"}],na=[{key:"20",text:"20"},{key:"30",text:"30"},{key:"40",text:"40"}],aa=[{key:"bachelor",text:"Бакалавриат"},{key:"specialist",text:"Специалитет"},{key:"master",text:"Магистратура"},{key:"doctorate",text:"Аспирантура"}],ia=({label:e,required:t=!1})=>e&&t?`${e}*`:e,ra=e=>o("div",{className:"min-h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),la=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},sa=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null;function oa(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function ca(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return oa(globalThis.document,"click",n),t}const da="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",ma=e=>e?da:"border-error",ua="w-full border rounded-md text-primary-text outline-none p-m",pa=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:p="",valid:h=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:b=!1,children:x,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),k=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const S=x?"pr-3xl":"",I=ma(h),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[sa(d),y?o("textarea",{className:u("block resize-y min-h-24",ua,I),id:u("textarea",n),value:p,name:a||n,placeholder:m,disabled:b,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",ua,S,I),id:n,type:l,value:p,name:a||n,placeholder:m,pattern:g,disabled:b,"aria-label":T,onChange:k,onFocus:N,onBlur:w},e)]}),x]})})),ha=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:p,isOpen:h,onOpen:g,onClose:f,required:y,onChange:b=Mn,...x})=>{const v=ca(f),N=r((e=>{const t=m&&e.length>m;!h&&g(),t||b(ga(e,s))}),[h,b]);return c("div",{className:u("shrink-0 w-full",e),ref:v,onBlur:f,onFocus:g,children:[o("div",{ref:p,children:o(pa,{type:l||"text","aria-label":t,label:ia({label:t,required:y}),valid:Boolean(!a),onChange:N,placeholder:fa({placeholder:d,errors:i,label:t}),value:n,...x})}),ra(a)]})})),ga=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,fa=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ya=d((e=>{const[t,{setFalse:n,setTrue:a}]=an();return o(ha,{isOpen:t,onOpen:a,onClose:n,...e})})),ba=({query:e,isDisabled:t,onChangeQuery:n,inputProps:a})=>o("div",{className:"absolute top-0 w-full z-20",children:o(ya,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e),maxLength:a?.maxLength,isInteger:a?.isInteger??!1})}),xa=(e,t)=>o(Y,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),va=e=>e?.text||e?.key||"",Na=({isManualInput:e,query:t,value:n,placeholder:a})=>e&&t?t:va(n)||a,wa=({isBorder:e=!0,valid:t=!0,isDisabled:n=!1,isOpen:a=!1,onOpen:i=Mn,onClose:r,isManualInput:l=!1,query:s="",value:d,placeholder:m="",iconVersion:p="black",options:h=[]})=>{const g=Ca(l,h,s);return c("div",{className:u({"border rounded-md":e},{"hover:border-primary-hover":e&&!n},n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error","h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden"),onClick:a?r:i,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Na({isManualInput:l,query:s,value:d,placeholder:m})}),g?"":xa(a,p)]})},Ca=(e,t,n)=>!(!e||!n?.length)||e&&!t.length,ka=()=>ue(he.emitter,"popup"),Sa=(e,t,n=!1)=>e?.length&&t?.trim()&&!n?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Ia=d((({popupRef:e,options:t,value:n,iconVersion:a,onChange:i,renderOptions:r=Ta,query:l,onChangeQuery:s,disableFilterOptions:d})=>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:Sa(t,l,d).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&(s?.(""),i(e))},children:[r(e),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:a,className:u("absolute right-2 pt-2xs",{hidden:e.key!==n?.key})})]},e.key)))}):null)),Ta=e=>o("span",{className:"min-h-6",children:va(e)});const Ra=d((({className:e,label:t,options:n=[],value:d,isSearch:m=!1,isManualInput:p=!1,disabled:h=!1,iconVersion:g="black",onChange:f,onSearchQuery:y=Mn,inputProps:b,disableFilterOptions:x=!1,renderOptions:v,...N})=>{const[w,{setFalse:C,setTrue:k}]=an(),[S,I]=a(""),T=h||!p&&0===n.length,R=l((()=>la((e=>y(e)),300)),[y]),E=r((()=>{T||k()}),[T]),D=r((()=>{!m&&I(""),C()}),[p]),_=r((e=>{I(e),p&&f?.({key:e,text:e}),R?.(e)}),[p,f,R]),P={query:S,value:d,options:n,isOpen:w,iconVersion:g,renderOptions:v,isSearch:m},O=function({isOpen:e,options:t,value:n,query:a,onChange:l=Mn,onClose:c=Mn,iconVersion:d,disableFilterOptions:m=!1,onChangeQuery:u=Mn,renderOptions:p}){const h=ka(),g=r((()=>{h.close(),c()}),[c]),f=r((e=>{g(),l(e)}),[g,l]),y=s(null),b=ca(g);return i((()=>{if(!e||!y.current)return;const i=y.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();h.open({popup:o(Ia,{popupRef:b,options:t,value:n,query:a,iconVersion:d,disableFilterOptions:m,onChange:f,onChangeQuery:u,renderOptions:p}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,f]),y}({onChange:f,onClose:D,disableFilterOptions:x,onChangeQuery:I,...P});return c("div",{className:u("space-y-xs",e),children:[sa(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:O,children:[wa({isDisabled:T,onClose:D,onOpen:E,isManualInput:p,...P,...N}),m&&w?ba({query:S,isDisabled:T,inputProps:b,onChangeQuery:_}):null]})]})})),Ea=d((({className:e="",label:t,error:n,required:a,...i})=>c("div",{className:e,children:[o(Ra,{...i,valid:!n,label:ia({label:t,required:a})}),ra(n)]}))),Da=d((({field:e,input:t})=>o(Ea,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Jn,...e(t?.name??""),...t}))),_a=(e="")=>Boolean("trade"===e||"all"===e),Pa=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:p,isPremium:h,dadataPartyNameSelect:g,dadataPartyInnSelect:f,...y}=e,b=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${_a(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,x={...y,...Aa(o),...Ma(c),...d&&{inn:d},...b?{partnerComments:b}:{},...s?{typeForm:s}:{},...Ba(m?.text,u),...Oa(p),...Fa([[f,"inn"],[g,"fullName"]])};return Object.fromEntries(Object.entries(x)?.map((([e,t])=>[e,t?.key||t])))},Oa=e=>e?.key?{isClient:e?.key===Yn}:{},Ba=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Ma=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Aa=e=>e?{vedTypes:Object.fromEntries(ea.map((({id:t})=>[t,t===e])))}:{},Fa=e=>e.reduce(((e,[t,n])=>(t?.text&&n&&(e[n]=t.text),e)),{}),La={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Jn[0],serviceType:Un[0],feedbackMethod:Kn[0],serviceDirection:Hn[0],vedTypes:ea[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},za=()=>{const e=(new Date).getTimezoneOffset(),t=Math.abs(e),n=t%60;return`GMT${e<0?"+":"-"}${Math.floor(t/60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Va="/api/v1",$a={lead:{withTypeForm:!0,isNaturalEndpoint:!0},sendcorporatelead:{withTypeForm:!0,isNaturalEndpoint:!1},practice:{withTypeForm:!1,isNaturalEndpoint:!0},internship:{withTypeForm:!1,isNaturalEndpoint:!0},initcorporatelead:{withTypeForm:!1,isNaturalEndpoint:!1},callback:{withTypeForm:!1,isNaturalEndpoint:!0}},ja=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Wa=e=>e?.replace(/[^+\d]/g,""),qa=({body:e,endpoint:t,router:n})=>{const a=t&&$a[t].isNaturalEndpoint,i=t&&$a[t].withTypeForm,{typeForm:r,region:l,phone:s="",email:o,birthday:c,desiredMeetingDate:d,fullRegion:m,addressBranch:u,secondaryPhone:p="",bankEmpolee:h,applicationDate:g,partnerName:f,russianPhone:y,partnerSymbolCode:b,internshipEndDate:x,internshipStartDate:v,...N}=e;return{...i?{typeForm:r}:{},...Ka(l,a),...Ya(o,a),...Ua(s),...Ua(y),...a?Ha([[c,"birthday"]]):{birthday:c},...Ha([[d,"desiredMeetingDate"],[x,"internshipEndDate"],[v,"internshipStartDate"]]),..."FEEDBACK"===r?{}:{addressBranch:u,bankEmpolee:h,applicationDate:g,...Ga(p)},...Xa(r,n),...Ja(r,{fullRegion:m,partnerName:f,partnerSymbolCode:b}),...N}},Ua=e=>e?{phone:Wa(e)}:{},Ha=e=>Object.fromEntries(e.filter((([e])=>e)).map((([e,t])=>[t,ja(e)]))),Ka=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Ya=(e,t=!0)=>({[t?"email":"mail"]:e}),Ga=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Wa(e)}:{},Ja=(e,t)=>"PF"===e?{region:t?.fullRegion,partner:t?.partnerName,partnerId:t?.partnerSymbolCode}:{},Xa=(e,t)=>"UNIVERSAL"===e?{typeForm:t?.pathname?.split("/")?.at(-1)||"/"}:{};function Qa(){return{send:async function({body:e,router:t,endpoint:n}){const a=n&&ti(n,e),i=`${Va}/${a}`,r=qa({body:e,endpoint:n,router:t});try{const e=await Za(i,r);return e?.ok?await e.json():null}catch(e){return null}},sendCode:async function({phone:e}){const t=(e=>({...Ua(e)}))(e);try{const e=Za(`${Va}/initCorporateLead`,t).then((async e=>{if(!e.ok)throw new Error(`Ошибка HTTP: ${e.status}`);return await e.text()}));return await e}catch(e){return null}},checkCode:async function({reqId:e,code:t,body:n,router:a}){const i={requestId:e,confimationCode:t,leadRequest:qa({body:n,router:a})};try{const e=await Za(`${Va}/confirmCorporateLead`,i);return await e.json()}catch(e){return null}},sendPhoneCallRequest:async function(e,t){const n=qa({body:e,endpoint:t}),a=ei(n);try{const e=await Za(`${Va}/callback`,a);return e?.ok?await e.json():null}catch(e){return null}}}}const Za=(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(t)}),ei=e=>{const{typeForm:t,consentDataProcessing:n,phone:a,...i}=e;return{...i,phone:a?.startsWith("+")?a.slice(1):a,clientTimezone:za()}},ti=(e,t)=>{const{serviceDirection:n}=t;return"lead"===e&&"Юридическое лицо / ИП"!==n?"lead":e},ni=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}},ai=Qa(),ii=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","extraSmall"===a&&"border-2 h-4 w-4","small"===a&&"border-4 h-8 w-8","big"===a&&"border-8 h-28 w-28",e),role:"status"})}))),ri=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(zn,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(ii,{blur:!0,size:"small"}):null,n]}))),li=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),si=[{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"}],oi=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(li,{paths:si,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(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":ui(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:mi(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ci(n)]})})})),ci=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",mi=(e=!1)=>e?"radio":"checkbox",ui=(e=!1)=>u("rounded border",{"bg-primary-main":e}),pi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},hi={primary:An.primary,secondary:An.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:An.secondary,transparent:"","":""},gi=d((e=>{const t=be(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:p,onClick:h}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[hi[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:h,...ve(m),children:p??fi(r,l)})})),fi=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,yi=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(gi,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),bi=({consentDataProcessing:e,link:t,button:n,typeForm:a})=>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(oi,{...e}),o(yi,{link:t})]}),ra(pi(e,Rn).error)]}):o(yi,{text:"PF"===a?"Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ":"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(ri,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),xi=e=>null!=e,vi=new Map,Ni=(e,t=vi)=>n=>{const a=Ci(n),i=t.get(a);if(a&&xi(i))return i;const r=e(...n);return a&&xi(r)&&t.set(a,Promise.resolve(r)),r},wi=e=>Boolean(e?.every((e=>Array.isArray(e)?wi(e):!e||"string"==typeof e))),Ci=e=>wi(e)?e.toString():"",ki=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Si(e,t,{fallback:n,cache:r}={}){const s=l((()=>Ii(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(xi))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Ni(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&ki(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Ii(e){return Array.isArray(e)?e:e instanceof Function?Ii(e()):[e]}const Ti=`${Va}/branches`,Ri=[];const Ei=async e=>await zt(e,{method:"GET"})||Ri;function Di(e=!1){const{data:t}=Si(`${Va}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const _i=(e="")=>"ULTRASERVICE"===e,Pi=d((({field:e,input:t,params:n})=>{const a=_i(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?Di(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Si(e?`${Ti}?regionCode=${e}`:null,Ei);return t||Ri}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Ea,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0,...t})})),Oi=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Bi=(e,t,n)=>Math.max(t,Math.min(e,n));function Mi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ai({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:r,onChange:t=>{const n=Mi(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const Fi=1,Li=100,zi=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:Fi),max:s=(i.length?i.length-1:Li),step:d=1,value:m=i[0]||l,disabled:p=!1,onChange:h}=e,g=Oi(e,{normalize:(e=0)=>i.length?Vi(i)(e):Bi(e,l,s),format:Xe()}),f=r((e=>{h&&h(Mi(e.target?.value))}),[h]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m box-border","text-primary-text",da,"disabled:border-gray disabled:bg-main-divider"),disabled:p,onChange:f,...g}),Ai({list:i,min:l,max:s,step:d,disabled:p,value:m,onChange:h})]}),$i(a)]})})),Vi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),$i=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ji=["От 1 000 ₽","До 1 000 000 000 ₽"],Wi=d((({field:e,input:t})=>o(zi,{title:"Сумма, ₽",items:ji,min:1e3,max:1e9,...e(t?.name??""),...t}))),qi=d((({field:e,input:t})=>o(ya,{label:"Годовая выручка, ₽",...e(t?.name??""),...t}))),Ui=d((({field:e,input:t})=>o(ya,{label:"Дата и время обращения в Банк",...t,...e(t?.name??"")}))),Hi=d((({field:e,input:t})=>o(Ea,{label:"Тип обратившегося",...t,options:Gn,...e("applierType")}))),Ki=d((({field:e,input:t})=>o(ya,{label:"Средний балл обучения",type:"number",...e(t?.name??""),...t}))),Yi=d((({field:e,input:t})=>o(ya,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??""),...t}))),Gi=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,weekends:s,onDateClick:c})=>{const d=[];let m=1;for(let u=0;u<6;u++){const p=[];for(let d=0;d<7;d++)if(0===u&&d<t)p.push(o("td",{},`empty-${d}`));else if(m>n)p.push(o("td",{},`empty-${d}`));else{const t=new Date(i,a,m),n=Ji(t,e),d=Xi(t,r,l),u=Qi(t,s),h=d||u;p.push(o("td",{children:o("div",{className:Zi(n,h),onClick:()=>!h&&c(t),children:m})},`day-${m}`)),m++}d.push(o("tr",{children:p},`row-${u}`))}return d},Ji=(e,t)=>t&&e.toDateString()===t.toDateString(),Xi=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Qi=(e,t)=>{if(!t||0===t.length)return!1;const n=0===e.getDay()?7:e.getDay();return t.includes(n)},Zi=(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"),er=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],tr=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,weekends:r,onDateSelect:s=Mn})=>{const{firstDayOfWeek:d,totalDays:m}=l((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:er.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Gi({firstDayOfWeek:d,today:e,totalDays:m,currentYear:n,currentMonth:t,min:a,max:i,weekends:r,onDateClick:s})})]})})),nr=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function ar(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(ir),r=a.map(((e,t)=>lr(e)?a.slice(0,t).filter(lr).length:-1)),l=a.map(((e,t)=>rr(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const ir=e=>"_"===e,rr=e=>/\d/.test(e),lr=e=>ir(e)||rr(e),sr=1940,or={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},cr=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const p=s(null),[h,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{mr({inputValue:h,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[h]),c("div",{onClick:()=>{null!==p.current&&p.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:p,className:"h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none",value:h,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(ar(t,"__.__.____"))},onBlur:()=>{dr(h)?mr({inputValue:h,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(Y,{className:"mr-s",...or})]})})),dr=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=sr&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},mr=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(dr(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},ur=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(cr,{onChange:a,disabled:l,onClick:e,value:t&&ja(t),setSelectedMonth:i,setSelectedYear:r,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),pr=nr.map((e=>({key:e}))),hr=Array.from({length:(new Date).getFullYear()-sr+1},((e,t)=>sr+t)).reverse().map((e=>({key:String(e)}))),gr=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},fr=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},yr={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},br={className:"min-w-32",iconVersion:"black",isBorder:!1},xr=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,weekends:p,onChange:h})=>{const[g,{setValue:f,setFalse:y}]=an(!1),[b,x]=a(n?.getMonth()||(new Date).getMonth()),[v,N]=a(n?.getFullYear()??(new Date).getFullYear()),w=r((e=>{h?.(e),y()}),[h]),{handlePrevMonth:C,handleNextMonth:k,handleSelectMonth:S,handleSelectYear:I,monthsOptions:T,yearsOptions:R,handleChangeVisibleCalendar:E,ref:D}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=ca(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(nr.indexOf(e));const t=gr(l,nr.indexOf(e));fr({maxDateOfMonth:t,selectedYear:l,selectedMonth:nr.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:pr,yearsOptions:hr,ref:c}})({onYearSelect:N,onMonthSelect:x,onShowCalendar:f,selectedYear:v,selectedMonth:b,showCalendar:g,onChange:h,value:n}),_=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(D,370);return c("div",{className:u("space-y-xs",e),ref:D,children:[sa(t),c("div",{className:"relative",children:[ur({handleChangeVisibleCalendar:E,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:N}),g&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":_}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:C,children:o(Y,{...yr,className:"-rotate-90 cursor-pointer"})}),o(Ra,{onChange:S,value:{key:nr[b]},options:T,...br}),o(Ra,{onChange:I,value:{key:String(v)},options:R,...br}),o("div",{className:"my-auto",onClick:k,children:o(Y,{...yr,className:"rotate-90 cursor-pointer"})})]}),o(tr,{today:n,currentMonth:b,currentYear:v,min:s,max:d,weekends:p,onDateSelect:w})]}):null]})]})})),vr=d((({className:e,label:t,error:n,required:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(xr,{label:ia({label:t,required:a}),valid:Boolean(!n),...i}),ra(n)]}))),Nr=d((({field:e,input:t})=>{const n=new Date;return o(vr,{label:t?.label||"Дата рождения",...e(t?.name??""),maxDate:n,...t})})),wr=d((({field:e,input:t})=>o(Ea,{label:"Когда перезвонить?",...t,options:Xn,...e(t?.name??"")}))),Cr=d((({field:e,input:t})=>o(ya,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??""),...t}))),kr=d((({field:e,input:t})=>o(ya,{className:"col-span-2",...e(t?.name??""),placeholder:t?.placeholder??"Ваше сообщение",isTextarea:!0,...t})));function Sr(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const Ir=e=>({value:e?.value||""}),Tr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=Ir,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(s)},Rr=async e=>(await Tr({url:"suggest/party",query:e})).map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))),Er={dadataPartyInnSelect:{fieldValue:"inn",linkedFieldName:"dadataPartyNameSelect",linkedFieldValue:"fullName"},dadataPartyNameSelect:{fieldValue:"fullName",linkedFieldName:"dadataPartyInnSelect",linkedFieldValue:"inn"}},Dr={dadataPartyInnSelect:{label:"ИНН",inputProps:{isInteger:!0,maxLength:12}},dadataPartyNameSelect:{label:"Полное наименование"}},_r=d((({field:e,input:t={}})=>{const n=t.name??"",i=Er[n].linkedFieldName,r=e(i).value,s=r?.data;Sr((async()=>{if(s?.fullName&&s?.fullName!==e(n)?.value?.data?.fullName){const t=Pr(r),{fullName:a,address:l,inn:s}=t,o=Br(t,i),c=Rr(o);u(o),d(await c),e(n)?.onChange?.({key:s,text:o,data:{fullName:a,address:l}})}}),[s]);const[c,d]=a([]),[m,u]=a("");Sr((async()=>{const e=Rr(m);return d(await e),c}),[m]);const p=l((()=>(c||[]).map(((e={})=>({key:e.inn??"",text:e[Er[n].fieldValue],data:{fullName:e.fullName,address:e.address}})))),[c]);return o(Ea,{...t,...Dr[n],options:p,...e(t.name??""),isSearch:!0,isManualInput:!0,disableFilterOptions:!0,onSearchQuery:u,renderOptions:Or})})),Pr=e=>({inn:e?.key,fullName:e?.data?.fullName,address:e?.data?.address}),Or=e=>c("span",{children:[o(ze,{size:"text-s",children:e?.data?.fullName}),c("div",{className:"space-x-2",children:[o(ze,{size:"text-s",font:"font-light",children:e?.key}),o(ze,{size:"text-s",font:"font-light",children:e?.data?.address})]})]}),Br=(e,t)=>e?.[Er[t].linkedFieldValue],Mr=d((({field:e,input:t})=>o(vr,{label:"Желаемая дата встречи",...e(t?.name??""),...t}))),Ar=d((({field:e,input:t})=>o(ya,{label:"Электронная почта",...e(t?.name??""),...t}))),Fr=d((({field:e,input:t})=>o(Ea,{label:"Способ получения ответа",options:Kn,...e(t?.name??""),...t}))),Lr="Файл не соответствует допустимым расширениям",zr="Ошибка при загрузке файла. Попробуйте загрузить файл позднее",Vr="SUCCESS";const $r=(e,t)=>new Promise((n=>{let a=e;const i=(100-e)/30,r=()=>{a+=i,a>=100?(t(100),n()):(t(a),setTimeout(r,16))};r()})),jr=d((({step:e=10,description:t,showPercentage:n=!0,isOnlyInteger:a=!1})=>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:[a?Math.round(e):e,"%"]}):null,t?o("div",{className:"text-right pr-m text-gray",children:t}):null]})]}))),Wr={name:"DocIcon",iconVersion:"black",width:"24",height:"24"},qr=({label:e,inputRef:t,id:n,key:a,type:i,name:r,pattern:l,disabled:s,onChange:d=Mn,onFocus:m,onBlur:p,extensions:h,uploadResponse:g,file:f})=>{const y=e??r??n;return o("div",{children:g?.status===Vr?Hr(f):c("div",{className:"flex items-center space-x-2",children:[o(Y,{className:"inline-block",...Wr}),sa(e),o("input",{ref:t,className:u("h-14 hidden"),id:n,type:i,name:r||n,pattern:l,disabled:s,"aria-label":y,onChange:e=>{e?.target?.files&&d(e?.target?.files[0])},onFocus:m,onBlur:p,accept:Ur(h)},a)]})})},Ur=(e=[])=>e.map((e=>{const t=String(e).trim();return t.startsWith(".")?t:"."+t})).map((e=>e.toLowerCase())).filter(((e,t,n)=>n.indexOf(e)===t)).join(", "),Hr=e=>o("span",{children:e?.name}),Kr=(e,t)=>{const n=e?`Поддерживаемые форматы файлов - ${e.join(", ")}. `:"";return o(ze,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:n+(t?`Максимальный размер файла - ${t}Мб.`:"")})},Yr=({from:e,to:t,onUpdate:n=Mn,minDuration:a=300})=>new Promise((i=>{const r=performance.now(),l=()=>{const s=performance.now()-r,o=Math.min(s/a,1),c=1-Math.pow(1-o,3);n(e+(t-e)*c),o<1?requestAnimationFrame(l):(n(t),i())};requestAnimationFrame(l)})),Gr={pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},Jr={pdf:"25 50 44 46 2d",docx:"50 4b 03 04",pptx:"50 4b 03 04",xlsx:"50 4b 03 04",doc:"D0 CF 11 E0 A1 B1 1A E1"},Xr=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const a=new FileReader;return a.onload=()=>{const e=a.result,n=new Uint8Array(e),i=Array.from(n).map((e=>e.toString(16).padStart(2,"0"))).join(" ");t(i)},a.onerror=n,e&&a.readAsArrayBuffer(e.slice(0,8))})))(e);if(!(t??[]).some((e=>{const t=Jr[e]?.toLowerCase();return console.log(t),console.log(n),t&&n.startsWith(t)})))throw new Error(Lr)},Qr=({onUploadError:e=Mn,onFileSelected:t=Mn,extensions:n,maxSizeMB:i,onUploadResponse:r=Mn})=>{const[s,o]=a(0),[c,d]=a(!1),m=l((()=>la((e=>d(e)),500)),[d]),u=l((()=>la((t=>e(t)),500)),[e]),p=l((()=>la((e=>r(e)),500)),[r]);return{verifyFile:async({file:e,onFileChanged:a=Mn})=>{t(e),d(!0);const r=[()=>(async(e,t)=>{const n=e.name.split(".")[1];if(console.log(n,t),!t?.includes(n))throw new Error(Lr)})(e,n),()=>(async(e,t)=>{if(t&&e.size>1024*t*1024)throw new Error("Файл превышает допустимый размер");if(0===e.size)throw new Error("Ошибка загрузки файла. Убедитесь, что файл не пустой")})(e,i),()=>Xr(e,n),()=>(async(e,t)=>{const n=e?.type??"";if(!(t||[]).map((e=>Gr[e])).filter((e=>void 0!==e)).includes(n))throw new Error(Lr)})(e,n)],l=50/r.length;let s=0;try{for(let e=0;e<r.length;e++){const t=r[e];await t();const n=(e+1)*l;await Yr({from:s,to:n,onUpdate:o,minDuration:300}),s=n}const t=await async function({file:e,onProgress:t=Mn}){return new Promise(((n,a)=>{const i=new FormData;let r;i.append("file",e);const l=new XMLHttpRequest;let s;l.upload.onprogress=e=>{if(e.lengthComputable){const n=e.loaded/e.total*50;t(n)}},l.upload.onload=()=>{let e=50;t(e),r=window.setInterval((()=>{e+=.2,s=e,e<90?t(e):(t(90),window.clearInterval(r))}),100)},l.onload=async()=>{try{const e=JSON.parse(l.responseText);"SUCCESS"===e.status?(window.clearInterval(r),await $r(s,t),n(e)):a(new Error(e.errorDesc??zr))}catch(e){a(new Error(zr))}},l.onerror=()=>{a(new Error(zr))},l.open("POST",`${Va}/uploadFile`),l.send(i)}))}({file:e,onProgress:o});p(t),a(t?.fileId??""),t?.status===Vr&&m?.(!1)}catch(e){const t=e instanceof Error?e.message:zr;u(t),a("")}m?.(!1)},isFileUploading:c,progress:s}},Zr=d((({key:e,className:t,id:n,name:r,type:l="file",label:d,valid:m=!0,pattern:p,autoFocus:h=!1,extensions:g,children:f,onFocus:y,onBlur:b,maxSizeMB:x,error:v,onFileChanged:N=Mn})=>{const w=s(null),[C,k]=a(null),[S,I]=a(""),[T,R]=a(null),{verifyFile:E,isFileUploading:D,progress:_}=Qr({onUploadError:I,onUploadResponse:R,onFileSelected:k,extensions:g,maxSizeMB:x});i((()=>{h&&w.current?.focus()}),[h,w]);const P=()=>{k(null),I(""),R(null),N("")},{handleDrag:O,handleLeave:B,handleDrop:M,isDragActive:A}=(({onFileSelected:e,onReset:t,uploadResponse:n,onFileChanged:i})=>{const[r,l]=a(!1);return{handleDrag:e=>{e.preventDefault(),n||l(!0)},handleLeave:()=>l(!1),handleDrop:async a=>{if(a.preventDefault(),n)return;t(),l(!1);const r=a.dataTransfer?.files?.[0];r&&await e({file:r,onFileChanged:i})},isDragActive:r}})({onReset:P,onFileSelected:E,uploadResponse:T,onFileChanged:N}),F=f?"pr-3xl":"",L=ma(m),z=A?"border-primary-hover":"";return c("div",{className:u("relative",t),onDragEnter:O,onDragOver:O,onDragLeave:B,onDrop:M,children:[o("label",{className:u("h-14 cursor-pointer space-y-xs block",ua,F,"border-dashed",L,z),children:D?o("div",{children:o(jr,{step:_,isOnlyInteger:!0})}):qr({label:d,inputRef:w,id:n,key:e,type:l,name:r,pattern:p,disabled:Boolean(T||D),onChange:async e=>{P(),e&&await E({file:e,onFileChanged:N})},onFocus:y,onBlur:b,extensions:g,uploadResponse:T,file:C})}),T?.status===Vr?o(Vn,{className:"absolute top-0 right-0 z-10",onClose:P}):null,Kr(g,x),ra(v||S),f]})})),el=d((({label:e,value:t="",error:n,type:a,inputRef:i,required:r,...l})=>o("div",{ref:i,children:o(Zr,{type:a||"file","aria-label":e,label:ia({label:e,required:r}),valid:Boolean(!n),value:t,error:n,...l})}))),tl=d((({field:e,input:t})=>{const[n,r]=a("");return i((()=>{e("fileId")?.onChange?.(n)}),[n]),o(el,{type:"file",label:t?.name??"",...e(t?.name??""),...t,onFileChanged:r})})),nl=d((({field:e,input:t})=>o(ya,{label:"ФИО",...e(t?.name??""),...t}))),al=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=Di(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(Ea,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??""),...t})})),il=d((({field:e,input:t})=>o(ya,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),rl=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a();i((()=>{r(e("internshipStartDate").value)}),[e("internshipStartDate").value]);return o(vr,{label:t?.label||"Дата окончания практики",...e(t?.name??""),...t,value:c,error:e(t?.name??"")?.error||l,errors:[e(t?.name??"")?.error||l],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(yn(a,{minLimit:n})?"":"Некорректно заполненное поле")},minDate:n})})),ll=d((({field:e,input:t})=>{const[n,r]=a(),[l,s]=a(""),[c,d]=a();i((()=>{r(e("internshipEndDate").value)}),[e("internshipEndDate").value]);return o(vr,{label:t?.label||"Дата начала практики",...e(t?.name??""),...t,value:c,error:l||e(t?.name??"")?.error,errors:[l??e(t?.name??"")?.error],onChange:a=>{d(a),e(t?.name??"")?.onChange?.(a),s(yn(a,{maxLimit:n})?"":"Некорректно заполненное поле")},maxDate:n})})),sl=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(oi,{text:t,value:n,disabled:i,onChange:l},a),ra(r)]}))),ol=d((({field:e,input:t})=>o(sl,{...e(t?.name??""),...t,text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),cl=`${Va}/outservice`,dl=[];async function ml(){const e=await zt(`${cl}/outserviceregions`);return e&&Array.isArray(e)?e:dl}const ul=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=Si("outServiceRegions",ml),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Ea,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...t,...e(t?.name??""),isSearch:!0})})),pl=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,hl=d((({field:e,input:t})=>o(ya,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:pl(e,t),...e(t?.name??""),...t}))),gl=d((({field:e,input:t})=>o(ya,{label:"Имя",maxLength:60,disabled:pl(e,t),...e(t?.name??""),...t}))),fl=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),yl=d((({field:e,input:t})=>_a(e("acquiringType")?.value?.key)?o(fl,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??""),...t}):null)),bl=d((({field:e,input:t})=>o(ya,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),xl=Kt((({field:e,input:t={},source:n})=>{const a=e("partnerSymbolCode")?.value;return i((()=>{const t=vl(n?.agentsList,a)||"Неизвестный партнёр";t&&e("partnerName")?.onChange?.(t)}),[a]),o(ya,{...e(t.name??""),...t,type:"hidden"})})),vl=(e=[],t="")=>e.find((({symbolCode:e})=>e===t))?.agentName??"",Nl=Kt((({field:e,input:t,source:n})=>{const i=n?.agentsList??[],[r,l]=a(""),[s,c]=a("");return o(ya,{label:"Идентификатор партнёра",...e(t?.name??""),...t,isInteger:!0,value:s,error:r??e("partnerSymbolCode")?.error,errors:[r??e("partnerSymbolCode")?.error],onChange:t=>{var n;c(t),e("partnerSymbolCode")?.onChange?.(t),l(t&&(n=t,!i.some((({symbolCode:e})=>e===n)))?"ID партнера не найден. Обратитесь к своему менеджеру":"")}})})),wl=e=>"_"===e,Cl=e=>/\d/.test(e),kl=e=>wl(e)||Cl(e),Sl=[..."+7 (___) ___-__-__"],Il=Sl.findIndex(wl),Tl=Sl.map(((e,t)=>kl(e)?Sl.slice(0,t).filter(kl).length:-1));function Rl(e){const t=e.replace(/\D/g,""),n=Sl.map(((e,n)=>Cl(e)?e:t.charAt(Tl[n])||e)),a=Tl.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Il,a)):n).join("")}const El=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Rl(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(pa,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Dl=d((({className:e,label:t,required:n,disabled:a,error:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(El,{"aria-label":t,label:ia({label:t,required:n}),valid:Boolean(!i),disabled:a,placeholder:"+7 (___) ___-__-__",...r}),ra(i)]}))),_l=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Dl,{label:"Телефон",disabled:pl(e,t,n),...e(n),...t})})),Pl=d((({field:e})=>_a(e("acquiringType")?.value?.key)?o(fl,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ol=Kt((({field:e,input:t,source:n})=>o(Ea,{placeholder:"Выберите продукт",label:"Продукт",options:Bl(n?.productList),...e(t?.name??""),...t}))),Bl=e=>(e??[]).map((e=>({key:e,value:e}))),Ml=d((({field:e,input:t})=>o(Ea,{label:"Какой у вас вопрос?",options:Qn,...e(t?.name??""),...t}))),Al=`${Va}/regions`,Fl=[];function Ll(e=Al){const{data:t}=Si(e,Vt);return Array.isArray(t)?t:Fl}const zl=`${Va}/outservice/outserviceregions`,Vl=d((({field:e,input:t,params:n})=>{var a;const i=Ll((a=n?.typeForm,"OUTSERVICE"===a?zl:void 0));return o(Ea,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??""),...t})})),$l=d((({field:e,input:t})=>o(ya,{label:"ФИО представителя",...t,...e("representativeName")}))),jl=d((({field:e})=>{const t=e("secondaryPhone");return o(Dl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?pi(t,Dn.secondaryPhone):t})})),Wl=d((({field:e,input:t,label:n,options:a})=>o(Ea,{label:n,options:a,...e(t?.name??""),...t}))),ql=d((({field:e,input:t})=>o(Ea,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Hn,...e(t?.name??""),...t}))),Ul=d((({field:e,input:t})=>o(ya,{label:"Описание ситуации",...t,...e("situationDescription")}))),Hl=d((({field:e,input:t})=>o(Ea,{label:"Пострадал в",...t,options:Zn,...e("sufferedFrom")}))),Kl=d((({field:e,input:t})=>o(ya,{label:"Фамилия",maxLength:60,disabled:pl(e,t),...e(t?.name??""),...t}))),Yl=["От 1 мес","До 15 лет"],Gl=d((({field:e})=>o(zi,{title:"Срок, месяцев",items:Yl,min:1,max:180,...e("term")}))),Jl=d((({field:e,input:t,label:n})=>o(ya,{label:n,maxLength:60,...e(t?.name??""),...t}))),Xl=d((({field:e,input:t})=>o(Ea,{label:"Тип обслуживания",options:Un,...e(t?.name??""),...t}))),Ql={horizontal:"@lg:flex-row",vertical:""},Zl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Ql[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(oi,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),es=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Zl,{className:"whitespace-normal",orientation:"horizontal",items:ea,...e(t?.name??"",{onChange:n}),...t})})})),ts=d((({field:e,input:t})=>o(oi,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??""),...t}))),ns={$ref:"/wcms-resources/outservice-productlist.json"},as={$ref:"/wcms-resources/agenty-dlya-rko.json"},is={fullName:nl,addressBranch:Pi,desiredMeetingDate:Mr,product:e=>o(Ol,{...e,source:ns}),localities:ul,isClient:ol,partnerComments:bl,collectionCount:Cr,acquiringType:Da,onlineCheckout:yl,posTerminal:Pl,serviceType:Xl,term:Gl,amount:Wi,annualRevenue:qi,vedTypes:es,feedbackMethod:Fr,serviceDirection:ql,bankEmpolee:Yi,secondaryPhone:jl,applicationDate:Ui,region:e=>_i(e?.params?.typeForm)?o(al,{...e}):o(Vl,{...e}),consentToReceiveMaterials:ts,sufferedFrom:Hl,situationDescription:Ul,representativeName:$l,applierType:Hi,surname:Kl,name:gl,middleName:hl,birthday:Nr,phone:_l,email:Ar,inn:il,comment:kr,fullRegion:al,partnerSymbolCode:e=>o(Nl,{...e,source:as}),partnerName:e=>o(xl,{...e,source:as}),dadataPartyNameSelect:_r,dadataPartyInnSelect:_r,questionProduct:Ml,callbackTime:wr,russianPhone:_l,cityOfResidence:e=>o(Jl,{...e,label:"Город проживания"}),internshipStartDate:ll,internshipEndDate:rl,university:e=>o(Jl,{...e,label:"ВУЗ"}),courseYear:e=>o(Jl,{...e,label:"Курс"}),graduationYear:e=>o(Jl,{...e,label:"Год окончания"}),fieldOfStudy:e=>o(Jl,{...e,label:"Направление обучения"}),educationLevel:e=>o(Wl,{...e,label:"Ступень обучения",options:aa}),averageGrade:Ki,skillsAndKnowledge:kr,workExperience:kr,motivationForInternship:kr,internshipDirection:e=>o(Wl,{...e,label:"Направление стажировки",options:ta}),workingHours:e=>o(Wl,{...e,label:"Количество рабочих часов",options:na}),fileUpload:tl},rs=d((({onFieldRef:e=Mn,children:t})=>{const n=s(null);return i((()=>{n.current&&e(n.current)}),[]),o("div",{ref:n,children:t})}));const ls=(e,t,n={})=>(a,i)=>{const r={...is,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o(rs,{onFieldRef:e(a.name??"").setFieldRef,children:o(r,{field:e,input:a,params:t})},String(i)):null},ss=e=>2===e?"@xl:grid-cols-2 gap-x-m":"@xl:grid-cols-1 gap-x-0",os=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,cs=(e,t,{typeForm:n,additionalParams:a})=>e.map(((e,i)=>c("div",{className:u(ss(e.columns),"grid"),children:[os(e.title),(e?.inputs||[])?.map(ls(t,{typeForm:n,...a}))]},`section-${i}`))),ds=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function ms({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=ds(l,t);return r((e=>{i.current=e,o()}),[])}const us=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const p=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),h=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:p(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:h(a),className:ps(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),ps=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${ma(!n||!a)} rounded-md caret-transparent outline-none`},hs=d((({disabled:e=!1,onClick:t,text:n})=>o(zn,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),gs=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),fs=d((({className:e,seconds:t})=>o("span",{className:e,children:ys(t)}))),ys=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),bs=d((({children:e,isLoading:t,isSubmitButtonDisabled:n,timeNextReq:a,onSubmit:i,onSendCode:r,values:l,onChange:s,errorText:d,hasError:m,phone:u,onClose:p})=>o(Wn,{maxWidth:"lg",onClose:p,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[xs(u),o(us,{values:l,setValues:s,errorText:d,hasError:m}),Ns(a,r),e,vs(n,i),t?o(ii,{blur:!1}):null]})}))),xs=e=>o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),vs=(e,t)=>o(hs,{text:"Далее",disabled:e,onClick:t}),Ns=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base gap-2xs",children:[o("span",{children:" Получить новый код можно через"}),o(fs,{seconds:e})]}):o(zn,{embedded:!0,onClick:t,children:o(gs,{children:"Получить новый код"})}),ws=e=>180-Math.floor((Date.now()-e)/1e3),Cs=Qa(),ks=Qa(),Ss=d((({phone:e,onSuccess:t=Mn,onClose:n=Mn,formatData:i={},reqId:l})=>{const[s,c]=a(Array(4).fill("")),[d,m]=a(l),{handleSubmit:u,hasError:p,errorText:h,isLoading:g,timeNextReq:f,isSubmitButtonDisabled:y,setTimeNextReq:b,setErrorText:x}=(({values:e,onSuccess:t,formatData:n,reqId:i})=>{const l=Math.max(ws(Date.now()),0),s=P(),[o,c]=a(""),[d,{setTrue:m,setFalse:u}]=an(!1),[p,h]=a(l),g=r((()=>c("")),[]),f=!e.every(Boolean);return{handleSubmit:r((async()=>{try{m();const a=await Cs.checkCode({code:e.join(""),body:n,reqId:i,router:s});if(a?.errorDesc)return void c(a?.errorDesc);h(0),g(),t?.(e.join(""))}catch{c("Неверный код")}finally{u()}}),[e]),hasError:Boolean(o),errorText:o,isLoading:d,timeNextReq:p,isSubmitButtonDisabled:f,setTimeNextReq:h,setErrorText:c}})({values:s,onSuccess:t,formatData:i,reqId:d??""}),v=Wa(e),N=ms({seconds:f,onTick:b}),w=r((async()=>{const e=await ks.sendCode({phone:v});e&&(b(180),N(180),x(""),m(String(e)))}),[v,N,n]);return o(bs,{isSubmitButtonDisabled:y,onSubmit:u,onSendCode:w,timeNextReq:f,values:s,onChange:c,phone:e,isLoading:g,errorText:h,hasError:p,onClose:n})})),Is={initcorporatelead:async({formatData:e={},typeForm:t,responseTypeDialog:n,verifyPhoneDialog:a,data:i=[],aspects:r={},ev:l})=>{const{phone:s}=e,o=await ai.sendCode({phone:String(s)});o?a.open({phone:s,formatData:e,reqId:String(o),onSuccess:()=>{a.close(),n.open({ok:!0,typeForm:t}),ni({aspectsAttributes:i,aspects:r,ev:l})}}):n.open({ok:Boolean(o),typeForm:t})},callback:async({formatData:e,data:t,aspects:n={},ev:a,typeForm:i,responseTypeDialog:r,onSuccess:l=Mn,endpoint:s})=>{const o=await ai.sendPhoneCallRequest(e,s);l(),"success"===o?.status?(r.open({ok:!0,typeForm:i}),ni({aspectsAttributes:t,aspects:n,ev:a})):"error"===o?.status?r.open({ok:!1,errorMessage:"Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка"}):(r.open({ok:Boolean(o)}),o&&ni({aspectsAttributes:t,aspects:n,ev:a}))},default:async({formatData:e,data:t,aspects:n={},ev:a,router:i,responseTypeDialog:r,endpoint:l,withSnowplow:s})=>{const o=await ai.send({body:e,router:i,endpoint:l}),c=Boolean(o);if(r.open({ok:c}),c){const{requestId:r}=o,{phone:l}=e,c=i.pathname.split("?")[1],d=JSON.stringify({id:r,phone:String(l),utm:c}),m=s?[...t??[],{aspectName:"snowplowEvent",params:{eventAction:"clickdepapl",eventJSON:d}}]:t;ni({aspectsAttributes:m,aspects:n,ev:a})}}},Ts=Kt((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,withSnowplow:p,isContacts:h,data:g,onSuccess:f,...y})=>{const b=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||La[e.name||""]]))),typeForm:{key:t,text:""}}))(b,n)),[b,n]),v=P(),N=nn(),C=l((()=>Pn(b)),[b]),k=gn(qn),S=gn(Ss),I=r((async(e,t)=>{const a=Pa({...e,...m});await Rs({formatData:a,ev:t,typeForm:n,data:g,aspects:N,router:v,responseTypeDialog:k,verifyPhoneDialog:S,onSuccess:f,withSnowplow:p},d)}),[n]),[,{field:T,onSubmit:R}]=mn(x,{resetOnSubmit:!0,formValidator:C,onSubmit:I}),E=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(b)?.name,D=E?T("consentDataProcessing"):void 0;return c(hn,{className:u("container space-y-m",e),title:t,...y,children:[c("form",{onSubmit:R,children:[cs(a,T,{typeForm:n,additionalParams:m}),bi({consentDataProcessing:D,link:s,button:i,typeForm:n})]}),h?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Rs=async(e,t)=>{const n=t&&Is[t]||Is.default;await n({...e,endpoint:t})},Es={creditCard:"кредитной карты",debitCard:"дебетовой карты",credit:"кредита"},Ds=d((({attempts:e,productType:t,onClose:n=Mn})=>{const a=en(),i=e>1,l=r((()=>{a.assign("/natural")}),[]),s=r((()=>{i?l():n()}),[i]);return o(Wn,{onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(C,{align:"text-center",children:"Уважаемый клиент!"}),o(C,{align:"text-center",children:`Для получения ${Es[t]} Вам необходимо обратиться в офис Банка`}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(zn,{type:"button",version:"secondary",onClick:l,children:"Завершить"}),i?null:o(zn,{type:"button",onClick:n,children:"Продолжить"})]})]})})}));function _s(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ps(e,t){return _s(e,t),_s(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Os{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new pe){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class Bs{bus;store=new Map;get size(){return this.store.size}constructor(e=new pe){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const Ms={};function As(e,t=Ms){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Fs=new Bs;function Ls(){return As(Fs)}Ps(Fs,new Os(globalThis?.sessionStorage));const zs=e=>globalThis[e];function Vs(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=zs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(zs(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(zs(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const $s=()=>globalThis.location!==globalThis?.top?.location,js=()=>{const e=$s(),t=globalThis.document?.body?.scrollHeight,n=Ls(),a=new URLSearchParams(decodeURIComponent(globalThis.location?.search)).get("styles");a&&((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(a),i((()=>{e&&globalThis.parent.postMessage({height:document.body.scrollHeight},"*")}),[t,e]),i((()=>{const t=e=>{e.data?.location&&(n.frameLocation=e.data?.location)};return e&&globalThis.addEventListener("message",t),()=>{e&&globalThis.removeEventListener("message",t)}}),[e])},Ws="Некорректно заполненное поле",qs="Укажите регион, город/населенный пункт, улицу, дом",Us=/^[0-9а-яё]*$/i,Hs=/^[\u0400-\u04FF-\s]+$/u,Ks=/^(?!\s*$)[^\p{Script=Cyrillic}]+$/u,Ys=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),Gs=()=>sn(Ys)(qs),Js=e=>sn((e=>"string"==typeof e&&e.length>1&&Hs.test(e)))(e??Ws),Xs=e=>sn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Ws),Qs=(e,t,n=!1)=>sn((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??Ws),Zs=e=>sn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),eo=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},to=e=>ao(18,e)("Укажите дату заключения трудового договора"),no=e=>ao(0,e)("Укажите дату регистрации"),ao=(e,t)=>sn((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),io=(e=!1)=>sn((t=>Boolean(t)&&Boolean(e)))("Укажите наименование организации"),ro=(e=!1)=>sn((t=>En(t)&&Boolean(e)))("Укажите ИНН"),lo={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},so=e=>Zs(lo[e]),oo={processPersonalDataFlg:Rn,consentProviderFlg:Rn,consentInformFlg:Rn,consentPfrFlg:Rn,consentOthersFlg:Rn,consentFATCA:Rn},co={addressCourier:Gs(),paymentSystem:wn("Укажите тип платежной системы"),currency:wn("Укажите валюту"),cardCategory:wn("Укажите категорию карты"),codeWord:(e=>sn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Us.test(e)))(e??Ws))("Необходимо ввести кодовое слово"),confirmationIncome:Cn(),methodObtain:wn(),deliveryDate:(e=>sn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},mo={organization:Cn("Выберите тип организации"),organizationAddress:sn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(qs),organizationPhone:Tn("Укажите номер телефона"),organizationName:wn("Укажите наименование организации"),legalForm:wn("Укажите ОПФ"),lastJobExperience:Xs("Укажите стаж на последнем месте работы"),experience5Years:Xs("Укажите общий стаж за последние 5 лет"),jobsNumber:Xs("Укажите количество мест работы за последние 5 лет"),addressFact:Gs(),addressRegistration:Gs(),addressRetail:Cn("Выберите адрес банка"),addressMatch:wn(),sex:wn("Укажите свой пол"),birthPlace:wn("Укажите место рождения"),education:Cn("Выберите ваше образование"),housing:Cn("Выберите тип жилья"),amountWorkers:Cn("Выберите информацию о количестве сотрудников"),employment:Cn("Выберите информацию о трудоустройстве"),employerActivities:Cn("Выберите вид деятельности организации"),employerOrganization:Cn("Выберите вид организации"),positionOrganization:Cn("Выберите вашу должность"),familyStatus:Cn("Выберите семейное положение"),familyMembers:Qs(2,"Укажите количество членов семьи"),children:Qs(2,"Укажите количество детей"),dependents:Qs(2,"Укажите количество иждивенцев"),snils:(e=>sn(eo)(e))("Некорректный номер СНИЛС"),conscription:wn(),armyIdFlg:Rn,dulSerie:Qs(4,"Укажите серию паспорта",!0),dulNumber:Qs(6,"Укажите номер паспорта",!0),dulSubdivisionCode:Qs(7,"Укажите код подразделения",!0),dulIssuedBy:wn("Укажите организацию, выдавшую паспорт"),retirementIncome:wn(),otherIncome:wn(),wages:wn(),mandatoryPayments:Qs(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:wn(),shareholderFlg:wn(),legalEntityName:wn(),bankEmployeeCode:wn(),partInBusiness:wn(),regionRetail:Cn("Выберите регион"),latinSurname:wn("Укажите фамилию"),surname:Js("Укажите свою фамилию на кириллице"),name:Js("Укажите своё имя на кириллице"),middleName:Js("Укажите своё отчество на кириллице")},uo={...mo,...co,...oo},po={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в CФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var ho;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(ho||(ho={}));const go=()=>{const e=globalThis.sessionStorage?.getItem("isNewMicroservice");return Boolean(e)},fo="/light-api-cash/v1",yo="/api/credit-application",bo=async(e,t,n)=>{try{return(await xo(e,t,n)).json()}catch(e){return console.error(e),null}};async function xo(e,t,n){const a=go(),i=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`${a?yo:fo}${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":i,"X-B3-Traceid":i,...vo()},credentials:"include",body:n?JSON.stringify(n):null})}const vo=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},No=d((({onChangeEsiaStatus:e,productType:t})=>{const n=en(),a=Ls().frameLocation,i=r((async()=>{try{const e=await(async e=>{const t=go();return await bo((t?"/user-data":"")+"/esia/getLink","POST",e)})({redirectUri:a||globalThis.location.origin+globalThis.location.pathname});e?.link&&(a?window.parent.postMessage({redirectUri:e?.link},"*"):n.assign(e.link))}catch{e(ho.Error)}}),[a]);return c("div",{className:"flex items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex gap-m flex-col justify-around w-full",children:[o("p",{className:"text-xl",children:"Заполните данные через Госуслуги"+("debitCard"===t?": ":"")}),c("ul","debitCard"===t?{className:"list-disc list-inside",children:[o("li",{children:"значительно сократит время оформления заявки"}),o("li",{children:"доступна курьерская доставка в г. Москва (в пределах МКАД)"})]}:{className:"list-disc list-inside",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(zn,{type:"button",onClick:i,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),wo={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},Co={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=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:wo,addressFact:wo,organizationAddress:wo,addressCourier:wo},ko=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const So=d((({value:e="",onChange:t=Mn,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...p})=>{const[h,{setFalse:g,setTrue:f}]=an(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),p=s(t),[h,g]=a([]),f=ka(),y=Co[n],b=r((()=>{p.current=t,f.close()}),[t]),x=r((e=>{b(),p.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[b,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await Tr({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>la(N,300)),[N]);return i((()=>{if(!e||!v.current||p.current===t)return void b();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(ko,{options:h,container:n,value:t,onChange:x}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,h,t,x]),v}({isOpen:h&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),b=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(ha,{value:e,onChange:b,inputRef:y,isOpen:h,onOpen:f,onClose:g,...p})})),Io=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(To(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(So,{disabled:pl(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),To=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house,...Ro(e)}),Ro=e=>{const t=e?.data?.block,n=e?.data?.block_type;if(!t)return{building:null,block:null};switch(n){case"литера":case"стр":return{building:t,block:null};case"к":{const e=Eo(t),[n,a]=t.split(e);return e?{building:a,block:n}:{building:null,block:n}}default:return{building:null,block:null}}},Eo=e=>e.includes("стр")?" стр ":e.includes("литера")?" литера ":"",Do=Kt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(To(t))}),[]),p=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(So,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:p,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),_o=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((t=>{e?.(n)?.onChange?.(To(t))}),[]),c=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(So,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Po=d((({field:e,input:t})=>o(sl,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Oo=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:Bo({textItems:r,subText:t,children:n,isPhone:a,...i})})),Bo=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Mo(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),Mo=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${Ao(e)}`,children:e.trim()}):e.trim()},String(n)))),Ao=e=>e.replace(/\D/g,""),Fo=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}))),Lo=d((({isUnfolded:e,...t})=>o(Y,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),zo=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(zn,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(gs,{children:a}),o(Lo,{isUnfolded:t,iconVersion:i?"color":""})]}))),Vo=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const $o=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),jo=d((({children:e})=>{const[t,{toggle:n}]=an(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Vo,{className:"block sm:hidden",children:[o($o,{isUnfolded:t,children:e}),o(zo,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Wo=e=>{const t=Uo(e);return o(Oo,{label:"Режим работы",value:t,className:"max-w-none"})},qo=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Uo=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[qo({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),qo({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Ho=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Ko=e=>Ho.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Yo=e=>{if(!e)return null;const t=Go(e);return c(Fo,{className:"border-none",children:[o(Oo,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Jo)})}),o(Oo,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},Go=e=>{const t=Ho.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Jo=({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(ze,{size:"text-xs",children:e})},String(n)),Xo=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Oo,{label:"Валюта",value:e.currency}):null,t?o(Oo,{label:"Купить",value:String(t)}):null,n?o(Oo,{label:"Продать",value:String(n)}):null]},String(a)),Qo={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"}},Zo=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",Qo[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:Qo[n].text,children:t})]}))),ec=(new Date).getDay(),tc=e=>{const[t]=e?.slice(ec-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Zo,{color:"green",children:i}):null,n&&r?o(Zo,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Zo,{color:"red",children:"Выходной"})},nc=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",ac=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Oo,{label:e,value:t&&n?n:"",subText:nc({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),ic=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,rc=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,lc=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,sc=(e,t)=>{if(!e.workSchedule)return null;const n=Ko(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),tc(n)]}),o(jo,{children:oc(e)})]},String(t))},oc=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=Ko(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Fo,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Oo,{label:"Факс",value:t,isPhone:!0}),o(Oo,{label:"Телефон филиала",value:e,isPhone:!0}),o(Oo,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Oo,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Oo,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Oo,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(Fo,{children:o(Oo,{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(ac)})})}):c(Fo,{children:[o(Oo,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Jo)})}),Wo(d)]}),l?.businessScheduleVisibleTag?Yo(l?.businessScheduleDescription):null,s?.currencies?.length?o(Fo,{className:"flex-wrap",children:s?.currencies?.map(Xo)}):null]})},cc=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=Ko(e),n=e?Uo(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ic(n):lc(n,a):rc(n):""})(n)}`;return{header:a,body:r}},dc={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,barrierFree:!1,equippedWithRamp:!1,equippedWithLift:!1,equippedWithElevator:!1,equippedWithStairclimber:!1,hasHelpMeButton:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},mc={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам",barrierFree:"Без барьеров",equippedWithRamp:"Есть пандус",equippedWithLift:"Есть подъёмник",equippedWithElevator:"Есть лифт",equippedWithStairclimber:"Есть лестницеход",hasHelpMeButton:"Есть кнопка «HELP ME»"},uc={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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),barrierFree:e=>Boolean("barrierFree"in e&&e.barrierFree),equippedWithRamp:e=>Boolean("equippedWithRamp"in e&&e.equippedWithRamp),equippedWithLift:e=>Boolean("equippedWithLift"in e&&e.equippedWithLift),equippedWithElevator:e=>Boolean("equippedWithElevator"in e&&e.equippedWithElevator),equippedWithStairclimber:e=>Boolean("equippedWithStairclimber"in e&&e.equippedWithStairclimber),hasHelpMeButton:e=>Boolean("hasHelpMeButton"in e&&e.hasHelpMeButton)},pc=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>uc[t](e)))))},hc=()=>{},gc=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=hc,getBalloonRemoteWorkplaces:i=hc})=>{const[r,s,o,c]=l((()=>{const r=pc(e,n),l=pc(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},fc=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),yc=d((({children:e})=>fc?e:null)),bc="/icons/MapMarkerClusterIcon.svg",xc="/icons/MapMarkerClusterYellowIcon.svg";function vc({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=Nc("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Nc("workplaces",e,i),l=wc(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=wc(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=wc(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Nc=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?bc:xc,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),wc=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?bc:xc,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Cc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},kc={...Cc,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Sc=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(kc).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Ic={...Cc,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Tc=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Ic).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:n,width:"20",height:"16"})})})),Rc=[55.753995,37.614069],Ec=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=Vs("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${B.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?vc({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Dc(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),vc({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const p="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(ii,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",p),children:[o(Tc,{yandexMaps:l}),o(Tc,{yandexMaps:l,direction:"out"})]}),Sc(l,m,u("right-2 top-80",p))]})})),Dc=e=>{const t=[Pc(_c(e,0)),Pc(_c(e,1))];return t.every((e=>e))?t:Rc},_c=(e,t)=>e.map((e=>e.coords?.[t])),Pc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Oc=e=>Number(e.toString().replace(",",".")),Bc=e=>{const t=go(),{data:n,error:a}=Si(`${t?`${yo}/public-data`:fo}/dictionary?dictionaryType=${encodeURIComponent(e)}`,Mc);return n&&"errorMessage"in n?{error:a}:{data:n,error:a}},Mc=async e=>await zt(e,{method:"POST"})||[],Ac=new Bs;function Fc(e){return As(Ac,e)}Ps(Ac,new Os(globalThis?.localStorage));const Lc=()=>Fc(),zc=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Bc("REGION_RF"),{programId:s}=Lc(),d="38"===s,m=e("regionRetail")?.value||{},u=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await bo("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Oc(e.latitude??Rc[0]),gpsLongitude:Oc(e.longitude??Rc[1])})))||[]})(m?.key??"");r(e)})()}),[m.key]);const{points:p}=gc({data:n,filtrationState:{},getBalloon:cc});return c("div",{children:[o(Ea,{label:"Адрес отделения",placeholder:"Выберите отделение",disabled:d,options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...u,isSearch:!0}),o("div",{className:"h-[600px]",children:o(yc,{children:o(Ec,{points:p,isLoad:!l,className:"h-full",selectedAddress:u?.value?.text})})})]})})),Vc=Kt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,onChange:r,...l})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Ea,{placeholder:a,options:s,...e(n),...l,onChange:r??e(n)?.onChange})})),$c=d((({field:e,input:t})=>{const n=Lc();return o(Vc,{field:e,source:n.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",...t})})),jc=d((({field:e,input:t})=>o(sl,{text:"Наличие военного билета",...e(t?.name??"")}))),Wc=d((({className:e,label:t,required:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zl,{label:ia({label:t,required:n}),...i}),ra(a)]}))),qc=[{id:"true",text:"Да"},{id:"false",text:"Нет"}],Uc=d((({field:e,input:t})=>{const[n,i]=a(""),l=r((t=>{i(t),"false"===t&&e("bankEmployeeCode")?.onChange?.(null)}),[]);return c("div",{className:"flex flex-col md:flex-row",children:[o(Wc,{label:"Мне помог сотрудник Банка",orientation:"horizontal",items:qc,value:n,onChange:l}),"true"===n?o(So,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,maxLength:8,...e(t?.name??""),...t}):null]})})),Hc=d((({field:e,input:t})=>o(sl,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Kc=d((({field:e,input:t})=>o(vr,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:pl(e,t),maxDate:new Date}))),Yc=d((({field:e,input:t})=>o(So,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:pl(e,t)})));function Gc(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const Jc=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",image:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:a?o(ie,{image:a,className:"block w-max"}):o(Y,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),Xc=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=Gc("programId"),{productType:m,leadForm:u}=Lc(),p="debitCard"===m,h=Boolean(e("esiaAccountTypeCd")?.value?.key),{value:g,onChange:f}=e("cardCategory"),y=e("paymentSystem")?.value?.key,b="office"===u?.methodObtain,x=e("cardCategory")?.value?.text?.toLowerCase()?.includes("неимен"),v=r((e=>0!==e.length?{key:e[0].key,text:e[0].value}:null),[y]),N=r((t=>{f?.(t),e("isMomentDebitCard")?.onChange?.(t?.text?.toLowerCase()?.includes("неимен"))}),[]);i((()=>{y&&d&&(async()=>{const t=await(async(e,t)=>{const n=await bo("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(y,d),n=!p||h&&!b?t:Zc(t);s(n),Qc(n,g)||f?.(v(n)),p&&e("isMomentDebitCard")?.onChange?.(x)})()}),[y,v,x]);const w=l((()=>n?.find((e=>e.key===g?.key))?.description),[n,g]);return c("div",{children:[o(Vc,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",...t,onChange:N}),w?o(Jc,{__html:w}):null]})})),Qc=(e,t)=>e.some((e=>e.key===t?.key)),Zc=e=>e.filter((e=>e.value&&e.value.toLowerCase().includes(" именная"))),ed=d((({field:e,input:t})=>o(So,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),td=d((({field:e,input:t})=>o(So,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t}))),nd=d((({field:e,input:t})=>{const{data:n}=Bc("INCOME_CERT_UNITED"),a=pl(e,t);return c("div",{className:"space-y-xl",children:[a?o(Jc,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(Vc,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",...t,disabled:a})]})})),ad=d((({field:e,input:t})=>{const{data:n}=Bc("MILITARY_STATUS");return o(Vc,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",...t})})),id=()=>Fc(),rd=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Ee();return c(Wn,{onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(zn,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),ld=(e,t)=>{const[n,{setTrue:a,setFalse:i}]=an(!1),{open:l}=gn(rd),s=Ee();return{openDocument:r((async()=>{if(e&&!n){a();const n=URL.createObjectURL(await(async(e,t=!1)=>{const n=await xo(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,s));l({src:n,onDocumentRead:t}),i()}}),[l,e,s,n]),isLoading:n}},sd=d((({className:e,error:t,docId:n,...a})=>{const{openDocument:i,isLoading:r}=ld(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(oi,{...a}),n?c(zn,{embedded:!0,onClick:i,children:[o(gs,{children:"Ознакомиться"}),r?o(ii,{blur:!1,size:"extraSmall",position:"static"}):null]}):null]}),ra(t)]})})),od=d((({field:e,input:t})=>{const{productType:n}=id(),a=po[n??""];return t&&t.name?o(sd,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),cd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),dd="flex flex-col justify-between lg:flex-row gap-4xl",md="flex flex-col lg:w-1/2 gap-2xl",ud="flex flex-col gap-y-xl min-w-52",pd=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Xe(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),hd=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(pd,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),gd=e=>yd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),fd=(e=[],t=!1,n=[])=>({...yd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),yd=(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]},bd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,xd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(zi,{items:[`От ${vd(e)}`,`До ${vd(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),vd=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Nd=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(Zl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),wd=e=>Nd({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Cd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(zi,{items:e?[`От ${Xe(1)(a.min||0)} ${n}`,`До ${Xe(1)(a.max||0)} ${n}`]:[],step:t,...a}),kd=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(Bi(t?.[i],n.minMonths,n.maxMonths))},Sd=Math.round(29.5),Id=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Td=e=>e,Rd=(e=Td)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ed=Rd(),Dd=(e=Td)=>Rd((t=>-e(t))),_d=Dd(),Pd=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Od([e,t],a),Od=([e,t],n=[])=>({[e]:n.length?_d(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ed(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Bd=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Md={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ad=e=>Fd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Fd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Fd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Fd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Fd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Ld=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[Md],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ad({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Pd(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Pd(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Ad({row:e,userInputParams:t,paramsViewSettings:n})&&Bd(a,["minSum","maxSum"],e)&&Bd(i,["minMonths","maxMonths"],e)))||Md)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,p=Id(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:p}},zd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Vd=(e,t=0)=>e?.sum?e.sum:t,$d=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,jd=e=>({moneyValue:Vd(e,2e5),monthsValue:$d(e,Sd),monthlyPayment:0,rate:0,isAnnuity:Boolean(e?.isAnnuity),isInsurance:Boolean(e?.isEnableInsurance),isSalaryClient:Boolean(e?.isEnableSalaryClient),isPensionClient:Boolean(e?.isEnablePensionClient),isStateEmployee:Boolean(e?.isEnableStateEmployee)}),Wd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},qd=Kt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...p})=>{const h=gd(n?.rateRows),g=r((e=>{const t=Ld(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:h?.rate??0})}),[s,n]),[f,{field:y}]=mn(jd(d),{onChange:g}),b=Ld(f,n,s),x=wd({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(Bi(f.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),i((()=>{N&&N(Bi(f.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),i((()=>{!zd(d)&&h&&kd({field:y,defParams:h,calcParams:b,map:Wd,monthsValue:"minMonths"})}),[n,d]),o(cd,{className:e,title:t,...p,children:c("section",{className:u(dd,e),children:[c("div",{className:md,children:[Cd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...y("moneyValue"),value:b.moneyValue}),xd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...y("monthsValue"),value:b.monthsValue}),Ud({...b,...s},y),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(ud,"@4xl:w-1/2"),children:[o(hd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(hd,{title:"Ставка от",value:h?.rate,fractionDigits:2,postfix:"%"}),o(hd,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),Ke(a,{isVertical:!0}),bd(l)]})]})})})),Ud=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(oi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(oi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(oi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(oi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Hd="calculator",Kd=d((({field:e,params:t})=>{const[n,l]=a(),s=e(Hd)?.value,c=r((t=>{e(Hd).onChange?.(t)}),[]);return i((()=>{t?.calcData?.defaultParams&&l(s?Gd(e(Hd).value):t?.calcData?.defaultParams)}),[t?.calcData?.defaultParams]),i((()=>{n&&c(jd(n))}),[n]),n?o(qd,{...t?.calcData,defaultParams:n,padding:"p-0",onChange:c}):o(ii,{})})),Yd={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Gd=(e,t=!1)=>{const n=t?Jd(Yd):Yd;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Jd=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Xd=d((({field:e,input:t})=>{const{data:n}=Bc("CREDIT_IN_RSHB");return o(Vc,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Qd={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card",46:"owner_debit_card_plus",47:"owner_debit_card_pens_plus"},Zd=[{id:"810",text:"Рубли"}],em=d((({field:e,input:t})=>{const{data:n}=Bc("CURRENCY"),{programId:a}=id(),i=l((()=>!Object.keys(Qd).includes(a||"")||"38"===a),[]),r=l((()=>i?Zd:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Wc,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??""),...t})})),tm=(e,t)=>{if(!t)return null;const n=rm(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},nm=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},am=(e,t)=>{const n=rm(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},im=(e,t,n)=>{const a=rm(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},rm=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,lm={amountWorkers:"EMPLOYEES_NUMBER",employerOrganization:"ORGANIZATION_KIND",employerActivities:"ORGANIZATION_ACTIVITY_TYPE",organization:"ORGANIZATION_TYPE"},sm=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=om(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(To(n.data?.address));const s={amountWorkers:nm(e?.amountWorkers,n.data?.employee_count),employerActivities:tm(e?.employerActivities??[],a),organization:im(e?.organization??[],i,r),employerOrganization:am(e?.employerOrganization??[],i),organizationName:l,inn:r,isDadataOrganization:!0};for(const e in s)t?.(e)?.onChange?.(s[e])},om=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),cm=d((({field:e,input:t})=>{const n=Lc(),[l,s]=a(""),{employerActivities:c,employerOrganization:d,organization:m,amountWorkers:u}=n,p=e?.("esiaAccountTypeCd")?.value,h=e?.("inn")?.value,g=e?.("organizationName")?.error,f=e("isDadataOrganization")?.value;i((()=>{s(g&&!f?"Необходимо выбрать ИНН из выпадающего списка":"")}),[f,g]);const y=r((t=>{sm(n,e,t)}),[]);i((()=>{(async()=>{await(async(e,t)=>{const n=go();await Promise.all(Object.entries(e).map((e=>{const[a,i]=e;bo(`${n?"/public-data":""}/dictionary?dictionaryType=${encodeURIComponent(i)}`,"POST").then((e=>{t[a]=e}))})))})(lm,n)})()}),[]),i((()=>{p&&h&&dm(n)&&(async()=>{const t=await(async e=>{const t=await Tr({url:"suggest/party",query:e});return t?.[0]})(h);t&&sm(n,e,t)})()}),[c,d,m,u]);const b=r((t=>{e?.("inn")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(So,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:y,disabled:pl(e,t),onChange:b,error:l||e("inn")?.error})})),dm=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i}=e;return[n,a,i,t].every(Boolean)},mm=new Date(Date.now()+864e5),um=d((({field:e,input:t})=>{const{productType:n}=Lc(),a="debitCard"===n,i=a?mm:new Date,{data:r}=Bc("DAYS_DELIVERY_SETTINGS"),s=l((()=>{const e=r?.find((e=>"WEEKEND"===e.key));return e&&e.value?e.value.split(",").map(Number):[]}),[r]);return o(vr,{label:"Дата доставки",...e(t?.name??""),minDate:i,weekends:a?s:[]})})),pm=d((({field:e,input:t})=>{const{productType:n}=Lc(),a="debitCard"===n,{data:i}=Bc("COURIER_DELIVERY_TIME"),r=["TIME_1","TIME_2","TIME_3"],s=["TIME_4","TIME_5"],c=l((()=>{const e=a?s:r;return(i||[]).filter((t=>t.key&&e.includes(t.key))).map((e=>({id:e.key,text:e.value})))}),[i,a]);return o(Wc,{label:"Время доставки",className:"flex-row",items:c,...e(t?.name??"")})})),hm=d((({field:e,input:t})=>o(So,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),gm=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(vr,{label:"Дата выдачи",...e(t?.name??""),disabled:pl(e,t),minDate:a,maxDate:new Date,...t})})),fm=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(So,{disabled:pl(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),ym=d((({field:e,input:t})=>o(So,{disabled:pl(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??""),...t}))),bm=d((({field:e,input:t})=>o(So,{disabled:pl(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??""),...t}))),xm=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(ar(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(So,{disabled:pl(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),vm=d((({field:e,input:t})=>{const{data:n}=Bc("EDUCATION_LEVEL");return o(Vc,{field:e,source:n,label:"Образование",fieldName:"education",...t})})),Nm=d((({field:e,input:t})=>{const n=r((t=>{(Ks.test(t)||0===t.length)&&e("email")?.onChange?.(t)}),[e]);return o(So,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t,onChange:n})})),wm=d((({field:e,input:t})=>{const n=Lc();return o(Vc,{field:e,source:n.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",...t})})),Cm=d((({field:e,input:t})=>{const n=Lc();return o(Vc,{field:e,source:n.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),km=d((({field:e,input:t})=>{const{data:n}=Bc("EMPLOYMENT_INFO_UNITED");return o(Vc,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",...t})})),Sm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Bi(Number(n),0,5)))),[]);return o(So,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:pl(e,t)})})),Im=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(So,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,...t,onChange:a})})),Tm=d((({field:e,input:t})=>{const{data:n}=Bc("MARITAL_STATUS");return o(Vc,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",...t})})),Rm=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(So,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:pl(e,t)})})),Em=d((({field:e,input:t})=>{const{data:n}=Bc("HOUSE_TYPE");return o(Vc,{field:e,source:n,label:"Тип жилья",fieldName:"housing",...t})})),Dm=d((({input:e})=>o(Jc,{__html:e?.label}))),_m=d((({field:e,input:t})=>o(sl,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Pm=d((({field:e,input:t})=>o(So,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:pl(e,t)}))),Om=d((({field:e,input:t})=>o(So,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:pl(e,t)}))),Bm=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Mm=(e="",t="")=>Bm.test(e)&&t.length<20&&e.length+t.length<=20,Am={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "},Fm=e=>e.replace(/[А-ЯЁа-яё,. -]/g,(e=>Am[e.toLowerCase()].toUpperCase()||"")),Lm=(e,t)=>{let n=Fm(e);const a=Fm(t).substring(0,20);return 20===a.length?n="":n.length+a.length>20&&(n=n.substring(0,1)),{translatedName:n,translatedSurame:a}},zm=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinName")?.onChange;i((()=>{const{translatedName:e}=Lm(a,l);s?.(e)}),[]);const c=r((e=>{(Mm(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ya,{label:"Имя",placeholder:"Имя латинскими буквами",...e(t?.name??""),onChange:c,...t})})),Vm=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("name")?.value,l=e("surname")?.value,s=e("latinSurname")?.onChange;i((()=>{const{translatedSurame:e}=Lm(a,l);s?.(e)}),[]);const c=r((e=>{(Mm(e,n)||0===e.length)&&s?.(e.toUpperCase())}),[n]);return o(ya,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",...e(t?.name??""),onChange:c,...t})})),$m=d((({field:e,input:t})=>o(So,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),jm=d((({field:e,input:t})=>o(So,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Wm=d((({field:e,input:t})=>o(vr,{label:"Дата рождения",...e(t?.name??""),...t,disabled:pl(e,t)}))),qm=d((({field:e,input:t})=>o(So,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),Um=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Hm=d((({field:e,input:t})=>o(Wc,{orientation:"horizontal",items:Um,...e(t?.name??"")}))),Km=d((({field:e,input:t})=>{const n=r((t=>{(Hs.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(So,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:pl(e,t),...e(t?.name??""),...t,onChange:n})})),Ym=d((({field:e,input:t})=>{const n=r((t=>{(Hs.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(So,{label:"Имя",maxLength:40,disabled:pl(e,t),...e(t?.name??""),...t,onChange:n})})),Gm=d((({field:e,input:t})=>{const n=Lc();return o(Vc,{field:e,source:n.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Jm=d((({field:e,input:t})=>{const n=Lc(),[l,s]=a(""),c=e?.("organizationName")?.error,d=e("isDadataOrganization")?.value;i((()=>{s(c&&!d?"Необходимо выбрать организацию из выпадающего списка":"")}),[d,c]);const m=r((t=>{sm(n,e,t)}),[]),u=r((t=>{e?.("organizationName")?.onChange?.(t),e?.("isDadataOrganization")?.onChange?.(!1)}),[]);return o(So,{label:"Наименование организации",...t,...e(t?.name??""),disabled:pl(e,t),onDaDataChange:m,onChange:u,error:l||e("organizationName")?.error})})),Xm=d((({field:e,input:t})=>o(So,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Qm=d((({field:e,input:t})=>o(vr,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date,...t}))),Zm=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(Bi(Number(n),0,100)))),[]);return o(So,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),eu=e=>e.map((e=>({key:e.type,text:e.name}))),tu=e=>e?.key,nu=[{key:"PAYMENT_SYSTEM_TYPE_3",text:"UnionPay"}],au=d((({field:e,input:t})=>{const[n,i]=a([]),r=Fc(),s=Ls();Sr((async()=>{const{programId:e}=r,{claimChannelCode:t}=s;if(e){const n=t?nu:await(async e=>{const t=await bo("/public-data/creditProgramConditions","POST",{creditProgramId:e});return eu(t?.paymentSystems||[])})(e);i(n??[])}}),[]);const c=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(Wc,{label:"Платежная система",orientation:"horizontal",items:c,...e(t?.name??"",{format:tu,parse:e=>n?.find((t=>t.key===e))}),...t})})),iu=d((({field:e,input:t})=>{const{data:n}=Bc("POSITION");return o(Vc,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",...t})})),ru=async()=>await bo("/public-data/regionsCardDelivery","GET")||void 0,lu={key:"REGION_77",text:"Москва и Московская область"},su={key:"3041100",text:"Аэропорт Шереметьево, МО, г.Химки, Шереметьевское шоссе, вл39с1"},ou={key:"REGION_77",text:"Москва и Московская область"},cu={key:"3",text:"г. Москва, Пресненская наб., д. 10, стр. 2"},du=d((({field:e,input:t})=>{const{programId:n,productType:a,leadForm:l}=Lc(),s=l?.regionRetail,{data:c}=Bc("REGION_RF"),{data:d}=Si("regionsDelivery",ru),{data:m}=Bc(mu(a)),u=Ls(),p="debitCard"===a,h="38"===n,g=Boolean(e("esiaAccountTypeCd")?.value?.key),f=c?.map((({key:e,value:t})=>({key:e,text:t}))),y="true"===m?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,b=e("regionRetail")?.onChange,x=e("addressRetail")?.onChange,v=e("regionHasDelivery")?.onChange,N=e("methodObtain")?.onChange,w=r((e=>(!p||g&&!h)&&y&&d?.find((t=>t.regionCode===e.key))?.deliveryFlg),[y,d]),C=r((e=>{const t=w(e);v?.(t),N?.(t?"courier":"office"),b?.(e),x?.("")}),[d,y,g]);return i((()=>{if(u.claimChannelCode)b?.(lu),x?.(su),v?.(w(lu)),N?.("office");else if(h)b?.(ou),x?.(cu),N?.("office");else if(s){const e=w(s);v?.(e),N?.(e?"courier":"office"),b?.(s)}}),[w]),o(Ea,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,disabled:h,options:f,...e(t?.name??""),...t,onChange:C})})),mu=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",uu=d((({field:e,input:t})=>o(So,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),pu=["male","female"],hu=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],gu=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await Tr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return pu.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(Wc,{label:"Пол",orientation:"horizontal",items:hu,...e(t?.name??""),...t})})),fu=d((({field:e,input:t})=>o(sl,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),yu=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(ar(e,"___-___-___ __")):t?.(ar(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(pa,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),bu=d((({className:e,label:t,required:n,value:a,error:i,onChange:r,onBlur:l,...s})=>c("div",{className:u("shrink-0 w-full",e),children:[o(yu,{"aria-label":t,label:ia({label:t,required:n}),valid:Boolean(!i),value:a,onChange:r,onBlur:l,placeholder:"___-___-___ __",...s}),ra(i)]}))),xu=d((({field:e,input:t})=>o(bu,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),vu=d((({field:e,input:t})=>{const n=r((t=>{(Hs.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(So,{label:"Фамилия",maxLength:40,disabled:pl(e,t),...e(t?.name??""),...t,onChange:n})})),Nu=d((({field:e,input:t})=>o(So,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:pl(e,t)}))),wu={$ref:"/wcms-resources/delivery-cities-data.json"},Cu={limitedBirthday:Wm,name:Ym,surname:vu,middleName:Km,email:Nm},ku={processPersonalDataFlg:od,consentProviderFlg:od,consentOthersFlg:od,consentInformFlg:od,consentPfrFlg:od,consentFATCA:od},Su={organization:Gm,organizationAddress:Io,organizationPhone:_l,organizationName:Jm,legalForm:jm,generalSeniority:Rm,lastJobExperience:Om,experience5Years:Sm,jobsNumber:Pm,beginDate:Kc,addressFact:_o,addressRegistration:Io,addressRetail:zc,addressMatch:Po,sex:gu,birthPlace:Yc,education:vm,housing:Em,amountWorkers:$c,employment:km,employerActivities:wm,employerOrganization:Cm,positionOrganization:iu,familyStatus:Tm,familyMembers:Im,children:ed,dependents:hm,snils:xu,conscription:ad,armyIdFlg:jc,dulSerie:bm,dulNumber:ym,dulIssueDate:gm,dulSubdivisionCode:xm,dulIssuedBy:fm,participantDateRegistration:Qm,retirementIncome:uu,otherIncome:Xm,wages:Nu,mandatoryPayments:qm,bankruptcyFlg:Hc,initiateBankruptcyFlg:_m,shareholderFlg:fu,legalEntityName:$m,creditInRshbCd:Xd,bankEmployeeCode:Uc,partInBusiness:Zm,regionRetail:du,infoCard:Dm,calculator:Kd,confirmationIncome:nd,inn:cm,...Cu},Iu={addressCourier:e=>o(Do,{...e,source:wu}),paymentSystem:au,currency:em,cardCategory:Xc,codeWord:td,methodObtain:Hm,deliveryDate:um,latinName:zm,latinSurname:Vm,deliveryTime:pm},Tu="Согласие на все документы",Ru=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(pi(t(e?.name),Rn).error)))),[e]),[d,{toggle:m}]=an(!0);return o("div",{className:"w-fit",children:c(Vo,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(oi,{text:Tu,value:a,onChange:i},n),ra(s?"Отметьте все обязательные соглашения":"")]}),o(zn,{embedded:!0,ariaLabel:Tu,onClick:m,children:o(Lo,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o($o,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(ls(t,{},ku))})]})})})),Eu=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=Du(t||[],n);return a.length>2?c("div",{children:[i.map(ls(e,{},{...Cu})),o(Ru,{inputs:a,field:e})]}):(t||[])?.map(ls(e,{},{...Cu}))},Du=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(po[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(po[t]).includes(String(e))))}),_u=(e,t=!1)=>o(ri,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Pu=async e=>await bo("/user-data/createDraftTask","POST",e)||{},Ou=e=>xo("/referal/saveReferalInfo","POST",e),Bu=e=>xo("/user-data/updateUserProfile","PUT",e),Mu=e=>xo("/user-data/updateUserTask","PUT",e),Au={width:"103",height:"21"},Fu={"bg-white":"color",transparent:"white"},Lu={"bg-white":"text-primary-main",transparent:"text-white"},zu=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Fu[e]},className:Lu[e],width:n?.width,height:n?.height}),Vu={"bg-white":"text-primary-text",transparent:"text-white"},$u=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ve(s),children:[zu(r,n?.image,Au),l?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:Vu[r],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),ju=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,p]=a(!1),[h,{setTrue:g,setFalse:f}]=an(!1),{closeAll:y}=ge(),b=r((async()=>{g();await(async e=>{const t=go();return await xo((t?"/user-data":"")+"/sms/checkCaptcha","POST",{captchaText:e.captchaText,...t&&{phoneNumber:e?.phoneNumber}}).then((e=>e.text())).then((e=>"ERROR"!==e))})({captchaText:d,phoneNumber:e})?(n?.(),t?.()):p(!0),f()}),[d,t]),x=r((()=>{(async()=>{s(URL.createObjectURL(await(async e=>{const t=go();return await xo(`${t?"/user-data":""}/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob))})(e)))})()}),[]);return i(x,[]),o(Wn,{head:o($u,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(zn,{className:"w-8",embedded:!0,onClick:x,children:o(Y,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(pa,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(zn,{version:"secondary",onClick:y,children:"Вернуться"}),o(ri,{version:"secondary",disabled:!d,onClick:b,children:"Отправить"})]}),h?o(ii,{blur:!1}):null]})})})),Wu=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},qu=({values:e,phoneNumber:t,onSuccess:n,onFail:l})=>{const s=Ls(),o=s.smsCode?.attempts||0,c=Math.max(ws(s.smsCode?.sendTime||Date.now()),0),[d,m]=a(""),[u,{setTrue:p,setFalse:h}]=an(!1),[g,f]=a(c),y=r((()=>m("")),[]),b=Boolean(0===g&&s.smsCode?.sendTime),x=o>2||b||!e.every(Boolean),v=r((async()=>{s.smsCode={...s.smsCode,attempts:o+1},p();const a=await(async e=>{const t=go();return await xo((t?"/user-data":"")+"/sms/checkCode","POST",{smsText:e.smsText,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName,...t&&{phoneNumber:e?.phoneNumber}})})({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"},phoneNumber:t});if(a.ok){const t=await a.json();Wu(t),f(0),y(),s.smsCode=null,n?.(e.join(""))}else 403===a.status?m(o>1?"Исчерпан лимит ввода смс-кода":"Неверный код"):l();h()}),[e,o]);return i((()=>{b?m("Код просрочен"):o>2&&m("Исчерпан лимит ввода смс-кода")}),[b]),{handleSubmit:v,hasError:Boolean(d),errorText:d,isLoading:u,timeNextReq:g,isSubmitButtonDisabled:x,setTimeNextReq:f,setErrorText:m}},Uu=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=Mn,onClose:s=Mn,onFail:c=Mn})=>{const[d,m]=a(Array(4).fill("")),u=Ls(),p=Wa(e),{handleSubmit:h,hasError:g,errorText:f,isLoading:y,timeNextReq:b,isSubmitButtonDisabled:x,setTimeNextReq:v,setErrorText:N}=qu({values:d,phoneNumber:p,onSuccess:l,onFail:c}),w=gn(ju),C=ms({seconds:b,onTick:v}),k=r((async()=>{const e=await(async e=>{const t=go();return await xo((t?"/user-data":"")+"/sms/sendCode","POST",{phoneNumber:e.phoneNumber,smsCodesSetName:t?e.smsCodesSetName.key:e.smsCodesSetName})})({phoneNumber:p,smsCodesSetName:{key:"AUTHENTICATION"}});e.ok?(v(180),C(180),N(""),u.smsCode=Hu(p)):429===e.status?w.open({phoneNumber:p,sendCode:k}):c()}),[p,C]);return i((()=>{u.smsCode?.sendTime&&u.smsCode?.phoneNumber===p||k()}),[]),o(bs,{isSubmitButtonDisabled:x,onSubmit:h,onSendCode:k,timeNextReq:b,values:d,onChange:m,phone:e,isLoading:y,errorText:f,hasError:g,onClose:s,children:Ku(n,t)})})),Hu=e=>({sendTime:Date.now(),attempts:0,phoneNumber:e}),Ku=(e,t=!1)=>t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:e?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Yu={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Gu={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Ju=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Xu=d((({onSubmit:e=Mn,onClose:t=Mn})=>{const[n,i]=a(""),[l,s]=a(!1),{openDocument:d}=ld(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),p=l?Gu:Yu;return o(Wn,{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:p.title})}),o(C,{align:"text-center",children:p.description}),o(Zl,{className:"whitespace-normal",orientation:"horizontal",items:Ju,value:n,onChange:u}),o(zn,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Qu={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Zu={...Qu,amur_card:"14",owner_card:"13",travel_card:"15",amur_debit_card:"17",owner_debit_card:"16",pension_debit_card:"18",salary_debit_card:"38",vordi_debit_card:"40",eco_debit_card:"42",junior_debit_card:"43",appetit_debit_card:"44",owner_debit_card_plus:"46",owner_debit_card_pens_plus:"47"},ep=d((({title:e,icon:t,description:n,onClick:a=Mn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(ze,{font:"font-medium",size:"text-s",children:e}):null,n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),tp={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},np={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},ap={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},ip=e=>Object.entries(e).reduce(((e,[t,n])=>t in tp?[...e,{contactTypeCd:{key:tp[t]},value:n}]:e),[]),rp=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in np){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{...a,addressType:{key:np[t]}}]}return e}),[]),lp=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:p,armyIdFlg:h,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:sp(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in ap?[...e,{incomeTypeCd:{key:ap[t]},value:Number(n||0)}]:e),[])),snils:p?.replace(/[-\s]/g,""),armyIdFlg:h,initiateBankruptcyFlg:f};var y},sp=(e,t)=>(Number(e??0)+Number(t??0)).toString(),op={WORK:"Работаю",RETIREE:"Пенсионер"},cp=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:sp(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},dp=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},mp=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},up=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,pp=(e=!1,t=!1)=>e?{nextStepLink:"/debit-card-lead",newTaskLink:"/natural/debetcards",description:"На дебетовую карту"}:t?{nextStepLink:"/credit-lead",newTaskLink:"/natural/loans/all-goals",description:"На получение кредита"}:{nextStepLink:"/credit-card-lead",newTaskLink:"/natural/creditcards/svoya",description:"На получение кредитной карты"},hp=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=Mn,onClose:i=Mn}){const l=Lc(),s=en(),{participants:d,creditProgram:m,createdDate:u="",id:p}=e,h=Zu[m.code],g=Boolean(Qu[m.code]),f=pp(n,g),{id:y,profile:b}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,educationLevelCd:x,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:k=[],employmentContractDate:S,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:_,employeesNumberCd:P,opf:O,seniority:B,generalSeniority:M,jobsNumber:A,lastWorkDuration:F,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:W,participantIncomes:q,snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,nameLegalEntity:G,creditInRshbCd:J,payrollCardRshbFlg:X,consentInsuranceFlg:Q}=t;return{currency:r?.key,paymentSystem:up(i),cardCategory:up(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:p,dulIssueDate:h,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:b,education:up(x),participantDateRegistration:v,housing:up(N),beginDate:S,employment:up(I,op),organizationName:T,inn:R,isDadataOrganization:Boolean(R),employerActivities:up(E),organization:up(D),employerOrganization:up(_),amountWorkers:up(P),legalForm:O,generalSeniority:B?.toString(),experience5Years:M?.toString(),jobsNumber:A?.toString(),lastJobExperience:F?.toString(),positionOrganization:up(L),familyStatus:up(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:up(W),snils:U,armyIdFlg:H,bankruptcyFlg:K,shareholderFlg:Y,legalEntityName:G,creditInRshbCd:up(J),calculator:{isInsurance:X,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...cp(q),...dp(k),...mp(C),...(Z=w,Z?.key?{sex:"MAN"===Z.key?"male":"female"}:null)};var Z})(e);l.participantId=y??null,l.taskId=p,l.profileId=b?.id??null,l.programId=h,l.leadForm=t,b?.id&&a(b.id,p),s.assign(f.nextStepLink)}),[]),v=r((()=>{s.assign(f.newTaskLink)}),[]);return o(Wn,{onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(ep,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${ja(new Date(u))}`:"",onClick:x}),o(ep,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:f.description,onClick:t?i:v})]})]})})})),gp=d((function({isDebit:e,onClose:t=Mn}){const n=en(),a=pp(e),i=r((()=>{n.assign(a.newTaskLink)}),[]),l=r((()=>{n.assign("/")}),[]);return o(Wn,{onClose:t,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(zn,{type:"button",className:"w-full",onClick:i,children:"Заполнить новую заявку"}),o(zn,{type:"button",version:"secondary",className:"w-full",onClick:l,children:"Вернуться на главную"})]})})})),fp=({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i,consents:r})=>{const l=bp(i?.utm_source),s=yp({participantId:e,profileId:n,formData:a,consents:r}),{crshbFileIds:o}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:l,id:t,...n?{participants:[s]}:{participant:s},marketingInfo:i},crshbFileIds:o}},yp=({participantId:e,profileId:t,formData:n,consents:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=n;return{birthDate:s&&ja(s,!0),id:e,midname:l,name:i,surname:r,...t&&{profile:{id:t}},participantContacts:ip({phone:o&&Wa(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"},...a}},bp=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},xp=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),vp=({programId:e,nextStepLink:t,productType:n,data:a,changeSubmitFormStatus:i,isNewMicroservice:l})=>{const[s,{setTrue:o,setFalse:c}]=an(!1),d=(()=>{const e=id();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),m=Ls(),u=id(),p=(({data:e})=>{const t=nn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});ni({aspectsAttributes:xp(e,i),aspects:t,ev:{}})}),[e])})({data:a}),h=en(),g=r((()=>{h.assign(t)}),[]),f=(e=>{const{open:t}=gn(Xu),n=gn(Uu),a=(t,n,a)=>async i=>{try{t?await Bu({profile:{id:t,consentBkiFlg:!0,smsConsentBki:i}}):n&&a&&await Mu({task:{id:n,participant:{id:a,consentBkiFlg:!0,smsConsentBki:i}},sendToBank:!1,taskKind:"SHORT"}),e()}catch(e){console.log(e)}},i=({phone:t,profileId:i,onFail:r,taskId:l,participantId:s})=>async o=>{"SIGNED"===o&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i,l,s),onFail:r}):e()};return{open:({phone:n,profileId:a,onFail:r,taskId:l,participantId:s})=>t({onSubmit:i({phone:n,profileId:a,onFail:r,taskId:l,participantId:s}),onClose:e})}})(g),y=gn(Uu),b=(()=>{const{open:e}=gn(hp),{open:t}=gn(gp);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({isDebit:i})}}})(),x=()=>{y.close(),i(!1)},v=r((async t=>{try{o();const i=Sp(t),r=await(a={profile:{phone:Wa(i.phone)}},bo("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{await wp({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:s,saveUserData:d,sendAspects:p}),y.close(),"debitCard"===n?g():f.open({phone:i.phone,profileId:r,onFail:x})},h=async()=>{try{const t=await(async e=>{const t=await bo("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await bo("/user-data/getTaskById","POST",e)||void 0)({taskId:t});y.close(),b.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:p,onClose:c})}else await c()}catch{x()}},v=Np(i,n);y.open({phone:i.phone,consents:v,onSuccess:h,onFail:x})}catch{x()}finally{c()}var a}),[]),N=r((async t=>{try{o();const i=Sp(t),r=await(a={phone:Wa(i.phone),email:i.email},bo("/public-data/createParticipant","POST",a).then((e=>e?.participantId||null))),l=u.referalData,s=m.marketingInfo;if(!r)throw new Error;const c=async()=>{const t=await Cp({programId:e,participantId:r,formData:i,referalData:l,productType:n,marketingInfo:s,saveUserData:d,sendAspects:p});y.close(),f.open({phone:i.phone,taskId:t,participantId:r,onFail:x})},h=async()=>{try{await c()}catch{x()}},g=Np(i,n);y.open({phone:i.phone,consents:g,onSuccess:h,onFail:x})}catch{x()}finally{c()}var a}),[]);return{isSending:s,handleSubmit:l?N:v}},Np=(e,t)=>{const n=po[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},wp=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=kp(n,a);await Bu(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&ja(l,!0),email:o,phone:Wa(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async()=>{const e=await bo("/claim-channel/","GET").then((e=>{const t=globalThis.location.href,n=e?.find((e=>e&&t.includes(e.key)))?.code;return globalThis.sessionStorage.setItem("claimChannelCode",n??""),n})).catch((()=>{}));return e})(),a=await(async e=>await bo("/user-data/createUserTaskDebit","PUT",e)||{})((({formData:e,programId:t,marketingInfo:n,claimChannelCode:a})=>{const{name:i,surname:r,middleName:l,limitedBirthday:s,phone:o,email:c}=e;return{task:{taskSource:bp(n?.utm_source),creditProgram:{code:Qd[t]},participants:[{birthDate:s&&ja(s,!0),midname:l,name:i,surname:r,participantContacts:ip({phone:o&&Wa(o),email:c})}],marketingInfo:n},claimChannelCode:a}})({formData:n,programId:e,marketingInfo:r,claimChannelCode:t}));o=a.taskId,c=a.participantId}else{const a=await Pu({profileId:t,programId:e});o=a.taskId,c=a.participantId,await Mu(fp({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await Ou({taskId:o,...i}),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},Cp=async({programId:e,participantId:t,formData:n,referalData:a,productType:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o;const c=kp(n,i);try{return o=(await Pu({participantId:t,programId:e})).taskId,await Mu(fp({participantId:t,taskId:o,formData:n,marketingInfo:r,consents:c})),a?.referalCode&&await Ou({taskId:o,...a}),s(t,o),l({participantId:t,taskId:o,programId:e,formData:n}),o}catch(e){throw console.log(e),new Error}},kp=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentFATCA:s}=e;let o;return o="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentPhotoFlg:!1}:{consentFATCA:s,consentPhotoFlg:n},{...o,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Sp=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Ip=(e=!1)=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),a=globalThis.localStorage.getItem("taskId"),i=en();if(!n||!t||!a&&!e)return i.assign("/"),()=>{};const r=async()=>{const e=await xo("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401===Number(e?.status)&&i.assign("/"),e?.ok){const t=await e.json();globalThis.sessionStorage.setItem("refreshToken",t.refresh_token),globalThis.sessionStorage.setItem("accessToken",t.access_token)}};!e&&r();const l=setInterval(r,24e4);return()=>clearInterval(l)},Tp={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},Rp=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Tp[e.name||""]])))}},Ep=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...vo()},credentials:"include",body:a}).then((e=>e.json())))},Dp=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=(e,t)=>e?`${t} ${e}`:void 0,u=[t,n,i||r,m(l,"ул"),m(s,"д"),m(c,"к"),m(o,"стр"),m(d,"кв")].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key??a,fullAddress:u}},_p=e=>Math.floor(e/12),Pp=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>Ep(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Op=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},Bp=(e,t)=>{const{esiaAdditionalDocument:n,crshbFileIds:a}=e,i=[n?.pdfFilePayout,n?.pdfFileWorkbook,n?.pdfFileSigPayout,n?.xmlFilePayout,n?.xmlFileSigPayout,n?.xmlFileWorkbook],r=t?Boolean(a?.length):i.every(Boolean);return[n?.inn,n?.averageMonthlyIncome?.toString(),n?.startWorkDate,n?.workLengthInFiveYears?.toString(),n?.workLength?.toString(),n?.workLengthLastJob?.toString(),n?.jobsNumberInFiveYears?.toString()].every(Boolean)&&r},Mp=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a,isNewMicroservice:s})=>{const o=id(),c=r((e=>{const t=e instanceof Function?e(d[m]):e;null!=t?d[m]=t:delete d[m]}),[d=o,m="leadForm"]);var d,m;const u=Ls(),p=globalThis.sessionStorage?.getItem(Yt);(()=>{const e=id(),t=nn();i((()=>{const n=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=n.get("referalCode"),i=n.get("refererCode"),r=n.get("productId");if(a){e.referalData={refererCode:i,referalCode:a,productId:r};const n=JSON.stringify({refererCode:i,referalCode:a,productId:r});ni({aspectsAttributes:[{aspectName:"snowplowEvent",params:{eventAction:"ownfin_referal_link_attributes",eventJSON:n}}],aspects:t,ev:{}})}}),[])})();const h=l((()=>Rp(e,o.leadForm,a)),[e,o.leadForm]),g=r((async(e,a)=>{n(ho.Pending);try{const i=await(async e=>{const t=go();return await bo((t?"/user-data":"")+"/esia/requestProfile","POST",e).then((e=>(e?.access_token&&e?.refresh_token&&(Wu(e),Ip(!0)),e)))})({code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0});if(i){const e=await(async(e,t=!1,n=!1)=>{Op(e);const a=!t&&Bp(e,n),{profile:i,addInfo:r,document:l,addressRegistration:s,addressFact:o,esiaAdditionalDocument:c,crshbFileIds:d}=e;let m=[];return a&&!n&&(m=await Pp(c)),{...{name:i.name,surname:i.surname,middleName:i.midname,limitedBirthday:i.birthDate,phone:Rl(i.phone),email:i.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:r.birthPlace,addressRegistration:Dp(s),esiaAccountTypeCd:t?i.esiaAccountType:{key:""},...o&&{addressFact:Dp(o)}},...a&&{snils:r.snils,inn:c.inn,wages:Math.floor(c.averageMonthlyIncome)?.toString(),beginDate:c.startWorkDate,experience5Years:_p(c.workLengthInFiveYears).toString(),generalSeniority:_p(c.workLength).toString(),lastJobExperience:_p(c.workLengthLastJob).toString(),jobsNumber:c.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:i.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:m,crshbFileIds:d}}})(i,"debitCard"===t,s);c((t=>({...t,...e}))),n(ho.Success)}}catch{n(ho.Error)}}),[]);return i((()=>{o.productType=t,u.marketingInfo=Ap(p,u),u.isNewMicroservice=s||null}),[p]),i((()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),t=e.get("code"),n=e.get("state");t&&n?g(t,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),h},Ap=(e,t)=>{const n=t.marketingInfo,a=new URLSearchParams(decodeURIComponent(e||""));return a.get("code")?n:{utm_campaign:a.get("utm_campaign"),utm_medium:a.get("utm_medium"),utm_source:a.get("utm_source"),utm_content:a.get("utm_content"),utm_term:a.get("utm_term"),bannerId:a.get("bannerId"),userId:a.get("userId")}},Fp=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:p,isNewMicroservice:h=!1,...g})=>{const[f,y]=a(),[b,x]=a(),[v,N]=a(0),w=s(null),C=l((()=>(e=>{const t=po[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),k=l((()=>Lp(C)),[C]),S=gn(Ds),I=$s();js();const T=l((()=>zp(m)),[m]),R=l((()=>Pn(k,T)),[k,T]),E=(e=!1)=>{x(e)},D=Mp({inputs:k,nextStepLink:r,productType:m,setEsiaStatus:y,esiaAuthSuccess:f===ho.Success,isNewMicroservice:h}),{isSending:_,handleSubmit:P}=vp({programId:n,nextStepLink:r,productType:m,data:p,changeSubmitFormStatus:E,isNewMicroservice:h}),[,{field:O,onSubmit:B,reset:M}]=mn(D,{formValidator:R,onSubmit:P}),A=gn(qn);return i((()=>{!1===b&&A.open({ok:b,onClose:()=>E(!0)})}),[b]),i((()=>{f&&w?.current&&w.current.scrollIntoView({block:"start"}),f===ho.Success&&M()}),[w?.current,f]),c(hn,{className:u("container space-y-m",e),title:t,...g,children:[f||I?null:o(No,{onChangeEsiaStatus:y,productType:m}),c("form",{onSubmit:e=>{O("processPersonalDataFlg")?.value||(N((e=>e+1)),v>0&&S.open({productType:m,attempts:v})),B?.(e)},className:"space-y-m relative",ref:w,children:[f===ho.Pending?o(ii,{blur:!1}):null,C.map(((e,t)=>c("div",{className:u(ss(e.columns),"grid gap-x-m"),children:[os(e.title),Eu({field:O,inputs:e?.inputs},m)]},`section-${t}`))),_u(d,_),f===ho.Error?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Lp=e=>e?.flatMap((e=>e?.inputs))||[],zp=e=>({...uo,limitedBirthday:so(e)}),Vp=d((({title:e,description:t})=>{const n=Ee();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),$p=e=>e%2!=0,jp="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Wp=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=an(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(jp),children:[D(r,{...i.options,parent:n}),$p(r.length)?o(Qt,{className:"col-span-6",...i}):null]}),c(Vo,{children:[c($o,{className:u(jp),isUnfolded:s,children:[D(l,{...i.options,parent:n}),$p(l.length)?o(Qt,{className:"col-span-6",...i}):null]}),o(zo,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),qp=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Up=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Hp=10;function Kp(e=0){const t=Math.round(e*Hp);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Yp=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const p=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:Kp(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}(r((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:p,role:"listitem",children:d})})),Gp=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Jp=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:p,children:h,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},b=s([]),x=r(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(Qp(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Xp(c,v):{},...N?Up(p):{},gap:`${l}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Yp,{className:u(m,i?Gp[i-1]:"",{"h-full":N},t),style:w?Xp(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:x,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(h)});var k})),Xp=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Qp=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Zp={"horizontal-list":"w-6","vertical-list":"h-6"},eh=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Zp[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),th=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},nh=e=>t=>e.scrollWidth/t,ah=e=>(t,n)=>{e.scrollBy({left:n*nh(e)(t),behavior:"smooth"})},ih=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Dd()(i),Rd()(i)]:[-1,-1],m=c>0,u=d<e-1,p=r((()=>{var t;n.current&&(m?ah(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),h=r((()=>{n.current&&(u?ah(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:p,scrollRight:h,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},rh={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},lh=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ee(),[p,h]=ih({itemCount:s.length}),g=sh(Boolean(s?.length));i((()=>{s?.length&&t>=0&&p?.current&&h.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Jp,{containerRef:p,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(th({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",rh[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(eh({activeIndex:t,onClick:f,listType:a}))}):null})),sh=(e=!1)=>({behavior:e?"auto":"smooth"}),oh=d((({className:e,name:t,...n})=>o(zn,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(Y,{name:t,iconVersion:"",size:"small"})}))),ch=d((e=>o(oh,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),dh=d((e=>o(oh,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),mh="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",uh=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?ph(t):null,r?o(ch,{wcmsIgnore:!0,className:u(hh(i),m?"left-1":"left-0"),onClick:s}):null,l?o(dh,{wcmsIgnore:!0,className:u(hh(i),m?"right-1":"right-0"),onClick:d}):null]})})),ph=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(mh,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(mh,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),hh=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),gh=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:p,showDots:h,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const b=Array.isArray(g)?g.length:0,[x,v]=ih({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(Jp,{containerRef:x,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(uh,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:p,isBottom:Boolean(y?.length)}),o(lh,{className:u(!h&&"lg:hidden"),activeIndex:N,dotCount:b,listType:r,version:t,navButtons:y,containerRef:x,containerScroll:v})]})})),fh=({blocksToRender:e,...t})=>o(gh,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:D(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",qp(!0)),children:R(e,t)},String(n))})}),yh=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[bh(n,t),o(Wp,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[bh(n,t),fh({...a,blocksToRender:t})]});default:return null}})),bh=(e,t)=>e&&!t.length?o(Vp,{...e}):null,xh=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),vh=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(fl,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Nh=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,xh(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(wh(a)).filter(Boolean))]}),n?o("div",{children:o(zn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),wh=e=>([t,n])=>{const a=n?.type;return"array"===a?Ch(t,e)(n):null},Ch=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(vh,{items:a,multiple:!n?.single,...t(e)})]},e)},kh=e=>e;function Sh(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Ih=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Th=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Ih(t[e])||Ih(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Ih(t[e])||Ih(n[e])||Rh(t[e])<=Rh(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Ih(t[e])||Ih(n[e])||Rh(t[e]?.min)>=Rh(n[e]?.min)&&Rh(t[e]?.min)<=Rh(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Ih(t[e])||Ih(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Ih(t[e])||Ih(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Rh=e=>Number(e||0),Eh=(e,{block:t,page:n,normalize:a=kh})=>{const i=t?.blocks||[],[r,s]=mn(e),o=l((()=>Sh(i,i.map((e=>qt(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=kh)=>e?.filter((([,e])=>Th(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Dh={},_h={},Ph=Kt((({className:e,filtrationSchema:t=Dh,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Eh(_h,{block:i.block,page:i.options?.page}),d=o(Ra,{className:"w-64",label:n?.title,options:Oh(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Oh(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Nh,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(zn,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(yh,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Oh=e=>Sh(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Bh=(e=!1)=>e?"text-left":"text-center",Mh={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Ah=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",Mh[t],e),style:{width:r,height:r},role:"figure",children:o(Y,{name:a,width:"54%",...i})}):null})),Fh=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ee();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:Bh(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Lh)}):null]})})),Lh=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(Ah,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),zh=(e,t,n)=>{return o(gh,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(ze,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(ze,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Vh=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?zh(e,0,t):null]}))),$h={start:"justify-start",center:"justify-center",end:"justify-end"},jh=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",$h[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ke(e)})})),Wh=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Xe(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),qh=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Uh=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Wh,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(hd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(qh,{title:e,...l}),Hh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Kh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Yh=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Hh.prefMonthsNum,prefTravelBonusRate:r=Hh.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Kh,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},Gh=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=mn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:p,maxSumOther:h,monthBonus:g,yearBonus:f}=Yh(l,n);return o(cd,{className:e,title:t,...r,children:c("section",{className:u(dd,e),children:[c("div",{className:md,children:[Cd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Cd({title:"Сумма покупок в остальных категориях, ₽",min:p,max:h,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Uh({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:ud,children:[f>=0?o(hd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ke(a,{isVertical:!0}),bd(i)]})]})})})),Jh=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Xh=e=>Nd({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Qh=" (c капитализацией)",Zh=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:ud,children:[o(hd,{title:`Доход в конце срока${r?Qh:""}`,value:e,postfix:n,prefix:"+"}),o(hd,{title:`Сумма в конце срока${r?Qh:""}`,value:t,postfix:n}),Ke(a,{isVertical:!0}),i?.map(bd)]}),eg={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const tg={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ng=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?eg[e?.rateType]:"",{data:n}=Si(t?`${Va}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&ag(s,e)&&Bd(a,["minSum","maxSum"],e)&&Bd(n,["minDays","maxDays"],e)))||tg,{rate:m}=d,u=ig(m,e),p=a+u,h=c||[tg];return{...d,...Od(["minSum","maxSum"],h),...Od(["minDays","maxDays"],h),...e,isDisabledOperatingDeposit:o,income:u,finalSum:p}},ag=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,ig=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},rg=Kt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:p}]=mn({moneyValue:Vd(l,1e5),daysValue:$d(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),h=ng(m,s),{income:g,finalSum:f,rate:y,depositeName:b}=h;return o(cd,{className:e,title:t,...d,children:c("section",{className:u(dd,e),children:[c("div",{className:md,children:[Cd({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...p("moneyValue"),value:h.moneyValue}),(x={title:"Срок, дней",min:h.minDays,max:h.maxDays,...p("daysValue"),value:h.daysValue},o(zi,{items:[`От ${Jh(x.min||0)}`,`До ${Jh(x.max||0)}`],step:1,...x})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[lg(h,p),Xh({...p("isMonthlyInterestPayment")})]})]}),Uh({rate:y,depositeName:b,isShowDepositeName:r}),Zh({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var x})),lg=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(oi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(oi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),sg=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},og={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},cg=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?ug(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[mg({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),mg({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),mg({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),mg({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Bd(a,["minSum","maxSum"],t),Bd(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||og,{rate:u}=m,p=e?.extraPercent?.key??0,h=Number(u)+Number(p),g=dg(h,e),f=a+g,y=t||[og];return{...m,...Od(["minSum","maxSum"],y),...Od(["minMonths","maxMonths"],y),availableMonths:sg(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},dg=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},mg=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],ug=(e,t)=>e+Math.round((t-e)/2),pg=(e="rub")=>"rub"===e,hg=(e,t)=>{const{minMonths:n,maxMonths:a}=Od(["minMonths","maxMonths"],bg(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Bi(i,n,a)}},gg=(e,t)=>{const{minSum:n,maxSum:a}=Od(["minSum","maxSum"],bg(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Bi(i,n,a)}},fg=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),yg=e=>{const t=pg(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},bg=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},xg=(e,t=!1)=>t?Nd({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,vg=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Ng(t("isReplenish"),e,a),wg(t("isWithdrawn"),e,a),Cg(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Xh(t("isMonthlyInterestPayment")):null,xg(t("isRemoteRegistration"),e.isShowRemoteRegistration),kg(t("extraPercent"),n),e.isShowNewClient?o(oi,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Ng=(e,t,n=!1)=>t.isShowReplenish?Nd({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,wg=(e,t,n=!1)=>t.isShowWithdrawn?Nd({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,Cg=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,kg=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Ra,{options:t,...e})]}):null,Sg={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Ig={text:"₽",key:"rub"},Tg={text:"Без учета надбавки",key:"0"},Rg=Kt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:p}=n??{},h=p?.map((e=>e.currency))??[Ig],g=r((e=>t=>e?{...t,...yg(t),...gg(t,e),...hg(t,e),...fg(t,e)}:t)(p),[p]),[f,{field:y}]=mn({moneyValue:Vd(d,2e4),monthsValue:$d(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Ig,extraPercent:d?.extraPercent??Tg},{normalizer:g}),b=Og(y),x=Boolean(y?.("isNewClient")?.value),v=p?.find((e=>e?.extraPercents))?.extraPercents,N=bg(p,b),w=cg(f,N,s),{rate:C,income:k,finalSum:S,type:I=""}=w,T=r((()=>{kd({field:y,defParams:fd(N,x,v),calcParams:w,monthsValue:"minMonths",map:Sg})}),[y,p,v]);i((()=>{!zd(d)&&N&&T()}),[d,p]);const R=y?.("extraPercent")?.value?.key,E=Pg(C,R),D=C===fd(N,x)?.rate&&R===v?.at(-1)?.key;return o(cd,{className:e,title:t,...m,children:c("section",{className:u(dd,e),children:[c("div",{className:md,children:[c("div",{className:"flex gap-m",children:[Cd({className:"w-full",title:`Сумма, ${b?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:b?.text,step:Eg(b?.key)}),p&&p?.length>1?o(Ea,{label:"Валюта",options:h,...y("currency")}):null]}),xd({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),vg({...w,...s},y,v)]}),Uh({rate:E,children:_g(T,D)}),Zh({income:k,finalSum:S,buttons:[...a,Dg(n?.buttons,I)],footnotes:[l],postfix:b?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Eg=(e="")=>pg(e)?1e3:100,Dg=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},_g=(e,t=!1)=>t?null:o(zn,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Pg=(e,t)=>Number(e)+Number(t??0),Og=e=>e?.("currency")?.value??Ig,Bg=e=>Mg({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Mg({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Mg=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Ag={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Fg=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[Ag],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Bg({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Pd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Pd(["minMonths","maxMonths"],o,s),p=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Bg({row:e,userInputParams:t,paramsViewSettings:n})&&Bd(a+l,["minSum","maxSum"],e)&&Bd(r,["minSumOld","maxSumOld"],e)&&Bd(l,["minSumExtra","maxSumExtra"],e)&&Bd(i,["minMonths","maxMonths"],e)))||Ag)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:h}=p,g=Id(h,e),f=e.oldMonthlyPayment-g;return{...p,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Lg=Kt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=mn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),p=Fg(d,n,r),h=l((()=>gd(n?.rateRows)?.rate),[n?.rateRows]),g=wd({...m("isAnnuity")});return o(cd,{className:e,title:t,...s,children:c("section",{className:u(dd,e),children:[c("div",{className:md,children:[Cd({title:"Остаток долга в других банках, ₽ ",step:500,min:p.minSum,max:p.maxSum-p.maxSumExtra,...m("moneyValue"),value:p.moneyValue}),Cd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:p.minSumOld,max:p.maxSumOld,...m("oldMonthlyPayment"),value:p.oldMonthlyPayment}),xd({title:"Новый срок кредита, месяцев",min:p.minMonths,max:p.maxMonths,...m("monthsValue"),value:p.monthsValue}),zg({...p,...r},m),p.isExtraMoney?Cd({title:"Дополнительная сумма, ₽ ",step:500,min:p.minSumExtra,max:p.maxSumExtra,...m("moneyExtra"),value:p.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(ud,"@4xl:w-1/2"),children:[o(hd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(hd,{title:"Ставка от",value:h,fractionDigits:2,postfix:"%"}),o(hd,{title:"Ежемесячный платёж",value:p.monthlyPayment,postfix:"₽"}),p.benefit>0?o(hd,{title:"Выгода в месяц",value:p.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ke(a,{isVertical:!0}),bd(i)]})]})})})),zg=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(oi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(oi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(oi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Vg=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=Oi(e,{normalize:(e=i)=>n&&a?String(Bi(Number($g(e)),n,a)):$g(e),format:Xe(l)}),d=r((e=>t&&t($g(e))),[t]);return o(pa,{onChange:d,...s,...c})})),$g=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),jg=d((e=>o(Vg,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),Wg={private:"p2p/registerP2P",business:"b2c/registerB2C"},qg=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Wn,{maxWidth:"lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Ug=e=>{const t=gn(qg),n=Ls(),a=en(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=en(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Va}/payment/${Wg[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},Hg={amount:1500},Kg=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=Ug(i),[{amount:s},{field:d,onSubmit:m}]=mn(Hg,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(jg,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(ri,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),Yg=({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(Y,{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})]}),Gg="relative h-full",Jg={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Xg=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(ef),l=n?{defaultPadding:"p-6xl pb-m"}:{};return _({...a,renderProps:(n,a,i)=>c("div",{className:Qg(n,{someCardsHighlighted:r}),children:[R(n,a,{className:Zg(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),ef(n)?Yg({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Qg=(e,{someCardsHighlighted:t})=>u(Gg,t&&(ef(e)?"pt-3xl":"pt-16")),Zg=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Gg,"min-w-80",Jg[a],t&&(ef(e)?"pt-16":"pt-3xl"),qp(n),n&&"h-full"),ef=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,tf=Kt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(gh,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?nf(s?.block?.blocks):[],hasBlur:!0,children:Xg({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),nf=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],af={black:"bg-black",white:"bg-white"},rf=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Pe,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Ke([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(lf)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),lf=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${af[e]}`},String(t)),sf=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=be()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),of=[{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"}}],cf=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>of.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),p=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},df(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Ke(m,{className:mf(s??!1,i??!1,n),buttonClassName:p})}),l?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),df=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",mf=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),uf=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:p,align:h="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:b=false,isImageSecondary:x=!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(sf,{href:i,target:m,className:"h-full",data:xp(v),children:c(Pe,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:p,description:n,headlineVersion:"XS",isEmbedded:!0,align:h}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(cf,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:x,imageAlign:"center",children:[o(Ue,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,pf(a,h)]})})}))),pf=(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,hf=new pe,gf=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ke(i)}):null]},String(t))},ff=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:p=[],options:h,data:f,...y})=>{const b=l((()=>p.map(gf)),[p]),[x,v]=l((()=>m>0?[b.slice(0,m),b.slice(m)]:[b,[]]),[m,b]),[N,C]=a(!1);i((()=>hf.subscribe("fold",(e=>{e&&h?.parent&&e.parent===h?.parent&&C(e.isUnfolded)}))),[h?.parent]);const k=r((()=>{hf.fire("fold",{type:"fold",isUnfolded:!N,parent:h?.parent})}),[N,h?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Se,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Vo,{children:[c("div",{children:[x,o($o,{isUnfolded:N,children:v})]}),p.length>=m?o(zo,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:k}):null]}):o("div",{children:x})]})})),yf=d((({text:e,value:t})=>c("div",{className:"space-y-xs w-full",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}),o("div",{className:"w-full text-2xl bg-main-gray px-4 py-3 rounded-md",children:Xe()(t)})]}))),bf=d((({cashbacks:e})=>{const{mounth:t,year:n}=xf(e);return c("div",{className:"w-full flex flex-col gap-lg",children:[o(w,{className:"text-left",headingType:"h5",as:"h2",title:"Результат расчета"}),o(Fe,{__html:'Категории покупок для расчета баллов предварительные.<br />Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>'}),c("div",{className:"flex flex-col @xs:flex-row gap-lg",children:[o(yf,{text:"Баллов в месяц",value:t}),o(yf,{text:"Баллов в год",value:n})]})]})})),xf=e=>e.reduce(((e,t)=>{const n=Number(t.percent.key)/100*t.sum;return{mounth:Math.min(e.mounth+n,5e3),year:Math.min(e.year+12*n,6e4)}}),{mounth:0,year:0}),vf=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"},{text:"Категория 5%",key:"5"},{text:"Категория 10%",key:"10"},{text:"Категория 15%",key:"15"}],Nf=[{text:"Категория 1,5%",key:"1.5"},{text:"Категория 3%",key:"3"}],wf=d((({categories:e,cashback:t,showIncreasedPercents:n,maxInputRange:i,deleteImage:r,onDelete:l,onChange:s})=>{const[d,m]=a(Cf(e)),u=0===t.id;return c("div",{className:"w-full space-y-m",children:[c("div",{className:"space-y-xs",children:[o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:"Выберите категорию"}),c("div",{className:"flex gap-m",children:[o(Ra,{className:"w-full",isManualInput:u,placeholder:"Выберите категорию",options:kf(u,n),value:t.percent,onChange:e=>{s({...t,percent:e})}}),u?null:o(zn,{version:"secondary",onClick:()=>l(t.id),shape:"round",className:"px-4 rounded-md",children:o(ie,{image:r})})]})]}),e?.length&&!u?o(Ra,{label:"Выберите категорию покупок",placeholder:"Выберите категорию покупок",options:e,value:d,onChange:m}):null,o(zi,{step:500,title:"Сумма покупок в категории",min:0,max:i,value:t.sum,onChange:e=>{s({...t,sum:e})}})]})})),Cf=e=>e?.[(new Date).getTime().toString().slice(-1)],kf=(e,t)=>e?[]:t?vf:Nf,Sf=[{id:0,percent:{text:'Категория 1% "На всё"',key:"1"},sum:5e3}],If={href:"/natural/debetcards/svoya-plus",text:"Оформить карту",target:"_self"},Tf=["5","10","15"],Rf=d((({maxInputRange:e=3e5,image:t,deleteImage:n,infoImage:i,className:r="",button:l=If,...s})=>{const{cashbacks:d,categories:m,onAddNewCashback:p,onChangeCashback:h,onDeleteCashback:f,onResetCashback:y}=(()=>{const{data:e}=Bc("CASHBACK_CATEGORY"),[t,n]=a(Sf);return{cashbacks:t,categories:e?.map((e=>({key:e.key||"",text:e.value})))||[],onAddNewCashback:()=>n((e=>[...e,{id:e[e.length-1].id+1,percent:{text:"Категория 1,5%",key:"1.5"},sum:5e3}])),onChangeCashback:e=>n((t=>t.map((t=>t.id===e.id?e:t)))),onDeleteCashback:e=>n((t=>t.filter((t=>t.id!==e)))),onResetCashback:()=>n(Sf)}})(),b=t?.src?o(ie,{image:t,className:"hidden w-full @xl:block",imageClassName:"justify-self-center"}):null;return c(g,{className:u("flex flex-col justify-center items-center gap-lg",r),defaultPadding:u("p-6xl"),...s,children:[o(S,{title:"Калькулятор расчета баллов",description:"Можно выбрать не более 5 категорий, одна из них из повышенной категории",headlineVersion:"XL",isEmbedded:!0}),c("div",{className:"flex flex-row items-start gap-lg",children:[c("div",{className:"w-full flex flex-col justify-center items-center gap-lg",children:[d.map((t=>o(wf,{categories:m,cashback:t,showIncreasedPercents:Df(t,d),maxInputRange:e,deleteImage:n,onDelete:f,onChange:h},String(t.id)))),Ef(d.length,p,y),o(bf,{cashbacks:d}),o(Jc,{__html:"<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>",image:i}),o(Se,{className:"w-full @lg:w-auto self-start",href:l.href,text:l.text,target:l.target,version:"primary"})]}),b]})]})})),Ef=(e,t,n)=>c("div",{className:"w-full flex flex-col gap-lg",children:[e<5?o(zn,{className:"self-start text-primary-main",embedded:!0,version:"secondary",onClick:t,children:"Добавить еще"}):null,e>2?o(zn,{className:"self-start",version:"secondary",onClick:n,children:"Сбросить все категории"}):null]}),Df=(e,t)=>Tf.includes(e.percent.key)||!t.some((e=>Tf.includes(e.percent.key))),_f=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(jr,{step:a,showPercentage:!1})]})})}));var Pf;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND",e.clientFound="CLIENT_FOUND",e.newClient="NEW_CLIENT"}(Pf||(Pf={}));const Of=e=>bo("/user-data/getTaskStatus","POST",e),Bf=async e=>{const t=await bo("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},Mf=d((({title:e,interval:t=0,onEnd:n=Mn})=>{const[i,r]=a(t);ms({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(S,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(fs,{seconds:i})})]})]})})),Af=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Mn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(Mf,{interval:s,onEnd:d}):null]}),o(Ff,{title:n,items:a}),o(Ff,{title:i,items:r,countColumns:!0}),l?o(gi,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Ff=({title:e,items:t,countColumns:n=!1})=>{const a=Ee();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(ze,{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",ss(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Lf(e)},t)))}):null]})]}):null},Lf=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),zf=d((()=>o(Af,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Vf=d((({onExpire:e})=>{const{statusInfo:t}=Lc();return o(Af,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),$f=d((()=>{const{statusInfo:e}=Lc(),t="courier"===e?.methodObtain;return o(Af,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),jf=d((()=>{const{statusInfo:e}=Lc();return o(Af,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Wf(e),buttonText:"Вернуться на главную"})})),Wf=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:ja(e?.deliveryDate)}]):t},qf=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Uf=d((()=>{const[e,t]=a(Pf.process),{taskId:n}=Lc();i((()=>{(async()=>{for(const e of qf)await Bf({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await Of({taskId:n});a&&a?.statusCd!==Pf.process&&(e(),t(a.statusCd))}),[n]);ds(l,3e4);const s=r((()=>t(Pf.rework)),[]);return Hf(e,s)})),Hf=(e,t)=>({IN_PROCESS:o(Vf,{onExpire:t}),CANCELLED:o(zf,{}),FAILED:o(zf,{}),DRAFT:o(zf,{}),APPROVED:o(jf,{}),PRE_DECISION:o(jf,{}),REVISION:o($f,{})}[e]||o($f,{})),Kf=e=>t=>t.filter((e=>e)).map((t=>[Yf(t,e),Qf(t,e),Gf(t,e),Jf(t,e),Xf(t,e)].some(Boolean)?{...t,required:!1}:t)),Yf=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Gf=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Jf=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Xf=({condition:e},t)=>e?.name&&e?.values?.every((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Qf=({name:e},t)=>"snils"===e&&!t("snils")&&Zf(t),Zf=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,ey={...Su,...Iu},ty=({field:e,inputs:t,params:n})=>t.map(ls(e,n,ey)),ny=({sections:e,field:t,params:n})=>e?.map((({inputs:e=[],columns:a,title:i,condition:r},l)=>{const s=Kf(ay(t))(e),c=[Xf({condition:r},ay(t))?null:os(i),...ty({field:t,inputs:s,params:n})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return c.length?o("div",{className:u(ss(a),"grid gap-x-m"),children:c},`section-${l}`):null})),ay=e=>t=>e(t)?.value,iy=({formState:e,inputs:t,productType:n})=>{return Pn(Kf((t=>e[t]))(t),{...uo,limitedBirthday:so(n),dulIssueDate:(i=e.limitedBirthday,ao(14,i)("Укажите дату выдачи паспорта")),generalSeniority:(a=e.lastJobExperience,sn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!a||Number(e)>=Number(a))))("Укажите количество лет стажа")),beginDate:to(e.limitedBirthday),participantDateRegistration:no(e.limitedBirthday),organizationName:io(e.isDadataOrganization),inn:ro(e.isDadataOrganization)})(e);var a,i},ry=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(zn,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(ri,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),ly=(e,t,n)=>({...n[e],...t,limitedBirthday:sy(t?.limitedBirthday),dulIssueDate:sy(t?.dulIssueDate),participantDateRegistration:sy(t?.participantDateRegistration),beginDate:sy(t?.beginDate),deliveryDate:sy(t?.deliveryDate)}),sy=e=>{try{return e?new Date(e):void 0}catch(e){return}},oy=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",isDadataOrganization:!1,organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0}],cy=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...oy(),{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],dy=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},my=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:p,organizationPhone:h,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return"RETIREE"===n?.key?{employmentTypeCd:n}:{employmentContractDate:ja(t||"",!0),employmentTypeCd:{key:"WORK"},organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:p,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:ip({organizationPhone:h&&Wa(h)}),participantAddresses:rp({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},uy=e=>{const{limitedBirthday:t="",sex:n,birthPlace:a,dulIssueDate:i="",dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o,education:c,participantDateRegistration:d,housing:m,addressRegistration:u,addressFact:p,addressMatch:h}=e;return{birthDate:ja(t,!0),birthPlace:a,dulIssueDate:ja(i,!0),dulIssuedBy:r,dulNumber:l,dulSerie:s,dulSubdivisionCode:o?.replace("-",""),educationLevelCd:c,registrationDate:d?ja(d,!0):void 0,homeMatchFlg:h,houseTypeCd:m,participantAddresses:rp({addressRegistration:u,addressFact:h?u:p}),genderCd:n?{key:"male"===n?"MAN":"WOMAN"}:void 0}},py=e=>e?new Date(e).toISOString().split(".")[0]:"",hy=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:py(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},gy=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},fy=(e,t)=>{switch(e){case 0:default:return{};case 1:return uy(t);case 2:return my(t);case 3:return lp(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:rp({addressCourier:t})}:{}})(t)}},yy=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=5===e,c=Lc(),d=l((()=>ly(e,c.leadForm,cy)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Mu((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...gy(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...fy(i,a)}],...dy(a),...hy(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},by=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{js();const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((e=>iy({formState:e,inputs:s,productType:"creditCard"})),[s]),[m,u,p]=yy({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=mn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ny({sections:t,field:h}),o(ry,{isSending:p,step:e,onPrevStep:n})]})})),xy=[{title:"Персональные данные",columns:2,inputs:[{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"sex",required:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],vy=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...xy,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"employerActivities",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"generalSeniority",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"lastJobExperience",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"experience5Years",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"positionOrganization",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}}]},{columns:2,inputs:[{condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode"}]}]],Ny=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],wy=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Ip,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=vy[n],[f,{setTrue:y}]=an(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(_f,{stepsTitles:Ny,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Uf,{}):o(by,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:y},String(n))})]})})})),Cy=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(jr,{step:a,showPercentage:!1})]})})})),ky=async e=>{await xo("/camunda/send/message","POST",e)},Sy=d((()=>o(Af,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Iy=e=>"11"===e?{name:"Потребительский кредит на рефинансирование",description:"Погашение основного долга по кредиту, иные цели и оплату страхования"}:{name:"Кредит на любые цели",description:"На любые цели"},Ty=d((({onExpire:e})=>{const{statusInfo:t,programId:n}=Lc(),a=Iy(n);return o(Af,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:a.name},{label:"Цель кредита",description:a.description},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Ry=d((()=>{const{statusInfo:e}=Lc();return o(Af,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ey=d((()=>{const{statusInfo:e,programId:t}=Lc(),n=Iy(t);return o(Af,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:n.name},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Dy=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],_y=["CREATE_APPLICATION_SHORT_MESSAGE"],Py=d((()=>{const e=go(),[t,n]=a(Pf.process),{taskId:l}=Lc();i((()=>{(async()=>{if(e)for(const e of _y)await ky({messageName:e,taskId:l});else for(const e of Dy)await Bf({signalType:e,taskId:l})})()}),[l]);const s=r((async e=>{const t=await Of({taskId:l});t&&t?.statusCd!==Pf.process&&(e(),n(t.statusCd))}),[l]);ds(s,3e4);const o=r((()=>n(Pf.rework)),[]);return Oy(t,o)})),Oy=(e,t)=>({IN_PROCESS:o(Ty,{onExpire:t}),CANCELLED:o(Sy,{}),FAILED:o(Sy,{}),DRAFT:o(Sy,{}),APPROVED:o(Ey,{}),PRE_DECISION:o(Ey,{}),REVISION:o(Ry,{})}[e]||o(Ry,{})),By=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(zn,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(ri,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),My={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},Ay=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:My[a?"annuity":"differential"]}},Fy=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Ly=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return uy(t);case 2:return my(t);case 3:return lp(t);default:return{}}},zy=[{calculator:void 0},...oy(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Vy=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=4===e,c=Lc(),d=l((()=>ly(e,c.leadForm,zy)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i){const t=await Mu((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>{const r=go(),l={id:e,...!r&&{profile:{id:n}},roleCd:{key:"BORROWER",value:"Заемщик"},...Ly(i,a)};return{sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,...r?{participant:l}:{participants:[l]},...Ay(a),...Fy(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}})({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},$y=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=Lc();js();const m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),p=r((e=>iy({formState:e,inputs:u,productType:"credit"})),[u]),[h,g,f]=Vy({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:b}]=mn(h,{formValidator:p,onSubmit:g});return c("form",{onSubmit:b,className:"space-y-m",children:[ny({sections:t,field:y,params:{calcData:m}}),o(By,{step:e,isSending:f,onPrevStep:a})]})})),jy=[[{columns:1,inputs:[{name:"calculator"}]}],[...xy,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{inputs:[{name:"employment",required:!0}]},{columns:2,inputs:[{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"inn",required:!0,dadata:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"amountWorkers",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"organizationPhone",label:"Телефон работодателя",required:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:2,inputs:[{name:"jobsNumber",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{name:"beginDate",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{title:"Адрес работодателя",inputs:[],condition:{name:"employment",values:["WORK","WORK_RETIREE"]}},{inputs:[{name:"organizationAddress",required:!0,dadata:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога",condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0,condition:{name:"employment",values:["WORK","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE","WORK_RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{columns:2,inputs:[{name:"bankEmployeeCode"}]}]],Wy=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],qy=Kt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Ip,[]);const p=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),h=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=jy[l],y=0===l,[b,{setTrue:x}]=an(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(Cy,{stepsTitles:Wy,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:b?o(Py,{}):o($y,{step:l,sections:f,programsSource:t,onNextStep:p,onPrevStep:h,onFinish:x},String(l))})]})})})),Uy=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=e===t?100:85;return c("div",{className:"py-lg px-5xl bg-white col-span-12",children:[n[e]||null,o(jr,{step:a,showPercentage:!1})]})})),Hy=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("div",{className:"flex flex-col md:flex-row items-center",children:o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"})}),o(Ky,{items:n}),a?o(Se,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(Se,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(Se,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),Ky=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{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 gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:Yy(e)},t)))}):null]})]}):null,Yy=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),Gy=d((()=>{const{leadForm:e}=Lc();return o(Hy,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:ja(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),Jy=d((()=>o(Hy,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),Xy=d((()=>o(Hy,{title:"Не закрывайте заявку",description:"Идёт проверка данных"}))),Qy=d((()=>o(Hy,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),Zy=d((({isOffice:e})=>o(Hy,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),eb=d((()=>{const[e,t]=a(Pf.process),{taskId:n,statusInfo:r,programId:l}=Lc(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await Bf({signalType:"FIND_PERSON_SIGNAL",taskId:n});await Bf({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Pf.notFound)})()}),[n]),tb(e,o,s)})),tb=(e,t,n)=>({IN_PROCESS:o(Xy,{}),NOT_FOUND:o(Jy,{}),CLIENT_NOT_OK:o(Jy,{}),NEW_CLIENT:o(Zy,{isOffice:t}),CLIENT_FOUND:o(Zy,{isOffice:t}),DBO_CLIENT:o(n?Qy:Gy,{}),PRE_DECISION:o(Zy,{isOffice:t})}[e]||o(Zy,{isOffice:t})),nb=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(zn,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ri,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),ab=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressMatch:!0,addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},isMomentDebitCard:!0,currency:"810",codeWord:"",latinName:"",latinSurname:""}],ib=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:py(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},rb=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},lb=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:rp({addressCourier:t})}:{}})(t);case 1:return uy(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},sb=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=an(!1),o=2===e,c=Lc(),d=l((()=>ly(e,c.leadForm,ab)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:Qd[a]},...rb(n),participants:[{id:e,residentOtherCountry:!1,...lb(i,n)}],...dy(n),...ib(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),xo("/user-data/updateUserTaskDebit","PUT",r)),o?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},ob=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{js();const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((e=>iy({formState:e,inputs:s,productType:"debitCard"})),[s]),[m,u,p]=sb({step:e,onNextStep:a,onFinish:i}),[,{field:h,onSubmit:g}]=mn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ny({sections:t,field:h}),o(nb,{step:e,isSending:p,onPrevStep:n})]})})),cb=[[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]},required:!0}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Ожидайте звонка для согласования даты и времени доставки карты"}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],[...xy,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[],condition:{name:"addressMatch",values:[!1]}},{inputs:[{name:"addressFact",required:!0,dadata:!0,condition:{name:"addressMatch",values:[!1]}}]},{inputs:[{name:"infoCard",condition:{name:"methodObtain",values:["courier"]},label:"Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг."}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[],condition:{name:"isMomentDebitCard",values:[!1]}},{columns:2,inputs:[{name:"latinName",condition:{name:"isMomentDebitCard",values:[!1]}},{name:"latinSurname",required:!0,condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения.",condition:{name:"isMomentDebitCard",values:[!1]}}]},{inputs:[{name:"codeWord",required:!0}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.",condition:{name:"isMomentDebitCard",values:[!1]}}]}]],db=["","Персональные данные","Платежная система"],mb=Kt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Ip,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),p=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),h=cb[n],f=0===n,[y,{setTrue:b}]=an(!1),x=r((()=>{b(),m()}),[]);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(Uy,{stepsTitles:db,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(eb,{}):o(ob,{step:n,sections:h,onNextStep:u,onPrevStep:p,onFinish:x},String(n))})]})})})),ub=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,pb=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),hb=1e9,gb={sum:{min:1e4,max:hb},period:3},fb=Kt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Eh(gb,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:yb(e)})}),p=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),h=bb(p);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(Nh,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(jg,{label:a?.title,min:500,max:hb,...d("sum",{parse:e=>({min:Number(e),max:hb}),format:({min:e})=>String(e)})}),o(zi,{title:i?.title,items:["От 3 мес","До 5 лет"],list:h,...d("period")})]})}),o(yh,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),yb=e=>$t((e?.paramsSource?.rateRows||[]).filter(ub).flatMap((e=>pb(e.minMonths,e.maxMonths)))),bb=e=>$t(e.flatMap((e=>e||[])).filter(ub).flatMap((e=>pb(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],xb=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,vb=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:xb(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Se,{version:i?.version,text:i?.text,...i}):null]}))),Nb=`${Va}/region`;function wb(e="Москва"){return Fc().location??{name:e}}function Cb(e="Москва"){const t=Fc(),n=r((async()=>{if(!t.location){const n=await zt(Nb);t.location=n??{name:e}}}),[t,e]);return Si(Nb,n),t}var kb;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(kb||(kb={}));const Sb=new Intl.NumberFormat("ru",{style:"currency",currency:kb.RUB}),Ib=e=>e?Sb.format(e):"",Tb="text-m font-light text-secondary-text ",Rb=`${Tb} text-left`,Eb=`${Tb} pl-5xl text-center`,Db=`${Tb} pl-5xl text-right`,_b={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Pb=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Rb,children:o(ze,{size:"text-m",children:"Валюта"})}),o("th",{className:Eb,children:o(ze,{size:"text-m",children:"Купить"})}),o("th",{className:Db,children:o(ze,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ob)})]}))),Ob=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(ie,{image:{icon:_b[t]},width:"24",height:"24"}):null,o(ze,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(ze,{size:"text-h6",children:Ib(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(ze,{size:"text-h6",children:Ib(e?.buyExchangeRate)})})]},t)},Bb={icon:"GpsIcon"},Mb=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Ah,{...Bb,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:"Курс указан для заданного офиса"})]})]}))),Ab=(e,t,n)=>{const a=Number(Fb(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},Fb=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Lb(e){if(!e)throw new Error("Value should be fulfilled");return e}const zb=e=>t=>{const[,n]=Lb(e.find((([e])=>e(t))));return n(t)},Vb=e=>zb(e.map((([e,t])=>[e,()=>t])));Vb.if=e=>new $b(void 0,e);class $b{parent;predicate;unit;get entry(){return[Lb(this.predicate),Lb(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new $b(this,e)}then(e){return new $b(this.parent,this.predicate,e)}else(e){return zb([...jb(this),[()=>!0,e]])}}const jb=e=>[...e?.parent?jb(e.parent):[],e.entry],Wb=e=>Vb([[e=>e.value!==kb.RUB&&e.oppositeValue!==kb.RUB,()=>e.handleConvert(e.value,kb.RUB)],[e=>e.value===kb.RUB&&e.oppositeValue===kb.RUB,()=>e.handleConvert(e.value,kb.USD)],[e=>e.value===kb.RUB&&e.oppositeValue===kb.RUB,()=>e.handleConvert(e.value,kb.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function qb(e){const{placeholder:t,rates:n,selected:a,value:i,onChange:r,setSelected:l}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(pa,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:r}),s.length?o(Ra,{className:"absolute right-0",isBorder:!1,onChange:e=>l(e.key),options:s,value:d}):null]})}const Ub=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[l,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||kb.RUB,selectBuy:n?.[0]?.currency?.currency||kb.USD}),d=r((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:[qb({placeholder:"Хочу продать",rates:n,selected:l.selectSell,setSelected:Hb(l,d,n),value:l.inputSell,onChange:e=>Yb(d,n)(e,l.selectSell,l.selectBuy)}),qb({placeholder:"Получу",rates:t,selected:l.selectBuy,setSelected:Kb(l,d,t),value:l.inputBuy,onChange:e=>Gb(d,t)(e,l.selectBuy,l.selectSell)})]}):null,i?.text?o(Se,{text:i.text,version:i?.version,...i}):null]})})),Hb=(e,t,n)=>a=>{t({selectSell:a}),Wb({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Yb(t,n)(e.inputSell,a,i)}})},Kb=(e,t,n)=>a=>{t({selectBuy:a}),Wb({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Gb(t,n)(e.inputBuy,a,i)})},Yb=(e,t)=>(n,a,i)=>{e({inputSell:Fb(n),selectBuy:i});const r=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;r&&e({inputBuy:String(Ab(n,r,a===kb.RUB)||"")})},Gb=(e,t)=>(n,a,i)=>{e({inputBuy:Fb(n),selectSell:i});const r=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;r&&e({inputSell:String(Ab(n,r,a===kb.RUB)||"")})},Jb=`${Va}/exchangerates`;const Xb=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Si(Jb+`?regionCode=${t}`,Vt);return n||{}}(wb()),r=i?.exchangeRate?.currencies?.filter((e=>0!==e.buyExchangeRate||0!==e.saleExchangeRate)),l=Qb(r),s=l.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:kb.RUB}});const d=l.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:kb.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Pe,{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(Pb,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Mb,{address:i?.address})]}),o(Ub,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Qb=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Zb=d((({className:e,items:t})=>{const n=be();return o("ul",{className:u("w-full",e),children:t?.map(ex(n))})})),ex=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},tx=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:nx(e)}))),nx=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(ax,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),ax=d((({className:e,item:t})=>{const[n,{toggle:a}]=an(!1);return c(Vo,{className:e,role:"menuitem",children:[c(zn,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(gs,{children:[o(Ah,{className:"shrink-0",...t.icon}),o(ze,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Lo,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o($o,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(Zb,{items:t.items}):null})]})})),ix=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(rx)}):null)),rx=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(lx)})]},String(t)),lx=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:sx(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),sx=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${ox(t)}`,children:o(ze,{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})}},ox=e=>e.replaceAll(/\D/g,""),cx=d((({className:e="",index:t,text:n,...a})=>{const i=be(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),dx=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(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(cx,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),mx=d((({className:e="",index:t,...n})=>{const a=be(),{href:i,target:r,text:l,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),ux=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{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(mx,{index:t,...e},String(t))))}):null]}))),px=Kt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:r,contacts:l,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:p,otherLinks:h=[]}=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(tx,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(ix,{items:l}),m?o(Se,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(cf,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),o("div",{className:"flex gap-m xl:gap-xs flex-wrap",children:h.map(((e,t)=>o(gi,{className:"text-s font-light",...e},`${e.href}_${t}`)))})]})]}),o(dx,{title:d,links:r}),o(ux,{links:i,license:p})]})})),hx=(e=!1)=>e?{}:{padding:"p-0"},gx={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},fx=[1,2,3,4],yx={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},bx=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...p})=>{const h=(e=>{const[t,n]=a(e.blocks??[]),r=Ls(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",gx[n],e),padding:t,version:s,isTheme:c,...p,children:_({...p,block:{...m,blocks:h},renderProps:xx({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>yx,allowRemoveChild:e=>(e?.blocks??[]).length>5}),xx=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>R(n,{...a,blockDecorator:vx(a.blockDecorator,i)},{className:u("w-full",qp(t)),...hx(e)}),vx=(e,t=0)=>(n,a)=>e?.({...n,render:e=>wx(t)({...n,...e},a)},`wrap_${a}`)??wx(t)(n,a),Nx=e=>Number(e)<5?"":"hidden",wx=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return fx.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(sf,{...r.content?.link,className:u(Nx(e),(l=e,fx.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},Cx=Kt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],p=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Ea,{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(gi,{className:u("w-full @xl:w-auto"),href:p,target:"_blank",version:n?.version??"primary",data:xp(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),kx={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Sx=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:p="",ref:h})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${kx[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...Ix(p),...ve(s),ref:h,children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Ix=e=>e?{"data-test-id":e}:null,Tx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=an(!1),d=nn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(Sx,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),Rx={text:"Отправить заявку",version:"primary"},Ex={text:"Согласен на обработку персональных данных",href:"/privacy-policy",target:"_blank"},Dx=({onClose:e=Mn})=>o(Wn,{onClose:e,position:"corner",children:o("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:o("div",{className:"container grid grid-cols-12",children:o(Ts,{className:"col-span-12 pt-0",endpoint:"callback",title:"Заказать обратный звонок",sections:[{inputs:[{name:"questionProduct",required:!0},{name:"callbackTime",required:!0,label:"Когда перезвонить?"},{name:"russianPhone",required:!0},{name:"consentDataProcessing",required:!0}]}],button:Rx,link:Ex,onSuccess:e})})})}),_x=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a,renderDropdownItem:i=Ox,handlers:r,onItemClick:l})=>{const s=Ee();return o("div",{ref:e,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{"max-w-max":s}),"aria-label":a,children:t?.map(((e,t)=>i({item:e,i:t,activeItem:n,handlers:r,closeDropdown:l})))})},Px=d((({isActive:e,...t})=>{const n=be(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),Ox=({item:e,i:t,activeItem:n})=>o(Px,{isActive:e===n,...e},e?.text??String(t));const Bx=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:l="large"})=>{const[c,{setFalse:d,toggle:m}]=an(!1),p=Ax(B.QUICK_ACTIONS??[]),h=Fx(),g=Ee(),f=function({items:e,activeItem:t,onClose:n,isOpen:a,onHover:l=!1,renderDropdownItem:c,handlers:d}){const m=ka();i((()=>{a&&(m.close(),n?.())}),[a]);const u=r((()=>{m.close(),n?.()}),[n]),p=s(null),h=s(null),g=ca(u),f=l?h:g;return i((()=>{if(!a||!p.current||!e?.length)return;const n=p.current,{top:i,left:r,width:l,height:s}=n.getBoundingClientRect();m.open({popup:o(_x,{dropdownRef:f,items:e,activeItem:t,renderDropdownItem:c,handlers:d,onItemClick:u}),top:i+window.scrollY+s,left:r,width:l})}),[a,e,u]),i((()=>(l&&f.current?.addEventListener("mouseleave",u),()=>{f.current?.removeEventListener("mouseleave",u)})),[l,f.current,a]),p}({items:p,onClose:d,isOpen:c,onHover:!g,renderDropdownItem:Mx,handlers:h});return i((()=>{if(!g)return f.current?.addEventListener("mouseenter",m),f.current?.addEventListener("mouseleave",d),()=>{f.current?.removeEventListener("mouseenter",m),f.current?.removeEventListener("mouseleave",d)}}),[]),o("div",{ref:f,children:o(Sx,{image:{icon:"CallbackIcon",iconVersion:e},ariaLabel:n,buttonSize:l,isGrayBg:!0,version:a,className:u(c?"shadow-blue-gray":"",t),onClick:m})})})),Mx=({item:e,handlers:t,closeDropdown:n=Mn})=>{const a={call:{handler:e=>{t?.call(e),n()},text:"Заказать звонок"},chat:{handler:e=>{t?.chat(e),n()},text:"Написать в чат"}};return o("button",{className:u("text-l font-light pb-m hover:text-primary-main text-left"),role:"link",onClick:a[e?.text??""].handler,children:a[e?.text??""].text},e?.text??"")},Ax=e=>e.map((e=>({text:e}))),Fx=()=>{const e=gn(Dx),t=r((()=>{e.open({onClose:()=>e.close()})}),[]),n=nn();return{call:t,chat:r((e=>{const t=n.openChatBot;t&&e&&t&&t(e).finally()}),[])}},Lx={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"},zx=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ee()?n:t;return i?o(Se,{className:u("py-s px-lg font-light whitespace-nowrap",Lx["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Vx=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:l})=>{const s=P(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:p,...h}=t??{},g=r((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o($u,{className:"my-2xs",bgColor:e,logo:h,data:p,showTitle:!1})}):$x(g,l),jx({version:i,iconVersion:m,internetBankButton:a})]})})),$x=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(Y,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,jx=({version:e,iconVersion:t,internetBankButton:n})=>c("div",{className:"flex gap-lg items-center",children:[B.QUICK_ACTIONS?o(Bx,{version:e,iconVersion:t}):null,B.CHAT_BOT&&!B.QUICK_ACTIONS?o(Tx,{version:e,iconVersion:t,buttonSize:"medium"}):null,o(zx,{version:e,...n})]}),Wx={"bg-white":"primary",transparent:"transparent"},qx=Kt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Wx[e],portal:a,logo:i={},...r})=>{const{backwardButton:l,logo:s={}}=r.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...r,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Vx,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:l,...r})})})})),Ux=Kt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=P();return o(g,{className:u("relative flex flex-col",gx[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:_({...c,extraProps:{className:u("w-full",qp(l)),...hx(a)}})})}),{childrenTypes:[]}),Hx=Kt((e=>o(Ux,{...e})),{childrenTypes:[]}),Kx=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",$h[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),Yx=["байт","Кб","Мб","Гб","Тб","Пб"],Gx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ve(r),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",Jx(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Jx=(e,t)=>e||t?o("span",{children:", "}):"",Xx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Yx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?Zx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(Gx,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:Qx(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},Qx=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Zx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},ev=d((({href:e,__html:t,target:n,onClose:a})=>c(Wn,{maxWidth:"lg",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(gi,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(zn,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),tv=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=gn(ev),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Qx(i),o(ze,{font:"font-light",children:e})]}):null})),nv={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},av=Kt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=P();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",nv[l]),role:"list",children:i.map(iv(d,r))}):null]})})),iv=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?rv(t)(n,a):Xx(e,t)(n,a)},rv=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(tv,{...a,icon:e,href:lv(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},lv=e=>"href"in e,sv=Kt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:p="Мобильное приложение",version:h="primary",...f})=>{const y="secondary"===h?"p-m min-w-32":"min-w-24",b=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:h,...f,children:c(Pe,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:p,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Ke(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(ze,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),ov="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",cv=["workingSaturday","premiumService","privateBanking","remoteWorkplace","serviceDisabledPeople","transferringDataToBiometricSystem"],dv=["sellingCoins","buyingCoins","bullionOperations","preciousMetalsOperations"],mv=["barrierFree","equippedWithRamp","equippedWithLift","equippedWithElevator","equippedWithStairclimber","hasHelpMeButton"],uv=d((({filters:e=[],field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=e.map((e=>o(oi,{text:i[e],...t(e)},e))),[l,s,d]=pv({onlyOffice:a,filtersCheckbox:r}),[m,{toggle:u}]=an(!1);return o("div",{children:e?.length?o("div",{children:c(Vo,{children:[o("div",{children:o("div",{className:ov,children:l})}),c("div",{className:"flex space-x-lg pb-2xl",children:[a?o(zo,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(zn,{embedded:!0,onClick:n,children:[o(gs,{children:"Очистить фильтр"}),o(Y,{name:"CloseIcon",size:"small"})]})]}),o("div",{children:c($o,{isUnfolded:m,children:[fv("Драгоценные металлы",s),fv("Специальные возможности",d)]})})]})}):null})})),pv=({onlyOffice:e=!1,filtersCheckbox:t=[]})=>e?hv(t):gv(t),hv=e=>{const t=[],n=[],a=[];for(const i of e)cv.includes(i.key)&&t.push(i),dv.includes(i.key)&&n.push(i),mv.includes(i.key)&&a.push(i);return[t,n,a]},gv=e=>[e.slice(0,6),e.slice(6)],fv=(e,t=[])=>o("div",{children:t.length>0?c("div",{className:"space-y-s",children:[o(ze,{children:e}),o("div",{className:ov,children:t})]}):null}),yv=(e,t)=>e&&"underlined"!==t?"primary":"secondary",bv=(e,t,n)=>{const a=yv("all"===t),i=yv("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(zn,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(zn,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},xv=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(vv)}):null]}):null,vv=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),Nv=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,wv=()=>{},Cv=e=>"all"===e?"block":"hidden",kv=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=wv,renderRemoteWorkplaceCard:l=wv,getBalloon:s=wv,initFilterState:d=dc,getBalloonRemoteWorkplaces:m=wv,descriptionData:p,title:h})=>{const g=h?.includes("Офис"),[f,{field:y,reset:b}]=mn(d),{filteredItems:x,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=gc({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,k]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[Nv(h,w),p?xv(p):null,g&&bv(t,C,k),o("div",{className:u("pb-3xl",Cv(C)),children:o(uv,{filters:Sv([...t,...i]),field:{field:y,reset:b},onlyOffice:g,labels:mc})})]}),o("div",{className:"h-[600px]",children:o(yc,{children:o(Ec,{points:v,isLoad:n,className:"h-full"})})})]}),c(yc,{children:[x.map(r),N.map(l)]})]})})),Sv=e=>Object.keys(dc).filter((t=>e.filter((e=>uc[t](e))).length)),Iv=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Tv=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Iv(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(ze,{size:"text-h4",children:Iv(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Zo,{color:"green",children:Iv(s)})})]}),o(jo,{children:o(Fo,{className:"flex-wrap",children:m?.map(((e,t)=>o(Oo,{...e},String(t))))})})]},String(d))},Rv=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Iv(t)} №${n}`,body:e.toUpperCase()}),Ev=[];const Dv=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:Ev},_v={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Pv=d((({descriptionData:e,className:t})=>{const n=wb(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=Si(`${Va}/atms?regionCode=${e}`,Dv);return{data:t||Ev,isLoad:!t&&!n}}(a);return o(kv,{className:t,data:i,isLoad:r,initFilterState:_v,renderCard:Tv,getBalloon:Rv,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Ov=({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(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(jo,{children:Bv(t)})]},String(n)):null,Bv=e=>c("div",{children:[c(Fo,{className:"flex",children:[o(Oo,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Oo,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(Oo,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(Oo,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Oo,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),Mv=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Av={branches:[],remoteWorkplaces:[]};const Fv=async e=>await zt(e,{method:"GET"})||Av,Lv=d((({className:e})=>{const t=wb(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Si(`${Va}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Fv);return{data:t||Av,isLoad:!t&&!n}}(n);return o(kv,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:sc,renderRemoteWorkplaceCard:Ov,getBalloon:cc,getBalloonRemoteWorkplaces:Mv,title:`Офисы филиала ${t?.name}`})})),zv=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(Lv,{}):o(Pv,{descriptionData:e})})})),Vv=Kt((e=>{const{__html:t,dynamicQueryParamText:n={},dynamicTextSource:a,richVersion:i="",...r}=e,l=Jt(n,a?.list,t);return o(g,{defaultPadding:"p-0",...r,children:o(Fe,{__html:l,richVersion:i})})})),$v=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",jv=Kt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Ee(),[m,{toggle:p}]=an(t),h=o($o,{className:u("gap-lg",$v(d)),isUnfolded:m,children:_({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(zo,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:p});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:l,...s,children:c(Vo,{children:[n?y:h,n?h:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),Wv={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"},qv=(e,t,n)=>(a,i)=>{const{button:r}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Uv(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Hv(a),r?.text?o(Se,{className:"box-border py-s w-full mt-lg",version:t,...r,children:r?.text}):null]})]})},String(i))},Uv=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",r=Boolean(n?.icon?.src),l=Kv(e,r),s=r?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",l),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Yv({step:n,iconVersion:i,i:a,stepVersion:t})})})},Hv=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",Wv.description),children:e.description}):null,o(Fe,{__html:e.__html})]}),Kv=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Yv=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return He(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?Wv.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Gv=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:r="gray",version:l="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:l,...s,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(qv(d,l,r))}):null,Ke(i,{isVertical:!0})]})})),Jv=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(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Xv=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("absolute bg-white p-0 rounded-xl bottom-0 top-32 w-full",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Vn,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Qv(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Zv=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return Qv(he.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},eN=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const tN=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(ze,{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(nN,{...e},String(t))))})]}):null,nN=d((({icon:e,...t})=>{const n=be(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),aN=(e,t)=>n=>n.name?o(sf,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:xp(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,iN=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(da,"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"})]}))),rN=d((({defaultLocation:e})=>{const t=wb(e),n=be(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(sf,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),lN=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Cb(t?.default),[s,d]=a(""),m=Ll(),u=l((()=>cN(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),p=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,oN)),[u]),h=r((e=>{i.location=e,n?.()}),[i,n]);return c(Wn,{maxWidth:"none",head:sN(s,d,t),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&eN(e.toLowerCase())(s.toLowerCase())>=.8)).map(aN(t?.dataSelect,h))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(p.entries()).map((g=h,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(ze,{size:"text-h6",children:e})}),t.map(aN(f,g))]},e)))}),tN(e)]});var g,f})),sN=(e,t,n)=>c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(rN,{defaultLocation:n?.default}),o(iN,{onSearch:t,searchTerm:e})]}),oN=e=>e.name?.charAt(0)??"",cN=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),dN=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=gn(lN,n),{name:s}=wb(),c=e?.current?.getBoundingClientRect(),d=r((()=>{const e=globalThis?.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px";const n=Q(X.SITE_URL);e.postMessage({type:"currentTab",data:n?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:s},"*")}),[X.SITE_URL]);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:s},"*")}),[s]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Xv,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:d,src:t?.src,width:c?.width||0})})})})),mN="burgerMenuDialog",uN=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=Mn})=>{const{open:i}=gn(dN),[l]=Zv(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(mN,l),o=r((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:mN})),[e,n,t,a]);return[s,{toggle:s?a:o}]},pN=[],hN=Kt((({sticky:e,...t})=>{const{menuItems:n=pN}=e??{},i=n.find((e=>"Меню"===e.title)),l=n.filter((e=>"Меню"!==e.title)),d=Math.floor(l.length/2),m=l.slice(0,d),u=l.slice(d),[p,h]=a(-1),[f,y]=a(""),{closeAll:b}=ge(),x=r((()=>{h(-1),y(""),b()}),[b]),v=ca(x),N=s(null),[C,{toggle:k}]=uN({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:x}),S=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:l,close:s}=ge(),c=r((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return r(((r,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();l({id:"left"===d?n[r].title:a[r].title,dialog:o(Xv,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[r].description||m[r].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[r]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:x}),I=r((e=>{e.stopPropagation(),x(),k()}),[x,k]),T=r(((e,t)=>{y(t),h(e),b(),S(e,t)}),[b,S]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(gN(T,"left",{activeIndex:p,currentItemPosition:f})),o(Jv,{item:i,isActive:C,onClick:e=>I(e)}),u.map(gN(T,"right",{activeIndex:p,currentItemPosition:f}))]})})})),gN=(e,t,n)=>(a,i,r)=>o(Jv,{item:a,isActive:r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:l=>{r[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||l.stopPropagation(),e(i,t)}},a.title||String(i)),fN={primary:"bg-white/30",secondary:"bg-main-divider"},yN={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},bN=d((({count:e,version:t="secondary"})=>{const n=Ee(),a=n?"bg-main-divider":fN[t],i=yN[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),xN=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},vN={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},NN={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},wN={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},CN={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},kN=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:p,...h}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer","rounded-none",vN[a],n?CN[a]:wN[a]),"aria-label":"Список табов",onClick:i,...h,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?NN[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[xN({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(bN,{count:m,version:yv(n,a)})}):null]})})})),SN=d((e=>o(e?.item?.href?IN:TN,{...e}))),IN=d((e=>{const t=be(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(kN,{...e,tag:"a",item:i,onClick:a})})),TN=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(kN,{item:e,onClick:a,...n})})),RN="hidden sm:flex absolute z-40",EN={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},DN=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=ih({itemCount:t?.length||0});return i((()=>_N(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Jp,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:EN[r].item,gap:EN[r].gap,children:t.map((d=n,m=a,p=r,(e,t)=>o(SN,{isActive:e===d,onClick:m,type:p,item:e},String(t))))}),s.canScrollLeft?o(ch,{wcmsIgnore:!0,className:u("left-6",RN,EN[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(dh,{wcmsIgnore:!0,className:u("right-6",RN,EN[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,p})),_N=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},PN={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ON=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(PN[t].wrapper,e),children:o(DN,{className:PN[t].component,tabsType:t,...n})}):null,BN="sticky top-1 z-20",MN=Kt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=FN(n||{}),p=P(),h=$s(),f=t.every((e=>"link"===e?.type)),y=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),b=VN(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,v=x.findIndex((e=>Boolean(e?.selected))),N=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===b)),w=b?N:v,[C,k]=a(AN(w)),S=x[C],I=zN(x[C],C),T=r((e=>{const t=x.indexOf(e),n=x[t];k(t),"group"===n.type&&((e,t)=>{e.text?y.set(m,e?.tabName??String(t)):y.delete(m),p.replace(`${p.pathname}?${y}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[BN]:[s,f,!h].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[ON({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[BN]:[s,!f,!h].every(Boolean)}),items:LN(t,x),activeItem:S,tabsType:i,onChange:T}),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])=>D(t,{...d?.options,slotName:I,parent:n,extraProps:{className:e===I?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(zN)?.filter(Boolean)||[]}),AN=e=>e&&-1!==e?e:0,FN=({__id:e,anchor:t})=>t??e??"tabs",LN=(e,t)=>t?.length?t:e,zN=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",VN=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),$N=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),jN={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},WN=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:jN[t],children:e})}))),qN=d((({className:e="",isOpen:t,onClick:n})=>o(zo,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),UN=e=>e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,HN=e=>e?o("div",{className:"text-l font-light",children:o(ze,{color:"text-secondary-text",children:e})}):null,KN=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,YN=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(qN,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[UN(e),HN(t),KN({__html:n,isDotted:a}),Ke(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),GN=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),JN=(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(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,XN=d((({rows:e})=>{return o(Jp,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,r=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${GN(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(ze,{size:"text-xl",children:e.data}):null,e?.cols?JN(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),QN=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(ze,{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(XN,{rows:t.rowsData})})})]},a)}))}))),ZN=(e=!1)=>""+(e?"text-white":"text-secondary-text"),ew=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:ZN(t===n),children:e||t+1})},e)))}):null,t?o(Se,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),tw=Kt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(ew,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(QN,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(ze,{size:"text-h6",children:"Данных нет"})})})),nw=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(tw,{...t,onClick:n})}):null]}))),aw=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(nw,{tableInner:i,...n,children:[$N(e),t?.length?o(WN,{version:"tariff",children:t.map(((e,t)=>o(YN,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),iw=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),rw=Kt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(aw,{row:e,...l},String(t)))),[p,h]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=an(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(Vo,{children:[c(iw,{children:[p,o($o,{isUnfolded:f,isOverflowVisible:!0,children:h})]}),o(zo,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(iw,{children:m})})]})})),lw=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?sw():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ow(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),sw=()=>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"}),ow=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),cw={AdTile:Qt,ApplicationForm:Ts,BankAccountFiltration:Ph,BenefitsBlock:Fh,BonusBenefitsBlock:Vh,ButtonsBlock:jh,CalculatorBonus:Gh,CalculatorBusinessDeposit:rg,CalculatorCredit:qd,CalculatorDeposit:Rg,CalculatorRefinancing:Lg,CardTransfer:Kg,Carousel:tf,CarouselCatalogCard:rf,CarouselRecommendationCard:uf,CarouselTariffsCard:ff,DepositFiltration:fb,ErrorBlock:vb,ExchangeRateTile:Xb,Footer:px,GalleryLayout:bx,GrantSupport:Cx,Header:qx,Headline:S,HorizontalLayout:Hx,ImgBlock:Kx,LinkDocs:av,MobileAppTile:sv,OfficesAtmsMap:zv,ProductBlock:Xt,RichTextBlock:Vv,RollupItem:jv,StepsBlock:Gv,StickyBottomMenu:hN,TabsLayout:MN,TariffsTable:rw,TextBlock:lw,VerticalLayout:Ux,ApplicationLeadForm:Fp,CreditCardForm:wy,CreditForm:qy,DebitForm:mb,CashbackCalculator:Rf},dw=me((()=>{i((()=>{Gt()}),[]);const e=nn();oa(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");ni({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const mw="cookie",uw=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=an();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(mw)||n()}),[],3e3);const l=r((()=>{globalThis.localStorage?.setItem(mw,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Fe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Vn,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function pw(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);oa(globalThis.document,"keydown",t)}const hw=d((()=>{const[e,{close:t}]=Zv(),n=Boolean(e.length);return pw(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),gw=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Qv(he.observable,"popup",{open:t,close:n}),pw(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),fw="header",yw="footer",bw="sticky-footer",xw={},vw=d((({className:e,data:t=xw,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Ut(s,l),m=$s();dw(),Cb();const p={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[fw]?.length?o("div",{className:u({hidden:m},"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]"),children:D(i?.[fw],{...p,slotName:fw})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[_({block:t,options:p,extraProps:{className:"scroll-mt-12"}}),!m&&D(i?.[yw],{...p,slotName:yw})]})]}),i?.[bw]?.length?o("div",{className:u({hidden:m},"fixed w-full bottom-0 left-0 z-[100]"),children:D(i?.[bw],{...p,slotName:bw})}):null,o(hw,{}),o(gw,{}),m?null:o(uw,{__html:d?.cookieContent?.__html})]})}));Object.assign(vw,{childrenTypes:[],slots:()=>[fw,yw,bw]});e.Blocks=cw,e.ContentPage=vw,e.handlerDecorator=me,e.joinList=xh,e.locationNavigator=en,e.packageVersion="0.14.990",e.projectSettings=B,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=P,Object.defineProperty(e,"__esModule",{value:!0})}));
|