@redneckz/wildless-cms-uni-blocks 0.14.917 → 0.14.919

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 (379) hide show
  1. package/bundle/bundle.umd.js +440 -367
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/api/getDictionaries.d.ts +2 -0
  4. package/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  5. package/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
  6. package/bundle/retail/model/LeadFormState.d.ts +1 -1
  7. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  8. package/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
  9. package/bundle/retail/validator/validators.d.ts +2 -0
  10. package/bundle/ui-kit/FormField/validators.d.ts +1 -0
  11. package/bundle/utils/isIFrame.d.ts +1 -0
  12. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  13. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  15. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  16. package/dist/components/ContentPage/ContentPage.js +5 -2
  17. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  18. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
  19. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  20. package/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  21. package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  22. package/dist/components/CreditCardForm/formStateMap.js +6 -0
  23. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  24. package/dist/components/CreditForm/CreditFormStep.js +2 -0
  25. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  26. package/dist/components/CreditForm/creditFormStepsData.js +14 -17
  27. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  28. package/dist/components/DebitForm/DebitFormStep.js +2 -0
  29. package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  30. package/dist/retail/adaptors/getPersonalInfoData.js +1 -9
  31. package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  32. package/dist/retail/api/getDictionaries.d.ts +2 -0
  33. package/dist/retail/api/getDictionaries.js +13 -0
  34. package/dist/retail/api/getDictionaries.js.map +1 -0
  35. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
  36. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  37. package/dist/retail/components/Fields/AmountWorkersField.js +0 -8
  38. package/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
  39. package/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  40. package/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  41. package/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  42. package/dist/retail/components/Fields/DaDataInnField.js +21 -8
  43. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  44. package/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
  45. package/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  46. package/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
  47. package/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  48. package/dist/retail/components/Fields/OrganizationField.js +0 -8
  49. package/dist/retail/components/Fields/OrganizationField.js.map +1 -1
  50. package/dist/retail/components/Fields/OrganizationNameField.js +12 -2
  51. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  52. package/dist/retail/content.js +4 -11
  53. package/dist/retail/content.js.map +1 -1
  54. package/dist/retail/hooks/useIFrameMode.d.ts +4 -0
  55. package/dist/retail/hooks/useIFrameMode.js +39 -0
  56. package/dist/retail/hooks/useIFrameMode.js.map +1 -0
  57. package/dist/retail/inputs.js +1 -1
  58. package/dist/retail/inputs.js.map +1 -1
  59. package/dist/retail/model/LeadFormState.d.ts +1 -1
  60. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  61. package/dist/retail/utils/getMainFormStateMap.js +1 -6
  62. package/dist/retail/utils/getMainFormStateMap.js.map +1 -1
  63. package/dist/retail/utils/getOrganizationParams.d.ts +6 -0
  64. package/dist/retail/utils/getOrganizationParams.js +7 -1
  65. package/dist/retail/utils/getOrganizationParams.js.map +1 -1
  66. package/dist/retail/utils/updateOrganizationFields.js +2 -0
  67. package/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  68. package/dist/retail/validator/getRetailFormValidator.js +2 -0
  69. package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  70. package/dist/retail/validator/validators.d.ts +2 -0
  71. package/dist/retail/validator/validators.js +6 -1
  72. package/dist/retail/validator/validators.js.map +1 -1
  73. package/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
  74. package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  75. package/dist/ui-kit/FormField/validators.d.ts +1 -0
  76. package/dist/ui-kit/FormField/validators.js +4 -3
  77. package/dist/ui-kit/FormField/validators.js.map +1 -1
  78. package/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
  79. package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  80. package/dist/utils/isIFrame.d.ts +1 -0
  81. package/dist/utils/isIFrame.js +5 -0
  82. package/dist/utils/isIFrame.js.map +1 -0
  83. package/lib/common.css +1 -1
  84. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  87. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  88. package/lib/components/ContentPage/ContentPage.js +5 -2
  89. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  90. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
  91. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  92. package/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  93. package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  94. package/lib/components/CreditCardForm/formStateMap.js +6 -0
  95. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  96. package/lib/components/CreditForm/CreditFormStep.js +2 -0
  97. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  98. package/lib/components/CreditForm/creditFormStepsData.js +14 -17
  99. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  100. package/lib/components/DebitForm/DebitFormStep.js +2 -0
  101. package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  102. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  103. package/lib/retail/adaptors/getPersonalInfoData.js +2 -10
  104. package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  105. package/lib/retail/api/getDictionaries.d.ts +2 -0
  106. package/lib/retail/api/getDictionaries.js +10 -0
  107. package/lib/retail/api/getDictionaries.js.map +1 -0
  108. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
  109. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  110. package/lib/retail/components/Fields/AmountWorkersField.js +0 -8
  111. package/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
  112. package/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  113. package/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  114. package/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  115. package/lib/retail/components/Fields/DaDataInnField.js +22 -9
  116. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  117. package/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
  118. package/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  119. package/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
  120. package/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  121. package/lib/retail/components/Fields/OrganizationField.js +0 -8
  122. package/lib/retail/components/Fields/OrganizationField.js.map +1 -1
  123. package/lib/retail/components/Fields/OrganizationNameField.js +13 -3
  124. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  125. package/lib/retail/content.js +4 -11
  126. package/lib/retail/content.js.map +1 -1
  127. package/lib/retail/hooks/useIFrameMode.d.ts +4 -0
  128. package/lib/retail/hooks/useIFrameMode.js +36 -0
  129. package/lib/retail/hooks/useIFrameMode.js.map +1 -0
  130. package/lib/retail/inputs.js +2 -2
  131. package/lib/retail/inputs.js.map +1 -1
  132. package/lib/retail/model/LeadFormState.d.ts +1 -1
  133. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  134. package/lib/retail/utils/getMainFormStateMap.js +1 -6
  135. package/lib/retail/utils/getMainFormStateMap.js.map +1 -1
  136. package/lib/retail/utils/getOrganizationParams.d.ts +6 -0
  137. package/lib/retail/utils/getOrganizationParams.js +6 -0
  138. package/lib/retail/utils/getOrganizationParams.js.map +1 -1
  139. package/lib/retail/utils/updateOrganizationFields.js +2 -0
  140. package/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  141. package/lib/retail/validator/getRetailFormValidator.js +3 -1
  142. package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  143. package/lib/retail/validator/validators.d.ts +2 -0
  144. package/lib/retail/validator/validators.js +3 -0
  145. package/lib/retail/validator/validators.js.map +1 -1
  146. package/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
  147. package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  148. package/lib/ui-kit/FormField/validators.d.ts +1 -0
  149. package/lib/ui-kit/FormField/validators.js +1 -1
  150. package/lib/ui-kit/FormField/validators.js.map +1 -1
  151. package/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
  152. package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  153. package/lib/utils/isIFrame.d.ts +1 -0
  154. package/lib/utils/isIFrame.js +2 -0
  155. package/lib/utils/isIFrame.js.map +1 -0
  156. package/mobile/bundle/bundle.umd.js +444 -371
  157. package/mobile/bundle/bundle.umd.min.js +1 -1
  158. package/mobile/bundle/retail/api/getDictionaries.d.ts +2 -0
  159. package/mobile/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  160. package/mobile/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
  161. package/mobile/bundle/retail/model/LeadFormState.d.ts +1 -1
  162. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  163. package/mobile/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
  164. package/mobile/bundle/retail/validator/validators.d.ts +2 -0
  165. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
  166. package/mobile/bundle/utils/isIFrame.d.ts +1 -0
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  168. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  169. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  170. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  171. package/mobile/dist/components/ContentPage/ContentPage.js +5 -2
  172. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  173. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
  174. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  175. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  176. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  177. package/mobile/dist/components/CreditCardForm/formStateMap.js +6 -0
  178. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  179. package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -0
  180. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  181. package/mobile/dist/components/CreditForm/creditFormStepsData.js +14 -17
  182. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  183. package/mobile/dist/components/DebitForm/DebitFormStep.js +2 -0
  184. package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  185. package/mobile/dist/retail/adaptors/getPersonalInfoData.js +1 -9
  186. package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  187. package/mobile/dist/retail/api/getDictionaries.d.ts +2 -0
  188. package/mobile/dist/retail/api/getDictionaries.js +13 -0
  189. package/mobile/dist/retail/api/getDictionaries.js.map +1 -0
  190. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
  191. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  192. package/mobile/dist/retail/components/Fields/AmountWorkersField.js +0 -8
  193. package/mobile/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
  194. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  195. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  196. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  197. package/mobile/dist/retail/components/Fields/DaDataInnField.js +21 -8
  198. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  199. package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
  200. package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  201. package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
  202. package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  203. package/mobile/dist/retail/components/Fields/OrganizationField.js +0 -8
  204. package/mobile/dist/retail/components/Fields/OrganizationField.js.map +1 -1
  205. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +12 -2
  206. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  207. package/mobile/dist/retail/content.js +4 -11
  208. package/mobile/dist/retail/content.js.map +1 -1
  209. package/mobile/dist/retail/hooks/useIFrameMode.d.ts +4 -0
  210. package/mobile/dist/retail/hooks/useIFrameMode.js +39 -0
  211. package/mobile/dist/retail/hooks/useIFrameMode.js.map +1 -0
  212. package/mobile/dist/retail/inputs.js +1 -1
  213. package/mobile/dist/retail/inputs.js.map +1 -1
  214. package/mobile/dist/retail/model/LeadFormState.d.ts +1 -1
  215. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  216. package/mobile/dist/retail/utils/getMainFormStateMap.js +1 -6
  217. package/mobile/dist/retail/utils/getMainFormStateMap.js.map +1 -1
  218. package/mobile/dist/retail/utils/getOrganizationParams.d.ts +6 -0
  219. package/mobile/dist/retail/utils/getOrganizationParams.js +7 -1
  220. package/mobile/dist/retail/utils/getOrganizationParams.js.map +1 -1
  221. package/mobile/dist/retail/utils/updateOrganizationFields.js +2 -0
  222. package/mobile/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  223. package/mobile/dist/retail/validator/getRetailFormValidator.js +2 -0
  224. package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  225. package/mobile/dist/retail/validator/validators.d.ts +2 -0
  226. package/mobile/dist/retail/validator/validators.js +6 -1
  227. package/mobile/dist/retail/validator/validators.js.map +1 -1
  228. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
  229. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  230. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
  231. package/mobile/dist/ui-kit/FormField/validators.js +4 -3
  232. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  233. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
  234. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  235. package/mobile/dist/utils/isIFrame.d.ts +1 -0
  236. package/mobile/dist/utils/isIFrame.js +5 -0
  237. package/mobile/dist/utils/isIFrame.js.map +1 -0
  238. package/mobile/lib/common.css +1 -1
  239. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  240. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  241. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  242. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  243. package/mobile/lib/components/ContentPage/ContentPage.js +5 -2
  244. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  245. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
  246. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  247. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  248. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  249. package/mobile/lib/components/CreditCardForm/formStateMap.js +6 -0
  250. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  251. package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -0
  252. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  253. package/mobile/lib/components/CreditForm/creditFormStepsData.js +14 -17
  254. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  255. package/mobile/lib/components/DebitForm/DebitFormStep.js +2 -0
  256. package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  257. package/mobile/lib/retail/adaptors/getPersonalInfoData.js +2 -10
  258. package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  259. package/mobile/lib/retail/api/getDictionaries.d.ts +2 -0
  260. package/mobile/lib/retail/api/getDictionaries.js +10 -0
  261. package/mobile/lib/retail/api/getDictionaries.js.map +1 -0
  262. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
  263. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  264. package/mobile/lib/retail/components/Fields/AmountWorkersField.js +0 -8
  265. package/mobile/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
  266. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  267. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  268. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  269. package/mobile/lib/retail/components/Fields/DaDataInnField.js +22 -9
  270. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  271. package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
  272. package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  273. package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
  274. package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  275. package/mobile/lib/retail/components/Fields/OrganizationField.js +0 -8
  276. package/mobile/lib/retail/components/Fields/OrganizationField.js.map +1 -1
  277. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +13 -3
  278. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  279. package/mobile/lib/retail/content.js +4 -11
  280. package/mobile/lib/retail/content.js.map +1 -1
  281. package/mobile/lib/retail/hooks/useIFrameMode.d.ts +4 -0
  282. package/mobile/lib/retail/hooks/useIFrameMode.js +36 -0
  283. package/mobile/lib/retail/hooks/useIFrameMode.js.map +1 -0
  284. package/mobile/lib/retail/inputs.js +2 -2
  285. package/mobile/lib/retail/inputs.js.map +1 -1
  286. package/mobile/lib/retail/model/LeadFormState.d.ts +1 -1
  287. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  288. package/mobile/lib/retail/utils/getMainFormStateMap.js +1 -6
  289. package/mobile/lib/retail/utils/getMainFormStateMap.js.map +1 -1
  290. package/mobile/lib/retail/utils/getOrganizationParams.d.ts +6 -0
  291. package/mobile/lib/retail/utils/getOrganizationParams.js +6 -0
  292. package/mobile/lib/retail/utils/getOrganizationParams.js.map +1 -1
  293. package/mobile/lib/retail/utils/updateOrganizationFields.js +2 -0
  294. package/mobile/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  295. package/mobile/lib/retail/validator/getRetailFormValidator.js +3 -1
  296. package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  297. package/mobile/lib/retail/validator/validators.d.ts +2 -0
  298. package/mobile/lib/retail/validator/validators.js +3 -0
  299. package/mobile/lib/retail/validator/validators.js.map +1 -1
  300. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
  301. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  302. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
  303. package/mobile/lib/ui-kit/FormField/validators.js +1 -1
  304. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  305. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
  306. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  307. package/mobile/lib/utils/isIFrame.d.ts +1 -0
  308. package/mobile/lib/utils/isIFrame.js +2 -0
  309. package/mobile/lib/utils/isIFrame.js.map +1 -0
  310. package/mobile/src/common.css +3 -0
  311. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
  312. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
  313. package/mobile/src/components/ContentPage/ContentPage.tsx +6 -4
  314. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
  315. package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
  316. package/mobile/src/components/CreditCardForm/formStateMap.tsx +6 -0
  317. package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -0
  318. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +14 -17
  319. package/mobile/src/components/DebitForm/DebitFormStep.tsx +2 -0
  320. package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
  321. package/mobile/src/retail/api/getDictionaries.ts +21 -0
  322. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
  323. package/mobile/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
  324. package/mobile/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
  325. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +28 -10
  326. package/mobile/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
  327. package/mobile/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
  328. package/mobile/src/retail/components/Fields/OrganizationField.tsx +0 -10
  329. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
  330. package/mobile/src/retail/content.tsx +4 -11
  331. package/mobile/src/retail/hooks/useIFrameMode.ts +45 -0
  332. package/mobile/src/retail/inputs.tsx +2 -2
  333. package/mobile/src/retail/model/LeadFormState.ts +1 -1
  334. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  335. package/mobile/src/retail/utils/getMainFormStateMap.ts +1 -6
  336. package/mobile/src/retail/utils/getOrganizationParams.ts +7 -0
  337. package/mobile/src/retail/utils/updateOrganizationFields.ts +2 -0
  338. package/mobile/src/retail/validator/getRetailFormValidator.ts +4 -0
  339. package/mobile/src/retail/validator/validators.ts +9 -0
  340. package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
  341. package/mobile/src/ui-kit/FormField/validators.ts +1 -1
  342. package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
  343. package/mobile/src/utils/isIFrame.ts +1 -0
  344. package/package.json +1 -1
  345. package/src/common.css +3 -0
  346. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
  347. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
  348. package/src/components/ContentPage/ContentPage.tsx +6 -4
  349. package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
  350. package/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
  351. package/src/components/CreditCardForm/formStateMap.tsx +6 -0
  352. package/src/components/CreditForm/CreditFormStep.tsx +2 -0
  353. package/src/components/CreditForm/creditFormStepsData.tsx +14 -17
  354. package/src/components/DebitForm/DebitFormStep.tsx +2 -0
  355. package/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
  356. package/src/retail/api/getDictionaries.ts +21 -0
  357. package/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
  358. package/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
  359. package/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
  360. package/src/retail/components/Fields/DaDataInnField.tsx +28 -10
  361. package/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
  362. package/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
  363. package/src/retail/components/Fields/OrganizationField.tsx +0 -10
  364. package/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
  365. package/src/retail/content.tsx +4 -11
  366. package/src/retail/hooks/useIFrameMode.ts +45 -0
  367. package/src/retail/inputs.tsx +2 -2
  368. package/src/retail/model/LeadFormState.ts +1 -1
  369. package/src/retail/model/NameFieldDef.ts +1 -0
  370. package/src/retail/utils/getMainFormStateMap.ts +1 -6
  371. package/src/retail/utils/getOrganizationParams.ts +7 -0
  372. package/src/retail/utils/updateOrganizationFields.ts +2 -0
  373. package/src/retail/validator/getRetailFormValidator.ts +4 -0
  374. package/src/retail/validator/validators.ts +9 -0
  375. package/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
  376. package/src/ui-kit/FormField/validators.ts +1 -1
  377. package/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
  378. package/src/utils/isIFrame.ts +1 -0
  379. package/tailwind.config.cjs +3 -0
