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

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 (396) hide show
  1. package/bundle/UniBlock/UniBlock.d.ts +3 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +257 -149
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  6. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  7. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  8. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  9. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  10. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  11. package/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  12. package/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  13. package/bundle/retail/api/checkCode.d.ts +1 -0
  14. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  15. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  16. package/bundle/retail/api/uploadFile.d.ts +1 -1
  17. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  18. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  19. package/dist/BlockRenderer/renderBlock.js +1 -1
  20. package/dist/BlockRenderer/renderBlock.js.map +1 -1
  21. package/dist/UniBlock/UniBlock.d.ts +3 -1
  22. package/dist/UniBlock/UniBlock.js.map +1 -1
  23. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  24. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  25. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  26. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  27. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  28. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  29. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  30. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  31. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  32. package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  33. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  34. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  35. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  36. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  37. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  38. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  39. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  40. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  41. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  42. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  43. package/dist/components/Blocks.js +2 -0
  44. package/dist/components/Blocks.js.map +1 -1
  45. package/dist/components/Blocks.mobile.js +2 -0
  46. package/dist/components/Blocks.mobile.js.map +1 -1
  47. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  48. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  49. package/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  50. package/dist/components/GalleryLayout/GalleryLayout.js +71 -0
  51. package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
  52. package/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  53. package/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
  54. package/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
  55. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  56. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  57. package/dist/retail/api/checkCode.d.ts +1 -0
  58. package/dist/retail/api/checkCode.js +3 -2
  59. package/dist/retail/api/checkCode.js.map +1 -1
  60. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  61. package/dist/retail/api/esiaRequestProfile.js +10 -0
  62. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  63. package/dist/retail/api/updateUserTask.d.ts +1 -0
  64. package/dist/retail/api/updateUserTask.js.map +1 -1
  65. package/dist/retail/api/uploadFile.d.ts +1 -1
  66. package/dist/retail/api/uploadFile.js +2 -3
  67. package/dist/retail/api/uploadFile.js.map +1 -1
  68. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  69. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  70. package/dist/retail/content.js +10 -1
  71. package/dist/retail/content.js.map +1 -1
  72. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  73. package/dist/retail/utils/mainFormStateMap.js +1 -0
  74. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  75. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
  76. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  77. package/dist/ui-kit/BaseTile/BaseTile.js +3 -3
  78. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  79. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  80. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  81. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  82. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  83. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  84. package/lib/BlockRenderer/renderBlock.js +1 -1
  85. package/lib/BlockRenderer/renderBlock.js.map +1 -1
  86. package/lib/UniBlock/UniBlock.d.ts +3 -1
  87. package/lib/UniBlock/UniBlock.js.map +1 -1
  88. package/lib/common.css +1 -1
  89. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  90. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  91. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  92. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  93. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  94. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  95. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  96. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  97. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  98. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  99. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  100. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  101. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  102. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  103. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  104. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  105. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  106. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  107. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  108. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  109. package/lib/components/Blocks.js +2 -0
  110. package/lib/components/Blocks.js.map +1 -1
  111. package/lib/components/Blocks.mobile.js +2 -0
  112. package/lib/components/Blocks.mobile.js.map +1 -1
  113. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  114. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  115. package/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  116. package/lib/{retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts → components/GalleryLayout/GalleryLayout.fixture.d.ts} +1 -1
  117. package/lib/components/GalleryLayout/GalleryLayout.js +69 -0
  118. package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
  119. package/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  120. package/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
  121. package/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
  122. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  123. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  124. package/lib/retail/api/checkCode.d.ts +1 -0
  125. package/lib/retail/api/checkCode.js +1 -1
  126. package/lib/retail/api/checkCode.js.map +1 -1
  127. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  128. package/lib/retail/api/esiaRequestProfile.js +7 -0
  129. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  130. package/lib/retail/api/updateUserTask.d.ts +1 -0
  131. package/lib/retail/api/updateUserTask.js.map +1 -1
  132. package/lib/retail/api/uploadFile.d.ts +1 -1
  133. package/lib/retail/api/uploadFile.js +2 -3
  134. package/lib/retail/api/uploadFile.js.map +1 -1
  135. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  136. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  137. package/lib/retail/content.js +10 -1
  138. package/lib/retail/content.js.map +1 -1
  139. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  140. package/lib/retail/utils/mainFormStateMap.js +1 -0
  141. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  142. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
  143. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  144. package/lib/ui-kit/BaseTile/BaseTile.js +3 -3
  145. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  146. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  147. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  149. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  150. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  151. package/mobile/bundle/UniBlock/UniBlock.d.ts +3 -1
  152. package/mobile/bundle/bundle.umd.js +257 -149
  153. package/mobile/bundle/bundle.umd.min.js +1 -1
  154. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  155. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  156. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  157. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  158. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  159. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  160. package/mobile/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  161. package/mobile/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  162. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  163. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  164. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  165. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  166. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  167. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  168. package/mobile/dist/BlockRenderer/renderBlock.js +1 -1
  169. package/mobile/dist/BlockRenderer/renderBlock.js.map +1 -1
  170. package/mobile/dist/UniBlock/UniBlock.d.ts +3 -1
  171. package/mobile/dist/UniBlock/UniBlock.js.map +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  173. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  175. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  176. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  177. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  178. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  179. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  180. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  181. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  182. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  183. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  184. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  185. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  186. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  187. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  188. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  189. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  190. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  191. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  192. package/mobile/dist/components/Blocks.js +2 -0
  193. package/mobile/dist/components/Blocks.js.map +1 -1
  194. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  195. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  196. package/mobile/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  197. package/mobile/dist/components/GalleryLayout/GalleryLayout.js +71 -0
  198. package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
  199. package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  200. package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
  201. package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
  202. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  203. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  204. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  205. package/mobile/dist/retail/api/checkCode.js +3 -2
  206. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  207. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  208. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  209. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  210. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  211. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  212. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  213. package/mobile/dist/retail/api/uploadFile.js +2 -3
  214. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  215. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  216. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  217. package/mobile/dist/retail/content.js +10 -1
  218. package/mobile/dist/retail/content.js.map +1 -1
  219. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  220. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  221. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  222. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
  223. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  224. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +3 -3
  225. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  227. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  230. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  231. package/mobile/lib/BlockRenderer/renderBlock.js +1 -1
  232. package/mobile/lib/BlockRenderer/renderBlock.js.map +1 -1
  233. package/mobile/lib/UniBlock/UniBlock.d.ts +3 -1
  234. package/mobile/lib/UniBlock/UniBlock.js.map +1 -1
  235. package/mobile/lib/common.css +1 -1
  236. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  237. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  239. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  240. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  241. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  242. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  243. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  244. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  245. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  246. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  247. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  248. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  249. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  250. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  251. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  252. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  253. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  254. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  255. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  256. package/mobile/lib/components/Blocks.js +2 -0
  257. package/mobile/lib/components/Blocks.js.map +1 -1
  258. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  259. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  260. package/mobile/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
  261. package/mobile/lib/components/GalleryLayout/GalleryLayout.js +69 -0
  262. package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
  263. package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
  264. package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
  265. package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
  266. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  267. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  268. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  269. package/mobile/lib/retail/api/checkCode.js +1 -1
  270. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  271. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  272. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  273. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  274. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  275. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  276. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  277. package/mobile/lib/retail/api/uploadFile.js +2 -3
  278. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  279. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  280. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  281. package/mobile/lib/retail/content.js +10 -1
  282. package/mobile/lib/retail/content.js.map +1 -1
  283. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  284. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  285. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  286. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
  287. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  288. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +3 -3
  289. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  290. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  291. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  292. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  293. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  295. package/mobile/src/BlockRenderer/renderBlock.tsx +3 -3
  296. package/mobile/src/UniBlock/UniBlock.tsx +3 -1
  297. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  298. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  299. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  300. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  301. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  302. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  303. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  304. package/mobile/src/components/Blocks.ts +2 -0
  305. package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
  306. package/mobile/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
  307. package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
  308. package/mobile/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
  309. package/mobile/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
  310. package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  311. package/mobile/src/retail/api/checkCode.ts +1 -1
  312. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  313. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  314. package/mobile/src/retail/api/uploadFile.ts +2 -3
  315. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  316. package/mobile/src/retail/content.tsx +10 -1
  317. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  318. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  319. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
  320. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
  321. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  322. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  323. package/package.json +2 -2
  324. package/src/BlockRenderer/renderBlock.tsx +3 -3
  325. package/src/UniBlock/UniBlock.tsx +3 -1
  326. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  327. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  328. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  329. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  330. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  331. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  332. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  333. package/src/components/Blocks.mobile.ts +2 -0
  334. package/src/components/Blocks.ts +2 -0
  335. package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
  336. package/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
  337. package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +61 -0
  338. package/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
  339. package/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
  340. package/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
  341. package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  342. package/src/retail/api/checkCode.ts +1 -1
  343. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  344. package/src/retail/api/updateUserTask.ts +1 -0
  345. package/src/retail/api/uploadFile.ts +2 -3
  346. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  347. package/src/retail/content.tsx +10 -1
  348. package/src/retail/model/NameFieldDef.ts +1 -0
  349. package/src/retail/utils/mainFormStateMap.ts +1 -0
  350. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
  351. package/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
  352. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  353. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  354. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  355. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  356. package/dist/retail/api/updateProfileEsia.js +0 -6
  357. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  358. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  359. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  360. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  361. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  362. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  363. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  364. package/lib/retail/api/updateProfileEsia.js +0 -3
  365. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  366. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  367. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  368. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  369. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  370. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  371. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  372. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  373. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  374. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  375. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  376. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  377. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  378. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  379. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  380. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  381. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  382. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  383. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  384. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  385. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  386. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  387. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  388. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  389. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  390. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  391. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  392. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  393. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  394. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  395. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  396. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -160,7 +160,7 @@
