@redneckz/wildless-cms-uni-blocks 0.14.813 → 0.14.814

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 (291) hide show
  1. package/bundle/bundle.umd.js +172 -131
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  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 -2
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  9. package/bundle/retail/api/checkCode.d.ts +1 -0
  10. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  11. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  14. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  15. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  16. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  17. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  18. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  20. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  21. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  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 +8 -2
  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 +54 -19
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  30. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  33. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  35. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  36. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  37. package/dist/retail/api/checkCode.d.ts +1 -0
  38. package/dist/retail/api/checkCode.js +3 -2
  39. package/dist/retail/api/checkCode.js.map +1 -1
  40. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  41. package/dist/retail/api/esiaRequestProfile.js +10 -0
  42. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  43. package/dist/retail/api/updateUserTask.d.ts +1 -0
  44. package/dist/retail/api/updateUserTask.js.map +1 -1
  45. package/dist/retail/api/uploadFile.d.ts +1 -1
  46. package/dist/retail/api/uploadFile.js +2 -3
  47. package/dist/retail/api/uploadFile.js.map +1 -1
  48. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  49. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  50. package/dist/retail/content.js +10 -1
  51. package/dist/retail/content.js.map +1 -1
  52. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  53. package/dist/retail/utils/mainFormStateMap.js +1 -0
  54. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  55. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  56. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  57. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  58. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  59. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  60. package/lib/common.css +1 -1
  61. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  62. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  63. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  64. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  65. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  66. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  67. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  68. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  69. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  70. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  71. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  72. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  73. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  74. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  75. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  76. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  77. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  78. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  79. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  80. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  81. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  82. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  83. package/lib/retail/api/checkCode.d.ts +1 -0
  84. package/lib/retail/api/checkCode.js +1 -1
  85. package/lib/retail/api/checkCode.js.map +1 -1
  86. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  87. package/lib/retail/api/esiaRequestProfile.js +7 -0
  88. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  89. package/lib/retail/api/updateUserTask.d.ts +1 -0
  90. package/lib/retail/api/updateUserTask.js.map +1 -1
  91. package/lib/retail/api/uploadFile.d.ts +1 -1
  92. package/lib/retail/api/uploadFile.js +2 -3
  93. package/lib/retail/api/uploadFile.js.map +1 -1
  94. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  95. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  96. package/lib/retail/content.js +10 -1
  97. package/lib/retail/content.js.map +1 -1
  98. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  99. package/lib/retail/utils/mainFormStateMap.js +1 -0
  100. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  101. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  102. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  103. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  104. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  105. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  106. package/mobile/bundle/bundle.umd.js +172 -131
  107. package/mobile/bundle/bundle.umd.min.js +1 -1
  108. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  109. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  110. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  111. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  112. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  113. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  114. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  115. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  116. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  117. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  118. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  119. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  120. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  121. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  122. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  123. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  124. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  125. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  126. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  127. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  128. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  129. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  130. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  131. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  132. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  133. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  134. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  135. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  136. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  137. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  138. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  139. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  140. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  141. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  142. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  143. package/mobile/dist/retail/api/checkCode.js +3 -2
  144. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  145. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  146. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  147. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  148. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  149. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  150. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  151. package/mobile/dist/retail/api/uploadFile.js +2 -3
  152. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  153. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  154. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  155. package/mobile/dist/retail/content.js +10 -1
  156. package/mobile/dist/retail/content.js.map +1 -1
  157. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  158. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  159. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  160. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  161. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  162. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  163. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  164. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  165. package/mobile/lib/common.css +1 -1
  166. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  167. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  168. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  169. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  170. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  171. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  172. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  173. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  174. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  175. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  176. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  177. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  178. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  179. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  180. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  181. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  182. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  183. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  184. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  185. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  186. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  187. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  188. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  189. package/mobile/lib/retail/api/checkCode.js +1 -1
  190. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  191. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  192. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  193. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  194. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  195. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  196. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  197. package/mobile/lib/retail/api/uploadFile.js +2 -3
  198. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  199. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  200. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  201. package/mobile/lib/retail/content.js +10 -1
  202. package/mobile/lib/retail/content.js.map +1 -1
  203. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  204. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  205. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  206. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  207. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  208. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  209. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  210. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  211. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  212. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  213. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  214. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  215. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  216. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  217. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  218. package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  219. package/mobile/src/retail/api/checkCode.ts +1 -1
  220. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  221. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  222. package/mobile/src/retail/api/uploadFile.ts +2 -3
  223. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  224. package/mobile/src/retail/content.tsx +10 -1
  225. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  226. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  227. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  228. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  229. package/package.json +1 -1
  230. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  231. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  232. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  233. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  234. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  235. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  236. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  237. package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  238. package/src/retail/api/checkCode.ts +1 -1
  239. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  240. package/src/retail/api/updateUserTask.ts +1 -0
  241. package/src/retail/api/uploadFile.ts +2 -3
  242. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  243. package/src/retail/content.tsx +10 -1
  244. package/src/retail/model/NameFieldDef.ts +1 -0
  245. package/src/retail/utils/mainFormStateMap.ts +1 -0
  246. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  247. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  248. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  249. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  250. package/dist/retail/api/updateProfileEsia.js +0 -6
  251. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  252. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  253. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  254. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  255. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  256. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  257. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  258. package/lib/retail/api/updateProfileEsia.js +0 -3
  259. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  260. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  261. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
  262. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  263. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  264. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  265. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  266. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  267. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  268. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  269. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  270. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  271. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  272. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  273. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  274. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  275. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  276. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  277. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  278. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  279. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  280. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  281. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  282. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  283. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  284. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  285. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  286. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  287. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  288. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  289. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  290. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  291. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -2011,7 +2011,7 @@
