@redneckz/wildless-cms-uni-blocks 0.14.697 → 0.14.699

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 (864) hide show
  1. package/bundle/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  2. package/bundle/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  3. package/bundle/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  4. package/bundle/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  5. package/bundle/api/dadataHints/dadataHintsType.d.ts +3 -0
  6. package/bundle/bundle.umd.js +400 -265
  7. package/bundle/bundle.umd.min.js +1 -1
  8. package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  9. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  10. package/bundle/components/ApplicationLeadForm/consents.d.ts +3 -3
  11. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  12. package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  13. package/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  14. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  15. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  16. package/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  17. package/bundle/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  18. package/bundle/components/CreditCardForm/calculateInputs.d.ts +2 -2
  19. package/bundle/components/CreditCardForm/formStateMap.d.ts +2 -2
  20. package/bundle/components/CreditCardForm/getCardData.d.ts +2 -2
  21. package/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  22. package/bundle/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  23. package/bundle/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  24. package/bundle/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  25. package/bundle/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  26. package/bundle/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  27. package/bundle/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  28. package/bundle/components/CreditCardForm/renderInputs.d.ts +2 -2
  29. package/bundle/components/CreditCardForm/renderStep.d.ts +3 -3
  30. package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  31. package/bundle/components/CreditForm/calculateInputs.d.ts +2 -2
  32. package/bundle/components/CreditForm/formStateMap.d.ts +2 -2
  33. package/bundle/components/CreditForm/getCalcData.d.ts +2 -2
  34. package/bundle/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  35. package/bundle/components/CreditForm/getFifthStepData.d.ts +2 -2
  36. package/bundle/components/CreditForm/getFirstStepData.d.ts +2 -2
  37. package/bundle/components/CreditForm/getFourthStepData.d.ts +2 -2
  38. package/bundle/components/CreditForm/getInitialFormState.d.ts +2 -2
  39. package/bundle/components/CreditForm/getSecondStepData.d.ts +2 -2
  40. package/bundle/components/CreditForm/getThirdStepData.d.ts +2 -2
  41. package/bundle/components/CreditForm/getZeroStepData.d.ts +2 -2
  42. package/bundle/components/CreditForm/renderInputs.d.ts +2 -2
  43. package/bundle/components/CreditForm/renderStep.d.ts +3 -3
  44. package/bundle/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  45. package/bundle/components/CreditForm/utils.d.ts +1 -1
  46. package/bundle/hooks/useCreditFormStore.d.ts +13 -0
  47. package/bundle/hooks/useLeadFormData.d.ts +1 -1
  48. package/bundle/hooks/useSetter.d.ts +2 -0
  49. package/bundle/ui-kit/DialogManager/useDialog.d.ts +4 -1
  50. package/bundle/ui-kit/FormField/SelectField.d.ts +1 -7
  51. package/bundle/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  52. package/bundle/ui-kit/FormField/validators.d.ts +1 -1
  53. package/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
  54. package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  55. package/bundle/utils/safeJsonParse.d.ts +1 -0
  56. package/dist/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  57. package/dist/api/RetailAPI/model/EOrganizationActivityTypes.js +2 -0
  58. package/dist/api/RetailAPI/model/EOrganizationActivityTypes.js.map +1 -0
  59. package/dist/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  60. package/dist/api/RetailAPI/model/LeadFormData.js +2 -0
  61. package/dist/api/RetailAPI/model/LeadFormData.js.map +1 -0
  62. package/dist/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  63. package/dist/api/RetailAPI/utils/getOrganizationParams.js +101 -0
  64. package/dist/api/RetailAPI/utils/getOrganizationParams.js.map +1 -0
  65. package/dist/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  66. package/dist/api/RetailAPI/utils/getUpdateUserProfile.js +1 -0
  67. package/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  68. package/dist/api/dadataHints/dadataHintsType.d.ts +3 -0
  69. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -7
  70. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  71. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  72. package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  73. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  74. package/dist/components/ApplicationLeadForm/LeadFormState.js +2 -0
  75. package/dist/components/ApplicationLeadForm/LeadFormState.js.map +1 -0
  76. package/dist/components/ApplicationLeadForm/consents.d.ts +3 -3
  77. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  78. package/dist/components/ApplicationLeadForm/getInitialFormState.js +3 -5
  79. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  80. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  81. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  82. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  83. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  84. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  85. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -19
  86. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  87. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  88. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +11 -8
  89. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  90. package/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  91. package/dist/components/ApplicationLeadForm/useLeadFormStore.js +6 -0
  92. package/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -0
  93. package/dist/components/CreditCardForm/CreditCardForm.js +1 -2
  94. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  95. package/dist/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  96. package/dist/components/CreditCardForm/calculateInputs.d.ts +2 -2
  97. package/dist/components/CreditCardForm/formStateMap.d.ts +2 -2
  98. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  99. package/dist/components/CreditCardForm/getCardData.d.ts +2 -2
  100. package/dist/components/CreditCardForm/getCardData.js.map +1 -1
  101. package/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  102. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  103. package/dist/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  104. package/dist/components/CreditCardForm/getFifthStepData.js.map +1 -1
  105. package/dist/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  106. package/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
  107. package/dist/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  108. package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  109. package/dist/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  110. package/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
  111. package/dist/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  112. package/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  113. package/dist/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  114. package/dist/components/CreditCardForm/getThirdStepData.js.map +1 -1
  115. package/dist/components/CreditCardForm/renderInputs.d.ts +2 -2
  116. package/dist/components/CreditCardForm/renderStep.d.ts +3 -3
  117. package/dist/components/CreditCardForm/renderStep.js.map +1 -1
  118. package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  119. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  120. package/dist/components/CreditForm/CreditForm.js +1 -2
  121. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  122. package/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
  123. package/dist/components/CreditForm/calculateInputs.d.ts +2 -2
  124. package/dist/components/CreditForm/formStateMap.d.ts +2 -2
  125. package/dist/components/CreditForm/formStateMap.js.map +1 -1
  126. package/dist/components/CreditForm/getCalcData.d.ts +2 -2
  127. package/dist/components/CreditForm/getCalcData.js.map +1 -1
  128. package/dist/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  129. package/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  130. package/dist/components/CreditForm/getFifthStepData.d.ts +2 -2
  131. package/dist/components/CreditForm/getFifthStepData.js.map +1 -1
  132. package/dist/components/CreditForm/getFirstStepData.d.ts +2 -2
  133. package/dist/components/CreditForm/getFirstStepData.js.map +1 -1
  134. package/dist/components/CreditForm/getFourthStepData.d.ts +2 -2
  135. package/dist/components/CreditForm/getFourthStepData.js.map +1 -1
  136. package/dist/components/CreditForm/getInitialFormState.d.ts +2 -2
  137. package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  138. package/dist/components/CreditForm/getSecondStepData.d.ts +2 -2
  139. package/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  140. package/dist/components/CreditForm/getThirdStepData.d.ts +2 -2
  141. package/dist/components/CreditForm/getThirdStepData.js.map +1 -1
  142. package/dist/components/CreditForm/getZeroStepData.d.ts +2 -2
  143. package/dist/components/CreditForm/getZeroStepData.js.map +1 -1
  144. package/dist/components/CreditForm/renderInputs.d.ts +2 -2
  145. package/dist/components/CreditForm/renderStep.d.ts +3 -3
  146. package/dist/components/CreditForm/renderStep.js.map +1 -1
  147. package/dist/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  148. package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  149. package/dist/components/CreditForm/utils.d.ts +1 -1
  150. package/dist/hooks/useCreditFormStore.d.ts +13 -0
  151. package/dist/hooks/useCreditFormStore.js +8 -0
  152. package/dist/hooks/useCreditFormStore.js.map +1 -0
  153. package/dist/hooks/useLeadFormData.d.ts +1 -1
  154. package/dist/hooks/useLocalStorage.js +2 -1
  155. package/dist/hooks/useLocalStorage.js.map +1 -1
  156. package/dist/hooks/useSetter.d.ts +2 -0
  157. package/dist/hooks/useSetter.js +14 -0
  158. package/dist/hooks/useSetter.js.map +1 -0
  159. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  160. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  161. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +2 -10
  162. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  163. package/dist/ui-kit/DialogManager/useDialog.d.ts +4 -1
  164. package/dist/ui-kit/DialogManager/useDialog.js.map +1 -1
  165. package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  166. package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  167. package/dist/ui-kit/FormField/Fields/AmountWorkersField.js +10 -2
  168. package/dist/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
  169. package/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
  170. package/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
  171. package/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js +10 -2
  172. package/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
  173. package/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js +10 -2
  174. package/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
  175. package/dist/ui-kit/FormField/Fields/InnField.js +4 -3
  176. package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  177. package/dist/ui-kit/FormField/Fields/OrganizationField.js +10 -2
  178. package/dist/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
  179. package/dist/ui-kit/FormField/Fields/OrganizationNameField.js +4 -1
  180. package/dist/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
  181. package/dist/ui-kit/FormField/SelectField.d.ts +1 -7
  182. package/dist/ui-kit/FormField/SelectField.js.map +1 -1
  183. package/dist/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  184. package/dist/ui-kit/FormField/updateOrganizationFields.js +17 -0
  185. package/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -0
  186. package/dist/ui-kit/FormField/validators.d.ts +1 -1
  187. package/dist/ui-kit/Input/Input.js +2 -3
  188. package/dist/ui-kit/Input/Input.js.map +1 -1
  189. package/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
  190. package/dist/ui-kit/Input/getValidStyle.js +6 -0
  191. package/dist/ui-kit/Input/getValidStyle.js.map +1 -0
  192. package/dist/ui-kit/RichText/RichText.js +3 -6
  193. package/dist/ui-kit/RichText/RichText.js.map +1 -1
  194. package/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
  195. package/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
  196. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  197. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -3
  198. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  199. package/dist/utils/safeJsonParse.d.ts +1 -0
  200. package/dist/utils/safeJsonParse.js +12 -0
  201. package/dist/utils/safeJsonParse.js.map +1 -0
  202. package/lib/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  203. package/lib/api/RetailAPI/model/EOrganizationActivityTypes.js +2 -0
  204. package/lib/api/RetailAPI/model/EOrganizationActivityTypes.js.map +1 -0
  205. package/lib/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  206. package/lib/api/RetailAPI/model/LeadFormData.js +2 -0
  207. package/lib/api/RetailAPI/model/LeadFormData.js.map +1 -0
  208. package/lib/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  209. package/lib/api/RetailAPI/utils/getOrganizationParams.js +95 -0
  210. package/lib/api/RetailAPI/utils/getOrganizationParams.js.map +1 -0
  211. package/lib/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  212. package/lib/api/RetailAPI/utils/getUpdateUserProfile.js +1 -0
  213. package/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  214. package/lib/api/dadataHints/dadataHintsType.d.ts +3 -0
  215. package/lib/common.css +1 -1
  216. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.d.ts +1 -0
  217. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -8
  218. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  219. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  220. package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  221. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  222. package/lib/components/ApplicationLeadForm/LeadFormState.js +2 -0
  223. package/lib/components/ApplicationLeadForm/LeadFormState.js.map +1 -0
  224. package/lib/components/ApplicationLeadForm/consents.d.ts +3 -3
  225. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  226. package/lib/components/ApplicationLeadForm/getInitialFormState.js +3 -5
  227. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  228. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  229. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  230. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  231. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  232. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  233. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -19
  234. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  235. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  236. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -9
  237. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  238. package/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  239. package/lib/components/ApplicationLeadForm/useLeadFormStore.js +3 -0
  240. package/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -0
  241. package/lib/components/CreditCardForm/CreditCardForm.fixture.mobile.d.ts +5 -0
  242. package/lib/components/CreditCardForm/CreditCardForm.js +1 -2
  243. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  244. package/lib/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  245. package/lib/components/CreditCardForm/calculateInputs.d.ts +2 -2
  246. package/lib/components/CreditCardForm/formStateMap.d.ts +2 -2
  247. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  248. package/lib/components/CreditCardForm/getCardData.d.ts +2 -2
  249. package/lib/components/CreditCardForm/getCardData.js.map +1 -1
  250. package/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  251. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  252. package/lib/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  253. package/lib/components/CreditCardForm/getFifthStepData.js.map +1 -1
  254. package/lib/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  255. package/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
  256. package/lib/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  257. package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  258. package/lib/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  259. package/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
  260. package/lib/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  261. package/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  262. package/lib/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  263. package/lib/components/CreditCardForm/getThirdStepData.js.map +1 -1
  264. package/lib/components/CreditCardForm/renderInputs.d.ts +2 -2
  265. package/lib/components/CreditCardForm/renderStep.d.ts +3 -3
  266. package/lib/components/CreditCardForm/renderStep.js.map +1 -1
  267. package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  268. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  269. package/lib/components/CreditForm/CreditForm.fixture.mobile.d.ts +5 -0
  270. package/lib/components/CreditForm/CreditForm.js +1 -2
  271. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  272. package/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
  273. package/lib/components/CreditForm/calculateInputs.d.ts +2 -2
  274. package/lib/components/CreditForm/formStateMap.d.ts +2 -2
  275. package/lib/components/CreditForm/formStateMap.js.map +1 -1
  276. package/lib/components/CreditForm/getCalcData.d.ts +2 -2
  277. package/lib/components/CreditForm/getCalcData.js.map +1 -1
  278. package/lib/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  279. package/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  280. package/lib/components/CreditForm/getFifthStepData.d.ts +2 -2
  281. package/lib/components/CreditForm/getFifthStepData.js.map +1 -1
  282. package/lib/components/CreditForm/getFirstStepData.d.ts +2 -2
  283. package/lib/components/CreditForm/getFirstStepData.js.map +1 -1
  284. package/lib/components/CreditForm/getFourthStepData.d.ts +2 -2
  285. package/lib/components/CreditForm/getFourthStepData.js.map +1 -1
  286. package/lib/components/CreditForm/getInitialFormState.d.ts +2 -2
  287. package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  288. package/lib/components/CreditForm/getSecondStepData.d.ts +2 -2
  289. package/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  290. package/lib/components/CreditForm/getThirdStepData.d.ts +2 -2
  291. package/lib/components/CreditForm/getThirdStepData.js.map +1 -1
  292. package/lib/components/CreditForm/getZeroStepData.d.ts +2 -2
  293. package/lib/components/CreditForm/getZeroStepData.js.map +1 -1
  294. package/lib/components/CreditForm/renderInputs.d.ts +2 -2
  295. package/lib/components/CreditForm/renderStep.d.ts +3 -3
  296. package/lib/components/CreditForm/renderStep.js.map +1 -1
  297. package/lib/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  298. package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  299. package/lib/components/CreditForm/utils.d.ts +1 -1
  300. package/lib/hooks/useCreditFormStore.d.ts +13 -0
  301. package/lib/hooks/useCreditFormStore.js +5 -0
  302. package/lib/hooks/useCreditFormStore.js.map +1 -0
  303. package/lib/hooks/useLeadFormData.d.ts +1 -1
  304. package/lib/hooks/useLocalStorage.js +2 -1
  305. package/lib/hooks/useLocalStorage.js.map +1 -1
  306. package/lib/hooks/useSetter.d.ts +2 -0
  307. package/lib/hooks/useSetter.js +11 -0
  308. package/lib/hooks/useSetter.js.map +1 -0
  309. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  310. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  311. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +2 -10
  312. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  313. package/lib/ui-kit/DialogManager/useDialog.d.ts +4 -1
  314. package/lib/ui-kit/DialogManager/useDialog.js.map +1 -1
  315. package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  316. package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  317. package/lib/ui-kit/FormField/Fields/AmountWorkersField.js +10 -2
  318. package/lib/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
  319. package/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
  320. package/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
  321. package/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js +10 -2
  322. package/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
  323. package/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js +10 -2
  324. package/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
  325. package/lib/ui-kit/FormField/Fields/InnField.js +4 -3
  326. package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  327. package/lib/ui-kit/FormField/Fields/OrganizationField.js +10 -2
  328. package/lib/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
  329. package/lib/ui-kit/FormField/Fields/OrganizationNameField.js +4 -1
  330. package/lib/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
  331. package/lib/ui-kit/FormField/SelectField.d.ts +1 -7
  332. package/lib/ui-kit/FormField/SelectField.js.map +1 -1
  333. package/lib/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  334. package/lib/ui-kit/FormField/updateOrganizationFields.js +14 -0
  335. package/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -0
  336. package/lib/ui-kit/FormField/validators.d.ts +1 -1
  337. package/lib/ui-kit/Input/Input.js +1 -2
  338. package/lib/ui-kit/Input/Input.js.map +1 -1
  339. package/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
  340. package/lib/ui-kit/Input/getValidStyle.js +3 -0
  341. package/lib/ui-kit/Input/getValidStyle.js.map +1 -0
  342. package/lib/ui-kit/RichText/RichText.js +3 -6
  343. package/lib/ui-kit/RichText/RichText.js.map +1 -1
  344. package/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
  345. package/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
  346. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  347. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -3
  348. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  349. package/lib/utils/safeJsonParse.d.ts +1 -0
  350. package/lib/utils/safeJsonParse.js +9 -0
  351. package/lib/utils/safeJsonParse.js.map +1 -0
  352. package/mobile/bundle/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  353. package/mobile/bundle/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  354. package/mobile/bundle/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  355. package/mobile/bundle/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  356. package/mobile/bundle/api/dadataHints/dadataHintsType.d.ts +3 -0
  357. package/mobile/bundle/bundle.umd.js +400 -265
  358. package/mobile/bundle/bundle.umd.min.js +1 -1
  359. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  360. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  361. package/mobile/bundle/components/ApplicationLeadForm/consents.d.ts +3 -3
  362. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  363. package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  364. package/mobile/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  365. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  366. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  367. package/mobile/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  368. package/mobile/bundle/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  369. package/mobile/bundle/components/CreditCardForm/calculateInputs.d.ts +2 -2
  370. package/mobile/bundle/components/CreditCardForm/formStateMap.d.ts +2 -2
  371. package/mobile/bundle/components/CreditCardForm/getCardData.d.ts +2 -2
  372. package/mobile/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  373. package/mobile/bundle/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  374. package/mobile/bundle/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  375. package/mobile/bundle/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  376. package/mobile/bundle/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  377. package/mobile/bundle/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  378. package/mobile/bundle/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  379. package/mobile/bundle/components/CreditCardForm/renderInputs.d.ts +2 -2
  380. package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +3 -3
  381. package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  382. package/mobile/bundle/components/CreditForm/calculateInputs.d.ts +2 -2
  383. package/mobile/bundle/components/CreditForm/formStateMap.d.ts +2 -2
  384. package/mobile/bundle/components/CreditForm/getCalcData.d.ts +2 -2
  385. package/mobile/bundle/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  386. package/mobile/bundle/components/CreditForm/getFifthStepData.d.ts +2 -2
  387. package/mobile/bundle/components/CreditForm/getFirstStepData.d.ts +2 -2
  388. package/mobile/bundle/components/CreditForm/getFourthStepData.d.ts +2 -2
  389. package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +2 -2
  390. package/mobile/bundle/components/CreditForm/getSecondStepData.d.ts +2 -2
  391. package/mobile/bundle/components/CreditForm/getThirdStepData.d.ts +2 -2
  392. package/mobile/bundle/components/CreditForm/getZeroStepData.d.ts +2 -2
  393. package/mobile/bundle/components/CreditForm/renderInputs.d.ts +2 -2
  394. package/mobile/bundle/components/CreditForm/renderStep.d.ts +3 -3
  395. package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  396. package/mobile/bundle/components/CreditForm/utils.d.ts +1 -1
  397. package/mobile/bundle/hooks/useCreditFormStore.d.ts +13 -0
  398. package/mobile/bundle/hooks/useLeadFormData.d.ts +1 -1
  399. package/mobile/bundle/hooks/useSetter.d.ts +2 -0
  400. package/mobile/bundle/ui-kit/DialogManager/useDialog.d.ts +4 -1
  401. package/mobile/bundle/ui-kit/FormField/SelectField.d.ts +1 -7
  402. package/mobile/bundle/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  403. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -1
  404. package/mobile/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
  405. package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  406. package/mobile/bundle/utils/safeJsonParse.d.ts +1 -0
  407. package/mobile/dist/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  408. package/mobile/dist/api/RetailAPI/model/EOrganizationActivityTypes.js +2 -0
  409. package/mobile/dist/api/RetailAPI/model/EOrganizationActivityTypes.js.map +1 -0
  410. package/mobile/dist/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  411. package/mobile/dist/api/RetailAPI/model/LeadFormData.js +2 -0
  412. package/mobile/dist/api/RetailAPI/model/LeadFormData.js.map +1 -0
  413. package/mobile/dist/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  414. package/mobile/dist/api/RetailAPI/utils/getOrganizationParams.js +101 -0
  415. package/mobile/dist/api/RetailAPI/utils/getOrganizationParams.js.map +1 -0
  416. package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  417. package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js +1 -0
  418. package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  419. package/mobile/dist/api/dadataHints/dadataHintsType.d.ts +3 -0
  420. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -7
  421. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  422. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  423. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  424. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  425. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.js +2 -0
  426. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.js.map +1 -0
  427. package/mobile/dist/components/ApplicationLeadForm/consents.d.ts +3 -3
  428. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  429. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +3 -5
  430. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  431. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  432. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  433. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  434. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  435. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  436. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -19
  437. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  438. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  439. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +11 -8
  440. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  441. package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  442. package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.js +6 -0
  443. package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -0
  444. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +1 -2
  445. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  446. package/mobile/dist/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  447. package/mobile/dist/components/CreditCardForm/calculateInputs.d.ts +2 -2
  448. package/mobile/dist/components/CreditCardForm/formStateMap.d.ts +2 -2
  449. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  450. package/mobile/dist/components/CreditCardForm/getCardData.d.ts +2 -2
  451. package/mobile/dist/components/CreditCardForm/getCardData.js.map +1 -1
  452. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  453. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  454. package/mobile/dist/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  455. package/mobile/dist/components/CreditCardForm/getFifthStepData.js.map +1 -1
  456. package/mobile/dist/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  457. package/mobile/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
  458. package/mobile/dist/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  459. package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  460. package/mobile/dist/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  461. package/mobile/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
  462. package/mobile/dist/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  463. package/mobile/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  464. package/mobile/dist/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  465. package/mobile/dist/components/CreditCardForm/getThirdStepData.js.map +1 -1
  466. package/mobile/dist/components/CreditCardForm/renderInputs.d.ts +2 -2
  467. package/mobile/dist/components/CreditCardForm/renderStep.d.ts +3 -3
  468. package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
  469. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  470. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  471. package/mobile/dist/components/CreditForm/CreditForm.js +1 -2
  472. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  473. package/mobile/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
  474. package/mobile/dist/components/CreditForm/calculateInputs.d.ts +2 -2
  475. package/mobile/dist/components/CreditForm/formStateMap.d.ts +2 -2
  476. package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
  477. package/mobile/dist/components/CreditForm/getCalcData.d.ts +2 -2
  478. package/mobile/dist/components/CreditForm/getCalcData.js.map +1 -1
  479. package/mobile/dist/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  480. package/mobile/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  481. package/mobile/dist/components/CreditForm/getFifthStepData.d.ts +2 -2
  482. package/mobile/dist/components/CreditForm/getFifthStepData.js.map +1 -1
  483. package/mobile/dist/components/CreditForm/getFirstStepData.d.ts +2 -2
  484. package/mobile/dist/components/CreditForm/getFirstStepData.js.map +1 -1
  485. package/mobile/dist/components/CreditForm/getFourthStepData.d.ts +2 -2
  486. package/mobile/dist/components/CreditForm/getFourthStepData.js.map +1 -1
  487. package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +2 -2
  488. package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  489. package/mobile/dist/components/CreditForm/getSecondStepData.d.ts +2 -2
  490. package/mobile/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  491. package/mobile/dist/components/CreditForm/getThirdStepData.d.ts +2 -2
  492. package/mobile/dist/components/CreditForm/getThirdStepData.js.map +1 -1
  493. package/mobile/dist/components/CreditForm/getZeroStepData.d.ts +2 -2
  494. package/mobile/dist/components/CreditForm/getZeroStepData.js.map +1 -1
  495. package/mobile/dist/components/CreditForm/renderInputs.d.ts +2 -2
  496. package/mobile/dist/components/CreditForm/renderStep.d.ts +3 -3
  497. package/mobile/dist/components/CreditForm/renderStep.js.map +1 -1
  498. package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  499. package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  500. package/mobile/dist/components/CreditForm/utils.d.ts +1 -1
  501. package/mobile/dist/hooks/useCreditFormStore.d.ts +13 -0
  502. package/mobile/dist/hooks/useCreditFormStore.js +8 -0
  503. package/mobile/dist/hooks/useCreditFormStore.js.map +1 -0
  504. package/mobile/dist/hooks/useLeadFormData.d.ts +1 -1
  505. package/mobile/dist/hooks/useLocalStorage.js +2 -1
  506. package/mobile/dist/hooks/useLocalStorage.js.map +1 -1
  507. package/mobile/dist/hooks/useSetter.d.ts +2 -0
  508. package/mobile/dist/hooks/useSetter.js +14 -0
  509. package/mobile/dist/hooks/useSetter.js.map +1 -0
  510. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  511. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  512. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +2 -10
  513. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  514. package/mobile/dist/ui-kit/DialogManager/useDialog.d.ts +4 -1
  515. package/mobile/dist/ui-kit/DialogManager/useDialog.js.map +1 -1
  516. package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  517. package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  518. package/mobile/dist/ui-kit/FormField/Fields/AmountWorkersField.js +10 -2
  519. package/mobile/dist/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
  520. package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
  521. package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
  522. package/mobile/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js +10 -2
  523. package/mobile/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
  524. package/mobile/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js +10 -2
  525. package/mobile/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
  526. package/mobile/dist/ui-kit/FormField/Fields/InnField.js +4 -3
  527. package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  528. package/mobile/dist/ui-kit/FormField/Fields/OrganizationField.js +10 -2
  529. package/mobile/dist/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
  530. package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js +4 -1
  531. package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
  532. package/mobile/dist/ui-kit/FormField/SelectField.d.ts +1 -7
  533. package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
  534. package/mobile/dist/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  535. package/mobile/dist/ui-kit/FormField/updateOrganizationFields.js +17 -0
  536. package/mobile/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -0
  537. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -1
  538. package/mobile/dist/ui-kit/Input/Input.js +2 -3
  539. package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
  540. package/mobile/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
  541. package/mobile/dist/ui-kit/Input/getValidStyle.js +6 -0
  542. package/mobile/dist/ui-kit/Input/getValidStyle.js.map +1 -0
  543. package/mobile/dist/ui-kit/RichText/RichText.js +3 -6
  544. package/mobile/dist/ui-kit/RichText/RichText.js.map +1 -1
  545. package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
  546. package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
  547. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  548. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -3
  549. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  550. package/mobile/dist/utils/safeJsonParse.d.ts +1 -0
  551. package/mobile/dist/utils/safeJsonParse.js +12 -0
  552. package/mobile/dist/utils/safeJsonParse.js.map +1 -0
  553. package/mobile/lib/api/RetailAPI/model/EOrganizationActivityTypes.d.ts +23 -0
  554. package/mobile/lib/api/RetailAPI/model/EOrganizationActivityTypes.js +2 -0
  555. package/mobile/lib/api/RetailAPI/model/EOrganizationActivityTypes.js.map +1 -0
  556. package/mobile/lib/api/RetailAPI/model/LeadFormData.d.ts +7 -0
  557. package/mobile/lib/api/RetailAPI/model/LeadFormData.js +2 -0
  558. package/mobile/lib/api/RetailAPI/model/LeadFormData.js.map +1 -0
  559. package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.d.ts +17 -0
  560. package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.js +95 -0
  561. package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.js.map +1 -0
  562. package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.d.ts +2 -2
  563. package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js +1 -0
  564. package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
  565. package/mobile/lib/api/dadataHints/dadataHintsType.d.ts +3 -0
  566. package/mobile/lib/common.css +1 -1
  567. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -8
  568. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  569. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -2
  570. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  571. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +147 -0
  572. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.js +2 -0
  573. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.js.map +1 -0
  574. package/mobile/lib/components/ApplicationLeadForm/consents.d.ts +3 -3
  575. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +2 -148
  576. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +3 -5
  577. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  578. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +2 -2
  579. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  580. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +2 -2
  581. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  582. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +5 -6
  583. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -19
  584. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  585. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -2
  586. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -9
  587. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  588. package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +15 -0
  589. package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.js +3 -0
  590. package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -0
  591. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +1 -2
  592. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  593. package/mobile/lib/components/CreditCardForm/CreditCardFormContent.d.ts +2 -2
  594. package/mobile/lib/components/CreditCardForm/calculateInputs.d.ts +2 -2
  595. package/mobile/lib/components/CreditCardForm/formStateMap.d.ts +2 -2
  596. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  597. package/mobile/lib/components/CreditCardForm/getCardData.d.ts +2 -2
  598. package/mobile/lib/components/CreditCardForm/getCardData.js.map +1 -1
  599. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +2 -2
  600. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  601. package/mobile/lib/components/CreditCardForm/getFifthStepData.d.ts +2 -2
  602. package/mobile/lib/components/CreditCardForm/getFifthStepData.js.map +1 -1
  603. package/mobile/lib/components/CreditCardForm/getFourthStepData.d.ts +2 -2
  604. package/mobile/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
  605. package/mobile/lib/components/CreditCardForm/getInitialFormState.d.ts +2 -2
  606. package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  607. package/mobile/lib/components/CreditCardForm/getSecondStepData.d.ts +2 -2
  608. package/mobile/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
  609. package/mobile/lib/components/CreditCardForm/getSixthStepData.d.ts +4 -4
  610. package/mobile/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  611. package/mobile/lib/components/CreditCardForm/getThirdStepData.d.ts +2 -2
  612. package/mobile/lib/components/CreditCardForm/getThirdStepData.js.map +1 -1
  613. package/mobile/lib/components/CreditCardForm/renderInputs.d.ts +2 -2
  614. package/mobile/lib/components/CreditCardForm/renderStep.d.ts +3 -3
  615. package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
  616. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +2 -2
  617. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  618. package/mobile/lib/components/CreditForm/CreditForm.js +1 -2
  619. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  620. package/mobile/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
  621. package/mobile/lib/components/CreditForm/calculateInputs.d.ts +2 -2
  622. package/mobile/lib/components/CreditForm/formStateMap.d.ts +2 -2
  623. package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
  624. package/mobile/lib/components/CreditForm/getCalcData.d.ts +2 -2
  625. package/mobile/lib/components/CreditForm/getCalcData.js.map +1 -1
  626. package/mobile/lib/components/CreditForm/getCreditFormTaskData.d.ts +2 -2
  627. package/mobile/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  628. package/mobile/lib/components/CreditForm/getFifthStepData.d.ts +2 -2
  629. package/mobile/lib/components/CreditForm/getFifthStepData.js.map +1 -1
  630. package/mobile/lib/components/CreditForm/getFirstStepData.d.ts +2 -2
  631. package/mobile/lib/components/CreditForm/getFirstStepData.js.map +1 -1
  632. package/mobile/lib/components/CreditForm/getFourthStepData.d.ts +2 -2
  633. package/mobile/lib/components/CreditForm/getFourthStepData.js.map +1 -1
  634. package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +2 -2
  635. package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  636. package/mobile/lib/components/CreditForm/getSecondStepData.d.ts +2 -2
  637. package/mobile/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  638. package/mobile/lib/components/CreditForm/getThirdStepData.d.ts +2 -2
  639. package/mobile/lib/components/CreditForm/getThirdStepData.js.map +1 -1
  640. package/mobile/lib/components/CreditForm/getZeroStepData.d.ts +2 -2
  641. package/mobile/lib/components/CreditForm/getZeroStepData.js.map +1 -1
  642. package/mobile/lib/components/CreditForm/renderInputs.d.ts +2 -2
  643. package/mobile/lib/components/CreditForm/renderStep.d.ts +3 -3
  644. package/mobile/lib/components/CreditForm/renderStep.js.map +1 -1
  645. package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +2 -2
  646. package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  647. package/mobile/lib/components/CreditForm/utils.d.ts +1 -1
  648. package/mobile/lib/hooks/useCreditFormStore.d.ts +13 -0
  649. package/mobile/lib/hooks/useCreditFormStore.js +5 -0
  650. package/mobile/lib/hooks/useCreditFormStore.js.map +1 -0
  651. package/mobile/lib/hooks/useLeadFormData.d.ts +1 -1
  652. package/mobile/lib/hooks/useLocalStorage.js +2 -1
  653. package/mobile/lib/hooks/useLocalStorage.js.map +1 -1
  654. package/mobile/lib/hooks/useSetter.d.ts +2 -0
  655. package/mobile/lib/hooks/useSetter.js +11 -0
  656. package/mobile/lib/hooks/useSetter.js.map +1 -0
  657. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  658. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  659. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +2 -10
  660. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
  661. package/mobile/lib/ui-kit/DialogManager/useDialog.d.ts +4 -1
  662. package/mobile/lib/ui-kit/DialogManager/useDialog.js.map +1 -1
  663. package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  664. package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  665. package/mobile/lib/ui-kit/FormField/Fields/AmountWorkersField.js +10 -2
  666. package/mobile/lib/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
  667. package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
  668. package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
  669. package/mobile/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js +10 -2
  670. package/mobile/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
  671. package/mobile/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js +10 -2
  672. package/mobile/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
  673. package/mobile/lib/ui-kit/FormField/Fields/InnField.js +4 -3
  674. package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  675. package/mobile/lib/ui-kit/FormField/Fields/OrganizationField.js +10 -2
  676. package/mobile/lib/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
  677. package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js +4 -1
  678. package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
  679. package/mobile/lib/ui-kit/FormField/SelectField.d.ts +1 -7
  680. package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
  681. package/mobile/lib/ui-kit/FormField/updateOrganizationFields.d.ts +4 -0
  682. package/mobile/lib/ui-kit/FormField/updateOrganizationFields.js +14 -0
  683. package/mobile/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -0
  684. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -1
  685. package/mobile/lib/ui-kit/Input/Input.js +1 -2
  686. package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
  687. package/mobile/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
  688. package/mobile/lib/ui-kit/Input/getValidStyle.js +3 -0
  689. package/mobile/lib/ui-kit/Input/getValidStyle.js.map +1 -0
  690. package/mobile/lib/ui-kit/RichText/RichText.js +3 -6
  691. package/mobile/lib/ui-kit/RichText/RichText.js.map +1 -1
  692. package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
  693. package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
  694. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +2 -5
  695. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -3
  696. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  697. package/mobile/lib/utils/safeJsonParse.d.ts +1 -0
  698. package/mobile/lib/utils/safeJsonParse.js +9 -0
  699. package/mobile/lib/utils/safeJsonParse.js.map +1 -0
  700. package/mobile/src/api/RetailAPI/model/EOrganizationActivityTypes.ts +23 -0
  701. package/mobile/src/api/RetailAPI/model/LeadFormData.ts +7 -0
  702. package/mobile/src/api/RetailAPI/utils/getOrganizationParams.ts +126 -0
  703. package/mobile/src/api/RetailAPI/utils/getUpdateUserProfile.ts +4 -2
  704. package/mobile/src/api/dadataHints/dadataHintsType.ts +3 -0
  705. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +6 -8
  706. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -2
  707. package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +5 -5
  708. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +152 -0
  709. package/mobile/src/components/ApplicationLeadForm/consents.ts +3 -3
  710. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -160
  711. package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
  712. package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +2 -2
  713. package/mobile/src/components/ApplicationLeadForm/{useApplicationLeadApi.ts → useApplicationLeadApi.tsx} +19 -34
  714. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +24 -10
  715. package/mobile/src/components/ApplicationLeadForm/useLeadFormStore.ts +12 -0
  716. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
  717. package/mobile/src/components/CreditCardForm/CreditCardFormContent.ts +2 -2
  718. package/mobile/src/components/CreditCardForm/calculateInputs.ts +2 -2
  719. package/mobile/src/components/CreditCardForm/formStateMap.tsx +2 -2
  720. package/mobile/src/components/CreditCardForm/getCardData.tsx +2 -2
  721. package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +3 -3
  722. package/mobile/src/components/CreditCardForm/getFifthStepData.ts +2 -2
  723. package/mobile/src/components/CreditCardForm/getFourthStepData.ts +2 -2
  724. package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +2 -2
  725. package/mobile/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
  726. package/mobile/src/components/CreditCardForm/getSixthStepData.ts +4 -4
  727. package/mobile/src/components/CreditCardForm/getThirdStepData.tsx +2 -2
  728. package/mobile/src/components/CreditCardForm/renderInputs.tsx +2 -2
  729. package/mobile/src/components/CreditCardForm/renderStep.tsx +4 -4
  730. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -3
  731. package/mobile/src/components/CreditForm/CreditForm.tsx +1 -2
  732. package/mobile/src/components/CreditForm/PendingStatusContent.tsx +2 -2
  733. package/mobile/src/components/CreditForm/calculateInputs.ts +2 -2
  734. package/mobile/src/components/CreditForm/formStateMap.tsx +2 -2
  735. package/mobile/src/components/CreditForm/getCalcData.ts +2 -2
  736. package/mobile/src/components/CreditForm/getCreditFormTaskData.ts +3 -3
  737. package/mobile/src/components/CreditForm/getFifthStepData.ts +2 -2
  738. package/mobile/src/components/CreditForm/getFirstStepData.tsx +2 -2
  739. package/mobile/src/components/CreditForm/getFourthStepData.ts +2 -2
  740. package/mobile/src/components/CreditForm/getInitialFormState.tsx +2 -2
  741. package/mobile/src/components/CreditForm/getSecondStepData.tsx +2 -2
  742. package/mobile/src/components/CreditForm/getThirdStepData.ts +2 -2
  743. package/mobile/src/components/CreditForm/getZeroStepData.ts +2 -2
  744. package/mobile/src/components/CreditForm/renderInputs.tsx +2 -2
  745. package/mobile/src/components/CreditForm/renderStep.tsx +4 -4
  746. package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +3 -3
  747. package/mobile/src/components/CreditForm/utils.ts +1 -1
  748. package/mobile/src/hooks/useCreditFormStore.tsx +13 -0
  749. package/mobile/src/hooks/useLeadFormData.ts +1 -1
  750. package/mobile/src/hooks/useLocalStorage.ts +2 -1
  751. package/mobile/src/hooks/useSetter.ts +16 -0
  752. package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
  753. package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +2 -11
  754. package/mobile/src/ui-kit/DialogManager/useDialog.tsx +2 -1
  755. package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +4 -4
  756. package/mobile/src/ui-kit/FormField/Fields/AmountWorkersField.tsx +12 -2
  757. package/mobile/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
  758. package/mobile/src/ui-kit/FormField/Fields/EmployerActivitiesField.tsx +12 -2
  759. package/mobile/src/ui-kit/FormField/Fields/EmployerOrganizationField.tsx +12 -2
  760. package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +5 -5
  761. package/mobile/src/ui-kit/FormField/Fields/OrganizationField.tsx +12 -2
  762. package/mobile/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +5 -1
  763. package/mobile/src/ui-kit/FormField/SelectField.tsx +1 -8
  764. package/mobile/src/ui-kit/FormField/updateOrganizationFields.ts +40 -0
  765. package/mobile/src/ui-kit/FormField/validators.ts +1 -1
  766. package/mobile/src/ui-kit/Input/Input.tsx +1 -3
  767. package/mobile/src/ui-kit/Input/getValidStyle.tsx +3 -0
  768. package/mobile/src/ui-kit/RichText/RichText.tsx +21 -21
  769. package/mobile/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
  770. package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +21 -26
  771. package/mobile/src/utils/safeJsonParse.ts +7 -0
  772. package/package.json +1 -1
  773. package/src/api/RetailAPI/model/EOrganizationActivityTypes.ts +23 -0
  774. package/src/api/RetailAPI/model/LeadFormData.ts +7 -0
  775. package/src/api/RetailAPI/utils/getOrganizationParams.ts +126 -0
  776. package/src/api/RetailAPI/utils/getUpdateUserProfile.ts +4 -2
  777. package/src/api/dadataHints/dadataHintsType.ts +3 -0
  778. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +15 -23
  779. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +6 -8
  780. package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -2
  781. package/src/components/ApplicationLeadForm/GroupedConsents.tsx +5 -5
  782. package/src/components/ApplicationLeadForm/LeadFormState.ts +152 -0
  783. package/src/components/ApplicationLeadForm/consents.ts +3 -3
  784. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -160
  785. package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
  786. package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +2 -2
  787. package/src/components/ApplicationLeadForm/{useApplicationLeadApi.ts → useApplicationLeadApi.tsx} +19 -34
  788. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +24 -10
  789. package/src/components/ApplicationLeadForm/useLeadFormStore.ts +12 -0
  790. package/src/components/CreditCardForm/CreditCardForm.fixture.mobile.tsx +25 -0
  791. package/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
  792. package/src/components/CreditCardForm/CreditCardFormContent.ts +2 -2
  793. package/src/components/CreditCardForm/calculateInputs.ts +2 -2
  794. package/src/components/CreditCardForm/formStateMap.tsx +2 -2
  795. package/src/components/CreditCardForm/getCardData.tsx +2 -2
  796. package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +3 -3
  797. package/src/components/CreditCardForm/getFifthStepData.ts +2 -2
  798. package/src/components/CreditCardForm/getFourthStepData.ts +2 -2
  799. package/src/components/CreditCardForm/getInitialFormState.tsx +2 -2
  800. package/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
  801. package/src/components/CreditCardForm/getSixthStepData.ts +4 -4
  802. package/src/components/CreditCardForm/getThirdStepData.tsx +2 -2
  803. package/src/components/CreditCardForm/renderInputs.tsx +2 -2
  804. package/src/components/CreditCardForm/renderStep.tsx +4 -4
  805. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -3
  806. package/src/components/CreditForm/CreditForm.fixture.mobile.tsx +30 -0
  807. package/src/components/CreditForm/CreditForm.tsx +1 -2
  808. package/src/components/CreditForm/PendingStatusContent.tsx +2 -2
  809. package/src/components/CreditForm/calculateInputs.ts +2 -2
  810. package/src/components/CreditForm/formStateMap.tsx +2 -2
  811. package/src/components/CreditForm/getCalcData.ts +2 -2
  812. package/src/components/CreditForm/getCreditFormTaskData.ts +3 -3
  813. package/src/components/CreditForm/getFifthStepData.ts +2 -2
  814. package/src/components/CreditForm/getFirstStepData.tsx +2 -2
  815. package/src/components/CreditForm/getFourthStepData.ts +2 -2
  816. package/src/components/CreditForm/getInitialFormState.tsx +2 -2
  817. package/src/components/CreditForm/getSecondStepData.tsx +2 -2
  818. package/src/components/CreditForm/getThirdStepData.ts +2 -2
  819. package/src/components/CreditForm/getZeroStepData.ts +2 -2
  820. package/src/components/CreditForm/renderInputs.tsx +2 -2
  821. package/src/components/CreditForm/renderStep.tsx +4 -4
  822. package/src/components/CreditForm/useCreditFormAPI.tsx +3 -3
  823. package/src/components/CreditForm/utils.ts +1 -1
  824. package/src/hooks/useCreditFormStore.tsx +13 -0
  825. package/src/hooks/useLeadFormData.ts +1 -1
  826. package/src/hooks/useLocalStorage.ts +2 -1
  827. package/src/hooks/useSetter.ts +16 -0
  828. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
  829. package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +2 -11
  830. package/src/ui-kit/DialogManager/useDialog.tsx +2 -1
  831. package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +4 -4
  832. package/src/ui-kit/FormField/Fields/AmountWorkersField.tsx +12 -2
  833. package/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
  834. package/src/ui-kit/FormField/Fields/EmployerActivitiesField.tsx +12 -2
  835. package/src/ui-kit/FormField/Fields/EmployerOrganizationField.tsx +12 -2
  836. package/src/ui-kit/FormField/Fields/InnField.tsx +5 -5
  837. package/src/ui-kit/FormField/Fields/OrganizationField.tsx +12 -2
  838. package/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +5 -1
  839. package/src/ui-kit/FormField/SelectField.tsx +1 -8
  840. package/src/ui-kit/FormField/updateOrganizationFields.ts +40 -0
  841. package/src/ui-kit/FormField/validators.ts +1 -1
  842. package/src/ui-kit/Input/Input.tsx +1 -3
  843. package/src/ui-kit/Input/getValidStyle.tsx +3 -0
  844. package/src/ui-kit/RichText/RichText.tsx +21 -21
  845. package/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
  846. package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.fixture.tsx +7 -10
  847. package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +21 -26
  848. package/src/utils/safeJsonParse.ts +7 -0
  849. package/bundle/ui-kit/RichText/getHtmlText.d.ts +0 -1
  850. package/dist/ui-kit/RichText/getHtmlText.d.ts +0 -1
  851. package/dist/ui-kit/RichText/getHtmlText.js +0 -5
  852. package/dist/ui-kit/RichText/getHtmlText.js.map +0 -1
  853. package/lib/ui-kit/RichText/getHtmlText.d.ts +0 -1
  854. package/lib/ui-kit/RichText/getHtmlText.js +0 -2
  855. package/lib/ui-kit/RichText/getHtmlText.js.map +0 -1
  856. package/mobile/bundle/ui-kit/RichText/getHtmlText.d.ts +0 -1
  857. package/mobile/dist/ui-kit/RichText/getHtmlText.d.ts +0 -1
  858. package/mobile/dist/ui-kit/RichText/getHtmlText.js +0 -5
  859. package/mobile/dist/ui-kit/RichText/getHtmlText.js.map +0 -1
  860. package/mobile/lib/ui-kit/RichText/getHtmlText.d.ts +0 -1
  861. package/mobile/lib/ui-kit/RichText/getHtmlText.js +0 -2
  862. package/mobile/lib/ui-kit/RichText/getHtmlText.js.map +0 -1
  863. package/mobile/src/ui-kit/RichText/getHtmlText.tsx +0 -1
  864. package/src/ui-kit/RichText/getHtmlText.tsx +0 -1