160
160
  // Adjusted by decorator block and blockClassName
161
161
  render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
162
162
  const { content } = adjustedBlock;
163
- return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
163
+ return BlockComponent ? (jsx(BlockComponent, { ...content, ...extraProps, className: style(adjustedBlockClassName, content?.className), block: block, options: options }, key)) : null;
164
164
  },
165
165
  }, key);
166
166
  }
@@ -621,13 +621,12 @@
621
621
  const handleClick = useCallback(() => router.back(), []);
622
622
  const backwardButtonText = rest.options?.page?.common?.backwardButton;
623
623
  const isBackBtn = backwardButton && !isMobile;
624
- return (jsxs("div", { className: style('relative flex flex-col gap-3xl overflow-hidden', padding || defaultPadding, className), children: [isBackBtn && renderBackwardButton({ version, handleClick, text: backwardButtonText }), title ? jsx("div", { className: "relative h-full", children: title }) : null, jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', {
624
+ return (jsxs("div", { className: style('relative flex flex-col gap-3xl overflow-hidden', padding || defaultPadding, className), children: [isBackBtn && renderBackwardButton({ version, handleClick, text: backwardButtonText }), title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', {
625
625
  'self-start @xl:w-auto': leftImage,
626
626
  }), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), jsxs("div", { className: style('grid gap-3xl items-center md:items-stretch', {
627
627
  '@xl:grid-cols-2 auto-cols-fr': rightImage,
628
628
  grow: !leftImage,
629
- }, 'h-full', //? fix issue https://github.com/redneckz/temp_wcms/issues/1254
630
- 'auto-rows-[max-content_1fr]'), children: [jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderUnitContainer(renderChildren({ ...rest, extraProps: { className: '@container-normal' } })), renderImageContainer(rightImage, {
629
+ }, 'h-auto'), children: [renderMiddleContent(insetTitle, children), renderUnitContainer(renderChildren({ ...rest, extraProps: { className: '@container-normal' } })), renderImageContainer(rightImage, {
631
630
  className: style('@xl:justify-self-end @xl:col-start-2', {
632
631
  [imageAlwaysOnRightContainerStyle(isImageAlwaysOnRight)]: buttons,
633
632
  'col-start-2 self-center': isImageAlwaysOnRight,
@@ -636,6 +635,7 @@
636
635
  imageAlign,
637
636
  }), buttons ? jsx("div", { className: "self-end", children: buttons }) : null] })] })] }));
638
637
  });