2011
2011
 
2012
2012
  const PhoneField = JSX(({ field, input }) => {
2013
2013
  const fieldName = input?.name || 'phone';
2014
- return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2014
+ return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2015
2015
  });
2016
2016
 
2017
2017
  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);
@@ -2191,7 +2191,7 @@
2191
2191
  function shouldRenderField({ input, field, }) {
2192
2192
  const { condition } = input;
2193
2193
  const { value } = field(condition?.name || '');
2194
- return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2194
+ return !condition || condition?.values?.includes(value?.key ?? value);
2195
2195
  }
2196
2196
 
2197
2197
  const PRODUCT_REF = {
@@ -2626,11 +2626,11 @@
2626
2626
  {
2627
2627
  columns: 2,
2628
2628
  inputs: [
2629
- { name: 'surname', required: true, dadata: true },
2630
- { name: 'name', required: true, dadata: true },
2631
- { name: 'middleName', dadata: true },
2632
- { name: 'limitedBirthday', required: true },
2633
- { name: 'phone', required: true },
2629
+ { name: 'surname', required: true, dadata: true, filledByEsia: true },
2630
+ { name: 'name', required: true, dadata: true, filledByEsia: true },
2631
+ { name: 'middleName', dadata: true, filledByEsia: true },
2632
+ { name: 'limitedBirthday', required: true, filledByEsia: true },
2633
+ { name: 'phone', required: true, filledByEsia: true },
2634
2634
  { name: 'email', required: true, dadata: true },
2635
2635
  ],
2636
2636
  },
@@ -2640,6 +2640,58 @@
2640
2640
  ];
2641
2641
  };
2642
2642
 
