@redneckz/wildless-cms-uni-blocks 0.14.820 → 0.14.821

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/bundle/bundle.umd.js +184 -222
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  6. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  7. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  9. package/bundle/retail/api/checkCode.d.ts +0 -1
  10. package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
  11. package/bundle/retail/api/updateUserTask.d.ts +0 -1
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  14. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  15. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  16. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  19. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  20. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  21. package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  22. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  23. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  24. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  26. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  27. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  30. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  33. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  35. package/dist/retail/api/checkCode.d.ts +0 -1
  36. package/dist/retail/api/checkCode.js +2 -3
  37. package/dist/retail/api/checkCode.js.map +1 -1
  38. package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
  39. package/dist/retail/api/updateProfileEsia.js +6 -0
  40. package/dist/retail/api/updateProfileEsia.js.map +1 -0
  41. package/dist/retail/api/updateUserTask.d.ts +0 -1
  42. package/dist/retail/api/updateUserTask.js.map +1 -1
  43. package/dist/retail/api/uploadFile.d.ts +1 -1
  44. package/dist/retail/api/uploadFile.js +3 -2
  45. package/dist/retail/api/uploadFile.js.map +1 -1
  46. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  47. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  48. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  49. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  50. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  51. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  52. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  53. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  54. package/dist/retail/components/Fields/BeginDateField.js +1 -2
  55. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  56. package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  57. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  58. package/dist/retail/components/Fields/DaDataInnField.js +1 -2
  59. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  60. package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  61. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  62. package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  63. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  64. package/dist/retail/components/Fields/JobsNumberField.js +1 -2
  65. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  66. package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  67. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  68. package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  69. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  70. package/dist/retail/components/Fields/WagesField.js +1 -2
  71. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  72. package/dist/retail/content.js +5 -11
  73. package/dist/retail/content.js.map +1 -1
  74. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  75. package/dist/retail/utils/mainFormStateMap.js +0 -1
  76. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  77. package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  78. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  79. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  80. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  81. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  82. package/lib/common.css +1 -1
  83. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  84. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  88. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  91. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  94. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  97. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  100. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  101. package/lib/retail/api/checkCode.d.ts +0 -1
  102. package/lib/retail/api/checkCode.js +1 -1
  103. package/lib/retail/api/checkCode.js.map +1 -1
  104. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  105. package/lib/retail/api/updateProfileEsia.js +3 -0
  106. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  107. package/lib/retail/api/updateUserTask.d.ts +0 -1
  108. package/lib/retail/api/updateUserTask.js.map +1 -1
  109. package/lib/retail/api/uploadFile.d.ts +1 -1
  110. package/lib/retail/api/uploadFile.js +3 -2
  111. package/lib/retail/api/uploadFile.js.map +1 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  113. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  114. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  115. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  118. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  119. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  121. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  122. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  123. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  124. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  125. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  126. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  127. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  128. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  129. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  130. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  131. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  132. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  133. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  134. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  135. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  136. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  137. package/lib/retail/components/Fields/WagesField.js +1 -2
  138. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  139. package/lib/retail/content.js +5 -11
  140. package/lib/retail/content.js.map +1 -1
  141. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  142. package/lib/retail/utils/mainFormStateMap.js +0 -1
  143. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  144. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  145. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  146. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  147. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  149. package/mobile/bundle/bundle.umd.js +184 -222
  150. package/mobile/bundle/bundle.umd.min.js +1 -1
  151. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  152. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  153. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  154. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  155. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  156. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  157. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  158. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  159. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  160. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  161. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  162. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  163. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  164. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  166. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  169. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  170. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  173. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  175. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  176. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  177. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  178. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  179. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  180. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  181. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  182. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  183. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  184. package/mobile/dist/retail/api/checkCode.js +2 -3
  185. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  186. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  187. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  188. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  189. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  190. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  191. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  192. package/mobile/dist/retail/api/uploadFile.js +3 -2
  193. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  194. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  195. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  196. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  197. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  198. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  199. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  200. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  202. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  203. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  205. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  207. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  208. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  209. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  210. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  211. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  212. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  213. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  214. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  215. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  216. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  217. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  218. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  219. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  220. package/mobile/dist/retail/content.js +5 -11
  221. package/mobile/dist/retail/content.js.map +1 -1
  222. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  223. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  224. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  225. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  227. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  230. package/mobile/lib/common.css +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  232. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  233. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  235. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  236. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  239. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  240. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  241. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  242. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  243. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  244. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  245. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  246. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  247. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  248. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  249. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  250. package/mobile/lib/retail/api/checkCode.js +1 -1
  251. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  252. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  253. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  254. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  255. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  256. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  257. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  258. package/mobile/lib/retail/api/uploadFile.js +3 -2
  259. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  260. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  261. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  262. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  263. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  264. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  265. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  266. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  267. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  268. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  269. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  270. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  271. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  272. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  273. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  274. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  275. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  276. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  277. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  278. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  279. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  280. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  281. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  282. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  283. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  284. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  285. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  286. package/mobile/lib/retail/content.js +5 -11
  287. package/mobile/lib/retail/content.js.map +1 -1
  288. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  289. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  290. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  291. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  292. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  293. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  295. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  296. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  297. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  298. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  299. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  300. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  301. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  302. package/mobile/src/retail/api/checkCode.ts +1 -1
  303. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  304. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  305. package/mobile/src/retail/api/uploadFile.ts +3 -2
  306. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  307. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  308. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  309. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  310. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  311. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  312. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  313. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  314. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  315. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  316. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  317. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  318. package/mobile/src/retail/content.tsx +5 -11
  319. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  320. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  321. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  322. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  323. package/package.json +1 -1
  324. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  325. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  326. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  327. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  328. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  329. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  330. package/src/retail/api/checkCode.ts +1 -1
  331. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  332. package/src/retail/api/updateUserTask.ts +0 -1
  333. package/src/retail/api/uploadFile.ts +3 -2
  334. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  335. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  336. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  337. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  338. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  339. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  340. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  341. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  342. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  343. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  344. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  345. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  346. package/src/retail/components/Fields/WagesField.tsx +0 -2
  347. package/src/retail/content.tsx +5 -11
  348. package/src/retail/model/NameFieldDef.ts +0 -1
  349. package/src/retail/utils/mainFormStateMap.ts +0 -1
  350. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  351. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  352. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  353. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  354. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  355. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  356. package/dist/retail/api/esiaRequestProfile.js +0 -10
  357. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  358. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  359. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  360. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  361. package/lib/retail/api/esiaRequestProfile.js +0 -7
  362. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  363. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  364. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  365. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  366. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  367. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  368. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  369. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  370. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  371. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  372. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  373. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  374. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  375. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  376. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  377. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -2022,7 +2022,7 @@