638
+ const renderMiddleContent = (insetTitle, children) => insetTitle || children ? (jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] })) : null;
639
639
  const imageAlwaysOnRightContainerStyle = (isImage) => style(isImage ? 'row-span-2' : '@xl:row-span-2');
640
640
  const renderUnitContainer = (childrenBlocks) => childrenBlocks?.length ? (jsx("div", { className: "flex items-start justify-end", children: childrenBlocks })) : null;
641
641
 
@@ -716,8 +716,15 @@
716
716
  const img = image?.src ? jsx(Img, { image: image }) : null;
717
717
  const headline = (jsx(Headline, { title: title, description: description, headlineVersion: headlineVersion, align: align, isEmbedded: true }));
718
718
  const filteredBenefits = benefits?.filter((_) => '__html' in _ || 'label' in _ || 'description' in _);
719
- return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isFullWidthTitle ? { title: headline } : { insetTitle: headline }), ...leftOrRightImage(img, directionRight), isImageSecondary: isImageSecondary, imageAlign: imageAlign, isImageAlwaysOnRight: isImageAlwaysOnRight, buttons: renderButtonsSection(buttons), backwardButton: backwardButton, ...rest, children: jsxs("div", { className: "flex flex-col sm:gap-xl gap-4xl", children: [filteredBenefits?.length ? (jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: filteredBenefits })) : null, __html ? (jsx(RichText, { richVersion: richVersion, __html: __html, isDotted: isDotted, itemSize: RICHTEXT_SIZE[headlineVersion] })) : null, children, priceList?.length ? jsx(PriceList, { priceList: priceList }) : null, renderTags(tags)] }) }));
719
+ return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isFullWidthTitle ? { title: headline } : { insetTitle: headline }), ...leftOrRightImage(img, directionRight), isImageSecondary: isImageSecondary, imageAlign: imageAlign, isImageAlwaysOnRight: isImageAlwaysOnRight, buttons: renderButtonsSection(buttons), backwardButton: backwardButton, ...rest, children: renderChildList(renderBenefits(filteredBenefits, { benefitsVersion, isTabularBenefits }), renderRichText(__html, { richVersion, isDotted, headlineVersion }), children, renderPriceList(priceList), renderTags(tags)) }));
720
720
  });
721
+ const renderBenefits = (benefits, { benefitsVersion, isTabularBenefits, } = {}) => benefits?.length ? (jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: benefits })) : null;
722
+ const renderRichText = (__html, { richVersion, isDotted, headlineVersion, } = {}) => __html ? (jsx(RichText, { __html: __html, richVersion: richVersion, isDotted: isDotted, itemSize: RICHTEXT_SIZE[headlineVersion ?? 'L'] })) : null;
723
+ const renderPriceList = (priceList) => priceList?.length ? jsx(PriceList, { priceList: priceList }) : null;
724
+ const renderChildList = (...elements) => {
725
+ const cleanElements = elements.filter(Boolean);
726
+ return cleanElements.length ? (jsx("div", { className: "flex flex-col sm:gap-xl gap-4xl", children: cleanElements.map((_, i) => (jsx("div", { children: _ }, String(i)))) })) : null;
727
+ };
721
728
  const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