@@ -664,15 +664,11 @@
664
664
  ? 'bg-secondary-light text-primary-main'
665
665
  : 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black'), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null;
666
666
 
667
- const getHtmlText = (html) => html.replace(/<\/?[^>]+\/?>/g, '').trim();
668
-
669
- const EMPTY_HTML = '<p><br></p>';
670
- const RichText = JSX((props) => {
671
- const { __html = '', richVersion = '', itemSize = 'list-m', isDotted = true } = props;
667
+ const RichText = JSX(({ __html = '', richVersion = '', itemSize = 'list-m', isDotted = true, children }) => {
672
668
  const dotStyle = isDotted ? '' : 'without-dots';
673
- return __html && getHtmlText(__html) !== EMPTY_HTML ? (
669
+ return __html || children ? (
674
670
  /* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
675
- jsx("div", { "data-component": "rich-text-container", children: jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle), dangerouslySetInnerHTML: { __html } }) })) : null;
671
+ jsx("div", { "data-component": "rich-text-container", children: jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle), dangerouslySetInnerHTML: __html ? { __html } : undefined, children: children }) })) : null;
676
672
  });
677
673
 
678
674
  const renderBenefitDescription = (description, i) => description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description }, `description-${i}`)) : null;
@@ -1262,6 +1258,8 @@
1262
1258
 
1263
1259
  const inputValidStyle = 'border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded';
1264
1260
 
1261
+ const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
1262
+
1265
1263
  const renderLabel = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
1266
1264
 
1267
1265
  const Input = JSX(
@@ -1281,7 +1279,6 @@
1281
1279
  const validStyle = getValidStyle(valid);
1282
1280
  return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { className: "space-y-xs", children: [renderLabel(label), isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle$1, validStyle), id: style('textarea', id), name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, disabled: disabled }, key)) : (jsx("input", { type: type, className: style('h-14', defaultStyle$1, paddingStyle, validStyle), ref: inputRef, id: id, name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern, disabled: disabled }, key))] }), children] }));
1283
1281
  });
1284
- const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
1285
1282
  const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
1286
1283
 
1287
1284
  const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
@@ -2663,6 +2660,154 @@
2663
2660
  const ITEMS_CREDIT_AMOUNT = ['От 1 000 ₽', 'До 1 000 000 000 ₽'];
2664
2661
  const AmountField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0443\u043C\u043C\u0430, \u20BD", items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })));
2665
2662
 
2663
+ function copy(source, target) {
2664
+ for (const [k, v] of source.entries()) {
2665
+ if (v !== null && v !== undefined) {
2666
+ target.setItem(k, v);
2667
+ }
2668
+ else {
2669
+ target.removeItem(k);
2670
+ }
2671
+ }
2672
+ }
2673
+
2674
+ function replicate(primary, secondary) {
2675
+ copy(primary, secondary);
2676
+ copy(secondary, primary);
2677
+ return primary.bus.watch(({ type, event }) => {
2678
+ if (event !== null && event !== undefined) {
2679
+ secondary.setItem(type, event);
2680
+ }
2681
+ else {
2682
+ secondary.removeItem(type);
2683
+ }
2684
+ });
2685
+ }
2686
+
2687
+ class StorageAdapter {
2688
+ storage;
2689
+ bus;
2690
+ get size() {
2691
+ return this.storage?.length ?? 0;
2692
+ }
2693
+ constructor(storage, bus = new EventBus()) {
2694
+ this.storage = storage;
2695
+ this.bus = bus;
2696
+ }
2697
+ hasItem(key) {
2698
+ return Boolean(this.storage?.getItem(String(key)));
2699
+ }
2700
+ getItem(key) {
2701
+ const _ = this.storage?.getItem(String(key)) ?? null;
2702
+ try {
2703
+ return JSON.parse(String(_));
2704
+ }
2705
+ catch (ex) {
2706
+ return null;
2707
+ }
2708
+ }
2709
+ entries() {
2710
+ return Array.from({ length: this.size }, (_, i) => {
2711
+ const k = String(this.storage?.key(i));
2712
+ return [k, this.getItem(k)];
2713
+ });
2714
+ }
2715
+ setItem(key, value) {
2716
+ if (value !== null) {
2717
+ this.storage?.setItem(String(key), JSON.stringify(value));
2718
+ }
2719
+ else {
2720
+ this.storage?.removeItem(String(key));
2721
+ }
2722
+ this.bus?.subject(key, value);
2723
+ }
2724
+ removeItem(key) {
2725
+ this.storage?.removeItem(String(key));
2726
+ this.bus?.subject(key, null);
2727
+ }
2728
+ }
2729
+
2730
+ class Store {
2731
+ bus;
2732
+ store = new Map();
2733
+ get size() {
2734
+ return this.store.size;
2735
+ }
2736
+ constructor(bus = new EventBus()) {
2737
+ this.bus = bus;
2738
+ }
2739
+ hasItem(key) {
2740
+ return this.store.has(key);
2741
+ }
2742
+ getItem(key) {
2743
+ return this.store.get(key);
2744
+ }
2745
+ entries() {
2746
+ return this.store.entries();
2747
+ }
2748
+ setItem(key, value) {
2749
+ this.store.set(key, value);
2750
+ this.bus.subject(key, value);
2751
+ }
2752
+ removeItem(key) {
2753
+ this.store.delete(key);
2754
+ this.bus.subject(key, null);
2755
+ }
2756
+ }
2757
+
2758
+ function useRerender() {
2759
+ const [, setCount] = useState(0);
2760
+ return useCallback(() => setCount(_ => (_ + 1) % (1 << 16)), []);
2761
+ }
2762
+
2763
+ const DEFAULT_METHODS = {};
2764
+ /**
2765
+ * MobX like reactivity (simplified).
2766
+ * Can be used to migrate from Redux/MobX or something else
2767
+ *
2768
+ * @param store
2769
+ * @returns reactive proxy backed by store
2770
+ */
2771
+ function useStore(store, methods = DEFAULT_METHODS) {
2772
+ const deps = useRef(null);
2773
+ const render = useRerender();
2774
+ useEffect(() => store.bus.watch(ev => {
2775
+ if (deps.current?.has(String(ev.type))) {
2776
+ render();
2777
+ }
2778
+ }), [store, render]);
2779
+ return useMemo(() => new Proxy(methods, {
2780
+ get(_, key) {
2781
+ deps.current ||= new Set();
2782
+ deps.current.add(key);
2783
+ return store.getItem(key);
2784
+ },
2785
+ has(_, key) {
2786
+ deps.current ||= new Set();
2787
+ deps.current.add(key);
2788
+ return store.hasItem(key);
2789
+ },
2790
+ set(_, key, value) {
2791
+ store.setItem(key, value);
2792
+ return true;
2793
+ },
2794
+ deleteProperty(_, key) {
2795
+ store.removeItem(key);
2796
+ return true;
2797
+ }
2798
+ }), [store]);
2799
+ }
2800
+
2801
+ const localStore = new Store(); // localStorage cache
2802
+ replicate(localStore, new StorageAdapter(globalThis?.localStorage));
2803
+ function useLocalStore(methods) {
2804
+ return useStore(localStore, methods);
2805
+ }
2806
+
2807
+ const useCreditFormStore = () => {
2808
+ return useLocalStore();
2809
+ };
2810
+
2666
2811
  const SelectField = UniBlock(({ field, source, fieldName, input, placeholder = 'Выберите из списка',
2667
2812
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2668
2813
  options, ...rest }) => {
@@ -2674,8 +2819,14 @@
2674
2819
  });
2675
2820
 
2676
2821
  const AmountWorkersField = JSX(({ field, input }) => {
2677
- const { data: amountWorkers } = useLeadFormData('EMPLOYEES_NUMBER');
2678
- return (jsx(SelectField, { field: field, source: amountWorkers, label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u0432 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", fieldName: "amountWorkers", input: input }));
2822
+ const { data } = useLeadFormData('EMPLOYEES_NUMBER');
2823
+ const store = useCreditFormStore();
2824
+ useEffect(() => {
2825
+ if (data) {
2826
+ store.amountWorkers = data;
2827
+ }
2828
+ }, [data]);
2829
+ return (jsx(SelectField, { field: field, source: store.amountWorkers ?? [], label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u0432 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", fieldName: "amountWorkers", input: input }));
2679
2830
  });
2680
2831
 
2681
2832
  const AnnualRevenueField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, input?.required) })));
@@ -2980,9 +3131,18 @@
2980
3131
  return Array.isArray(data) ? data : [];
2981
3132
  };
2982
3133
 
3134
+ const safeJsonParse = (data) => {
3135
+ try {
3136
+ return JSON.parse(String(data));
3137
+ }
3138
+ catch (ex) {
3139
+ return null;
3140
+ }
3141
+ };
3142
+
2983
3143
  function useLocalStorage(key) {
2984
3144
  const initialValue = globalThis.localStorage?.getItem(key);
2985
- const [storedValue, setStoredValue] = useState(initialValue ? JSON.parse(initialValue) : null);
3145
+ const [storedValue, setStoredValue] = useState(initialValue ? safeJsonParse(initialValue) : null);
2986
3146
  const setValue = useCallback((value) => {
2987
3147
  setStoredValue((oldValue) => {
2988
3148
  const newValue = value instanceof Function ? value(oldValue) : value;
@@ -3429,7 +3589,7 @@
3429
3589
  const handleChange = useCallback((_) => {
3430
3590
  field(FIELD_NAME$9).onChange?.(_);
3431
3591
  }, []);
3432
- return (jsx(CalculatorCredit, { ...params?.calcData, defaultParams: defaultValueAdapter(field(FIELD_NAME$9).value), onChange: handleChange }));
3592
+ return (jsx(CalculatorCredit, { ...params?.calcData, padding: "p-0", defaultParams: defaultValueAdapter(field(FIELD_NAME$9).value), onChange: handleChange }));
3433
3593
  });
3434
3594
 
3435
3595
  const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
@@ -3495,13 +3655,25 @@
3495
3655
  });
3496
3656
 
3497
3657
  const EmployerActivitiesField = JSX(({ field, input }) => {
3498
- const { data: employerActivities } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
3499
- return (jsx(SelectField, { field: field, source: employerActivities, label: "\u0412\u0438\u0434 \u0434\u0435\u044F\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438-\u0440\u0430\u0431\u043E\u0442\u043E\u0434\u0430\u0442\u0435\u043B\u044F", fieldName: "employerActivities", input: input }));
3658
+ const { data } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
3659
+ const store = useCreditFormStore();
3660
+ useEffect(() => {
3661
+ if (data) {
3662
+ store.employerActivities = data;
3663
+ }
3664
+ }, [data]);
3665
+ return (jsx(SelectField, { field: field, source: store.employerActivities ?? [], label: "\u0412\u0438\u0434 \u0434\u0435\u044F\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438-\u0440\u0430\u0431\u043E\u0442\u043E\u0434\u0430\u0442\u0435\u043B\u044F", fieldName: "employerActivities", input: input }));
3500
3666
  });
3501
3667
 
3502
3668
  const EmployerOrganizationField = JSX(({ field, input }) => {
3503
- const { data: employerOrganization } = useLeadFormData('ORGANIZATION_KIND');
3504
- return (jsx(SelectField, { field: field, source: employerOrganization, label: "\u0412\u0438\u0434 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043E\u0442\u043E\u0434\u0430\u0442\u0435\u043B\u044F", fieldName: "employerOrganization", input: input }));
3669
+ const { data } = useLeadFormData('ORGANIZATION_KIND');
3670
+ const store = useCreditFormStore();
3671
+ useEffect(() => {
3672
+ if (data) {
3673
+ store.employerOrganization = data;
3674
+ }
3675
+ }, [data]);
3676
+ return (jsx(SelectField, { field: field, source: store.employerOrganization ?? [], label: "\u0412\u0438\u0434 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043E\u0442\u043E\u0434\u0430\u0442\u0435\u043B\u044F", fieldName: "employerOrganization", input: input }));
3505
3677
  });
3506
3678
 
3507
3679
  const EmploymentField = JSX(({ field, input }) => {
@@ -3555,11 +3727,118 @@
3555
3727
  return (jsx(SelectField, { field: field, source: housing, label: "\u0422\u0438\u043F \u0436\u0438\u043B\u044C\u044F", fieldName: "housing", input: input }));
3556
3728
  });
3557
3729
 
3730
+ const getOrganizationActivityType = (options, okved) => {
3731
+ if (!okved) {
3732
+ return null;
3733
+ }
3734
+ const getOptionByKey = getOptionOp(options);
3735
+ const okvedType = +okved?.split('.')[0];
3736
+ const secondOkvedType = +okved?.split('.')[1];
3737
+ switch (okvedType) {
3738
+ case 1:
3739
+ return getOptionByKey("AGRICULTURE" /* EOrganizationActivityTypes.AGRICULTURE */);
3740
+ case 35:
3741
+ return getOptionByKey("FUEL_AND_ENERGY" /* EOrganizationActivityTypes.FUEL_AND_ENERGY */);
3742
+ case 41:
3743
+ case 42:
3744
+ case 43:
3745
+ return getOptionByKey("CONSTRUCTION" /* EOrganizationActivityTypes.CONSTRUCTION */);
3746
+ case 46:
3747
+ case 47:
3748
+ return getOptionByKey("TRADE" /* EOrganizationActivityTypes.TRADE */);
3749
+ case 55:
3750
+ case 79:
3751
+ return getOptionByKey("TOURISM" /* EOrganizationActivityTypes.TOURISM */);
3752
+ case 62:
3753
+ return getOptionByKey("TECHNOLOGY" /* EOrganizationActivityTypes.TECHNOLOGY */);
3754
+ case 63:
3755
+ return getOptionByKey("CONSULTING_SERVICE" /* EOrganizationActivityTypes.CONSULTING_SERVICE */);
3756
+ case 64:
3757
+ return getOptionByKey("BANK" /* EOrganizationActivityTypes.BANK */);
3758
+ case 65:
3759
+ return getOptionByKey("INSURER" /* EOrganizationActivityTypes.INSURER */);
3760
+ case 66:
3761
+ return getOptionByKey("FINANCIAL_INSTITUTIONS" /* EOrganizationActivityTypes.FINANCIAL_INSTITUTIONS */);
3762
+ case 72:
3763
+ case 74:
3764
+ return getOptionByKey("SCIENCE" /* EOrganizationActivityTypes.SCIENCE */);
3765
+ case 80:
3766
+ return getOptionByKey("SECURITY" /* EOrganizationActivityTypes.SECURITY */);
3767
+ case 84: {
3768
+ if (secondOkvedType < 22) {
3769
+ return getOptionByKey("GOVERNANCE" /* EOrganizationActivityTypes.GOVERNANCE */);
3770
+ }
3771
+ if (secondOkvedType === 22) {
3772
+ return getOptionByKey("ARMY" /* EOrganizationActivityTypes.ARMY */);
3773
+ }
3774
+ return getOptionByKey("OTHER_SECTORS" /* EOrganizationActivityTypes.OTHER_SECTORS */);
3775
+ }
3776
+ case 85:
3777
+ return getOptionByKey("EDUCATION" /* EOrganizationActivityTypes.EDUCATION */);
3778
+ case 86:
3779
+ return getOptionByKey("HEALTHCARE" /* EOrganizationActivityTypes.HEALTHCARE */);
3780
+ case 87:
3781
+ return getOptionByKey("SOCIAL_SPHERE" /* EOrganizationActivityTypes.SOCIAL_SPHERE */);
3782
+ default: {
3783
+ if (okvedType >= 10 && okvedType <= 33) {
3784
+ return getOptionByKey("INDUSTRY" /* EOrganizationActivityTypes.INDUSTRY */);
3785
+ }
3786
+ if (okvedType >= 5 && okvedType <= 9) {
3787
+ return getOptionByKey("FUEL_AND_ENERGY" /* EOrganizationActivityTypes.FUEL_AND_ENERGY */);
3788
+ }
3789
+ if (okvedType >= 49 && okvedType <= 53) {
3790
+ return getOptionByKey("TRANSPORT" /* EOrganizationActivityTypes.TRANSPORT */);
3791
+ }
3792
+ return getOptionByKey("OTHER_SECTORS" /* EOrganizationActivityTypes.OTHER_SECTORS */);
3793
+ }
3794
+ }
3795
+ };
3796
+ const getEmployeesNumberOption = (options, count) => {
3797
+ const [option] = [options?.find((_) => Number(count) <= Number(_.description))].map((_) => ({
3798
+ key: _?.key ?? '',
3799
+ text: _?.value ?? '',
3800
+ }));
3801
+ return option;
3802
+ };
3803
+ const getOrganizationKind = (options, okopf) => {
3804
+ const getOptionByKey = getOptionOp(options);
3805
+ if ([40001, 40002, 71610].includes(okopf)) {
3806
+ return getOptionByKey('FOREIGN');
3807
+ }
3808
+ return getOptionByKey('RUSSIAN');
3809
+ };
3810
+ const getOrganizationType = (options, okopf, inn) => {
3811
+ const getOptionByKey = getOptionOp(options);
3812
+ if (inn === '7725114488') {
3813
+ return getOptionByKey('RSHB');
3814
+ }
3815
+ if (okopf === 50102) {
3816
+ return getOptionByKey('SOLE_TRADER');
3817
+ }
3818
+ if (okopf >= 75000 && okopf <= 75505 && okopf !== 75500) {
3819
+ return getOptionByKey('BUDGETARY');
3820
+ }
3821
+ return getOptionByKey('COMMERCIAL');
3822
+ };
3823
+ const getOptionOp = (options) => (key) => options.map((_) => ({ key, text: _.value || '' })).find((_) => _.key === key) ?? null;
3824
+
3825
+ const updateOrganizationFields = (store, field, item) => {
3826
+ const inn = item.data?.inn ?? '';
3827
+ const okopf = Number(item.data?.opf?.code);
3828
+ const okved = item.data?.okved ?? '';
3829
+ field?.('legalForm')?.onChange?.(item.data?.opf?.short);
3830
+ field?.('organizationAddress')?.onChange?.(getAddressFromDaDataItem(item.data?.address));
3831
+ field?.('amountWorkers')?.onChange?.(getEmployeesNumberOption(store?.amountWorkers, item.data?.employee_count));
3832
+ field?.('employerActivities')?.onChange?.(getOrganizationActivityType(store?.employerActivities ?? [], okved));
3833
+ field?.('organization')?.onChange?.(getOrganizationType(store?.organization ?? [], okopf, inn));
3834
+ field?.('employerOrganization')?.onChange?.(getOrganizationKind(store?.employerOrganization ?? [], okopf));
3835
+ };
3836
+
3558
3837
  const InnField = JSX(({ field, input }) => {
3838
+ const store = useCreditFormStore();
3559
3839
  const onDaDataChange = useCallback((item) => {
3560
- field?.('organizationAddress')?.onChange?.(getAddressFromDaDataItem(item.data?.address));
3561
3840
  field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
3562
- field?.('legalForm')?.onChange?.(item.data?.opf?.short);
3841
+ updateOrganizationFields(store, field, item);
3563
3842
  }, []);
3564
3843
  return (jsx(InputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
3565
3844
  });
@@ -3619,14 +3898,21 @@
3619
3898
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
3620
3899
 
3621
3900
  const OrganizationField = JSX(({ field, input }) => {
3622
- const { data: organization } = useLeadFormData('ORGANIZATION_TYPE');
3623
- return (jsx(SelectField, { field: field, source: organization, label: "\u0422\u0438\u043F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", fieldName: "organization", input: input }));
3901
+ const { data } = useLeadFormData('ORGANIZATION_TYPE');
3902
+ const store = useCreditFormStore();
3903
+ useEffect(() => {
3904
+ if (data) {
3905
+ store.organization = data;
3906
+ }
3907
+ }, [data]);
3908
+ return (jsx(SelectField, { field: field, source: store.organization ?? [], label: "\u0422\u0438\u043F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", fieldName: "organization", input: input }));
3624
3909
  });
3625
3910
 
3626
3911
  const OrganizationNameField = JSX(({ field, input }) => {
3912
+ const store = useCreditFormStore();
3627
3913
  const onDaDataChange = useCallback((item) => {
3628
3914
  field?.('inn')?.onChange?.(item.data?.inn);
3629
- field?.('legalForm')?.onChange?.(item.data?.opf?.short);
3915
+ updateOrganizationFields(store, field, item);
3630
3916
  }, []);
3631
3917
  return (jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...getValidation(field('organizationName'), validatorObj.organizationName, input?.required), onDaDataChange: onDaDataChange }));
3632
3918
  });
@@ -4155,58 +4441,6 @@
4155
4441
  },
4156
4442
  ];
4157
4443
 
4158
- const initialFormState = {
4159
- typeForm: '',
4160
- region: { key: '', text: '' },
4161
- addressBranch: { key: '', text: '' },
4162
- surname: '',
4163
- name: '',
4164
- phone: '',
4165
- secondaryPhone: '',
4166
- organizationPhone: '',
4167
- comment: '',
4168
- product: '',
4169
- partnerComments: '',
4170
- annualRevenue: '',
4171
- term: 12,
4172
- amount: 100000,
4173
- acquiringType: ACQUIRING_TYPES[0],
4174
- serviceType: SERVICE_TYPES[0],
4175
- feedbackMethod: FEEDBACK_METHOD[0],
4176
- serviceDirection: SERVICE_DIRECTIONS[0],
4177
- vedTypes: VED_TYPES[0],
4178
- birthday: undefined,
4179
- limitedBirthday: undefined,
4180
- isClient: false,
4181
- onlineCheckout: false,
4182
- posTerminal: false,
4183
- consentToReceiveMaterials: false,
4184
- consentDataProcessing: false,
4185
- processPersonalDataFlg: false,
4186
- consentProviderFlg: false,
4187
- consentOthersFlg: false,
4188
- consentInformFlg: false,
4189
- addressRegistration: '',
4190
- participantDateRegistration: undefined,
4191
- currency: '',
4192
- paymentSystem: '',
4193
- cardCategory: { key: '', text: '' },
4194
- codeWord: '',
4195
- addressRetail: { key: '', text: '' },
4196
- };
4197
- const getInitialFormState$2 = (inputs, savedForm, typeForm = '') => {
4198
- if (savedForm) {
4199
- const formStateCopy = { ...savedForm };
4200
- formStateCopy.limitedBirthday = new Date(formStateCopy?.limitedBirthday || 0);
4201
- return formStateCopy;
4202
- }
4203
- const formState = Object.fromEntries(inputs.map((_) => [
4204
- _.name,
4205
- (_.fieldType === 'ved' && _?.defaultValue) || initialFormState[_.name || ''],
4206
- ]));
4207
- return { ...formState, typeForm: { key: typeForm, text: '' } };
4208
- };
4209
-
4210
4444
  const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
4211
4445
 
4212
4446
  const createDraftTask = async (body) => {
@@ -4220,6 +4454,7 @@
4220
4454
 
4221
4455
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
4222
4456
 
4457
+ // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
4223
4458
  const getUpdateUserProfileData = (profileId, formData) => {
4224
4459
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
4225
4460
  return {
@@ -4242,6 +4477,16 @@
4242
4477
  };
4243
4478
  };
4244
4479
 
4480
+ const useSetter = (target, key) => useCallback((value) => {
4481
+ const newValue = value instanceof Function ? value(target[key]) : value;
4482
+ if (newValue !== null && newValue !== undefined) {
4483
+ target[key] = newValue;
4484
+ }
4485
+ else {
4486
+ delete target[key];
4487
+ }
4488
+ }, [target, key]);
4489
+
4245
4490
  const sendCode = (body) => fetchRetailJSON('/sms/sendCode', 'POST', body).then((res) => !isErrorResult(res, body.phoneNumber));
4246
4491
  const isErrorResult = (res, phoneNumber) => Boolean(res) &&
4247
4492
  typeof res !== 'string' &&
@@ -4361,7 +4606,7 @@
4361
4606
  });
4362
4607
  const getInputStyle = (index, values, hasError = false) => {
4363
4608
  const isInputEmpty = !values[index];
4364
- return `w-20 h-24 text-5xl text-center p-lg m-2 border ${hasError && isInputEmpty ? 'border-error' : 'border-gray'} rounded-md caret-transparent outline-none`;
4609
+ return `w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${getValidStyle(!hasError || !isInputEmpty)} rounded-md caret-transparent outline-none`;
4365
4610
  };
4366
4611
 
4367
4612
  const SubmitButton = JSX(({ isDisabled, onClick, text }) => {
@@ -4421,10 +4666,11 @@
4421
4666
  };
4422
4667
  };
4423
4668
 
4424
- const VerifyPhoneDialog = JSX(({ title, description, __html, code = true, codeLength = 4, textButton = 'Далее', phoneNumber = '+79999999999', onSuccess = noop, onClose = noop, }) => {
4669
+ const VerifyPhoneDialog = JSX(({ phone, code = true, codeLength = 4, consents, onSuccess = noop, onClose = noop }) => {
4425
4670
  const [values, setValues] = useState(Array(codeLength).fill(''));
4426
4671
  const { handleSubmit, hasError, errorText, isLoading, timeNextReq, isSubmitButtonDisabled, setTimeNextReq, setIsTimerStarted, setAttempts, } = useVerifyPhoneDialogSubmit({ values, onSuccess });
4427
4672
  const captchaDialog = useDialog(CaptchaDialog);
4673
+ const phoneNumber = formatPhone(phone);
4428
4674
  const handleSendCode = useCallback(async () => {
4429
4675
  const isSuccessSendCode = await sendCode({
4430
4676
  phoneNumber,
@@ -4442,9 +4688,9 @@
4442
4688
  useEffect(() => {
4443
4689
  handleSendCode();
4444
4690
  }, []);
4445
- return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center rounded-md", children: [jsx(Headline, { className: "w-full", title: title, description: description, headlineVersion: "XS", isEmbedded: true, as: "h6" }), code ? (jsx(InputCode, { values: values, setValues: setValues, errorText: errorText, hasError: hasError })) : null, renderText$1(timeNextReq, setTimeNextReq, handleSendCode), jsx(RichText, { itemSize: "list-s", __html: __html }), renderTextButton(textButton, isSubmitButtonDisabled, handleSubmit), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
4691
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center rounded-md", children: [jsx(Headline, { className: "w-full", title: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430", description: `Мы отправили код на ${phone}`, headlineVersion: "XS", isEmbedded: true, as: "h6" }), code ? (jsx(InputCode, { values: values, setValues: setValues, errorText: errorText, hasError: hasError })) : null, renderText$1(timeNextReq, setTimeNextReq, handleSendCode), jsxs(RichText, { itemSize: "list-s", children: [jsx("span", { children: "\u0412\u0432\u043E\u0434\u044F \u043A\u043E\u0434, \u044F \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044E, \u0447\u0442\u043E \u043E\u0437\u043D\u0430\u043A\u043E\u043C\u043B\u0435\u043D \u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u044E: " }), jsx("ul", { children: consents?.map((_, i) => (jsx("li", { children: _ }, `${_}-${i}`))) })] }), renderNextButton(isSubmitButtonDisabled, handleSubmit), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
4446
4692
  });
4447
- const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
4693
+ const renderNextButton = (isDisabled, onClick) => (jsx(SubmitButton, { text: "\u0414\u0430\u043B\u0435\u0435", isDisabled: isDisabled, onClick: onClick }));
4448
4694
  const renderText$1 = (timeNextReq, setTimeNextReq, handleSendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-base", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "text-base ml-1", time: timeNextReq, setTime: setTimeNextReq })] })) : (jsx(LinkButton, { onClick: handleSendCode, className: "text-primary-main", children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }));
4449
4695
 
4450
4696
  const defaultConsentText = {
@@ -4474,7 +4720,7 @@
4474
4720
  }
4475
4721
  }, []);
4476
4722
  const consentText = showRefuseContent ? refuseConsentText : defaultConsentText;
4477
- return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx("div", { role: "button", onClick: openDocument, children: jsx(Heading, { className: "text-center text-balance", headingType: "h2", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleSubmit, children: "\u0414\u0430\u043B\u0435\u0435" })] }) }));
4723
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx("div", { role: "button", onClick: openDocument, children: jsx(Heading, { className: "text-center text-balance", headingType: "h2", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleSubmit, children: "\u0414\u0430\u043B\u0435\u0435" })] }) }));
4478
4724
  });