@@ -1882,7 +1882,7 @@
1882
1882
  useEffect(() => {
1883
1883
  updateSelectedDate({ inputValue, setSelectedMonth, setSelectedYear, onChange });
1884
1884
  }, [inputValue]);
1885
- return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur, disabled: disabled }), disabled ? null : jsx(Icon, { className: "mr-s", ...ICON_PROPS$1 })] }));
1885
+ return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur, disabled: disabled }), disabled ? null : jsx(Icon, { className: "mr-s", ...ICON_PROPS$1 })] }));
1886
1886
  });
1887
1887
  const isValidYear = (year) => Number(year) >= START_YEAR && Number(year) <= new Date().getFullYear();
1888
1888
  const isValidMonth = (month) => Number(month) > 0 && Number(month) < 13;
@@ -2978,6 +2978,256 @@
2978
2978
  return (jsx(Dialog, { onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Paragraph, { align: "text-center", children: "\u0423\u0432\u0430\u0436\u0430\u0435\u043C\u044B\u0439 \u043A\u043B\u0438\u0435\u043D\u0442!" }), jsx(Paragraph, { align: "text-center", children: "\u0414\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043A\u0440\u0435\u0434\u0438\u0442\u0430 \u0412\u0430\u043C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u044C\u0441\u044F \u0432 \u043E\u0444\u0438\u0441 \u0411\u0430\u043D\u043A\u0430" }), jsxs("div", { className: "flex flex-col sm:flex-row gap-xl items-center", children: [jsx(Button, { type: "button", version: "secondary", onClick: returnToMainPage, children: "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C" }), isMaxAttempts ? null : (jsx(Button, { type: "button", onClick: onClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" }))] })] }) }));
2979
2979
  });
2980
2980
 
2981
+ function copy(source, target) {
2982
+ for (const [k, v] of source.entries()) {
2983
+ if (v !== null && v !== undefined) {
2984
+ target.setItem(k, v);
2985
+ }
2986
+ else {
2987
+ target.removeItem(k);
2988
+ }
2989
+ }
2990
+ }
2991
+
2992
+ function replicate(primary, secondary) {
2993
+ copy(primary, secondary);
2994
+ copy(secondary, primary);
2995
+ return primary.bus.watch(({ type, event }) => {
2996
+ if (event !== null && event !== undefined) {
2997
+ secondary.setItem(type, event);
2998
+ }
2999
+ else {
3000
+ secondary.removeItem(type);
3001
+ }
3002
+ });
3003
+ }
3004
+
3005
+ class StorageAdapter {
3006
+ storage;
3007
+ bus;
3008
+ get size() {
3009
+ return this.storage?.length ?? 0;
3010
+ }
3011
+ constructor(storage, bus = new EventBus()) {
3012
+ this.storage = storage;
3013
+ this.bus = bus;
3014
+ }
3015
+ hasItem(key) {
3016
+ return Boolean(this.storage?.getItem(String(key)));
3017
+ }
3018
+ getItem(key) {
3019
+ const _ = this.storage?.getItem(String(key)) ?? null;
3020
+ try {
3021
+ return JSON.parse(String(_));
3022
+ }
3023
+ catch (ex) {
3024
+ return null;
3025
+ }
3026
+ }
3027
+ entries() {
3028
+ return Array.from({ length: this.size }, (_, i) => {
3029
+ const k = String(this.storage?.key(i));
3030
+ return [k, this.getItem(k)];
3031
+ });
3032
+ }
3033
+ setItem(key, value) {
3034
+ if (value !== null) {
3035
+ this.storage?.setItem(String(key), JSON.stringify(value));
3036
+ }
3037
+ else {
3038
+ this.storage?.removeItem(String(key));
3039
+ }
3040
+ this.bus?.subject(key, value);
3041
+ }
3042
+ removeItem(key) {
3043
+ this.storage?.removeItem(String(key));
3044
+ this.bus?.subject(key, null);
3045
+ }
3046
+ }
3047
+
3048
+ class Store {
3049
+ bus;
3050
+ store = new Map();
3051
+ get size() {
3052
+ return this.store.size;
3053
+ }
3054
+ constructor(bus = new EventBus()) {
3055
+ this.bus = bus;
3056
+ }
3057
+ hasItem(key) {
3058
+ return this.store.has(key);
3059
+ }
3060
+ getItem(key) {
3061
+ return this.store.get(key);
3062
+ }
3063
+ entries() {
3064
+ return this.store.entries();
3065
+ }
3066
+ setItem(key, value) {
3067
+ this.store.set(key, value);
3068
+ this.bus.subject(key, value);
3069
+ }
3070
+ removeItem(key) {
3071
+ this.store.delete(key);
3072
+ this.bus.subject(key, null);
3073
+ }
3074
+ }
3075
+
3076
+ function useRerender() {
3077
+ const [, setCount] = useState(0);
3078
+ return useCallback(() => setCount(_ => (_ + 1) % (1 << 16)), []);
3079
+ }
3080
+
3081
+ const DEFAULT_METHODS = {};
3082
+ /**
3083
+ * MobX like reactivity (simplified).
3084
+ * Can be used to migrate from Redux/MobX or something else
3085
+ *
3086
+ * @param store
3087
+ * @returns reactive proxy backed by store
3088
+ */
3089
+ function useStore(store, methods = DEFAULT_METHODS) {
3090
+ const deps = useRef(null);
3091
+ const render = useRerender();
3092
+ useEffect(() => store.bus.watch(ev => {
3093
+ if (deps.current?.has(String(ev.type))) {
3094
+ render();
3095
+ }
3096
+ }), [store, render]);
3097
+ return useMemo(() => new Proxy(methods, {
3098
+ get(_, key) {
3099
+ deps.current ||= new Set();
3100
+ deps.current.add(key);
3101
+ return store.getItem(key);
3102
+ },
3103
+ has(_, key) {
3104
+ deps.current ||= new Set();
3105
+ deps.current.add(key);
3106
+ return store.hasItem(key);
3107
+ },
3108
+ set(_, key, value) {
3109
+ store.setItem(key, value);
3110
+ return true;
3111
+ },
3112
+ deleteProperty(_, key) {
3113
+ store.removeItem(key);
3114
+ return true;
3115
+ }
3116
+ }), [store]);
3117
+ }
3118
+
3119
+ const sessionStore = new Store(); // sessionStorage cache
3120
+ replicate(sessionStore, new StorageAdapter(globalThis?.sessionStorage));
3121
+ function useSessionStore() {
3122
+ return useStore(sessionStore);
3123
+ }
3124
+
3125
+ const getNS = (_) => globalThis[_];
3126
+ const initializeExternalNS = (namespaceName, url, isModule = false) => {
3127
+ const script = globalThis.document.getElementById(url);
3128
+ if (script) {
3129
+ const ns = getNS(namespaceName);
3130
+ if (ns) {
3131
+ return Promise.resolve(ns);
3132
+ }
3133
+ else {
3134
+ return new Promise((resolve) => {
3135
+ script.addEventListener('load', () => {
3136
+ resolve(getNS(namespaceName));
3137
+ });
3138
+ });
3139
+ }
3140
+ }
3141
+ else {
3142
+ return new Promise((resolve, reject) => {
3143
+ const newScript = globalThis.document.createElement('script');
3144
+ newScript.src = url;
3145
+ newScript.async = true;
3146
+ newScript.id = url;
3147
+ if (isModule) {
3148
+ newScript.type = 'module';
3149
+ }
3150
+ newScript.addEventListener('load', () => {
3151
+ resolve(getNS(namespaceName));
3152
+ });
3153
+ newScript.addEventListener('error', (error) => {
3154
+ reject(error);
3155
+ });
3156
+ globalThis.document.head.appendChild(newScript);
3157
+ });
3158
+ }
3159
+ };
3160
+ const initializeExternalStylesheet = (url = '') => {
3161
+ const link = globalThis.document.getElementById(url);
3162
+ if (!link) {
3163
+ const newLink = globalThis.document.createElement('link');
3164
+ newLink.href = url;
3165
+ newLink.id = url;
3166
+ newLink.rel = 'stylesheet';
3167
+ globalThis.document.head.appendChild(newLink);
3168
+ }
3169
+ };
3170
+ function useExternalNS(namespaceName, url, unmountNS = true) {
3171
+ const [externalNS, setExternalNS] = useState(undefined);
3172
+ useEffect(() => {
3173
+ let isMounted = true;
3174
+ initializeExternalNS(namespaceName, url)
3175
+ .then((ns) => {
3176
+ if (isMounted) {
3177
+ setExternalNS(ns);
3178
+ }
3179
+ })
3180
+ .catch((error) => {
3181
+ console.error(`Failed to initialize external namespace: ${error}`);
3182
+ });
3183
+ return () => {
3184
+ isMounted = false;
3185
+ if (unmountNS) {
3186
+ const script = globalThis.document.getElementById(url);
3187
+ if (script) {
3188
+ globalThis.document.head.removeChild(script);
3189
+ }
3190
+ setExternalNS(undefined);
3191
+ }
3192
+ };
3193
+ }, [namespaceName, url, unmountNS]);
3194
+ return externalNS;
3195
+ }
3196
+
3197
+ const isIFrame = () => globalThis.location !== globalThis?.top?.location;
3198
+
3199
+ const useIFrameMode = () => {
3200
+ const isFrame = isIFrame();
3201
+ const height = globalThis.document?.body?.scrollHeight;
3202
+ const sessionStore = useSessionStore();
3203
+ const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
3204
+ const styles = params.get('styles');
3205
+ if (styles) {
3206
+ initializeExternalStylesheet(styles);
3207
+ }
3208
+ useEffect(() => {
3209
+ if (isFrame) {
3210
+ globalThis.parent.postMessage({ height: document.body.scrollHeight }, '*');
3211
+ }
3212
+ }, [height, isFrame]);
3213
+ useEffect(() => {
3214
+ const handlePostMessage = (event) => {
3215
+ if (!event.data?.location) {
3216
+ return;
3217
+ }
3218
+ sessionStore.frameLocation = event.data?.location;
3219
+ };
3220
+ if (isFrame) {
3221
+ globalThis.addEventListener('message', handlePostMessage);
3222
+ }
3223
+ return () => {
3224
+ if (isFrame) {
3225
+ globalThis.removeEventListener('message', handlePostMessage);
3226
+ }
3227
+ };
3228
+ }, [isFrame]);
3229
+ };
3230
+
2981
3231
  const ERROR_MESSAGE = 'Некорректно заполненное поле';
2982
3232
  const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
2983
3233
  const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
@@ -3040,6 +3290,8 @@
3040
3290
  }
3041
3291
  return false;
3042
3292
  });
3293
+ const organizationNameValidator = (isDadataOrganization) => validator((_) => Boolean(_) && Boolean(isDadataOrganization))('Укажите наименование организации');
3294
+ const organizationInnValidator = (isDadataOrganization) => validator((_) => isValidInnLength(_) && Boolean(isDadataOrganization))('Укажите ИНН');
3043
3295
 
3044
3296
  const limitedBirthdayValidationData = {
3045
3297
  credit: {
@@ -3275,19 +3527,23 @@
3275
3527
 
3276
3528
  const EsiaLoginBanner = JSX(({ onChangeEsiaStatus, productType }) => {
3277
3529
  const navigator = locationNavigator();
3530
+ const sessionStore = useSessionStore();
3531
+ const frameLocation = sessionStore.frameLocation;
3278
3532
  const handleAuth = useCallback(async () => {
3279
3533
  try {
3280
3534
  const resp = await getLink({
3281
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
3535
+ redirectUri: frameLocation || globalThis.location.origin + globalThis.location.pathname,
3282
3536
  });
3283
3537
  if (resp?.link) {
3284
- navigator.assign(resp.link);
3538
+ frameLocation
3539
+ ? window.parent.postMessage({ redirectUri: resp?.link }, '*')
3540
+ : navigator.assign(resp.link);
3285
3541
  }
3286
3542
  }
3287
3543
  catch {
3288
3544
  onChangeEsiaStatus(EsiaStatuses.Error);
3289
3545
  }
3290
- }, []);
3546
+ }, [frameLocation]);
3291
3547
  return (jsxs("div", { className: "flex items-center rounded-md bg-main-gray p-4xl", children: [jsxs("div", { className: "flex gap-m flex-col justify-around w-full", children: [jsx("p", { className: "text-xl", children: `Заполните данные через Госуслуги${productType === 'debitCard' ? ' - это значительно сократит время оформления заявки' : ''}` }), productType === 'debitCard' ? null : (jsxs("ul", { className: "list-disc list-inside", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] })), jsx(Img, { className: "block self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
3292
3548
  });
3293
3549
 
@@ -4053,68 +4309,6 @@
4053
4309
  return (jsx("div", { className: `select-none cursor-pointer py-m w-12 bg-white ${Object.values(styles$1).join(' ')} ${className}`, onClick: setUserGeoLocation, children: jsx(Icon, { name: "UserGeoLocationIcon", width: "20", height: "16" }) }));
4054
4310
  };
4055
4311
 
4056
- const getNS = (_) => globalThis[_];
4057
- const initializeExternalNS = (namespaceName, url, isModule = false) => {
4058
- const script = globalThis.document.getElementById(url);
4059
- if (script) {
4060
- const ns = getNS(namespaceName);
4061
- if (ns) {
4062
- return Promise.resolve(ns);
4063
- }
4064
- else {
4065
- return new Promise((resolve) => {
4066
- script.addEventListener('load', () => {
4067
- resolve(getNS(namespaceName));
4068
- });
4069
- });
4070
- }
4071
- }
4072
- else {
4073
- return new Promise((resolve, reject) => {
4074
- const newScript = globalThis.document.createElement('script');
4075
- newScript.src = url;
4076
- newScript.async = true;
4077
- newScript.id = url;
4078
- if (isModule) {
4079
- newScript.type = 'module';
4080
- }
4081
- newScript.addEventListener('load', () => {
4082
- resolve(getNS(namespaceName));
4083
- });
4084
- newScript.addEventListener('error', (error) => {
4085
- reject(error);
4086
- });
4087
- globalThis.document.head.appendChild(newScript);
4088
- });
4089
- }
4090
- };
4091
- function useExternalNS(namespaceName, url, unmountNS = true) {
4092
- const [externalNS, setExternalNS] = useState(undefined);
4093
- useEffect(() => {
4094
- let isMounted = true;
4095
- initializeExternalNS(namespaceName, url)
4096
- .then((ns) => {
4097
- if (isMounted) {
4098
- setExternalNS(ns);
4099
- }
4100
- })
4101
- .catch((error) => {
4102
- console.error(`Failed to initialize external namespace: ${error}`);
4103
- });
4104
- return () => {
4105
- isMounted = false;
4106
- if (unmountNS) {
4107
- const script = globalThis.document.getElementById(url);
4108
- if (script) {
4109
- globalThis.document.head.removeChild(script);
4110
- }
4111
- setExternalNS(undefined);
4112
- }
4113
- };
4114
- }, [namespaceName, url, unmountNS]);
4115
- return externalNS;
4116
- }
4117
-
4118
4312
  const YMAPS_NAMESPACE = 'ymaps';
4119
4313
  const useYandexMaps = () => {
4120
4314
  const url = `https://api-maps.yandex.ru/2.1/?apikey=${projectSettings.YANDEX_MAP_API_KEY || ''}&lang=ru_RU`;
@@ -4187,202 +4381,64 @@
4187
4381
  getArraySumAndAverage(mapByIndex(points, 0)),
4188
4382
  getArraySumAndAverage(mapByIndex(points, 1)),
4189
4383
  ];
4190
- return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
4191
- };
4192
- const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
4193
- const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
4194
-
4195
- const fetchRegionOffices = async (regionKey) => {
4196
- const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
4197
- regionRfCd: {
4198
- key: regionKey,
4199
- },
4200
- cashCardFlg: true,
4201
- });
4202
- return (response?.offices?.map((office) => ({
4203
- ...office,
4204
- gpsLatitude: formatCoordinate(office.latitude ?? DEFAULT_CENTER_COORDS[0]),
4205
- gpsLongitude: formatCoordinate(office.longitude ?? DEFAULT_CENTER_COORDS[1]),
4206
- })) || []);
4207
- };
4208
- const formatCoordinate = (coordinate) => Number(coordinate.toString().replace(',', '.'));
4209
-
4210
- const API_BASE_URI = '/light-api-cash/v1';
4211
-
4212
- const useLeadFormData = (typeField) => {
4213
- const { data, error } = useAsyncData(`${API_BASE_URI}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
4214
- if (data && 'errorMessage' in data) {
4215
- return { error };
4216
- }
4217
- return { data: data, error };
4218
- };
4219
- const fetchData = async (url) => {
4220
- const result = await fetchJSON(url, { method: 'POST' });
4221
- return result || [];
4222
- };
4223
-
4224
- const AddressRetailField = JSX(({ field, input }) => {
4225
- const [offices, setOffices] = useState([]);
4226
- const { data } = useLeadFormData('REGION_RF');
4227
- const regionValue = field('regionRetail')?.value || {};
4228
- const addressField = field(input?.name ?? '');
4229
- useEffect(() => {
4230
- (async () => {
4231
- const officesList = await fetchRegionOffices(regionValue?.key ?? '');
4232
- setOffices(officesList);
4233
- })();
4234
- if (regionValue?.key) {
4235
- addressField.onChange?.('');
4236
- }
4237
- }, [regionValue.key]);
4238
- const { points } = useOfficesAtmsMapData({
4239
- data: offices,
4240
- filtrationState: {},
4241
- getBalloon: getOfficePoint,
4242
- });
4243
- return (jsxs("div", { children: [jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: offices.map(({ id, address = '' }) => ({
4244
- key: id?.toString() || '',
4245
- text: address,
4246
- })), ...addressField, isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full", selectedAddress: addressField?.value?.text }) }) })] }));
4247
- });
4248
-
4249
- function copy(source, target) {
4250
- for (const [k, v] of source.entries()) {
4251
- if (v !== null && v !== undefined) {
4252
- target.setItem(k, v);
4253
- }
4254
- else {
4255
- target.removeItem(k);
4256
- }
4257
- }
4258
- }
4259
-
4260
- function replicate(primary, secondary) {
4261
- copy(primary, secondary);
4262
- copy(secondary, primary);
4263
- return primary.bus.watch(({ type, event }) => {
4264
- if (event !== null && event !== undefined) {
4265
- secondary.setItem(type, event);
4266
- }
4267
- else {
4268
- secondary.removeItem(type);
4269
- }
4270
- });
4271
- }
4272
-
4273
- class StorageAdapter {
4274
- storage;
4275
- bus;
4276
- get size() {
4277
- return this.storage?.length ?? 0;
4278
- }
4279
- constructor(storage, bus = new EventBus()) {
4280
- this.storage = storage;
4281
- this.bus = bus;
4282
- }
4283
- hasItem(key) {
4284
- return Boolean(this.storage?.getItem(String(key)));
4285
- }
4286
- getItem(key) {
4287
- const _ = this.storage?.getItem(String(key)) ?? null;
4288
- try {
4289
- return JSON.parse(String(_));
4290
- }
4291
- catch (ex) {
4292
- return null;
4293
- }
4294
- }
4295
- entries() {
4296
- return Array.from({ length: this.size }, (_, i) => {
4297
- const k = String(this.storage?.key(i));
4298
- return [k, this.getItem(k)];
4299
- });
4300
- }
4301
- setItem(key, value) {
4302
- if (value !== null) {
4303
- this.storage?.setItem(String(key), JSON.stringify(value));
4304
- }
4305
- else {
4306
- this.storage?.removeItem(String(key));
4307
- }
4308
- this.bus?.subject(key, value);
4309
- }
4310
- removeItem(key) {
4311
- this.storage?.removeItem(String(key));
4312
- this.bus?.subject(key, null);
4313
- }
4314
- }
4384
+ return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
4385
+ };
4386
+ const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
4387
+ const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
4315
4388
 
4316
- class Store {
4317
- bus;
4318
- store = new Map();
4319
- get size() {
4320
- return this.store.size;
4321
- }
4322
- constructor(bus = new EventBus()) {
4323
- this.bus = bus;
4324
- }
4325
- hasItem(key) {
4326
- return this.store.has(key);
4327
- }
4328
- getItem(key) {
4329
- return this.store.get(key);
4330
- }
4331
- entries() {
4332
- return this.store.entries();
4333
- }
4334
- setItem(key, value) {
4335
- this.store.set(key, value);
4336
- this.bus.subject(key, value);
4337
- }
4338
- removeItem(key) {
4339
- this.store.delete(key);
4340
- this.bus.subject(key, null);
4341
- }
4342
- }
4389
+ const fetchRegionOffices = async (regionKey) => {
4390
+ const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
4391
+ regionRfCd: {
4392
+ key: regionKey,
4393
+ },
4394
+ cashCardFlg: true,
4395
+ });
4396
+ return (response?.offices?.map((office) => ({
4397
+ ...office,
4398
+ gpsLatitude: formatCoordinate(office.latitude ?? DEFAULT_CENTER_COORDS[0]),
4399
+ gpsLongitude: formatCoordinate(office.longitude ?? DEFAULT_CENTER_COORDS[1]),
4400
+ })) || []);
4401
+ };
4402
+ const formatCoordinate = (coordinate) => Number(coordinate.toString().replace(',', '.'));
4343
4403
 
4344
- function useRerender() {
4345
- const [, setCount] = useState(0);
4346
- return useCallback(() => setCount(_ => (_ + 1) % (1 << 16)), []);
4347
- }
4404
+ const API_BASE_URI = '/light-api-cash/v1';
4348
4405
 
4349
- const DEFAULT_METHODS = {};
4350
- /**
4351
- * MobX like reactivity (simplified).
4352
- * Can be used to migrate from Redux/MobX or something else
4353
- *
4354
- * @param store
4355
- * @returns reactive proxy backed by store
4356
- */
4357
- function useStore(store, methods = DEFAULT_METHODS) {
4358
- const deps = useRef(null);
4359
- const render = useRerender();
4360
- useEffect(() => store.bus.watch(ev => {
4361
- if (deps.current?.has(String(ev.type))) {
4362
- render();
4363
- }
4364
- }), [store, render]);
4365
- return useMemo(() => new Proxy(methods, {
4366
- get(_, key) {
4367
- deps.current ||= new Set();
4368
- deps.current.add(key);
4369
- return store.getItem(key);
4370
- },
4371
- has(_, key) {
4372
- deps.current ||= new Set();
4373
- deps.current.add(key);
4374
- return store.hasItem(key);
4375
- },
4376
- set(_, key, value) {
4377
- store.setItem(key, value);
4378
- return true;
4379
- },
4380
- deleteProperty(_, key) {
4381
- store.removeItem(key);
4382
- return true;
4383
- }
4384
- }), [store]);
4385
- }
4406
+ const useLeadFormData = (typeField) => {
4407
+ const { data, error } = useAsyncData(`${API_BASE_URI}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
4408
+ if (data && 'errorMessage' in data) {
4409
+ return { error };
4410
+ }
4411
+ return { data: data, error };
4412
+ };
4413
+ const fetchData = async (url) => {
4414
+ const result = await fetchJSON(url, { method: 'POST' });
4415
+ return result || [];
4416
+ };
4417
+
4418
+ const AddressRetailField = JSX(({ field, input }) => {
4419
+ const [offices, setOffices] = useState([]);
4420
+ const { data } = useLeadFormData('REGION_RF');
4421
+ const regionValue = field('regionRetail')?.value || {};
4422
+ const addressField = field(input?.name ?? '');
4423
+ useEffect(() => {
4424
+ (async () => {
4425
+ const officesList = await fetchRegionOffices(regionValue?.key ?? '');
4426
+ setOffices(officesList);
4427
+ })();
4428
+ if (regionValue?.key) {
4429
+ addressField.onChange?.('');
4430
+ }
4431
+ }, [regionValue.key]);
4432
+ const { points } = useOfficesAtmsMapData({
4433
+ data: offices,
4434
+ filtrationState: {},
4435
+ getBalloon: getOfficePoint,
4436
+ });
4437
+ return (jsxs("div", { children: [jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: offices.map(({ id, address = '' }) => ({
4438
+ key: id?.toString() || '',
4439
+ text: address,
4440
+ })), ...addressField, isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full", selectedAddress: addressField?.value?.text }) }) })] }));
4441
+ });
4386
4442
 
4387
4443
  const localStore = new Store(); // localStorage cache
4388
4444
  replicate(localStore, new StorageAdapter(globalThis?.localStorage));
@@ -4405,19 +4461,28 @@
4405
4461
  });
4406
4462
 
4407
4463
  const AmountWorkersField = JSX(({ field, input }) => {
4408
- const { data } = useLeadFormData('EMPLOYEES_NUMBER');
4409
4464
  const store = useRetailFormStore();
4410
- useEffect(() => {
4411
- if (data) {
4412
- store.amountWorkers = data;
4413
- }
4414
- }, [data]);
4415
4465
  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 }));
4416
4466
  });
4417
4467
 
4418
4468
  const ArmyIdFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u041D\u0430\u043B\u0438\u0447\u0438\u0435 \u0432\u043E\u0435\u043D\u043D\u043E\u0433\u043E \u0431\u0438\u043B\u0435\u0442\u0430", ...field(input?.name ?? '') })));
4419
4469
 
4420
- const BankEmpoleeCodeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u0434 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044F \u0411\u0430\u043D\u043A\u0430", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434", isInteger: true, ...field(input?.name ?? ''), ...input })));
4470
+ const RadioButtonGroupControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), ...rest }), renderErrorText(error)] })));
4471
+
4472
+ const BUTTON_TYPES = [
4473
+ { id: 'true', text: 'Да' },
4474
+ { id: 'false', text: 'Нет' },
4475
+ ];
4476
+ const BankEmployeeCodeField = JSX(({ field, input }) => {
4477
+ const [bankEmployeeFlg, setBankEmployeeFlg] = useState('');
4478
+ const handleBankEmployeeFlgChange = useCallback((value) => {
4479
+ setBankEmployeeFlg(value);
4480
+ if (value === 'false') {
4481
+ field('bankEmployeeCode')?.onChange?.(null);
4482
+ }
4483
+ }, []);
4484
+ return (jsxs("div", { className: "flex flex-col md:flex-row", children: [jsx(RadioButtonGroupControl, { label: "\u041C\u043D\u0435 \u043F\u043E\u043C\u043E\u0433 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A \u0411\u0430\u043D\u043A\u0430", orientation: "horizontal", items: BUTTON_TYPES, value: bankEmployeeFlg, onChange: handleBankEmployeeFlgChange }), bankEmployeeFlg === 'true' ? (jsx(DaDataInputControl, { label: "\u041A\u043E\u0434 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044F \u0411\u0430\u043D\u043A\u0430", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434", isInteger: true, maxLength: 8, ...field(input?.name ?? ''), ...input })) : null] }));
4485
+ });
4421
4486
 
4422
4487
  const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
4423
4488
 
@@ -4882,8 +4947,6 @@
4882
4947
  47: 'owner_debit_card_pens_plus',
4883
4948
  };
4884
4949
 
4885
- const RadioButtonGroupControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), ...rest }), renderErrorText(error)] })));
4886
-
4887
4950
  const RUBLE = [{ id: '810', text: 'Рубли' }];