2022
2022
 
2023
2023
  const PhoneField = JSX(({ field, input }) => {
2024
2024
  const fieldName = input?.name || 'phone';
2025
- return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2025
+ return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2026
2026
  });
2027
2027
 
2028
2028
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
@@ -2202,7 +2202,7 @@
2202
2202
  function shouldRenderField({ input, field, }) {
2203
2203
  const { condition } = input;
2204
2204
  const { value } = field(condition?.name || '');
2205
- return !condition || condition?.values?.includes(value?.key ?? value);
2205
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2206
2206
  }
2207
2207
 
2208
2208
  const PRODUCT_REF = {
@@ -2637,11 +2637,11 @@
2637
2637
  {
2638
2638
  columns: 2,
2639
2639
  inputs: [
2640
- { name: 'surname', required: true, dadata: true, filledByEsia: true },
2641
- { name: 'name', required: true, dadata: true, filledByEsia: true },
2642
- { name: 'middleName', dadata: true, filledByEsia: true },
2643
- { name: 'limitedBirthday', required: true, filledByEsia: true },
2644
- { name: 'phone', required: true, filledByEsia: true },
2640
+ { name: 'surname', required: true, dadata: true },
2641
+ { name: 'name', required: true, dadata: true },
2642
+ { name: 'middleName', dadata: true },
2643
+ { name: 'limitedBirthday', required: true },
2644
+ { name: 'phone', required: true },
2645
2645
  { name: 'email', required: true, dadata: true },
2646
2646
  ],
2647
2647
  },
@@ -2651,57 +2651,6 @@
2651
2651
  ];
2652
2652
  };
2653
2653
 