4479
4725
 
4480
4726
  const useConsentBkiDialog = (onClose) => {
@@ -4500,7 +4746,8 @@
4500
4746
  const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
4501
4747
  if (confirmStatus === 'SIGNED' && phone) {
4502
4748
  verifyPhoneDialog.open({
4503
- ...verifyPhoneContent$1(phone),
4749
+ phone,
4750
+ consents: ['согласие на запрос информации в БКИ'],
4504
4751
  onSuccess: handleSuccessVerify(profileId),
4505
4752
  });
4506
4753
  }
@@ -4512,14 +4759,6 @@
4512
4759
  open: (phone, profileId) => open({ onSubmit: handleSubmitBkiConstent(phone, profileId), onClose }),
4513
4760
  };
4514
4761
  };
4515
- const verifyPhoneContent$1 = (phone) => ({
4516
- title: 'Подтвердите номер телефона',
4517
- description: `Мы отправили код на ${phone}`,
4518
- phoneNumber: formatPhone(phone),
4519
- textButton: 'Далее',
4520
- __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
4521
- <ul><li>согласие на запрос информации в БКИ</li></ul>`,
4522
- });
4523
4762
 
4524
4763
  const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
4525
4764
 
@@ -4542,7 +4781,7 @@
4542
4781
  }
4543
4782
  onClose?.();
4544
4783
  }, []);
4545
- 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", 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: "flex items-center justify-between w-full m-0", children: [jsx(Button, { type: "button", onClick: handleAuth, 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, children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
4784
+ 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: "flex flex-wrap gap-lg w-full", children: [jsx(Button, { type: "button", onClick: handleAuth, 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, children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
4546
4785
  });
4547
4786
 
4548
4787
  const useEsiaLoginDialog = (nextStepLink) => {
@@ -4652,20 +4891,20 @@
4652
4891
  };
4653
4892
  };
4654
4893
 
4655
- const useApplicationLeadApi = ({ inputs, programId, nextStepLink, saveForm, }) => {
4894
+ const useLeadFormStore = () => useLocalStore();
4895
+
4896
+ const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
4656
4897
  const [responseStatus, setResponseStatus] = useState('');
4657
- const [, setTaskId] = useLocalStorage('taskId');
4658
- const [, setProfileId] = useLocalStorage('profileId');
4659
- const [, setParticipantId] = useLocalStorage('participantId');
4660
- const [, setProgramId] = useLocalStorage('programId');
4898
+ const leadFormStore = useLeadFormStore();
4899
+ const saveForm = useSetter(leadFormStore, 'leadForm');
4661
4900
  const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
4662
4901
  const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
4663
4902
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
4664
4903
  const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
4665
- setParticipantId(participantId);
4666
- setTaskId(taskId);
4667
- setProfileId(profileId);
4668
- setProgramId(programNumber);
4904
+ leadFormStore.participantId = participantId;
4905
+ leadFormStore.taskId = taskId;
4906
+ leadFormStore.profileId = profileId;
4907
+ leadFormStore.programId = programNumber;
4669
4908
  }, []);
4670
4909
  // eslint-disable-next-line consistent-return
4671
4910
  const handleSubmit = useCallback(async (formData) => {
@@ -4698,7 +4937,8 @@
4698
4937
  .filter((_) => formData[_])
4699
4938
  .map((_) => CONSENTS[_]?.text);
4700
4939
  verifyPhoneDialog.open({
4701
- ...verifyPhoneContent(formData?.phone, acceptedConsents),
4940
+ phone: formData?.phone,
4941
+ consents: acceptedConsents,
4702
4942
  onSuccess: handleSuccessVerify,
4703
4943
  });
4704
4944
  }
@@ -4733,14 +4973,6 @@
4733
4973
  saveUserData({ participantId, taskId, profileId, programId });
4734
4974
  saveForm(formData);
4735
4975
  };
4736
- const verifyPhoneContent = (phone, consents) => ({
4737
- title: 'Подтвердите номер телефона',
4738
- description: `Мы отправили код на ${phone}`,
4739
- phoneNumber: formatPhone(phone),
4740
- textButton: 'Далее',
4741
- __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${consentsToList(consents)}`,
4742
- });
4743
- const consentsToList = (consents) => `<ul>${consents?.map((_) => '<li>' + _ + '</li>').join('')}</ul>`;
4744
4976
  const transformOtherConsentsField = (formData) => {
4745
4977
  const { consentOthersFlg, ...form } = formData;
4746
4978
  return {
@@ -4753,6 +4985,56 @@
4753
4985
 
4754
4986
  const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
4755
4987
 
4988
+ const initialFormState = {
4989
+ typeForm: '',
4990
+ region: { key: '', text: '' },
4991
+ addressBranch: { key: '', text: '' },
4992
+ surname: '',
4993
+ name: '',
4994
+ phone: '',
4995
+ secondaryPhone: '',
4996
+ organizationPhone: '',
4997
+ comment: '',
4998
+ product: '',
4999
+ partnerComments: '',
5000
+ annualRevenue: '',
5001
+ term: 12,
5002
+ amount: 100000,
5003
+ acquiringType: ACQUIRING_TYPES[0],
5004
+ serviceType: SERVICE_TYPES[0],
5005
+ feedbackMethod: FEEDBACK_METHOD[0],
5006
+ serviceDirection: SERVICE_DIRECTIONS[0],
5007
+ vedTypes: VED_TYPES[0],
5008
+ birthday: undefined,
5009
+ limitedBirthday: undefined,
5010
+ isClient: false,
5011
+ onlineCheckout: false,
5012
+ posTerminal: false,
5013
+ consentToReceiveMaterials: false,
5014
+ consentDataProcessing: false,
5015
+ processPersonalDataFlg: false,
5016
+ consentProviderFlg: false,
5017
+ consentOthersFlg: false,
5018
+ consentInformFlg: false,
5019
+ addressRegistration: '',
5020
+ participantDateRegistration: undefined,
5021
+ currency: '',
5022
+ paymentSystem: '',
5023
+ cardCategory: { key: '', text: '' },
5024
+ codeWord: '',
5025
+ addressRetail: { key: '', text: '' },
5026
+ };
5027
+ const getInitialFormState$2 = (inputs, savedForm) => {
5028
+ if (savedForm) {
5029
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5030
+ }
5031
+ const formState = Object.fromEntries(inputs.map((_) => [
5032
+ _.name,
5033
+ (_.fieldType === 'ved' && _?.defaultValue) || initialFormState[_.name || ''],
5034
+ ]));
5035
+ return { ...formState, typeForm: { key: '', text: '' } };
5036
+ };
5037
+
4756
5038
  const parseEsiaProfile = (esiaProfile) => {
4757
5039
  const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
4758
5040
  return {
@@ -4802,10 +5084,12 @@
4802
5084
  };
4803
5085
  };
4804
5086
 
4805
- const useInitApplicationLead = (nextStepLink) => {
5087
+ const useInitApplicationLead = (inputs, nextStepLink) => {
4806
5088
  const navigator = locationNavigator();
4807
5089
  const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
4808
- const [, setLeadForm] = useLocalStorage('leadForm');
5090
+ const leadFormStore = useLeadFormStore();
5091
+ const saveForm = useSetter(leadFormStore, 'leadForm');
5092
+ const initialFormState = useMemo(() => getInitialFormState$2(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
4809
5093
  const updateEsiaProfile = useCallback(async (profileId, code, state) => {
4810
5094
  startLoading();
4811
5095
  try {
@@ -4816,7 +5100,7 @@
4816
5100
  redirectUri: globalThis.location?.href,
4817
5101
  });
4818
5102
  if (data) {
4819
- setLeadForm((_) => ({
5103
+ saveForm((_) => ({
4820
5104
  ..._,
4821
5105
  ...parseEsiaProfile(data),
4822
5106
  }));
@@ -4828,7 +5112,7 @@
4828
5112
  }
4829
5113
  }, [nextStepLink]);
4830
5114
  useEffect(() => {
4831
- const profileId = JSON.parse(globalThis.localStorage?.getItem('profileId') ?? 'null');
5115
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
4832
5116
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
4833
5117
  const code = params.get('code');
4834
5118
  const state = params.get('state');
@@ -4840,21 +5124,16 @@
4840
5124
  sessionStorage.removeItem('refreshToken');
4841
5125
  }
4842
5126
  }, []);
4843
- return {
4844
- isLoading,
4845
- };
5127
+ return [initialFormState, { isLoading }];
4846
5128
  };
4847
5129
 
4848
5130
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, ...rest }) => {
4849
- const inputs = (applicationFormData?.flatMap((_) => _?.inputs) || []);
4850
- const { isLoading } = useInitApplicationLead(nextStepLink);
4851
- const [leadForm, setLeadForm] = useLocalStorage('leadForm');
4852
- const initialFormState = getInitialFormState$2(inputs, leadForm);
5131
+ const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
5132
+ const [initialFormState, { isLoading }] = useInitApplicationLead(inputs, nextStepLink);
4853
5133
  const { handleSubmit, responseStatus } = useApplicationLeadApi({
4854
5134
  inputs,
4855
5135
  programId,
4856
5136
  nextStepLink,
4857
- saveForm: setLeadForm,
4858
5137
  });
4859
5138
  const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
4860
5139
  const responseTypeDialog = useDialog(ResponseTypeDialog);
@@ -7174,7 +7453,7 @@
7174
7453
  }, []);
7175
7454
  const sections = useMemo(() => stepsSectionsMap$1[step], [step]);
7176
7455
  const [isFormFinished, setIsFormFinished] = useState(false);
7177
- return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished }, String(step)) })] }) }));
7456
+ return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished }, String(step)) })] }) }));
7178
7457
  });