2643
+ const getTraceId = () => {
2644
+ const result = new Uint8Array(8);
2645
+ globalThis.crypto.getRandomValues(result);
2646
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2647
+ };
2648
+
2649
+ const fetchRetailJSON = async (url, method, body) => {
2650
+ try {
2651
+ const response = await doRequest(url, method, body);
2652
+ return response.json();
2653
+ }
2654
+ catch (err) {
2655
+ console.error(err);
2656
+ return null;
2657
+ }
2658
+ };
2659
+ async function doRequest(url, method, body) {
2660
+ const traceId = getTraceId();
2661
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2662
+ method,
2663
+ headers: {
2664
+ 'Content-Type': 'application/json',
2665
+ 'X-B3-Sampled': '1',
2666
+ 'X-B3-Spanid': traceId,
2667
+ 'X-B3-Traceid': traceId,
2668
+ ...getAuthorizationHeaders(),
2669
+ },
2670
+ credentials: 'include',
2671
+ body: body ? JSON.stringify(body) : null,
2672
+ });
2673
+ }
2674
+ const getAuthorizationHeaders = () => {
2675
+ const token = sessionStorage.getItem('accessToken');
2676
+ return token ? { Authorization: `Bearer ${token}` } : null;
2677
+ };
2678
+
2679
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2680
+
2681
+ const EsiaLoginBanner = JSX(() => {
2682
+ const navigator = locationNavigator();
2683
+ const handleAuth = useCallback(async () => {
2684
+ const resp = await getLink({
2685
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
2686
+ });
2687
+ if (resp?.link) {
2688
+ navigator.assign(resp.link);
2689
+ globalThis.location.href = resp.link;
2690
+ }
2691
+ }, []);
2692
+ 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" })] }));
2693
+ });
2694
+
2643
2695
  const debounce = (fn, delay = 600) => {
2644
2696
  let timerId;
2645
2697
  const debouncedCallback = (...args) => {
@@ -3526,42 +3578,6 @@
3526
3578
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3527
3579
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3528
3580
 
3529
- const getTraceId = () => {
3530
- const result = new Uint8Array(8);
3531
- globalThis.crypto.getRandomValues(result);
3532
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3533
- };
3534
-
3535
- const fetchRetailJSON = async (url, method, body) => {
3536
- try {
3537
- const response = await doRequest(url, method, body);
3538
- return response.json();
3539
- }
3540
- catch (err) {
3541
- console.error(err);
3542
- return null;
3543
- }
3544
- };
3545
- async function doRequest(url, method, body) {
3546
- const traceId = getTraceId();
3547
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3548
- method,
3549
- headers: {
3550
- 'Content-Type': 'application/json',
3551
- 'X-B3-Sampled': '1',
3552
- 'X-B3-Spanid': traceId,
3553
- 'X-B3-Traceid': traceId,
3554
- ...getAuthorizationHeaders(),
3555
- },
3556
- credentials: 'include',
3557
- body: body ? JSON.stringify(body) : null,
3558
- });
3559
- }
3560
- const getAuthorizationHeaders = () => {
3561
- const token = sessionStorage.getItem('accessToken');
3562
- return token ? { Authorization: `Bearer ${token}` } : null;
3563
- };
3564
-
3565
3581
  const fetchRegionOffices = async (regionKey) => {
3566
3582
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3567
3583
  regionRfCd: {
@@ -5315,11 +5331,11 @@
5315
5331
  }, []);
5316
5332
 
5317
5333
  const getFamilyStatusAndIncomeData = (formData) => {
5318
- const { familyStatus, familyMembers, dependents, children, confirmationIncome, wages, mandatoryPayments, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, } = formData;
5334
+ const { familyStatus, familyMembers, dependents, children, confirmationIncome, wages, mandatoryPayments, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, esiaAccountTypeCd, } = formData;
5319
5335
  return {
5320
5336
  maritalStatusCd: familyStatus,
5321
5337
  totalDependents: familyMembers,
5322
- incomeCertificateCd: confirmationIncome,
5338
+ incomeCertificateCd: esiaAccountTypeCd?.key ? { key: 'SFR_CERTIFICATE' } : confirmationIncome,
5323
5339
  otherDependents: dependents,
5324
5340
  childrenDependents: children,
5325
5341
  militaryStatusCd: conscription,
@@ -5432,7 +5448,7 @@
5432
5448
  const participant = task.participants[0];
5433
5449
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5434
5450
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5435
- 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;
5451
+ 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;
5436
5452
  return {
5437
5453
  currency: currency?.key,
5438
5454
  paymentSystem: getSelectValue(paymentSystem),
@@ -5484,6 +5500,7 @@
5484
5500
  monthsValue,
5485
5501
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5486
5502
  },
5503
+ esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5487
5504
  ...getParticipantIncomes(participantIncomes),
5488
5505
  ...getParticipantAddresses(participantAddresses),
5489
5506
  ...getParticipantContacts(participantContacts),
@@ -5538,39 +5555,6 @@
5538
5555
  };
5539
5556
  };
5540
5557
 