2654
- const getTraceId = () => {
2655
- const result = new Uint8Array(8);
2656
- globalThis.crypto.getRandomValues(result);
2657
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2658
- };
2659
-
2660
- const fetchRetailJSON = async (url, method, body) => {
2661
- try {
2662
- const response = await doRequest(url, method, body);
2663
- return response.json();
2664
- }
2665
- catch (err) {
2666
- console.error(err);
2667
- return null;
2668
- }
2669
- };
2670
- async function doRequest(url, method, body) {
2671
- const traceId = getTraceId();
2672
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2673
- method,
2674
- headers: {
2675
- 'Content-Type': 'application/json',
2676
- 'X-B3-Sampled': '1',
2677
- 'X-B3-Spanid': traceId,
2678
- 'X-B3-Traceid': traceId,
2679
- ...getAuthorizationHeaders(),
2680
- },
2681
- credentials: 'include',
2682
- body: body ? JSON.stringify(body) : null,
2683
- });
2684
- }
2685
- const getAuthorizationHeaders = () => {
2686
- const token = sessionStorage.getItem('accessToken');
2687
- return token ? { Authorization: `Bearer ${token}` } : null;
2688
- };
2689
-
2690
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2691
-
2692
- const EsiaLoginBanner = JSX(() => {
2693
- const navigator = locationNavigator();
2694
- const handleAuth = useCallback(async () => {
2695
- const resp = await getLink({
2696
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
2697
- });
2698
- if (resp?.link) {
2699
- navigator.assign(resp.link);
2700
- }
2701
- }, []);
2702
- return (jsxs("div", { className: "flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9", children: [jsxs("div", { className: "flex flex-col justify-around w-full", children: [jsx("p", { className: "mb-4 text-xl @md:text-2xl @md:mb-6", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsxs("ul", { className: "list-disc list-inside mb-9", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { className: "block mb-6 self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
2703
- });
2704
-
2705
2654
  const debounce = (fn, delay = 600) => {
2706
2655
  let timerId;
2707
2656
  const debouncedCallback = (...args) => {
@@ -3588,6 +3537,42 @@
3588
3537
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3589
3538
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3590
3539
 
3540
+ const getTraceId = () => {
3541
+ const result = new Uint8Array(8);
3542
+ globalThis.crypto.getRandomValues(result);
3543
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3544
+ };
3545
+
3546
+ const fetchRetailJSON = async (url, method, body) => {
3547
+ try {
3548
+ const response = await doRequest(url, method, body);
3549
+ return response.json();
3550
+ }
3551
+ catch (err) {
3552
+ console.error(err);
3553
+ return null;
3554
+ }
3555
+ };
3556
+ async function doRequest(url, method, body) {
3557
+ const traceId = getTraceId();
3558
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3559
+ method,
3560
+ headers: {
3561
+ 'Content-Type': 'application/json',
3562
+ 'X-B3-Sampled': '1',
3563
+ 'X-B3-Spanid': traceId,
3564
+ 'X-B3-Traceid': traceId,
3565
+ ...getAuthorizationHeaders(),
3566
+ },
3567
+ credentials: 'include',
3568
+ body: body ? JSON.stringify(body) : null,
3569
+ });
3570
+ }
3571
+ const getAuthorizationHeaders = () => {
3572
+ const token = sessionStorage.getItem('accessToken');
3573
+ return token ? { Authorization: `Bearer ${token}` } : null;
3574
+ };
3575
+
3591
3576
  const fetchRegionOffices = async (regionKey) => {
3592
3577
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3593
3578
  regionRfCd: {
@@ -3817,7 +3802,7 @@
3817
3802
 
3818
3803
  const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
3819
3804
 
3820
- const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
3805
+ const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input })));
3821
3806
 
3822
3807
  const FIELD_NAME$2 = 'birthPlace';
3823
3808
  const BirthPlaceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$2) })));
@@ -3881,8 +3866,7 @@
3881
3866
 
3882
3867
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3883
3868
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3884
- const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
3885
- return (jsxs("div", { children: [filledByEsia ? (jsx("div", { className: "mb-6", children: jsx(InfoCard, { __html: "\u0414\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u043D\u043E\u0433\u043E \u0441\u043F\u043E\u0441\u043E\u0431\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430, \u043E\u0444\u043E\u0440\u043C\u0438\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442 \u0431\u0435\u0437 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043D\u0430 \u043F\u043E\u0440\u0442\u0430\u043B\u0435 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }) })) : null, jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input, disabled: filledByEsia })] }));
3869
+ return (jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input }));
3886
3870
  });
3887
3871
 
3888
3872
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4426,7 +4410,7 @@
4426
4410
  }
4427
4411
  })();
4428
4412
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4429
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4413
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4430
4414
  });
4431
4415
 
4432
4416
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? '') })));
@@ -4505,7 +4489,7 @@
4505
4489
  const MIN_YEARS = 0;