722
729
  const renderTags = (tags) => (tags?.length ? jsx(Tags, { tags: tags }) : null);
723
730
 
@@ -2011,7 +2018,7 @@
2011
2018
 
2012
2019
  const PhoneField = JSX(({ field, input }) => {
2013
2020
  const fieldName = input?.name || 'phone';
2014
- return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2021
+ return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2015
2022
  });
2016
2023
 
2017
2024
  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 +2198,7 @@
2191
2198
  function shouldRenderField({ input, field, }) {
2192
2199
  const { condition } = input;
2193
2200
  const { value } = field(condition?.name || '');
2194
- return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2201
+ return !condition || condition?.values?.includes(value?.key ?? value);
2195
2202
  }
2196
2203
 
2197
2204
  const PRODUCT_REF = {
@@ -2626,11 +2633,11 @@
2626
2633
  {
2627
2634
  columns: 2,
2628
2635
  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 },
2636
+ { name: 'surname', required: true, dadata: true, filledByEsia: true },
2637
+ { name: 'name', required: true, dadata: true, filledByEsia: true },
2638
+ { name: 'middleName', dadata: true, filledByEsia: true },
2639
+ { name: 'limitedBirthday', required: true, filledByEsia: true },
2640
+ { name: 'phone', required: true, filledByEsia: true },
2634
2641
  { name: 'email', required: true, dadata: true },
2635
2642
  ],
2636
2643
  },
@@ -2640,6 +2647,58 @@
2640
2647
  ];
2641
2648
  };
2642
2649
 
2650
+ const getTraceId = () => {
2651
+ const result = new Uint8Array(8);
2652
+ globalThis.crypto.getRandomValues(result);
2653
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2654
+ };
2655
+
2656
+ const fetchRetailJSON = async (url, method, body) => {
2657
+ try {
2658
+ const response = await doRequest(url, method, body);
2659
+ return response.json();
2660
+ }
2661
+ catch (err) {
2662
+ console.error(err);
2663
+ return null;
2664
+ }
2665
+ };
2666
+ async function doRequest(url, method, body) {
2667
+ const traceId = getTraceId();
2668
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2669
+ method,
2670
+ headers: {
2671
+ 'Content-Type': 'application/json',
2672
+ 'X-B3-Sampled': '1',
2673
+ 'X-B3-Spanid': traceId,
2674
+ 'X-B3-Traceid': traceId,
2675
+ ...getAuthorizationHeaders(),
2676
+ },
2677
+ credentials: 'include',
2678
+ body: body ? JSON.stringify(body) : null,
2679
+ });
2680
+ }
2681
+ const getAuthorizationHeaders = () => {
2682
+ const token = sessionStorage.getItem('accessToken');
2683
+ return token ? { Authorization: `Bearer ${token}` } : null;
2684
+ };
2685
+
2686
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2687
+
2688
+ const EsiaLoginBanner = JSX(() => {
2689
+ const navigator = locationNavigator();
2690
+ const handleAuth = useCallback(async () => {
2691
+ const resp = await getLink({
2692
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
2693
+ });
2694
+ if (resp?.link) {
2695
+ navigator.assign(resp.link);
2696
+ globalThis.location.href = resp.link;
2697
+ }
2698
+ }, []);
2699
+ 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" })] }));
2700
+ });
2701
+
2643
2702
  const debounce = (fn, delay = 600) => {
2644
2703
  let timerId;
2645
2704
  const debouncedCallback = (...args) => {
@@ -3526,42 +3585,6 @@
3526
3585
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3527
3586
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3528
3587
 
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
3588
  const fetchRegionOffices = async (regionKey) => {
3566
3589
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3567
3590
  regionRfCd: {
@@ -5315,11 +5338,11 @@
5315
5338
  }, []);
5316
5339
 
5317
5340
  const getFamilyStatusAndIncomeData = (formData) => {
5318
- const { familyStatus, familyMembers, dependents, children, confirmationIncome, wages, mandatoryPayments, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, } = formData;
5341
+ const { familyStatus, familyMembers, dependents, children, confirmationIncome, wages, mandatoryPayments, additionalIncome, otherIncome, otherPayments, rentalIncome, retirementIncome, snils, armyIdFlg, conscription, esiaAccountTypeCd, } = formData;
5319
5342
  return {
5320
5343
  maritalStatusCd: familyStatus,
5321
5344
  totalDependents: familyMembers,
5322
- incomeCertificateCd: confirmationIncome,
5345
+ incomeCertificateCd: esiaAccountTypeCd?.key ? { key: 'SFR_CERTIFICATE' } : confirmationIncome,
5323
5346
  otherDependents: dependents,
5324
5347
  childrenDependents: children,
5325
5348
  militaryStatusCd: conscription,
@@ -5432,7 +5455,7 @@
5432
5455
  const participant = task.participants[0];
5433
5456
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5434
5457
  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;
5458
+ 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
5459
  return {
5437
5460
  currency: currency?.key,
5438
5461
  paymentSystem: getSelectValue(paymentSystem),
@@ -5484,6 +5507,7 @@
5484
5507
  monthsValue,
5485
5508
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5486
5509
  },
5510
+ esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5487
5511
  ...getParticipantIncomes(participantIncomes),
5488
5512
  ...getParticipantAddresses(participantAddresses),
5489
5513
  ...getParticipantContacts(participantContacts),
@@ -5538,39 +5562,6 @@
5538
5562
  };
5539
5563
  };
5540
5564
 
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
5565
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5575
5566
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5576
5567
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5692,21 +5683,19 @@
5692
5683
 
5693
5684
  /* eslint-disable max-lines */
5694
5685
  // eslint-disable-next-line max-lines-per-function
5695
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5686
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5696
5687
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5697
5688
  const [ok, setOK] = useState();
5698
5689
  const saveUserData = useSaveUserData();
5699
5690
  const sendAspects = useSendLeadFormAspects({ data });
5700
5691
  const navigator = locationNavigator();
5701
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5702
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5692
+ const goToNextStep = useCallback(() => {
5693
+ navigator.assign(nextStepLink);
5694
+ }, []);
5695
+ const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5703
5696
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5704
5697
  const draftDialog = useDraftDialog();
5705
5698
  const handleSubmit = useCallback(async (formData) => {
5706
- if (esiaError) {
5707
- navigator.assign(nextStepLink);
5708
- return;
5709
- }
5710
5699
  try {
5711
5700
  startSending();
5712
5701
  const profileId = await createUserProfile({
@@ -5724,7 +5713,7 @@
5724
5713
  });
5725
5714
  verifyPhoneDialog.close();
5726
5715
  if (productType === 'debitCard') {
5727
- openEsiaLoginDialog();
5716
+ goToNextStep();
5728
5717
  }
5729
5718
  else {
5730
5719
  consentBkiDialog.open(formData.phone, profileId);
@@ -5763,7 +5752,7 @@
5763
5752
  catch {
5764
5753
  setOK(false);
5765
5754
  }
5766
- }, [esiaError]);
5755
+ }, []);
5767
5756
  return { isSending, ok, handleSubmit };
5768
5757
  };
5769
5758
  const getAcceptedConsents = (formData, productType) => {
@@ -5846,7 +5835,10 @@
5846
5835
  }
5847
5836
  }, [target, key]);