5541
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5542
-
5543
- const EsiaLoginDialog = JSX(({ onClose }) => {
5544
- const navigator = locationNavigator();
5545
- const retailFormStore = useRetailFormStore();
5546
- const handleAuth = useCallback(async () => {
5547
- const resp = await getLink({
5548
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
5549
- });
5550
- if (resp?.link) {
5551
- navigator.assign(resp.link);
5552
- globalThis.location.href = resp.link;
5553
- }
5554
- }, []);
5555
- const handleClose = useCallback(() => {
5556
- if (retailFormStore.leadForm) {
5557
- const leadForm = { ...retailFormStore.leadForm };
5558
- delete leadForm.esiaAccountTypeCd;
5559
- retailFormStore.leadForm = leadForm;
5560
- }
5561
- onClose?.();
5562
- }, []);
5563
- 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" })] })] }) }));
5564
- });
5565
-
5566
- const useEsiaLoginDialog = (nextStepLink) => {
5567
- const { open } = useDialog(EsiaLoginDialog);
5568
- const navigator = locationNavigator();
5569
- return useCallback(() => {
5570
- open({ onClose: () => navigator.assign(nextStepLink) });
5571
- }, [open, nextStepLink]);
5572
- };
5573
-
5574
5558
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5575
5559
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5576
5560
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5692,21 +5676,19 @@
5692
5676
 
5693
5677
  /* eslint-disable max-lines */
5694
5678
  // eslint-disable-next-line max-lines-per-function
5695
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5679
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5696
5680
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5697
5681
  const [ok, setOK] = useState();
5698
5682
  const saveUserData = useSaveUserData();
5699
5683
  const sendAspects = useSendLeadFormAspects({ data });
5700
5684
  const navigator = locationNavigator();
5701
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5702
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5685
+ const goToNextStep = useCallback(() => {
5686
+ navigator.assign(nextStepLink);
5687
+ }, []);
5688
+ const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5703
5689
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5704
5690
  const draftDialog = useDraftDialog();
5705
5691
  const handleSubmit = useCallback(async (formData) => {
5706
- if (esiaError) {
5707
- navigator.assign(nextStepLink);
5708
- return;
5709
- }
5710
5692
  try {
5711
5693
  startSending();
5712
5694
  const profileId = await createUserProfile({
@@ -5724,7 +5706,7 @@
5724
5706
  });
5725
5707
  verifyPhoneDialog.close();
5726
5708
  if (productType === 'debitCard') {
5727
- openEsiaLoginDialog();
5709
+ goToNextStep();
5728
5710
  }
5729
5711
  else {
5730
5712
  consentBkiDialog.open(formData.phone, profileId);
@@ -5763,7 +5745,7 @@
5763
5745
  catch {
5764
5746
  setOK(false);
5765
5747
  }
5766
- }, [esiaError]);
5748
+ }, []);
5767
5749
  return { isSending, ok, handleSubmit };
5768
5750
  };
5769
5751
  const getAcceptedConsents = (formData, productType) => {
@@ -5846,7 +5828,10 @@
5846
5828
  }
5847
5829
  }, [target, key]);
5848
5830
 
5849
- const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5831
+ const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5832
+ saveToken(res);
5833
+ return res;
5834
+ });
5850
5835
 
5851
5836
  const initialFormState = {
5852
5837
  surname: '',
@@ -5864,19 +5849,24 @@
5864
5849
  consentPhotoFlg: false,
5865
5850
  consentFATCA: false,
5866
5851
  };
5867
- const getInitialFormState$1 = (inputs, savedForm) => {
5852
+ const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5868
5853
  if (savedForm) {
5869
- return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5854
+ return {
5855
+ ...savedForm,
5856
+ limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5857
+ ...(!esiaAuthSuccess && {
5858
+ esiaAccountTypeCd: { key: '' },
5859
+ }),
5860
+ };
5870
5861
  }
5871
5862
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5872
5863
  return { ...formState };
5873
5864
  };
5874
5865
 