4888
4951
  const CurrencyField = JSX(({ field, input }) => {
4889
4952
  const { data } = useLeadFormData('CURRENCY');
@@ -4893,6 +4956,15 @@
4893
4956
  return (jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: currencies, ...field(input?.name ?? '') }));
4894
4957
  });
4895
4958
 
4959
+ const getDictionaries = (dictionaries, store) => {
4960
+ Promise.all(Object.entries(dictionaries).map((dictionary) => {
4961
+ const [fieldName, dictionaryName] = dictionary;
4962
+ fetchRetailJSON(`/dictionary?dictionaryType=${encodeURIComponent(dictionaryName)}`, 'POST').then((res) => {
4963
+ store[fieldName] = res;
4964
+ });
4965
+ }));
4966
+ };
4967
+
4896
4968
  const getOrganizationFromInn = async (inn) => {
4897
4969
  const res = await getDaDataHints({
4898
4970
  url: 'suggest/party',
@@ -5000,6 +5072,12 @@
5000
5072
  const getOptionOp = (options) => (key) => options
5001
5073
  .map((_) => ({ key: _.key, text: _.value }))
5002
5074
  .find((_) => _.key === key) ?? null;
5075
+ const organizationDictionaries = {
5076
+ amountWorkers: 'EMPLOYEES_NUMBER',
5077
+ employerOrganization: 'ORGANIZATION_KIND',
5078
+ employerActivities: 'ORGANIZATION_ACTIVITY_TYPE',
5079
+ organization: 'ORGANIZATION_TYPE',
5080
+ };
5003
5081
 
5004
5082
  const updateOrganizationFields = (store, field, item) => {
5005
5083
  const { okved, okopf, inn, organizationName } = getOrganizationRequisites(item);
@@ -5011,6 +5089,8 @@
5011
5089
  organization: getOrganizationType(store?.organization ?? [], okopf, inn),
5012
5090
  employerOrganization: getOrganizationKind(store?.employerOrganization ?? [], okopf),
5013
5091
  organizationName,
5092
+ inn,
5093
+ isDadataOrganization: true,
5014
5094
  };
5015
5095
  for (const fieldName in organizationData) {
5016
5096
  field?.(fieldName)?.onChange?.(organizationData[fieldName]);
@@ -5023,14 +5103,26 @@
5023
5103
  organizationName: item.data?.name?.short_with_opf ?? '',
5024
5104
  });
5025
5105
 
5106
+ const NO_DADATA_ERROR_TEXT$1 = 'Необходимо выбрать ИНН из выпадающего списка';
5026
5107
  const DaDataInnField = JSX(({ field, input }) => {
5027
5108
  const store = useRetailFormStore();
5109
+ const [errorText, setErrorText] = useState('');
5028
5110
  const { employerActivities, employerOrganization, organization, amountWorkers } = store;
5029
5111
  const esiaAccountTypeCd = field?.('esiaAccountTypeCd')?.value;
5030
5112
  const inn = field?.('inn')?.value;
5113
+ const fieldError = field?.('organizationName')?.error;
5114
+ const isDadataOrganization = field('isDadataOrganization')?.value;
5115
+ useEffect(() => {
5116
+ setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT$1 : '');
5117
+ }, [isDadataOrganization, fieldError]);
5031
5118
  const onDaDataChange = useCallback((item) => {
5032
5119
  updateOrganizationFields(store, field, item);
5033
5120
  }, []);
5121
+ useEffect(() => {
5122
+ (async () => {
5123
+ await getDictionaries(organizationDictionaries, store);
5124
+ })();
5125
+ }, []);
5034
5126
  useEffect(() => {
5035
5127
  if (!esiaAccountTypeCd || !inn || !isDictionariesAlreadyLoad(store)) {
5036
5128
  return;
@@ -5042,16 +5134,15 @@
5042
5134
  }
5043
5135
  })();
5044
5136
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
5045
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: isEsiaAuthorize(field, input) }));
5137
+ const onChange = useCallback((value) => {
5138
+ field?.('inn')?.onChange?.(value);
5139
+ field?.('isDadataOrganization')?.onChange?.(false);
5140
+ }, []);
5141
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: isEsiaAuthorize(field, input), onChange: onChange, error: errorText || field('inn')?.error }));
5046
5142
  });