5848
5837
 
5849
- const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5838
+ const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5839
+ saveToken(res);
5840
+ return res;
5841
+ });
5850
5842
 
5851
5843
  const initialFormState = {
5852
5844
  surname: '',
@@ -5864,19 +5856,24 @@
5864
5856
  consentPhotoFlg: false,
5865
5857
  consentFATCA: false,
5866
5858
  };
5867
- const getInitialFormState$1 = (inputs, savedForm) => {
5859
+ const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5868
5860
  if (savedForm) {
5869
- return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5861
+ return {
5862
+ ...savedForm,
5863
+ limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5864
+ ...(!esiaAuthSuccess && {
5865
+ esiaAccountTypeCd: { key: '' },
5866
+ }),
5867
+ };
5870
5868
  }
5871
5869
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5872
5870
  return { ...formState };
5873
5871
  };
5874
5872
 
5875
- const uploadFile = async (file, taskId, documentCategory) => {
5873
+ const uploadFile = async (file, documentCategory, isPDF = false) => {
5876
5874
  const fd = new FormData();
5877
- fd.append('taskId', taskId);
5878
5875
  fd.append('documentCategory', documentCategory);
5879
- fd.append('file', file, 'file.pdf');
5876
+ fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5880
5877
  const res = await globalThis
5881
5878
  ?.fetch?.(`/light-api-cash/v1/file`, {
5882
5879
  method: 'POST',
@@ -5890,23 +5887,46 @@
5890
5887
  return res;
5891
5888
  };
5892
5889
 
5893
- const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5890
+ const parseEsiaProfile = async (esiaProfile, isDebit) => {
5894
5891
  isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5895
5892
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5896
- const files = [];
5893
+ let files = [];
5897
5894
  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
- });
5895
+ files = await saveDocuments([
5896
+ {
5897
+ file: esiaAdditionalDocument.pdfFileWorkbook,
5898
+ category: 'CONFIRMING_INCOME_DOC',
5899
+ isPDF: true,
5900
+ },
5901
+ {
5902
+ file: esiaAdditionalDocument.pdfFilePayout,
5903
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5904
+ isPDF: true,
5905
+ },
5906
+ {
5907
+ file: esiaAdditionalDocument.pdfFileSigPayout,
5908
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5909
+ isPDF: true,
5910
+ },
5911
+ {
5912
+ file: esiaAdditionalDocument.xmlFilePayout,
5913
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5914
+ isPDF: false,
5915
+ },
5916
+ {
5917
+ file: esiaAdditionalDocument.xmlFileSigPayout,
5918
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5919
+ isPDF: false,
5920
+ },
5921
+ {
5922
+ file: esiaAdditionalDocument.xmlFileWorkbook,
5923
+ category: 'CONFIRMING_INCOME_DOC',
5924
+ isPDF: false,
5925
+ },
5926
+ //TODO: После тестирования добавить документы снизу
5927
+ // {file: esiaAdditionalDocument.pdfFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: true},
5928
+ // {file: esiaAdditionalDocument.xmlFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: false},
5929
+ ]);
5910
5930
  }
5911
5931
  const mainData = {
5912
5932
  name: profile.name,
@@ -5968,11 +5988,16 @@
5968
5988
  };
5969
5989
  };