7179
7458
 
7180
7459
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
@@ -7989,7 +8268,7 @@
7989
8268
  const sections = useMemo(() => stepsSectionsMap[step], [step]);
7990
8269
  const isStartStep = step === 0;
7991
8270
  const [isFormFinished, setIsFormFinished] = useState(false);
7992
- return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, programsSource: programsSource }, String(step)) })] }) }));
8271
+ return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, programsSource: programsSource }, String(step)) })] }) }));
7993
8272
  });
7994
8273
 
7995
8274
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
@@ -8158,150 +8437,6 @@
8158
8437
  };
8159
8438
  const ErrorBlock = JSX(({ className = '', title, description, error, button, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-center items-center', className), defaultPadding: style('p-6xl'), version: "transparent", ...rest, children: [jsx("div", { className: "flex justify-center", children: renderErrorContent(error) }), jsx(Headline, { title: title, description: description, headlineVersion: "XL", isEmbedded: true, className: "mb-2xl last:mb-0" }), button?.text ? (jsx(LinkButton, { version: button?.version, text: button?.text, ...button })) : null] })));
8160
8439
 
8161
- function copy(source, target) {
8162
- for (const [k, v] of source.entries()) {
8163
- if (v !== null && v !== undefined) {
8164
- target.setItem(k, v);
8165
- }
8166
- else {
8167
- target.removeItem(k);
8168
- }
8169
- }
8170
- }
8171
-
8172
- function replicate(primary, secondary) {
8173
- copy(primary, secondary);
8174
- copy(secondary, primary);
8175
- return primary.bus.watch(({ type, event }) => {
8176
- if (event !== null && event !== undefined) {
8177
- secondary.setItem(type, event);
8178
- }
8179
- else {
8180
- secondary.removeItem(type);
8181
- }
8182
- });
8183
- }
8184
-
8185
- class StorageAdapter {
8186
- storage;
8187
- bus;
8188
- get size() {
8189
- return this.storage?.length ?? 0;
8190
- }
8191
- constructor(storage, bus = new EventBus()) {
8192
- this.storage = storage;
8193
- this.bus = bus;
8194
- }
8195
- hasItem(key) {
8196
- return Boolean(this.storage?.getItem(String(key)));
8197
- }
8198
- getItem(key) {
8199
- const _ = this.storage?.getItem(String(key)) ?? null;
8200
- try {
8201
- return JSON.parse(String(_));
8202
- }
8203
- catch (ex) {
8204
- return null;
8205
- }
8206
- }
8207
- entries() {
8208
- return Array.from({ length: this.size }, (_, i) => {
8209
- const k = String(this.storage?.key(i));
8210
- return [k, this.getItem(k)];
8211
- });
8212
- }
8213
- setItem(key, value) {
8214
- if (value !== null) {
8215
- this.storage?.setItem(String(key), JSON.stringify(value));
8216
- }
8217
- else {
8218
- this.storage?.removeItem(String(key));
8219
- }
8220
- this.bus?.subject(key, value);
8221
- }
8222
- removeItem(key) {
8223
- this.storage?.removeItem(String(key));
8224
- this.bus?.subject(key, null);
8225
- }
8226
- }
8227
-
8228
- class Store {
8229
- bus;
8230
- store = new Map();
8231
- get size() {
8232
- return this.store.size;
8233
- }
8234
- constructor(bus = new EventBus()) {
8235
- this.bus = bus;
8236
- }
8237
- hasItem(key) {
8238
- return this.store.has(key);
8239
- }
8240
- getItem(key) {
8241
- return this.store.get(key);
8242
- }
8243
- entries() {
8244
- return this.store.entries();
8245
- }
8246
- setItem(key, value) {
8247
- this.store.set(key, value);
8248
- this.bus.subject(key, value);
8249
- }
8250
- removeItem(key) {
8251
- this.store.delete(key);
8252
- this.bus.subject(key, null);
8253
- }
8254
- }
8255
-
8256
- function useRerender() {
8257
- const [, setCount] = useState(0);
8258
- return useCallback(() => setCount(_ => (_ + 1) % (1 << 16)), []);
8259
- }
8260
-
8261
- const DEFAULT_METHODS = {};
8262
- /**
8263
- * MobX like reactivity (simplified).
8264
- * Can be used to migrate from Redux/MobX or something else
8265
- *
8266
- * @param store
8267
- * @returns reactive proxy backed by store
8268
- */
8269
- function useStore(store, methods = DEFAULT_METHODS) {
8270
- const deps = useRef(null);
8271
- const render = useRerender();
8272
- useEffect(() => store.bus.watch(ev => {
8273
- if (deps.current?.has(String(ev.type))) {
8274
- render();
8275
- }
8276
- }), [store, render]);
8277
- return useMemo(() => new Proxy(methods, {
8278
- get(_, key) {
8279
- deps.current ||= new Set();
8280
- deps.current.add(key);
8281
- return store.getItem(key);
8282
- },
8283
- has(_, key) {
8284
- deps.current ||= new Set();
8285
- deps.current.add(key);
8286
- return store.hasItem(key);
8287
- },
8288
- set(_, key, value) {
8289
- store.setItem(key, value);
8290
- return true;
8291
- },
8292
- deleteProperty(_, key) {
8293
- store.removeItem(key);
8294
- return true;
8295
- }
8296
- }), [store]);
8297
- }
8298
-
8299
- const localStore = new Store(); // localStorage cache
8300
- replicate(localStore, new StorageAdapter(globalThis?.localStorage));
8301
- function useLocalStore(methods) {
8302
- return useStore(localStore, methods);
8303
- }
8304
-
8305
8440
  const REGION_URL = `${API_BASE_URI}/region`;
8306
8441
  function useLocation(defaultLocation = 'Москва') {
8307
8442
  const locationStore = useLocalStore();
@@ -10410,7 +10545,7 @@
10410
10545
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10411
10546
  });
10412
10547
 
10413
- const packageVersion = "0.14.696";
10548
+ const packageVersion = "0.14.698";
10414
10549
 
10415
10550
  exports.Blocks = Blocks;
10416
10551
  exports.ContentPage = ContentPage;