5047
5143
  const isDictionariesAlreadyLoad = (store) => {
5048
- const { employerActivities, employerOrganization, organization, amountWorkers, productType } = store;
5049
- return [
5050
- employerOrganization,
5051
- organization,
5052
- amountWorkers,
5053
- productType === 'creditCard' ? employerActivities : true,
5054
- ].every(Boolean);
5144
+ const { employerActivities, employerOrganization, organization, amountWorkers } = store;
5145
+ return [employerOrganization, organization, amountWorkers, employerActivities].every(Boolean);
5055
5146
  };
5056
5147
 
5057
5148
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: new Date() })));
@@ -5119,24 +5210,12 @@
5119
5210
  });
5120
5211
 
5121
5212
  const EmployerActivitiesField = JSX(({ field, input }) => {
5122
- const { data } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
5123
5213
  const store = useRetailFormStore();
5124
- useEffect(() => {
5125
- if (data) {
5126
- store.employerActivities = data;
5127
- }
5128
- }, [data]);
5129
5214
  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 }));
5130
5215
  });
5131
5216
 
5132
5217
  const EmployerOrganizationField = JSX(({ field, input }) => {
5133
- const { data } = useLeadFormData('ORGANIZATION_KIND');
5134
5218
  const store = useRetailFormStore();
5135
- useEffect(() => {
5136
- if (data) {
5137
- store.employerOrganization = data;
5138
- }
5139
- }, [data]);
5140
5219
  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 }));