5970
5990
  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));
5991
+ const saveDocuments = async (documents) => {
5992
+ const files = [];
5993
+ for (const doc of documents) {
5994
+ const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
5995
+ await fetch(`${contentType},${doc.file}`)
5996
+ .then((res) => res.blob())
5997
+ .then((value) => uploadFile(value, doc.category, doc.isPDF))
5998
+ .then((file) => files.push(file));
5999
+ }
6000
+ return files;
5976
6001
  };
5977
6002
  const checkEsiaDataForCredit = (esiaProfile) => {
5978
6003
  const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
@@ -5999,6 +6024,13 @@
5999
6024
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6000
6025
  esiaAdditionalDocument.pdfFilePayout,
6001
6026
  esiaAdditionalDocument.pdfFileWorkbook,
6027
+ esiaAdditionalDocument.pdfFileSigPayout,
6028
+ esiaAdditionalDocument.xmlFilePayout,
6029
+ esiaAdditionalDocument.xmlFileSigPayout,
6030
+ esiaAdditionalDocument.xmlFileWorkbook,
6031
+ //TODO: После тестирования добавить документы снизу
6032
+ // esiaAdditionalDocument.pdfFileSigWorkbook,
6033
+ // esiaAdditionalDocument.xmlFileSigWorkbook
6002
6034
  ];
6003
6035
  if (!data.every((_) => Boolean(_))) {
6004
6036
  throw new Error();
@@ -6026,29 +6058,28 @@
6026
6058
  }
6027
6059
  };
6028
6060
 
6029
- const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6030
- const navigator = locationNavigator();
6061
+ const useInitApplicationLead = ({ inputs, productType, setEsiaError, setEsiaAuthSuccess, esiaAuthSuccess, }) => {
6031
6062
  const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6032
6063
  const leadFormStore = useLeadFormStore();
6033
6064
  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) => {
6065
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6066
+ const requestEsiaProfile = useCallback(async (code, state) => {
6036
6067
  startLoading();
6037
6068
  try {
6038
- const data = await updateProfileEsia({
6039
- profileId,
6069
+ const data = await esiaRequestProfile({
6040
6070
  code,
6041
6071
  state,
6042
6072
  redirectUri: globalThis.location?.href,
6073
+ authorize: true,
6043
6074
  });
6044
- if (data && leadFormStore?.taskId) {
6045
- const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6075
+ if (data) {
6076
+ const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6046
6077
  saveForm((_) => ({
6047
6078
  ..._,
6048
6079
  ...parsedData,
6049
6080
  }));
6081
+ setEsiaAuthSuccess();
6050
6082
  }
6051
- navigator.assign(nextStepLink);
6052
6083
  }
6053
6084
  catch {
6054
6085
  setEsiaError();
@@ -6056,15 +6087,14 @@
6056
6087
  finally {
6057
6088
  endLoading();
6058
6089
  }
6059
- }, [nextStepLink]);
6090
+ }, []);
6060
6091
  useEffect(() => {
6061
6092
  leadFormStore.productType = productType;
6062
- const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6063
6093
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6064
6094
  const code = params.get('code');
6065
6095
  const state = params.get('state');
6066
- if (profileId && code && state) {
6067
- updateEsiaProfile(profileId, code, state);
6096
+ if (code && state) {
6097
+ requestEsiaProfile(code, state);
6068
6098
  }
6069
6099
  else {
6070
6100
  sessionStorage.removeItem('accessToken');
@@ -6076,6 +6106,7 @@
6076
6106
 
6077
6107
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6078
6108
  const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6109
+ const [esiaAuthSuccess, { setTrue: setEsiaAuthSuccess }] = useBool(false);
6079
6110
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6080
6111
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
6081
6112
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
@@ -6084,15 +6115,17 @@
6084
6115
  nextStepLink,
6085
6116
  productType,
6086
6117
  setEsiaError,
6118
+ setEsiaAuthSuccess,
6119
+ esiaAuthSuccess,
6087
6120
  });
6088
6121
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6089
6122
  programId,
6090
6123
  nextStepLink,
6091
6124
  productType,
6092
- esiaError,
6125
+ esiaAuthSuccess,
6093
6126
  data,
6094
6127
  });
6095
- const [, { field, onSubmit }] = useForm(initialFormState, {
6128
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6096
6129
  formValidator,
6097
6130
  onSubmit: handleSubmit,
6098
6131
  });
@@ -6102,7 +6135,12 @@
6102
6135
  responseTypeDialog.open({ ok });
6103
6136
  }
6104
6137
  }, [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] }) }));
6138
+ useEffect(() => {
6139
+ if (initialFormState?.esiaAccountTypeCd) {
6140
+ reset();
6141
+ }
6142
+ }, [initialFormState]);
6143
+ 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
6144
  });