4506
4490
  const Experience5YearsField = JSX(({ field, input }) => {
4507
4491
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4508
- return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4492
+ return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange }));
4509
4493
  });
4510
4494
 
4511
4495
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4526,7 +4510,7 @@
4526
4510
  return (jsx(SelectField, { field: field, source: familyStatus, label: "\u0421\u0435\u043C\u0435\u0439\u043D\u043E\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", fieldName: "familyStatus", input: input }));
4527
4511
  });
4528
4512
 
4529
- const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4513
+ const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input })));
4530
4514
 
4531
4515
  const HousingField = JSX(({ field, input }) => {
4532
4516
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4535,9 +4519,9 @@
4535
4519
 
4536
4520
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4537
4521
 
4538
- const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4522
+ const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input })));
4539
4523
 
4540
- const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4524
+ const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input })));
4541
4525
 
4542
4526
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4543
4527
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4689,7 +4673,7 @@
4689
4673
  field?.('inn')?.onChange?.(item.data?.inn);
4690
4674
  updateOrganizationFields(store, field, item);
4691
4675
  }, []);
4692
- return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), onDaDataChange: onDaDataChange }));
4676
+ return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4693
4677
  });
4694
4678
 
4695
4679
  const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
@@ -4829,7 +4813,7 @@
4829
4813
 
4830
4814
  const TotalIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4831
4815
 
4832
- const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4816
+ const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4833
4817
 
4834
4818
  const DELIVERY_CITIES_REF = {
4835
4819
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -5459,7 +5443,7 @@
5459
5443
  const participant = task.participants[0];
5460
5444
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5461
5445
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5462
- const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, profile, } = participant;
5446
+ const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, } = participant;
5463
5447
  return {
5464
5448
  currency: currency?.key,
5465
5449
  paymentSystem: getSelectValue(paymentSystem),
@@ -5511,7 +5495,6 @@
5511
5495
  monthsValue,
5512
5496
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5513
5497
  },
5514
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5515
5498
  ...getParticipantIncomes(participantIncomes),
5516
5499
  ...getParticipantAddresses(participantAddresses),
5517
5500
  ...getParticipantContacts(participantContacts),
@@ -5566,6 +5549,39 @@
5566
5549
  };
5567
5550
  };
5568
5551
 