5141
5220
  });
5142
5221
 
@@ -5340,23 +5419,27 @@
5340
5419
  });
5341
5420
 
5342
5421
  const OrganizationField = JSX(({ field, input }) => {
5343
- const { data } = useLeadFormData('ORGANIZATION_TYPE');
5344
5422
  const store = useRetailFormStore();
5345
- useEffect(() => {
5346
- if (data) {
5347
- store.organization = data;
5348
- }
5349
- }, [data]);
5350
5423
  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 }));
5351
5424
  });
5352
5425
 
5426
+ const NO_DADATA_ERROR_TEXT = 'Необходимо выбрать организацию из выпадающего списка';
5353
5427
  const OrganizationNameField = JSX(({ field, input }) => {
5354
5428
  const store = useRetailFormStore();
5429
+ const [errorText, setErrorText] = useState('');
5430
+ const fieldError = field?.('organizationName')?.error;
5431
+ const isDadataOrganization = field('isDadataOrganization')?.value;
5432
+ useEffect(() => {
5433
+ setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT : '');
5434
+ }, [isDadataOrganization, fieldError]);
5355
5435
  const onDaDataChange = useCallback((item) => {
5356
- field?.('inn')?.onChange?.(item.data?.inn);
5357
5436
  updateOrganizationFields(store, field, item);
5358
5437
  }, []);
5359
- return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: isEsiaAuthorize(field, input), onDaDataChange: onDaDataChange }));
5438
+ const onChange = useCallback((value) => {
5439
+ field?.('organizationName')?.onChange?.(value);
5440
+ field?.('isDadataOrganization')?.onChange?.(false);
5441
+ }, []);
5442
+ return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: isEsiaAuthorize(field, input), onDaDataChange: onDaDataChange, onChange: onChange, error: errorText || field('organizationName')?.error }));
5360
5443
  });
