@redneckz/wildless-cms-uni-blocks 0.14.925 → 0.14.927

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 (163) hide show
  1. package/bundle/bundle.umd.js +54 -38
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  4. package/bundle/retail/api/checkCode.d.ts +1 -2
  5. package/bundle/retail/api/sendCode.d.ts +1 -1
  6. package/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  7. package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  8. package/bundle/retail/utils/saveToken.d.ts +2 -0
  9. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +10 -2
  10. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  11. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  12. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +9 -5
  13. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  14. package/dist/components/DebitForm/DebitFormStepsData.js +1 -1
  15. package/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  16. package/dist/retail/api/checkCode.d.ts +1 -2
  17. package/dist/retail/api/checkCode.js +2 -9
  18. package/dist/retail/api/checkCode.js.map +1 -1
  19. package/dist/retail/api/esiaRequestProfile.js +2 -2
  20. package/dist/retail/api/esiaRequestProfile.js.map +1 -1
  21. package/dist/retail/api/sendCode.d.ts +1 -1
  22. package/dist/retail/api/sendCode.js +1 -3
  23. package/dist/retail/api/sendCode.js.map +1 -1
  24. package/dist/retail/components/Fields/LatinNameField.js +1 -1
  25. package/dist/retail/components/Fields/LatinSurnameField.js +1 -1
  26. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  27. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +8 -4
  28. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  29. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  30. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +18 -14
  31. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  32. package/dist/retail/hooks/useReferalProgramm.js +1 -1
  33. package/dist/retail/hooks/useReferalProgramm.js.map +1 -1
  34. package/dist/retail/utils/mockLocalStorage.js +4 -1
  35. package/dist/retail/utils/mockLocalStorage.js.map +1 -1
  36. package/dist/retail/utils/saveToken.d.ts +2 -0
  37. package/dist/retail/utils/saveToken.js +8 -0
  38. package/dist/retail/utils/saveToken.js.map +1 -0
  39. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +10 -2
  40. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  41. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  42. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -6
  43. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  44. package/lib/components/DebitForm/DebitFormStepsData.js +1 -1
  45. package/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  46. package/lib/retail/api/checkCode.d.ts +1 -2
  47. package/lib/retail/api/checkCode.js +2 -8
  48. package/lib/retail/api/checkCode.js.map +1 -1
  49. package/lib/retail/api/esiaRequestProfile.js +1 -1
  50. package/lib/retail/api/esiaRequestProfile.js.map +1 -1
  51. package/lib/retail/api/sendCode.d.ts +1 -1
  52. package/lib/retail/api/sendCode.js +1 -3
  53. package/lib/retail/api/sendCode.js.map +1 -1
  54. package/lib/retail/components/Fields/LatinNameField.js +1 -1
  55. package/lib/retail/components/Fields/LatinSurnameField.js +1 -1
  56. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  57. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +8 -4
  58. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  59. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  60. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +18 -14
  61. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  62. package/lib/retail/hooks/useReferalProgramm.js +1 -1
  63. package/lib/retail/hooks/useReferalProgramm.js.map +1 -1
  64. package/lib/retail/utils/mockLocalStorage.js +4 -1
  65. package/lib/retail/utils/mockLocalStorage.js.map +1 -1
  66. package/lib/retail/utils/saveToken.d.ts +2 -0
  67. package/lib/retail/utils/saveToken.js +5 -0
  68. package/lib/retail/utils/saveToken.js.map +1 -0
  69. package/mobile/bundle/bundle.umd.js +54 -38
  70. package/mobile/bundle/bundle.umd.min.js +1 -1
  71. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  72. package/mobile/bundle/retail/api/checkCode.d.ts +1 -2
  73. package/mobile/bundle/retail/api/sendCode.d.ts +1 -1
  74. package/mobile/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  75. package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  76. package/mobile/bundle/retail/utils/saveToken.d.ts +2 -0
  77. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +10 -2
  78. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  79. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  80. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +9 -5
  81. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  82. package/mobile/dist/components/DebitForm/DebitFormStepsData.js +1 -1
  83. package/mobile/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  84. package/mobile/dist/retail/api/checkCode.d.ts +1 -2
  85. package/mobile/dist/retail/api/checkCode.js +2 -9
  86. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  87. package/mobile/dist/retail/api/esiaRequestProfile.js +2 -2
  88. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -1
  89. package/mobile/dist/retail/api/sendCode.d.ts +1 -1
  90. package/mobile/dist/retail/api/sendCode.js +1 -3
  91. package/mobile/dist/retail/api/sendCode.js.map +1 -1
  92. package/mobile/dist/retail/components/Fields/LatinNameField.js +1 -1
  93. package/mobile/dist/retail/components/Fields/LatinSurnameField.js +1 -1
  94. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  95. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +8 -4
  96. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  97. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  98. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +18 -14
  99. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  100. package/mobile/dist/retail/hooks/useReferalProgramm.js +1 -1
  101. package/mobile/dist/retail/hooks/useReferalProgramm.js.map +1 -1
  102. package/mobile/dist/retail/utils/mockLocalStorage.js +4 -1
  103. package/mobile/dist/retail/utils/mockLocalStorage.js.map +1 -1
  104. package/mobile/dist/retail/utils/saveToken.d.ts +2 -0
  105. package/mobile/dist/retail/utils/saveToken.js +8 -0
  106. package/mobile/dist/retail/utils/saveToken.js.map +1 -0
  107. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +10 -2
  108. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  109. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  110. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -6
  111. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  112. package/mobile/lib/components/DebitForm/DebitFormStepsData.js +1 -1
  113. package/mobile/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  114. package/mobile/lib/retail/api/checkCode.d.ts +1 -2
  115. package/mobile/lib/retail/api/checkCode.js +2 -8
  116. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  117. package/mobile/lib/retail/api/esiaRequestProfile.js +1 -1
  118. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -1
  119. package/mobile/lib/retail/api/sendCode.d.ts +1 -1
  120. package/mobile/lib/retail/api/sendCode.js +1 -3
  121. package/mobile/lib/retail/api/sendCode.js.map +1 -1
  122. package/mobile/lib/retail/components/Fields/LatinNameField.js +1 -1
  123. package/mobile/lib/retail/components/Fields/LatinSurnameField.js +1 -1
  124. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -0
  125. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +8 -4
  126. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  127. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +3 -2
  128. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +18 -14
  129. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  130. package/mobile/lib/retail/hooks/useReferalProgramm.js +1 -1
  131. package/mobile/lib/retail/hooks/useReferalProgramm.js.map +1 -1
  132. package/mobile/lib/retail/utils/mockLocalStorage.js +4 -1
  133. package/mobile/lib/retail/utils/mockLocalStorage.js.map +1 -1
  134. package/mobile/lib/retail/utils/saveToken.d.ts +2 -0
  135. package/mobile/lib/retail/utils/saveToken.js +5 -0
  136. package/mobile/lib/retail/utils/saveToken.js.map +1 -0
  137. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -2
  138. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +11 -5
  139. package/mobile/src/components/DebitForm/DebitFormStepsData.tsx +1 -1
  140. package/mobile/src/retail/api/checkCode.ts +2 -9
  141. package/mobile/src/retail/api/esiaRequestProfile.ts +2 -1
  142. package/mobile/src/retail/api/sendCode.ts +1 -4
  143. package/mobile/src/retail/components/Fields/LatinNameField.tsx +1 -1
  144. package/mobile/src/retail/components/Fields/LatinSurnameField.tsx +1 -1
  145. package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +15 -4
  146. package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +22 -15
  147. package/mobile/src/retail/hooks/useReferalProgramm.ts +1 -1
  148. package/mobile/src/retail/utils/mockLocalStorage.ts +6 -2
  149. package/mobile/src/retail/utils/saveToken.ts +6 -0
  150. package/package.json +1 -1
  151. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -2
  152. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +11 -5
  153. package/src/components/DebitForm/DebitFormStepsData.tsx +1 -1
  154. package/src/retail/api/checkCode.ts +2 -9
  155. package/src/retail/api/esiaRequestProfile.ts +2 -1
  156. package/src/retail/api/sendCode.ts +1 -4
  157. package/src/retail/components/Fields/LatinNameField.tsx +1 -1
  158. package/src/retail/components/Fields/LatinSurnameField.tsx +1 -1
  159. package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +15 -4
  160. package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +22 -15
  161. package/src/retail/hooks/useReferalProgramm.ts +1 -1
  162. package/src/retail/utils/mockLocalStorage.ts +6 -2
  163. package/src/retail/utils/saveToken.ts +6 -0