5552
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5553
+
5554
+ const EsiaLoginDialog = JSX(({ onClose }) => {
5555
+ const navigator = locationNavigator();
5556
+ const retailFormStore = useRetailFormStore();
5557
+ const handleAuth = useCallback(async () => {
5558
+ const resp = await getLink({
5559
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
5560
+ });
5561
+ if (resp?.link) {
5562
+ navigator.assign(resp.link);
5563
+ globalThis.location.href = resp.link;
5564
+ }
5565
+ }, []);
5566
+ const handleClose = useCallback(() => {
5567
+ if (retailFormStore.leadForm) {
5568
+ const leadForm = { ...retailFormStore.leadForm };
5569
+ delete leadForm.esiaAccountTypeCd;
5570
+ retailFormStore.leadForm = leadForm;
5571
+ }
5572
+ onClose?.();
5573
+ }, []);
5574
+ return (jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex items-center justify-around w-full px-m", children: [jsxs("ul", { className: "list-disc", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), jsxs("div", { className: "@container flex flex-wrap gap-lg w-full", children: [jsx(Button, { type: "button", onClick: handleAuth, className: "w-full md:w-auto", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsx(Button, { type: "button", version: "secondary", onClick: handleClose, className: "w-full md:w-auto", children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
5575
+ });
5576
+
5577
+ const useEsiaLoginDialog = (nextStepLink) => {
5578
+ const { open } = useDialog(EsiaLoginDialog);
5579
+ const navigator = locationNavigator();
5580
+ return useCallback(() => {
5581
+ open({ onClose: () => navigator.assign(nextStepLink) });
5582
+ }, [open, nextStepLink]);
5583
+ };
5584
+
5569
5585
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5570
5586
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5571
5587
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5687,19 +5703,21 @@
5687
5703
 
5688
5704
  /* eslint-disable max-lines */
5689
5705
  // eslint-disable-next-line max-lines-per-function
5690
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5706
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5691
5707
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5692
5708
  const [ok, setOK] = useState();
5693
5709
  const saveUserData = useSaveUserData();
5694
5710
  const sendAspects = useSendLeadFormAspects({ data });
5695
5711
  const navigator = locationNavigator();
5696
- const goToNextStep = useCallback(() => {
5697
- navigator.assign(nextStepLink);
5698
- }, []);
5699
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5712
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5713
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5700
5714
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5701
5715
  const draftDialog = useDraftDialog();
5702
5716
  const handleSubmit = useCallback(async (formData) => {
5717
+ if (esiaError) {
5718
+ navigator.assign(nextStepLink);
5719
+ return;
5720
+ }
5703
5721
  try {
5704
5722
  startSending();
5705
5723
  const profileId = await createUserProfile({
@@ -5717,7 +5735,7 @@
5717
5735
  });
5718
5736
  verifyPhoneDialog.close();
5719
5737
  if (productType === 'debitCard') {
5720
- goToNextStep();
5738
+ openEsiaLoginDialog();
5721
5739
  }
5722
5740
  else {
5723
5741
  consentBkiDialog.open(formData.phone, profileId);
@@ -5756,7 +5774,7 @@
5756
5774
  catch {
5757
5775
  setOK(false);
5758
5776
  }
5759
- }, []);
5777
+ }, [esiaError]);
5760
5778
  return { isSending, ok, handleSubmit };
5761
5779
  };
5762
5780
  const getAcceptedConsents = (formData, productType) => {
@@ -5839,10 +5857,7 @@
5839
5857
  }
5840
5858
  }, [target, key]);
5841
5859
 
5842
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5843
- saveToken(res);
5844
- return res;
5845
- });
5860
+ const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5846
5861
 
5847
5862
  const initialFormState = {
5848
5863
  surname: '',
@@ -5860,24 +5875,19 @@
5860
5875
  consentPhotoFlg: false,
5861
5876
  consentFATCA: false,
5862
5877
  };
5863
- const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5878
+ const getInitialFormState$1 = (inputs, savedForm) => {
5864
5879
  if (savedForm) {
5865
- return {
5866
- ...savedForm,
5867
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5868
- ...(!esiaAuthSuccess && {
5869
- esiaAccountTypeCd: { key: '' },
5870
- }),
5871
- };
5880
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5872
5881
  }
5873
5882
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5874
5883
  return { ...formState };
5875
5884
  };
5876
5885
 