5361
5444
 
5362
5445
  const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
@@ -5561,7 +5644,7 @@
5561
5644
  shareholderFlg: ShareholderFlgField,
5562
5645
  legalEntityName: LegalEntityNameField,
5563
5646
  creditInRshbCd: CreditInRshbCdField,
5564
- bankEmployeeCode: BankEmpoleeCodeField,
5647
+ bankEmployeeCode: BankEmployeeCodeField,
5565
5648
  partInBusiness: PartInBusinessField,
5566
5649
  regionRetail: RegionRetailField,
5567
5650
  infoCard: InfoCardField,
@@ -5611,12 +5694,6 @@
5611
5694
 
5612
5695
  const renderSubmitButton = (button, isSending = false) => (jsx(SubmitButton$1, { className: "w-full @xl:w-auto", isLoading: isSending, children: button?.text ? button.text : 'Отправить заявку' }));
5613
5696
 
5614
- const sessionStore = new Store(); // sessionStorage cache
5615
- replicate(sessionStore, new StorageAdapter(globalThis?.sessionStorage));
5616
- function useSessionStore() {
5617
- return useStore(sessionStore);
5618
- }
5619
-
5620
5697
  const createDraftTask = async (body) => {
5621
5698
  const res = await fetchRetailJSON('/user-data/createDraftTask', 'POST', body);
5622
5699
  return res || {};
@@ -6115,6 +6192,7 @@
6115
6192
  employment: getSelectValue(employment, EMPLOYMENT_TYPE),
6116
6193
  organizationName,
6117
6194
  inn,
6195
+ isDadataOrganization: Boolean(inn),
6118
6196
  employerActivities: getSelectValue(employerActivities),
6119
6197
  organization: getSelectValue(organization),
6120
6198
  employerOrganization: getSelectValue(employerOrganization),
@@ -6851,6 +6929,7 @@
6851
6929
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6852
6930
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
6853
6931
  const noConsentDialog = useDialog(NoConsentDialog);
6932
+ useIFrameMode();
6854
6933
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6855
6934
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6856
6935
  const initialFormState = useInitApplicationLead({
@@ -8478,6 +8557,8 @@
8478
8557
  generalSeniority: generalSeniorityValidator(formState.lastJobExperience),
8479
8558
  beginDate: workBeginDateValidator(formState.limitedBirthday),
8480
8559
  participantDateRegistration: dateRegistrationValidator(formState.limitedBirthday),
8560
+ organizationName: organizationNameValidator(formState.isDadataOrganization),
8561
+ inn: organizationInnValidator(formState.isDadataOrganization),
8481
8562
  })(formState);
8482
8563
 
8483
8564
  const StepsNavigationButtons$2 = JSX(({ step, isSending, onPrevStep }) => {
@@ -8547,6 +8628,7 @@
8547
8628
  fiasCode: '',
8548
8629
  },
8549
8630
  organizationName: '',
8631
+ isDadataOrganization: false,
8550
8632
  organizationPhone: '',
8551
8633
  partInBusiness: undefined,
8552
8634
  positionOrganization: { key: '', text: '' },
@@ -8563,12 +8645,6 @@
8563
8645
  esiaAccountTypeCd: { key: '', text: '' },
8564
8646
  initiateBankruptcyFlg: isCredit ? false : undefined,
8565
8647
  },
8566
- {
8567
- bankruptcyFlg: false,
8568
- shareholderFlg: false,
8569
- legalEntityName: '',
8570
- creditInRshbCd: undefined,
8571
- },
8572
8648
  ];