6107
6145
 
6108
6146
  const NotFound = JSX(({ title, description }) => {
@@ -7359,7 +7397,7 @@
7359
7397
  black: 'bg-black',
7360
7398
  white: 'bg-white',
7361
7399
  };
7362
- const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors = [], align = 'text-left', padding, ...rest }) => (jsx(BlockWrapper, { className: style('flex flex-col justify-left', className), defaultPadding: "p-2xl", ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, title: jsx(Headline, { title: title, description: description, headlineVersion: "XS", isEmbedded: true, align: align }), rightImage: image?.src ? (jsx(Img, { className: "flex justify-center align-center mb-xl", image: image })) : null, buttons: renderButtonsSection([button], { buttonClassName: 'w-full self-end' }), children: [colors?.length ? (jsxs("div", { className: "flex text-secondary-text mb-m", children: [jsx("div", { className: "mr-xs", children: jsx(Text, { size: "text-s", align: "text-left", font: "font-light", children: "\u0426\u0432\u0435\u0442\u0430:" }) }), colors.map(renderColorOption)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null] }) })));
7400
+ const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors = [], align = 'text-left', padding, ...rest }) => (jsx(BlockWrapper, { className: style('flex flex-col justify-left', className), defaultPadding: "p-2xl", ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, title: jsx(Headline, { title: title, description: description, headlineVersion: "XS", isEmbedded: true, align: align, className: "min-h-24" }), rightImage: image?.src ? (jsx(Img, { className: "flex justify-center align-center mb-xl", image: image })) : null, buttons: renderButtonsSection([button], { buttonClassName: 'w-full self-end' }), children: [colors?.length ? (jsxs("div", { className: "flex text-secondary-text mb-m", children: [jsx("div", { className: "mr-xs", children: jsx(Text, { size: "text-s", align: "text-left", font: "font-light", children: "\u0426\u0432\u0435\u0442\u0430:" }) }), colors.map(renderColorOption)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null] }) })));
7363
7401
  const renderColorOption = (color, i) => (jsx("figure", { className: `w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cardStyleMap[color]}` }, String(i)));
7364
7402
 
7365
7403
  const CarouselLinkButton = JSX(({ icon, ...linkProps }) => {
@@ -7811,6 +7849,7 @@
7811
7849
  mandatoryPayments: undefined,
7812
7850
  snils: '',
7813
7851
  armyIdFlg: false,
7852
+ esiaAccountTypeCd: { key: '', text: '' },
7814
7853
  },
7815
7854
  {
7816
7855
  bankruptcyFlg: false,
@@ -8252,7 +8291,16 @@
8252
8291
  },
8253
8292
  {
8254
8293
  columns: 1,
8255
- inputs: [{ name: 'confirmationIncome', required: true }],
8294
+ inputs: [
8295
+ {
8296
+ name: 'confirmationIncome',
8297
+ required: true,
8298
+ condition: {
8299
+ name: 'esiaAccountTypeCd',
8300
+ values: [''],
8301
+ },
8302
+ },
8303
+ ],
8256
8304
  },
8257
8305
  {
8258
8306
  columns: 1,
@@ -9848,6 +9896,77 @@
9848
9896
  return (jsxs(BlockWrapper, { tag: "footer", className: style('grid gap-y-xl p-4xl pb-24 lg:p-xl', className), ...rest, children: [renderLogoSearchBar(common, navigationItems), jsxs("div", { className: "flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ", children: [jsx(Sitemap, { navigationItems: navigationItems }), jsx("div", { className: "border-t border-main-divider lg:hidden w-full" }), jsxs("div", { className: style(LEFT_COLUMN_STYLE, 'flex flex-col shrink-0 overflow-hidden space-y-xl'), children: [jsx(Contacts, { items: contacts }), feedbackButton ? (jsx(LinkButton, { className: "w-full", version: "primary", ...feedbackButton })) : null, mediaLinks.map((_, i) => (jsx(SocialMedia, { media: _?.links ?? [], showButtonText: false, stretched: true, children: _?.title }, String(i)))), otherLinks.map((_, i) => (jsx(Link, { className: "text-s font-light", ..._ }, `${_.href}_${i}`)))] })] }), jsx(HorizontalNavigation, { title: horizontalNavigationTitle, links: relatedEnterprises }), jsx(TextInformation, { links: documents, license: license })] }));
9849
9897
  });
9850
9898
 
9899
+ const getInnerPadding = (isPadding = false) => isPadding ? {} : { padding: 'p-0' };
9900
+
9901
+ const gapStyles = {
9902
+ XXL: 'gap-6xl',
9903
+ XL: 'gap-5xl',
9904
+ L: 'gap-3xl',
9905
+ M: 'gap-m',
9906
+ S: 'gap-xs',
9907
+ XS: 'gap-2xs',
9908
+ '': '',
9909
+ };
9910
+
9911
+ const MIN_LENGTH_CHILD = 5;
9912
+ const SHORT_TILE_INDEXES = [1, 2, 3, 4];
9913
+ const LINK_SCHEMA = {
9914
+ link: {
9915
+ allOf: [
9916
+ { $ref: `#/definitions/LinkCommonProps` },
9917
+ {
9918
+ type: 'object',
9919
+ properties: {
9920
+ data: {
9921
+ type: 'array',
9922
+ items: { $ref: '#/definitions/AspectsDef' },
9923
+ title: 'Дополнительные атрибуты',
9924
+ },
9925
+ },
9926
+ },
9927
+ ],
9928
+ title: 'Ссылка',
9929
+ required: ['href'],
9930
+ },
9931
+ };
9932
+ const GalleryLayout = UniBlock(({ className = '', padding = 'p-0', gap = '', isInnerPadding = true, version = 'transparent', isTheme = false, isCardBorder = false, ...rest }) => (jsx(BlockWrapper, { className: style('grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr', gapStyles[gap], className), padding: padding, version: version, isTheme: isTheme, ...rest, children: renderChildren({
9933
+ ...rest,
9934
+ renderProps: getRenderProps({ isInnerPadding, isCardBorder }),
9935
+ }) })), {
9936
+ childrenTypes: ['ProductBlock'],
9937
+ childSchema: () => LINK_SCHEMA,
9938
+ allowRemoveChild: (slot) => (slot?.blocks ?? []).length > MIN_LENGTH_CHILD,
9939
+ });
9940
+ const getRenderProps = ({ isInnerPadding, isCardBorder, }) => (childBlock, childOptions, i) => renderBlock$1(childBlock, {
9941
+ ...childOptions,
9942
+ blockDecorator: blockDecoratorWrapper(childOptions.blockDecorator, i),
9943
+ }, {
9944
+ className: style('w-full', getBorderStyle(isCardBorder)),
9945
+ ...getInnerPadding(isInnerPadding),
9946
+ });
9947
+ const blockDecoratorWrapper = (blockDecorator, idx = 0) => (props, i) => blockDecorator?.({
9948
+ ...props,
9949
+ render: (renderProps) => productBlockDecorator(idx)({ ...props, ...renderProps }, i),
9950
+ }, `wrap_${i}`) ?? productBlockDecorator(idx)(props, i);
9951
+ const productBlockDecorator = (idx) => ({ blockClassName, block, render }, i) => (jsx(LinkWrapper, { ...block.content?.link, className: getChildStyle(idx), children: render({
9952
+ blockClassName: style(blockClassName, 'h-full'),
9953
+ block: modifyBlock(block, idx),
9954
+ }) }, i));
9955
+ const getChildStyle = (index) => SHORT_TILE_INDEXES.includes(index)
9956
+ ? 'lg:col-span-1 lg:row-span-1'
9957
+ : 'lg:col-span-2 lg:row-span-2';
9958
+ const modifyBlock = (block, i) => {
9959
+ const content = { ...block.content };
9960
+ if (SHORT_TILE_INDEXES.includes(i)) {
9961
+ delete content.description;
9962
+ delete content.benefits;
9963
+ }
9964
+ if (content.link?.href) {
9965
+ delete content.buttons;
9966
+ }
9967
+ return { ...block, content };
9968
+ };
9969
+
9851
9970
  const GracePeriod = JSX(({ className = '', title, description, calendar, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-m', className), defaultPadding: "p-6xl", ...rest, children: [jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true }), calendar ? renderCalendar(calendar) : null] })));
9852
9971
  const renderCalendar = (calendar) => {
9853
9972
  const colCount = calendar.reduce((accumulator, currentValue) => currentValue?.month?.length ? accumulator + currentValue.month.length : accumulator, 0) || 1;
@@ -10184,18 +10303,6 @@
10184
10303
  common: page?.common ?? {},
10185
10304
  });
10186
10305
 
10187
- const getInnerPadding = (isPadding = false) => isPadding ? {} : { padding: 'p-0' };
10188
-
10189
- const gapStyles = {
10190
- XXL: 'gap-6xl',
10191
- XL: 'gap-5xl',
10192
- L: 'gap-3xl',
10193
- M: 'gap-m',
10194
- S: 'gap-xs',
10195
- XS: 'gap-2xs',
10196
- '': '',
10197
- };
10198
-
10199
10306
  const HorizontalLayout = UniBlock(({ className = '', padding = 'p-0', gap = 'XS', isInnerPadding = true, version = 'transparent', isTheme = false, isCardBorder, ...rest }) => (jsx(BlockWrapper, { className: style('relative', 'grid grid-cols-12', gapStyles[gap], className), padding: padding, version: version, isTheme: isTheme, ...rest, children: renderChildren({
10200
10307
  ...rest,
10201
10308
  extraProps: {
@@ -11301,6 +11408,7 @@
11301
11408
  ErrorBlock,
11302
11409
  ExchangeRateTile,
11303
11410
  Footer,
11411
+ GalleryLayout,
11304
11412
  GracePeriod,
11305
11413
  GrantSupport,
11306
11414
  Header,
@@ -11473,7 +11581,7 @@
11473
11581
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11474
11582
  });
11475
11583
 
11476
- const packageVersion = "0.14.812";
11584
+ const packageVersion = "0.14.814";
11477
11585
 
11478
11586
  exports.Blocks = Blocks;
11479
11587
  exports.ContentPage = ContentPage;