5877
- const uploadFile = async (file, documentCategory, isPDF = false) => {
5886
+ const uploadFile = async (file, taskId, documentCategory) => {
5878
5887
  const fd = new FormData();
5888
+ fd.append('taskId', taskId);
5879
5889
  fd.append('documentCategory', documentCategory);
5880
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5890
+ fd.append('file', file, 'file.pdf');
5881
5891
  const res = await globalThis
5882
5892
  ?.fetch?.(`/light-api-cash/v1/file`, {
5883
5893
  method: 'POST',
@@ -5891,13 +5901,23 @@
5891
5901
  return res;
5892
5902
  };
5893
5903
 
5894
- const parseEsiaProfile = async (esiaProfile, isDebit) => {
5895
- checkEsiaData(esiaProfile);
5896
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5904
+ const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5905
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5897
5906
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5898
- let files = [];
5899
- if (isFullEsiaData) {
5900
- files = await saveDocuments(esiaAdditionalDocument);
5907
+ const files = [];
5908
+ if (!isDebit) {
5909
+ await saveDocument({
5910
+ document: esiaAdditionalDocument.pdfFileWorkbook,
5911
+ taskId,
5912
+ category: 'CONFIRMING_INCOME_DOC',
5913
+ files,
5914
+ });
5915
+ await saveDocument({
5916
+ document: esiaAdditionalDocument.pdfFilePayout,
5917
+ taskId,
5918
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5919
+ files,
5920
+ });
5901
5921
  }
5902
5922
  const mainData = {
5903
5923
  name: profile.name,
@@ -5914,11 +5934,11 @@
5914
5934
  birthPlace: addInfo.birthPlace,
5915
5935
  addressRegistration: buildAddress(addressRegistration),
5916
5936
  addressFact: buildAddress(addressFact),
5917
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
5937
+ esiaAccountTypeCd: profile.esiaAccountType,
5918
5938
  };
5919
5939
  return {
5920
5940
  ...mainData,
5921
- ...(isFullEsiaData && {
5941
+ ...(!isDebit && {
5922
5942
  snils: addInfo.snils,
5923
5943
  inn: esiaAdditionalDocument.inn,
5924
5944
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -5927,9 +5947,6 @@
5927
5947
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
5928
5948
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
5929
5949
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5930
- esiaAccountTypeCd: profile.esiaAccountType,
5931
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5932
- employment: { key: 'WORK', text: 'Работаю' },
5933
5950
  files,
5934
5951
  }),
5935
5952
  };
@@ -5962,67 +5979,21 @@
5962
5979
  };
5963
5980
  };
5964
5981
  const getYearFromMonth = (month) => Math.floor(month / 12);
5965
- const saveDocuments = async (esiaAdditionalDocument) => {
5966
- const files = [];
5967
- const documents = [
5968
- {
5969
- file: esiaAdditionalDocument.pdfFileWorkbook,
5970
- category: 'CONFIRMING_INCOME_DOC',
5971
- isPDF: true,
5972
- },
5973
- {
5974
- file: esiaAdditionalDocument.pdfFilePayout,
5975
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5976
- isPDF: true,
5977
- },
5978
- {
5979
- file: esiaAdditionalDocument.pdfFileSigPayout,
5980
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5981
- isPDF: true,
5982
- },
5983
- {
5984
- file: esiaAdditionalDocument.xmlFilePayout,
5985
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5986
- isPDF: false,
5987
- },
5988
- {
5989
- file: esiaAdditionalDocument.xmlFileSigPayout,
5990
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5991
- isPDF: false,
5992
- },
5993
- {
5994
- file: esiaAdditionalDocument.xmlFileWorkbook,
5995
- category: 'CONFIRMING_INCOME_DOC',
5996
- isPDF: false,
5997
- },
5998
- {
5999
- file: esiaAdditionalDocument.pdfFileSigWorkbook,
6000
- category: 'CONFIRMING_INCOME_DOC',
6001
- isPDF: true,
6002
- },
6003
- {
6004
- file: esiaAdditionalDocument.xmlFileSigWorkbook,
6005
- category: 'CONFIRMING_INCOME_DOC',
6006
- isPDF: false,
6007
- },
6008
- ];
6009
- for (const doc of documents) {
6010
- const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
6011
- await fetch(`${contentType},${doc.file}`)
6012
- .then((res) => res.blob())
6013
- .then((value) => uploadFile(value, doc.category, doc.isPDF))
6014
- .then((file) => files.push(file));
6015
- }
6016
- return files;
6017
- };
6018
- const checkEsiaData = (esiaProfile) => {
6019
- const { profile, document, addressRegistration } = esiaProfile;
5982
+ const saveDocument = async ({ document, taskId, category, files, }) => {
5983
+ await fetch(`data:application/pdf;base64,${document}`)
5984
+ .then((res) => res.blob())
5985
+ .then((value) => uploadFile(value, taskId, category))
5986
+ .then((file) => files.push(file));
5987
+ };
5988
+ const checkEsiaDataForCredit = (esiaProfile) => {
5989
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6020
5990
  const data = [
6021
5991
  profile.name,
6022
5992
  profile.surname,
6023
5993
  profile.midname,
6024
5994
  profile.birthDate,
6025
5995
  profile.phone,
5996
+ profile.email,
6026
5997
  document.dulIssueDate,
6027
5998
  document.dulIssuedBy,
6028
5999
  document.dulNumber,
@@ -6030,14 +6001,6 @@
6030
6001
  document.dulSubdivisionCode,
6031
6002
  addressRegistration,
6032
6003
  profile.esiaAccountType,
6033
- ];
6034
- if (!data.every((_) => Boolean(_))) {
6035
- throw new Error();
6036
- }
6037
- };
6038
- const checkEsiaAdditionalDocument = (esiaProfile) => {
6039
- const { esiaAdditionalDocument } = esiaProfile;
6040
- const data = [
6041
6004
  esiaAdditionalDocument.inn,
6042
6005
  esiaAdditionalDocument.averageMonthlyIncome.toString(),
6043
6006
  esiaAdditionalDocument.startWorkDate,
@@ -6047,84 +6010,100 @@
6047
6010
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6048
6011
  esiaAdditionalDocument.pdfFilePayout,
6049
6012
  esiaAdditionalDocument.pdfFileWorkbook,
6050
- esiaAdditionalDocument.pdfFileSigPayout,
6051
- esiaAdditionalDocument.xmlFilePayout,
6052
- esiaAdditionalDocument.xmlFileSigPayout,
6053
- esiaAdditionalDocument.xmlFileWorkbook,
6054
- esiaAdditionalDocument.pdfFileSigWorkbook,
6055
- esiaAdditionalDocument.xmlFileSigWorkbook,
6056
6013
  ];
6057
- return data.every((_) => Boolean(_));
6014
+ if (!data.every((_) => Boolean(_))) {
6015
+ throw new Error();
6016
+ }
6017
+ };
6018
+ const checkEsiaDataForDebit = (esiaProfile) => {
6019
+ const { profile, document, addressRegistration } = esiaProfile;
6020
+ const data = [
6021
+ profile.name,
6022
+ profile.surname,
6023
+ profile.midname,
6024
+ profile.birthDate,
6025
+ profile.phone,
6026
+ profile.email,
6027
+ document.dulIssueDate,
6028
+ document.dulIssuedBy,
6029
+ document.dulNumber,
6030
+ document.dulSerie,
6031
+ document.dulSubdivisionCode,
6032
+ addressRegistration,
6033
+ profile.esiaAccountType,
6034
+ ];
6035
+ if (!data.every((_) => Boolean(_))) {
6036
+ throw new Error();
6037
+ }
6058
6038
  };
6059
6039
 
6060
- const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6040
+ const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6041
+ const navigator = locationNavigator();
6042
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6061
6043
  const leadFormStore = useLeadFormStore();
6062
6044
  const saveForm = useSetter(leadFormStore, 'leadForm');
6063
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6064
- const requestEsiaProfile = useCallback(async (code, state) => {
6065
- setEsiaStatus(EsiaStatuses.Pending);
6045
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6046
+ const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6047
+ startLoading();
6066
6048
  try {
6067
- const data = await esiaRequestProfile({
6049
+ const data = await updateProfileEsia({
6050
+ profileId,
6068
6051
  code,
6069
6052
  state,
6070
6053
  redirectUri: globalThis.location?.href,
6071
- authorize: true,
6072
6054
  });
6073
- if (data) {
6074
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6055
+ if (data && leadFormStore?.taskId) {
6056
+ const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6075
6057
  saveForm((_) => ({
6076
6058
  ..._,
6077
6059
  ...parsedData,
6078
6060
  }));
6079
- setEsiaStatus(EsiaStatuses.Success);
6080
6061
  }
6062
+ navigator.assign(nextStepLink);
6081
6063
  }
6082
6064
  catch {
6083
- setEsiaStatus(EsiaStatuses.Error);
6065
+ setEsiaError();
6084
6066
  }
6085
- }, []);
6067
+ finally {
6068
+ endLoading();
6069
+ }
6070
+ }, [nextStepLink]);
6086
6071
  useEffect(() => {
6087
6072
  leadFormStore.productType = productType;
6073
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6088
6074
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6089
6075
  const code = params.get('code');
6090
6076
  const state = params.get('state');
6091
- if (code && state) {
6092
- requestEsiaProfile(code, state);
6077
+ if (profileId && code && state) {
6078
+ updateEsiaProfile(profileId, code, state);
6093
6079
  }
6094
6080
  else {
6095
6081
  sessionStorage.removeItem('accessToken');
6096
6082
  sessionStorage.removeItem('refreshToken');
6097
6083
  }
6098
6084
  }, []);
6099
- return initialFormState;
6085
+ return [initialFormState, { isLoading }];
6100
6086
  };
6101
6087
 
6102
- var EsiaStatuses;
6103
- (function (EsiaStatuses) {
6104
- EsiaStatuses["Success"] = "SUCCESS";
6105
- EsiaStatuses["Error"] = "ERROR";
6106
- EsiaStatuses["Pending"] = "PENDING";
6107
- })(EsiaStatuses || (EsiaStatuses = {}));
6108
6088
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6109
- const [esiaStatus, setEsiaStatus] = useState();
6110
- const leadForm = useRef(null);
6089
+ const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6111
6090
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6112
6091
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
6113
6092
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
6114
- const initialFormState = useInitApplicationLead({
6093
+ const [initialFormState, { isLoading }] = useInitApplicationLead({
6115
6094
  inputs,
6116
6095
  nextStepLink,
6117
6096
  productType,
6118
- setEsiaStatus,
6119
- esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6097
+ setEsiaError,
6120
6098
  });
6121
6099
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6122
6100
  programId,
6123
6101
  nextStepLink,
6124
6102
  productType,
6103
+ esiaError,
6125
6104
  data,
6126
6105
  });
6127
- const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6106
+ const [, { field, onSubmit }] = useForm(initialFormState, {
6128
6107
  formValidator,
6129
6108
  onSubmit: handleSubmit,
6130
6109
  });
@@ -6134,17 +6113,7 @@
6134
6113
  responseTypeDialog.open({ ok });
6135
6114
  }
6136
6115
  }, [ok]);
6137
- useEffect(() => {
6138
- if (esiaStatus && leadForm?.current) {
6139
- leadForm.current.scrollIntoView({
6140
- block: 'start',
6141
- });
6142
- }
6143
- if (esiaStatus === EsiaStatuses.Success) {
6144
- reset();
6145
- }
6146
- }, [leadForm?.current, esiaStatus]);
6147
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, {}) : null, jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
6116
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaError ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] }) }));
6148
6117
  });