8573
8649
 
8574
8650
  const formStateMap$2 = [
@@ -8578,6 +8654,12 @@
8578
8654
  codeWord: '',
8579
8655
  },
8580
8656
  ...getMainFormStateMap(),
8657
+ {
8658
+ bankruptcyFlg: false,
8659
+ shareholderFlg: false,
8660
+ legalEntityName: '',
8661
+ creditInRshbCd: undefined,
8662
+ },
8581
8663
  {
8582
8664
  regionRetail: { key: '', text: '' },
8583
8665
  addressRetail: { key: '', text: '' },
@@ -8637,12 +8719,9 @@
8637
8719
  };
8638
8720
 
8639
8721
  const getPersonalInfoData = (formData) => {
8640
- const { name, surname, middleName, limitedBirthday = '', phone = '', email, sex, birthPlace, dulIssueDate = '', dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, education, participantDateRegistration, housing, addressRegistration, addressFact, addressMatch, } = formData;
8722
+ const { limitedBirthday = '', sex, birthPlace, dulIssueDate = '', dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, education, participantDateRegistration, housing, addressRegistration, addressFact, addressMatch, } = formData;
8641
8723
  return {
8642
8724
  birthDate: formatDate(limitedBirthday, true),
8643
- midname: middleName,
8644
- name,
8645
- surname,
8646
8725
  birthPlace,
8647
8726
  dulIssueDate: formatDate(dulIssueDate, true),
8648
8727
  dulIssuedBy,
@@ -8655,10 +8734,6 @@
8655
8734
  : undefined,
8656
8735
  homeMatchFlg: addressMatch,
8657
8736
  houseTypeCd: housing,
8658
- participantContacts: getParticipantContacts$1({
8659
- phone: formatPhone(phone),
8660
- email,
8661
- }),
8662
8737
  participantAddresses: getParticipantAddresses$1({
8663
8738
  addressRegistration,
8664
8739
  addressFact: addressMatch ? addressRegistration : addressFact,
@@ -8802,6 +8877,7 @@
8802
8877
 
8803
8878
  const PRODUCT_TYPE$2 = 'creditCard';
8804
8879
  const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
8880
+ useIFrameMode();
8805
8881
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
8806
8882
  const formValidator = useCallback((formState) => getRetailFormValidator({
8807
8883
  formState,
@@ -8826,21 +8902,14 @@
8826
8902
  title: 'Персональные данные',
8827
8903
  columns: 2,
8828
8904
  inputs: [
8829
- {
8830
- name: 'surname',
8831
- required: true,
8832
- dadata: true,
8833
- filledByEsia: true,
8834
- },
8835
- { name: 'name', required: true, dadata: true, filledByEsia: true },
8836
- { name: 'middleName', dadata: true, filledByEsia: true },
8837
- { name: 'sex', required: true },
8838
8905
  { name: 'limitedBirthday', required: true, filledByEsia: true },
8839
8906
  { name: 'birthPlace', required: true, filledByEsia: true },
8840
- { name: 'phone', disabled: true, required: true },
8841
- { name: 'email', required: true, dadata: true },
8842
8907
  ],
8843
8908
  },
8909
+ {
8910
+ columns: 2,
8911
+ inputs: [{ name: 'sex', required: true }],
8912
+ },
8844
8913
  {
8845
8914
  title: 'Паспортные данные',
8846
8915
  columns: 2,
@@ -9035,29 +9104,32 @@
9035
9104
  ],
9036
9105
  },
9037
9106
  {
9038
- inputs: [
9039
- { name: 'employment', required: true },
9040
- { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
9041
- ],
9107
+ inputs: [{ name: 'employment', required: true }],
9042
9108
  },
9043
9109
  {
9044
9110
  columns: 2,
9045
9111
  inputs: [
9112
+ { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
9046
9113
  { name: 'inn', required: true, dadata: true, filledByEsia: true },
9047
- { name: 'legalForm', required: true },
9048
9114
  ],
9049
9115
  },
9050
9116
  {
9117
+ inputs: [{ name: 'amountWorkers', required: true }],
9118
+ },
9119
+ {
9120
+ columns: 2,
9051
9121
  inputs: [
9052
- { name: 'organization', required: true },
9053
- { name: 'amountWorkers', required: true },
9122
+ { name: 'employerActivities', required: true },
9123
+ {
9124
+ name: 'organizationPhone',
9125
+ label: 'Телефон работодателя',
9126
+ required: true,
9127
+ },
9054
9128
  ],
9055
9129
  },
9056
9130
  {
9057
9131
  columns: 2,
9058
9132
  inputs: [
9059
- { name: 'employerActivities', required: true },
9060
- { name: 'employerOrganization', required: true },
9061
9133
  { name: 'generalSeniority', required: true, filledByEsia: true },
9062
9134
  { name: 'lastJobExperience', required: true, filledByEsia: true },
9063
9135
  { name: 'experience5Years', required: true, filledByEsia: true },
@@ -9065,14 +9137,7 @@
9065
9137
  ],
9066
9138
  },
9067
9139
  {
9068
- inputs: [
9069
- {
9070
- name: 'organizationPhone',
9071
- label: 'Телефон работодателя',
9072
- required: true,
9073
- },
9074
- { name: 'beginDate', required: true, filledByEsia: true },
9075
- ],
9140
+ inputs: [{ name: 'beginDate', required: true, filledByEsia: true }],
9076
9141
  },
9077
9142
  {
9078
9143
  columns: 2,
@@ -9206,13 +9271,20 @@
9206
9271
  values: ['office'],
9207
9272
  },
9208
9273
  },
9274
+ ],
9275
+ },
9276
+ {
9277
+ columns: 2,
9278
+ inputs: [
9209
9279
  {
9210
- name: 'bankEmployeeCode',
9211
9280
  condition: {
9212
9281
  name: 'methodObtain',
9213
9282
  values: ['office'],
9214
9283
  },
9215
9284
  },
9285
+ {
9286
+ name: 'bankEmployeeCode',
9287
+ },
9216
9288
  ],
9217
9289
  },
9218
9290
  ];
@@ -9519,6 +9591,7 @@
9519
9591
  const PRODUCT_TYPE$1 = 'credit';
9520
9592
  const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
9521
9593
  const { programId } = useRetailFormStore();
9594
+ useIFrameMode();
9522
9595
  const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
9523
9596
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
9524
9597
  const formValidator = useCallback((formState) => getRetailFormValidator({
@@ -9581,38 +9654,30 @@
9581
9654
  ],
9582
9655
  },
9583
9656
  {
9584
- inputs: [
9585
- { name: 'employment', required: true },
9586
- { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
9587
- ],
9657
+ inputs: [{ name: 'employment', required: true }],
9588
9658
  },
9589
9659
  {
9590
9660
  columns: 2,
9591
9661
  inputs: [
9662
+ { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
9592
9663
  { name: 'inn', required: true, dadata: true, filledByEsia: true },
9593
- { name: 'legalForm', required: true },
9594
9664
  ],
9595
9665
  },
9596
9666
  {
9667
+ columns: 2,
9597
9668
  inputs: [
9598
- { name: 'organization', required: true },
9599
9669
  { name: 'amountWorkers', required: true },
9670
+ {
9671
+ name: 'organizationPhone',
9672
+ label: 'Телефон работодателя',
9673
+ required: true,
9674
+ },
9600
9675
  ],
9601
9676
  },
9602
9677
  {
9603
9678
  columns: 2,
9604
9679
  inputs: [
9605
- { name: 'employerOrganization', required: true },
9606
9680
  { name: 'jobsNumber', required: true, filledByEsia: true },
9607
- ],
9608
- },
9609
- {
9610
- inputs: [
9611
- {
9612
- name: 'organizationPhone',
9613
- label: 'Телефон работодателя',
9614
- required: true,
9615
- },
9616
9681
  { name: 'beginDate', required: true, filledByEsia: true },
9617
9682
  ],
9618
9683
  },
@@ -9713,7 +9778,12 @@
9713
9778
  ],
9714
9779
  },
9715
9780
  {
9716
- inputs: [{ name: 'bankEmployeeCode' }],
9781
+ columns: 2,
9782
+ inputs: [
9783
+ {
9784
+ name: 'bankEmployeeCode',
9785
+ },
9786
+ ],
9717
9787
  },
9718
9788
  ];
9719
9789
  const CALCULATOR_CONTENT = [
@@ -10025,6 +10095,7 @@
10025
10095
 
10026
10096
  const PRODUCT_TYPE = 'debitCard';
10027
10097
  const DebitFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
10098
+ useIFrameMode();
10028
10099
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
10029
10100
  const formValidator = useCallback((formState) => getRetailFormValidator({
10030
10101
  formState,
@@ -11628,7 +11699,7 @@
11628
11699
  const Tag = tag;
11629
11700
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11630
11701
  const { text, description, icon, count, tabName, ...link } = item;
11631
- return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), "aria-label": "\u0421\u043F\u0438\u0441\u043E\u043A \u0442\u0430\u0431\u043E\u0432", onClick: onClick, ...link, children: jsxs("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), role: "tab", "aria-label": `Таб ${text}`, children: [renderTabItemInner({
11702
+ return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', 'rounded-none', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), "aria-label": "\u0421\u043F\u0438\u0441\u043E\u043A \u0442\u0430\u0431\u043E\u0432", onClick: onClick, ...link, children: jsxs("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), role: "tab", "aria-label": `Таб ${text}`, children: [renderTabItemInner({
11632
11703
  text,
11633
11704
  description,
11634
11705
  icon,
@@ -12101,6 +12172,7 @@
12101
12172
  const ContentPage = JSX(({ className, data = EMPTY_DATA, blocksRegistry, blockDecorator }) => {
12102
12173
  const { slots, blocks, fallback, ...pageContent } = data;
12103
12174
  const resolvedPageContent = useJSONRef(pageContent, fallback);
12175
+ const isFrame = isIFrame();
12104
12176
  useClickHandler();
12105
12177
  useDefaultLocation();
12106
12178
  const options = {
@@ -12110,11 +12182,12 @@
12110
12182
  blockDecorator,
12111
12183
  parent: data,
12112
12184
  };
12113
- return (jsxs("div", { "data-theme": data.colorPalette || 'pc', children: [jsxs("section", { className: style('@container relative', data.style, className), children: [slots?.[HEADER_SLOT]?.length ? (jsx("div", { className: "relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.[HEADER_SLOT], { ...options, slotName: HEADER_SLOT }) })) : null, jsxs("div", { className: "container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: [renderChildren({
12185
+ return (jsxs("div", { "data-theme": data.colorPalette || 'pc', children: [jsxs("section", { className: style('@container relative', data.style, className), children: [!isFrame && slots?.[HEADER_SLOT]?.length ? (jsx("div", { className: "relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.[HEADER_SLOT], { ...options, slotName: HEADER_SLOT }) })) : null, jsxs("div", { className: "container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: [renderChildren({
12114
12186
  block: data,
12115
12187
  options,
12116
12188
  extraProps: { className: 'scroll-mt-12' },
12117
- }), renderBlocksList(slots?.[FOOTER_SLOT], { ...options, slotName: FOOTER_SLOT })] })] }), slots?.[STICKY_FOOTER_SLOT]?.length ? (jsx("div", { className: "fixed w-full bottom-0 left-0 z-[100]", children: renderBlocksList(slots?.[STICKY_FOOTER_SLOT], {
12189
+ }), !isFrame &&
12190
+ renderBlocksList(slots?.[FOOTER_SLOT], { ...options, slotName: FOOTER_SLOT })] })] }), !isFrame && slots?.[STICKY_FOOTER_SLOT]?.length ? (jsx("div", { className: "fixed w-full bottom-0 left-0 z-[100]", children: renderBlocksList(slots?.[STICKY_FOOTER_SLOT], {
12118
12191
  ...options,
12119
12192
  slotName: STICKY_FOOTER_SLOT,
12120
12193
  }) })) : null, jsx(DialogManager, {}), jsx(PopupManager, {}), jsx(CookiePopup, { __html: resolvedPageContent?.cookieContent?.__html })] }));
@@ -12124,7 +12197,7 @@
12124
12197
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
12125
12198
  });
12126
12199
 
12127
- const packageVersion = "0.14.916";
12200
+ const packageVersion = "0.14.918";
12128
12201
 
12129
12202
  exports.Blocks = Blocks;
12130
12203
  exports.ContentPage = ContentPage;