5875
- const uploadFile = async (file, taskId, documentCategory) => {
5866
+ const uploadFile = async (file, documentCategory, isPDF = false) => {
5876
5867
  const fd = new FormData();
5877
- fd.append('taskId', taskId);
5878
5868
  fd.append('documentCategory', documentCategory);
5879
- fd.append('file', file, 'file.pdf');
5869
+ fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5880
5870
  const res = await globalThis
5881
5871
  ?.fetch?.(`/light-api-cash/v1/file`, {
5882
5872
  method: 'POST',
@@ -5890,23 +5880,46 @@
5890
5880
  return res;
5891
5881
  };
5892
5882
 
5893
- const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5883
+ const parseEsiaProfile = async (esiaProfile, isDebit) => {
5894
5884
  isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5895
5885
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5896
- const files = [];
5886
+ let files = [];
5897
5887
  if (!isDebit) {
5898
- await saveDocument({
5899
- document: esiaAdditionalDocument.pdfFileWorkbook,
5900
- taskId,
5901
- category: 'CONFIRMING_INCOME_DOC',
5902
- files,
5903
- });
5904
- await saveDocument({
5905
- document: esiaAdditionalDocument.pdfFilePayout,
5906
- taskId,
5907
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5908
- files,
5909
- });
5888
+ files = await saveDocuments([
5889
+ {
5890
+ file: esiaAdditionalDocument.pdfFileWorkbook,
5891
+ category: 'CONFIRMING_INCOME_DOC',
5892
+ isPDF: true,
5893
+ },
5894
+ {
5895
+ file: esiaAdditionalDocument.pdfFilePayout,
5896
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5897
+ isPDF: true,
5898
+ },
5899
+ {
5900
+ file: esiaAdditionalDocument.pdfFileSigPayout,
5901
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5902
+ isPDF: true,
5903
+ },
5904
+ {
5905
+ file: esiaAdditionalDocument.xmlFilePayout,
5906
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5907
+ isPDF: false,
5908
+ },
5909
+ {
5910
+ file: esiaAdditionalDocument.xmlFileSigPayout,
5911
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5912
+ isPDF: false,
5913
+ },
5914
+ {
5915
+ file: esiaAdditionalDocument.xmlFileWorkbook,
5916
+ category: 'CONFIRMING_INCOME_DOC',
5917
+ isPDF: false,
5918
+ },
5919
+ //TODO: После тестирования добавить документы снизу
5920
+ // {file: esiaAdditionalDocument.pdfFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: true},
5921
+ // {file: esiaAdditionalDocument.xmlFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: false},
5922
+ ]);
5910
5923
  }
5911
5924
  const mainData = {
5912
5925
  name: profile.name,
@@ -5968,11 +5981,16 @@
5968
5981
  };
5969
5982
  };
5970
5983
  const getYearFromMonth = (month) => Math.floor(month / 12);
5971
- const saveDocument = async ({ document, taskId, category, files, }) => {
5972
- await fetch(`data:application/pdf;base64,${document}`)
5973
- .then((res) => res.blob())
5974
- .then((value) => uploadFile(value, taskId, category))
5975
- .then((file) => files.push(file));
5984
+ const saveDocuments = async (documents) => {
5985
+ const files = [];
5986
+ for (const doc of documents) {
5987
+ const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
5988
+ await fetch(`${contentType},${doc.file}`)
5989
+ .then((res) => res.blob())
5990
+ .then((value) => uploadFile(value, doc.category, doc.isPDF))
5991
+ .then((file) => files.push(file));
5992
+ }
5993
+ return files;
5976
5994
  };
5977
5995
  const checkEsiaDataForCredit = (esiaProfile) => {
5978
5996
  const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
@@ -5999,6 +6017,13 @@
5999
6017
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6000
6018
  esiaAdditionalDocument.pdfFilePayout,
6001
6019
  esiaAdditionalDocument.pdfFileWorkbook,
6020
+ esiaAdditionalDocument.pdfFileSigPayout,
6021
+ esiaAdditionalDocument.xmlFilePayout,
6022
+ esiaAdditionalDocument.xmlFileSigPayout,
6023
+ esiaAdditionalDocument.xmlFileWorkbook,
6024
+ //TODO: После тестирования добавить документы снизу
6025
+ // esiaAdditionalDocument.pdfFileSigWorkbook,
6026
+ // esiaAdditionalDocument.xmlFileSigWorkbook
6002
6027
  ];
6003
6028
  if (!data.every((_) => Boolean(_))) {
6004
6029
  throw new Error();
@@ -6026,29 +6051,28 @@
6026
6051
  }
6027
6052
  };
6028
6053
 
6029
- const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6030
- const navigator = locationNavigator();
6054
+ const useInitApplicationLead = ({ inputs, productType, setEsiaError, setEsiaAuthSuccess, esiaAuthSuccess, }) => {
6031
6055
  const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6032
6056
  const leadFormStore = useLeadFormStore();
6033
6057
  const saveForm = useSetter(leadFormStore, 'leadForm');
6034
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6035
- const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6058
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6059
+ const requestEsiaProfile = useCallback(async (code, state) => {
6036
6060
  startLoading();
6037
6061
  try {
6038
- const data = await updateProfileEsia({
6039
- profileId,
6062
+ const data = await esiaRequestProfile({
6040
6063
  code,
6041
6064
  state,
6042
6065
  redirectUri: globalThis.location?.href,
6066
+ authorize: true,
6043
6067
  });
6044
- if (data && leadFormStore?.taskId) {
6045
- const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6068
+ if (data) {
6069
+ const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6046
6070
  saveForm((_) => ({
6047
6071
  ..._,
6048
6072
  ...parsedData,
6049
6073
  }));
6074
+ setEsiaAuthSuccess();
6050
6075
  }
6051
- navigator.assign(nextStepLink);
6052
6076
  }
6053
6077
  catch {
6054
6078
  setEsiaError();
@@ -6056,15 +6080,14 @@
6056
6080
  finally {
6057
6081
  endLoading();
6058
6082
  }
6059
- }, [nextStepLink]);
6083
+ }, []);
6060
6084
  useEffect(() => {
6061
6085
  leadFormStore.productType = productType;
6062
- const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6063
6086
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6064
6087
  const code = params.get('code');
6065
6088
  const state = params.get('state');
6066
- if (profileId && code && state) {
6067
- updateEsiaProfile(profileId, code, state);
6089
+ if (code && state) {
6090
+ requestEsiaProfile(code, state);
6068
6091
  }
6069
6092
  else {
6070
6093
  sessionStorage.removeItem('accessToken');
@@ -6076,6 +6099,7 @@
6076
6099
 
6077
6100
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6078
6101
  const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6102
+ const [esiaAuthSuccess, { setTrue: setEsiaAuthSuccess }] = useBool(false);
6079
6103
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6080
6104
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
6081
6105
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
@@ -6084,15 +6108,17 @@
6084
6108
  nextStepLink,
6085
6109
  productType,
6086
6110
  setEsiaError,
6111
+ setEsiaAuthSuccess,
6112
+ esiaAuthSuccess,
6087
6113
  });
6088
6114
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6089
6115
  programId,
6090
6116
  nextStepLink,
6091
6117
  productType,
6092
- esiaError,
6118
+ esiaAuthSuccess,
6093
6119
  data,
6094
6120
  });
6095
- const [, { field, onSubmit }] = useForm(initialFormState, {
6121
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6096
6122
  formValidator,
6097
6123
  onSubmit: handleSubmit,
6098
6124
  });
@@ -6102,7 +6128,12 @@
6102
6128
  responseTypeDialog.open({ ok });
6103
6129
  }
6104
6130
  }, [ok]);
6105
- 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] }) }));
6131
+ useEffect(() => {
6132
+ if (initialFormState?.esiaAccountTypeCd) {
6133
+ reset();
6134
+ }
6135
+ }, [initialFormState]);
6136
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaAuthSuccess && !esiaError ? jsx(EsiaLoginBanner, {}) : null, 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] })] }));
6106
6137
  });