6149
6118
 
6150
6119
  const NotFound = JSX(({ title, description }) => {
@@ -7853,7 +7822,6 @@
7853
7822
  mandatoryPayments: undefined,
7854
7823
  snils: '',
7855
7824
  armyIdFlg: false,
7856
- esiaAccountTypeCd: { key: '', text: '' },
7857
7825
  },
7858
7826
  {
7859
7827
  bankruptcyFlg: false,
@@ -8244,7 +8212,7 @@
8244
8212
  label: 'Телефон работодателя',
8245
8213
  required: true,
8246
8214
  },
8247
- { name: 'beginDate', required: true, filledByEsia: true },
8215
+ { name: 'beginDate', required: true },
8248
8216
  ],
8249
8217
  },
8250
8218
  {
@@ -8285,16 +8253,6 @@
8285
8253
  {
8286
8254
  title: 'Совокупный доход',
8287
8255
  },
8288
- {
8289
- columns: 1,
8290
- inputs: [
8291
- {
8292
- name: 'confirmationIncome',
8293
- required: true,
8294
- filledByEsia: true,
8295
- },
8296
- ],
8297
- },
8298
8256
  {
8299
8257
  inputs: [
8300
8258
  {
@@ -8303,6 +8261,10 @@
8303
8261
  },
8304
8262
  ],
8305
8263
  },
8264
+ {
8265
+ columns: 1,
8266
+ inputs: [{ name: 'confirmationIncome', required: true }],
8267
+ },
8306
8268
  {
8307
8269
  columns: 1,
8308
8270
  inputs: [{ name: 'wages', required: true, filledByEsia: true }],
@@ -11592,7 +11554,7 @@
11592
11554
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11593
11555
  });
11594
11556
 
11595
- const packageVersion = "0.14.819";
11557
+ const packageVersion = "0.14.820";
11596
11558
 
11597
11559
  exports.Blocks = Blocks;
11598
11560
  exports.ContentPage = ContentPage;