@@ -5359,7 +5359,7 @@
5359
5359
  };
5360
5360
  const autoTranslateToLatin = (str) => str.replace(/[А-ЯЁа-яё,. -]/g, (_) => REPLACER[_.toLowerCase()].toUpperCase() || '');
5361
5361
 
5362
- const MAX_LENGTH$1 = 20;
5362
+ const MAX_LENGTH$1 = 21;
5363
5363
  const LatinNameField = JSX(({ field, input }) => {
5364
5364
  const latinSurname = field('latinSurname')?.value;
5365
5365
  const name = field('name')?.value;
@@ -5375,7 +5375,7 @@
5375
5375
  return (jsx(InputControl, { label: "\u0418\u043C\u044F", placeholder: "\u0418\u043C\u044F \u043B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u043C\u0438 \u0431\u0443\u043A\u0432\u0430\u043C\u0438", maxLength: Math.max(MAX_LENGTH$1 - latinSurname?.length, 1), ...field(input?.name ?? ''), onChange: onChange, ...input }));
5376
5376
  });
5377
5377
 
5378
- const MAX_LENGTH = 20;
5378
+ const MAX_LENGTH = 21;
5379
5379
  const LatinSurnameField = JSX(({ field, input }) => {
5380
5380
  const latinName = field('latinName')?.value;
5381
5381
  const surname = field('surname')?.value;
@@ -5729,9 +5729,7 @@
5729
5729
 
5730
5730
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
5731
5731
 
5732
- const sendCode = (body) => doRequest('/sms/sendCode', 'POST', body)
5733
- .then((res) => res.text())
5734
- .then((text) => text === 'OK');
5732
+ const sendCode = (body) => doRequest('/sms/sendCode', 'POST', body);
5735
5733
 
5736
5734
  const ICON_SIZE = { width: '103', height: '21' };
5737
5735
 
@@ -5794,16 +5792,15 @@
5794
5792
  return (jsx(Dialog, { head: jsx(Logo, {}), onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsxs("div", { className: "flex", children: [jsx("img", { className: "grow", src: captcha }), jsx(Button, { className: "w-8", embedded: true, onClick: handleCreateCaptcha, children: jsx(Icon, { iconVersion: "normal", name: "RefreshIcon" }) })] }), jsx(Input, { className: "w-80", onChange: setCode, value: code, placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438" }), hasError ? jsx("div", { className: "text-error", children: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043E\u0434" }) : null, jsxs("div", { className: "flex w-80 justify-between", children: [jsx(Button, { version: "secondary", onClick: closeAll, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F" }), jsx(SubmitButton$1, { version: "secondary", disabled: !code, onClick: handleCheckCaptcha, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })] }), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
5795
5793
  });
5796
5794
 
5797
- const checkCode = async (body) => fetchRetailJSON('/sms/checkCode', 'POST', body).then(saveToken);
5795
+ const checkCode = async (body) => await doRequest('/sms/checkCode', 'POST', body);
5796
+
5798
5797
  const saveToken = (data) => {
5799
- if (data?.access_token && data?.refresh_token) {
5800
- globalThis.sessionStorage.setItem('accessToken', data.access_token);
5801
- globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
5802
- }
5798
+ globalThis.sessionStorage.setItem('accessToken', data.access_token);
5799
+ globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
5803
5800
  };
5804
5801
 
5805
5802
  const TIME_TO_RESEND = 180;
5806
- const useVerifyPhoneDialogSubmit = ({ values, onSuccess, }) => {
5803
+ const useVerifyPhoneDialogSubmit = ({ values, onSuccess, onFail, }) => {
5807
5804
  const sessionStore = useSessionStore();
5808
5805
  const attempts = sessionStore.smsCode?.attempts || 0;
5809
5806
  const timer = Math.max(getTimer(sessionStore.smsCode?.sendTime || Date.now()), 0);
@@ -5814,27 +5811,30 @@
5814
5811
  const isTimeExpired = Boolean(timeNextReq === 0 && sessionStore.smsCode?.sendTime);
5815
5812
  const isSubmitButtonDisabled = attempts > 2 || isTimeExpired || !values.every(Boolean);
5816
5813
  const handleSubmit = useCallback(async () => {
5817
- try {
5818
- sessionStore.smsCode = {
5819
- ...sessionStore.smsCode,
5820
- attempts: attempts + 1,
5821
- };
5822
- startLoading();
5823
- await checkCode({
5824
- smsText: values.join(''),
5825
- smsCodesSetName: { key: 'AUTHENTICATION' },
5826
- });
5814
+ sessionStore.smsCode = {
5815
+ ...sessionStore.smsCode,
5816
+ attempts: attempts + 1,
5817
+ };
5818
+ startLoading();
5819
+ const response = await checkCode({
5820
+ smsText: values.join(''),
5821
+ smsCodesSetName: { key: 'AUTHENTICATION' },
5822
+ });
5823
+ if (response.ok) {
5824
+ const data = (await response.json());
5825
+ saveToken(data);
5827
5826
  setTimeNextReq(0);
5828
5827
  resetError();
5829
5828
  sessionStore.smsCode = null;
5830
5829
  onSuccess?.(values.join(''));
5831
5830
  }
5832
- catch {
5831
+ else if (response.status === 403) {
5833
5832
  setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
5834
5833
  }
5835
- finally {
5836
- endLoading();
5834
+ else {
5835
+ onFail();
5837
5836
  }
5837
+ endLoading();
5838
5838
  }, [values, attempts]);
5839
5839
  useEffect(() => {
5840
5840
  if (isTimeExpired) {
@@ -5857,12 +5857,13 @@
5857
5857
  };
5858
5858
 
5859
5859
  const CODE_LENGTH = 4;
5860
- const VerifyPhoneDialog = JSX(({ phone, withDescription = true, consents, onSuccess = noop, onClose = noop }) => {
5860
+ const VerifyPhoneDialog = JSX(({ phone, withDescription = true, consents, onSuccess = noop, onClose = noop, onFail = noop, }) => {
5861
5861
  const [values, setValues] = useState(Array(CODE_LENGTH).fill(''));
5862
5862
  const sessionStore = useSessionStore();
5863
5863
  const { handleSubmit, hasError, errorText, isLoading, timeNextReq, isSubmitButtonDisabled, setTimeNextReq, setErrorText, } = useVerifyPhoneDialogSubmit({
5864
5864
  values,
5865
5865
  onSuccess,
5866
+ onFail,
5866
5867
  });
5867
5868
  const captchaDialog = useDialog(CaptchaDialog);
5868
5869
  const phoneNumber = formatPhone(phone);
@@ -5872,7 +5873,7 @@
5872
5873
  phoneNumber,
5873
5874
  smsCodesSetName: { key: 'AUTHENTICATION' },
5874
5875
  });
5875
- if (response) {
5876
+ if (response.ok) {
5876
5877
  setTimeNextReq(TIME_TO_RESEND);
5877
5878
  restartTimer(TIME_TO_RESEND);
5878
5879
  setErrorText('');
@@ -5881,10 +5882,13 @@
5881
5882
  attempts: 0,
5882
5883
  };
5883
5884
  }
5884
- else {
5885
+ else if (response.status === 429) {
5885
5886
  captchaDialog.open({ phoneNumber, sendCode: handleSendCode });
5886
5887
  }
5887
- }, [phoneNumber, restartTimer, onClose]);
5888
+ else {
5889
+ onFail();
5890
+ }
5891
+ }, [phoneNumber, restartTimer]);
5888
5892
  useEffect(() => {
5889
5893
  if (!sessionStore.smsCode?.sendTime) {
5890
5894
  handleSendCode();
@@ -6408,9 +6412,8 @@
6408
6412
 
6409
6413
  /* eslint-disable max-lines */
6410
6414
  // eslint-disable-next-line max-lines-per-function
6411
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
6415
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, changeSubmitFormStatus, }) => {
6412
6416
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
6413
- const [ok, setOK] = useState();
6414
6417
  const saveUserData = useSaveUserData();
6415
6418
  const sessionStore = useSessionStore();
6416
6419
  const leadFormStore = useLeadFormStore();
@@ -6422,6 +6425,10 @@
6422
6425
  const consentBkiDialog = useConsentBkiDialog(goToNextStep);
6423
6426
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
6424
6427
  const draftDialog = useDraftDialog();
6428
+ const handleFailSendForm = () => {
6429
+ verifyPhoneDialog.close();
6430
+ changeSubmitFormStatus(false);
6431
+ };
6425
6432
  const handleSubmit = useCallback(async (formData) => {
6426
6433
  try {
6427
6434
  startSending();
@@ -6472,7 +6479,7 @@
6472
6479
  }
6473
6480
  }
6474
6481
  catch {
6475
- setOK(false);
6482
+ handleFailSendForm();
6476
6483
  }
6477
6484
  };
6478
6485
  const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
@@ -6480,16 +6487,17 @@
6480
6487
  phone: transformedFormData.phone,
6481
6488
  consents: acceptedConsents,
6482
6489
  onSuccess: handleSuccessVerify,
6490
+ onFail: handleFailSendForm,
6483
6491
  });
6484
6492
  }
6485
6493
  catch {
6486
- setOK(false);
6494
+ handleFailSendForm();
6487
6495
  }
6488
6496
  finally {
6489
6497
  endSending();
6490
6498
  }
6491
6499
  }, []);
6492
- return { isSending, ok, handleSubmit };
6500
+ return { isSending, handleSubmit };
6493
6501
  };
6494
6502
  const getAcceptedConsents = (formData, productType) => {
6495
6503
  const consents = productTypeToConsentsMap[productType];
@@ -6650,7 +6658,7 @@
6650
6658
  {
6651
6659
  aspectName: 'snowplowEvent',
6652
6660
  params: {
6653
- eventName: 'ownfin_referal_link_attributes',
6661
+ eventAction: 'ownfin_referal_link_attributes',
6654
6662
  eventJSON,
6655
6663
  },
6656
6664
  },
@@ -6931,6 +6939,7 @@
6931
6939
 
6932
6940
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6933
6941
  const [esiaStatus, setEsiaStatus] = useState();
6942
+ const [ok, setOK] = useState();
6934
6943
  const [attemptsWithoutConsents, setAttemptsWithoutConsents] = useState(0);
6935
6944
  const leadForm = useRef(null);
6936
6945
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
@@ -6939,6 +6948,9 @@
6939
6948
  useIFrameMode();
6940
6949
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6941
6950
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6951
+ const changeSubmitFormStatus = (status) => {
6952
+ setOK(status);
6953
+ };
6942
6954
  const initialFormState = useInitApplicationLead({
6943
6955
  inputs,
6944
6956
  nextStepLink,
@@ -6946,11 +6958,12 @@
6946
6958
  setEsiaStatus,
6947
6959
  esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6948
6960
  });
6949
- const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6961
+ const { isSending, handleSubmit } = useApplicationLeadApi({
6950
6962
  programId,
6951
6963
  nextStepLink,
6952
6964
  productType,
6953
6965
  data,
6966
+ changeSubmitFormStatus,
6954
6967
  });
6955
6968
  const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6956
6969
  formValidator,
@@ -6969,7 +6982,10 @@
6969
6982
  const responseTypeDialog = useDialog(ResponseTypeDialog);
6970
6983
  useEffect(() => {
6971
6984
  if (ok !== undefined) {
6972
- responseTypeDialog.open({ ok });
6985
+ responseTypeDialog.open({
6986
+ ok,
6987
+ onClose: () => changeSubmitFormStatus(undefined),
6988
+ });
6973
6989
  }
6974
6990
  }, [ok]);
6975
6991
  useEffect(() => {
@@ -10285,7 +10301,7 @@
10285
10301
  name: 'infoCard',
10286
10302
  label:
10287
10303
  // eslint-disable-next-line max-len
10288
- 'Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.',
10304
+ 'Количество символов ограничивается 21. При этом, если фамилия и имя на карте содержит более 22 символов, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 21, то указывать только фамилию.',
10289
10305
  },
10290
10306
  ],
10291
10307
  },
@@ -11927,7 +11943,7 @@
11927
11943
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11928
11944
  });
11929
11945
 
11930
- const packageVersion = "0.14.924";
11946
+ const packageVersion = "0.14.926";
11931
11947
 
11932
11948
  exports.Blocks = Blocks;
11933
11949
  exports.ContentPage = ContentPage;