6107
6138
 
6108
6139
  const NotFound = JSX(({ title, description }) => {
@@ -7811,6 +7842,7 @@
7811
7842
  mandatoryPayments: undefined,
7812
7843
  snils: '',
7813
7844
  armyIdFlg: false,
7845
+ esiaAccountTypeCd: { key: '', text: '' },
7814
7846
  },
7815
7847
  {
7816
7848
  bankruptcyFlg: false,
@@ -8252,7 +8284,16 @@
8252
8284
  },
8253
8285
  {
8254
8286
  columns: 1,
8255
- inputs: [{ name: 'confirmationIncome', required: true }],
8287
+ inputs: [
8288
+ {
8289
+ name: 'confirmationIncome',
8290
+ required: true,
8291
+ condition: {
8292
+ name: 'esiaAccountTypeCd',
8293
+ values: [''],
8294
+ },
8295
+ },
8296
+ ],
8256
8297
  },
8257
8298
  {
8258
8299
  columns: 1,
@@ -11473,7 +11514,7 @@
11473
11514
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11474
11515
  });
11475
11516
 
11476
- const packageVersion = "0.14.812";
11517
+ const packageVersion = "0.14.813";
11477
11518
 
11478
11519
  exports.Blocks = Blocks;
11479
11520
  exports.ContentPage = ContentPage;