@redneckz/wildless-cms-uni-blocks 0.14.1029 → 0.14.1031

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 (215) hide show
  1. package/bundle/api/getSubmitBody.d.ts +4225 -865
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +79 -7
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  6. package/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  7. package/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  8. package/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  9. package/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  10. package/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  11. package/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  12. package/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  13. package/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  14. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  15. package/dist/api/getSubmitBody.d.ts +4225 -865
  16. package/dist/api/getSubmitBody.js +14 -0
  17. package/dist/api/getSubmitBody.js.map +1 -1
  18. package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  19. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  20. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  21. package/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  22. package/dist/components/ApplicationForm/Footnote.js +1 -1
  23. package/dist/components/ApplicationForm/Footnote.js.map +1 -1
  24. package/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  25. package/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  26. package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  27. package/dist/components/Blocks.js +2 -0
  28. package/dist/components/Blocks.js.map +1 -1
  29. package/dist/components/Blocks.mobile.js +2 -0
  30. package/dist/components/Blocks.mobile.js.map +1 -1
  31. package/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  32. package/dist/components/ReferalForm/ReferalForm.js +33 -0
  33. package/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  34. package/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  35. package/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  36. package/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  37. package/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  38. package/dist/components/ReferalForm/ResultLink.js +13 -0
  39. package/dist/components/ReferalForm/ResultLink.js.map +1 -0
  40. package/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  41. package/dist/components/ReferalForm/referalFormData.js +19 -0
  42. package/dist/components/ReferalForm/referalFormData.js.map +1 -0
  43. package/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  44. package/dist/components/ReferalForm/renderLinkInput.js +20 -0
  45. package/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  46. package/dist/components/ReferalForm/renderSections.d.ts +3 -0
  47. package/dist/components/ReferalForm/renderSections.js +10 -0
  48. package/dist/components/ReferalForm/renderSections.js.map +1 -0
  49. package/dist/hooks/useDadataParty.js +1 -1
  50. package/dist/hooks/useDadataParty.js.map +1 -1
  51. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  52. package/lib/api/getSubmitBody.d.ts +4225 -865
  53. package/lib/api/getSubmitBody.js +14 -0
  54. package/lib/api/getSubmitBody.js.map +1 -1
  55. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  56. package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  57. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  58. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  59. package/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  60. package/lib/components/ApplicationForm/Footnote.js +1 -1
  61. package/lib/components/ApplicationForm/Footnote.js.map +1 -1
  62. package/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  63. package/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  64. package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  65. package/lib/components/Blocks.js +2 -0
  66. package/lib/components/Blocks.js.map +1 -1
  67. package/lib/components/Blocks.mobile.js +2 -0
  68. package/lib/components/Blocks.mobile.js.map +1 -1
  69. package/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  70. package/lib/components/ReferalForm/ReferalForm.fixture.d.ts +5 -0
  71. package/lib/components/ReferalForm/ReferalForm.fixture.mobile.d.ts +5 -0
  72. package/lib/components/ReferalForm/ReferalForm.js +31 -0
  73. package/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  74. package/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  75. package/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  76. package/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  77. package/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  78. package/lib/components/ReferalForm/ResultLink.js +11 -0
  79. package/lib/components/ReferalForm/ResultLink.js.map +1 -0
  80. package/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  81. package/lib/components/ReferalForm/referalFormData.js +17 -0
  82. package/lib/components/ReferalForm/referalFormData.js.map +1 -0
  83. package/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  84. package/lib/components/ReferalForm/renderLinkInput.js +18 -0
  85. package/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  86. package/lib/components/ReferalForm/renderSections.d.ts +3 -0
  87. package/lib/components/ReferalForm/renderSections.js +7 -0
  88. package/lib/components/ReferalForm/renderSections.js.map +1 -0
  89. package/lib/hooks/useDadataParty.js +1 -1
  90. package/lib/hooks/useDadataParty.js.map +1 -1
  91. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  92. package/mobile/bundle/api/getSubmitBody.d.ts +4225 -865
  93. package/mobile/bundle/bundle.umd.js +79 -7
  94. package/mobile/bundle/bundle.umd.min.js +1 -1
  95. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  96. package/mobile/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  97. package/mobile/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  98. package/mobile/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  99. package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  100. package/mobile/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  101. package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  102. package/mobile/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  103. package/mobile/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  104. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  105. package/mobile/dist/api/getSubmitBody.d.ts +4225 -865
  106. package/mobile/dist/api/getSubmitBody.js +14 -0
  107. package/mobile/dist/api/getSubmitBody.js.map +1 -1
  108. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  109. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  110. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  111. package/mobile/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  112. package/mobile/dist/components/ApplicationForm/Footnote.js +1 -1
  113. package/mobile/dist/components/ApplicationForm/Footnote.js.map +1 -1
  114. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  115. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  116. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  117. package/mobile/dist/components/Blocks.js +2 -0
  118. package/mobile/dist/components/Blocks.js.map +1 -1
  119. package/mobile/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  120. package/mobile/dist/components/ReferalForm/ReferalForm.js +33 -0
  121. package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  122. package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  123. package/mobile/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  124. package/mobile/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  125. package/mobile/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  126. package/mobile/dist/components/ReferalForm/ResultLink.js +13 -0
  127. package/mobile/dist/components/ReferalForm/ResultLink.js.map +1 -0
  128. package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  129. package/mobile/dist/components/ReferalForm/referalFormData.js +19 -0
  130. package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -0
  131. package/mobile/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  132. package/mobile/dist/components/ReferalForm/renderLinkInput.js +20 -0
  133. package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  134. package/mobile/dist/components/ReferalForm/renderSections.d.ts +3 -0
  135. package/mobile/dist/components/ReferalForm/renderSections.js +10 -0
  136. package/mobile/dist/components/ReferalForm/renderSections.js.map +1 -0
  137. package/mobile/dist/hooks/useDadataParty.js +1 -1
  138. package/mobile/dist/hooks/useDadataParty.js.map +1 -1
  139. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  140. package/mobile/lib/api/getSubmitBody.d.ts +4225 -865
  141. package/mobile/lib/api/getSubmitBody.js +14 -0
  142. package/mobile/lib/api/getSubmitBody.js.map +1 -1
  143. package/mobile/lib/common.css +1 -1
  144. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  145. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  146. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  147. package/mobile/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  148. package/mobile/lib/components/ApplicationForm/Footnote.js +1 -1
  149. package/mobile/lib/components/ApplicationForm/Footnote.js.map +1 -1
  150. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  151. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  152. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  153. package/mobile/lib/components/Blocks.js +2 -0
  154. package/mobile/lib/components/Blocks.js.map +1 -1
  155. package/mobile/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  156. package/mobile/lib/components/ReferalForm/ReferalForm.js +31 -0
  157. package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  158. package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  159. package/mobile/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  160. package/mobile/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  161. package/mobile/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  162. package/mobile/lib/components/ReferalForm/ResultLink.js +11 -0
  163. package/mobile/lib/components/ReferalForm/ResultLink.js.map +1 -0
  164. package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  165. package/mobile/lib/components/ReferalForm/referalFormData.js +17 -0
  166. package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -0
  167. package/mobile/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  168. package/mobile/lib/components/ReferalForm/renderLinkInput.js +18 -0
  169. package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  170. package/mobile/lib/components/ReferalForm/renderSections.d.ts +3 -0
  171. package/mobile/lib/components/ReferalForm/renderSections.js +7 -0
  172. package/mobile/lib/components/ReferalForm/renderSections.js.map +1 -0
  173. package/mobile/lib/hooks/useDadataParty.js +1 -1
  174. package/mobile/lib/hooks/useDadataParty.js.map +1 -1
  175. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  176. package/mobile/src/api/getSubmitBody.ts +17 -0
  177. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  178. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  179. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  180. package/mobile/src/components/ApplicationForm/Footnote.tsx +10 -1
  181. package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  182. package/mobile/src/components/Blocks.ts +2 -0
  183. package/mobile/src/components/ReferalForm/ReferalForm.example.json +8 -0
  184. package/mobile/src/components/ReferalForm/ReferalForm.tsx +80 -0
  185. package/mobile/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  186. package/mobile/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  187. package/mobile/src/components/ReferalForm/ResultLink.tsx +23 -0
  188. package/mobile/src/components/ReferalForm/referalFormData.ts +18 -0
  189. package/mobile/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  190. package/mobile/src/components/ReferalForm/renderSections.tsx +18 -0
  191. package/mobile/src/hooks/useDadataParty.ts +1 -1
  192. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  193. package/package.json +1 -1
  194. package/src/api/getSubmitBody.ts +17 -0
  195. package/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  196. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +36 -0
  197. package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  198. package/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  199. package/src/components/ApplicationForm/Footnote.tsx +10 -1
  200. package/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  201. package/src/components/Blocks.mobile.ts +2 -0
  202. package/src/components/Blocks.ts +2 -0
  203. package/src/components/ReferalForm/ReferalForm.example.json +8 -0
  204. package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +24 -0
  205. package/src/components/ReferalForm/ReferalForm.fixture.tsx +24 -0
  206. package/src/components/ReferalForm/ReferalForm.tsx +80 -0
  207. package/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  208. package/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  209. package/src/components/ReferalForm/ResultLink.tsx +23 -0
  210. package/src/components/ReferalForm/referalFormData.ts +18 -0
  211. package/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  212. package/src/components/ReferalForm/renderSections.tsx +18 -0
  213. package/src/hooks/useDadataParty.ts +1 -1
  214. package/src/icons/IconName.ts +4 -4
  215. package/src/model/FormTypeFieldDef.ts +2 -1
@@ -1647,6 +1647,7 @@
1647
1647
  }),
1648
1648
  ...getRkoTariffName(typeForm),
1649
1649
  ...staticBody,
1650
+ ...getReferalRkoData(body, typeForm),
1650
1651
  };
1651
1652
  };
1652
1653
  const getPhoneBody = (phone) => {
@@ -1682,6 +1683,19 @@
1682
1683
  partnerComments: globalThis?.sessionStorage.getItem('rkoTariffName') ?? 'Неизвестный тариф',
1683
1684
  }
1684
1685
  : {};
1686
+ const getReferalRkoData = (body, typeForm) => {
1687
+ const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
1688
+ const partnerComments = params.get('utm_mail');
1689
+ const partner = params.get('utm_source');
1690
+ return typeForm === 'REF'
1691
+ ? {
1692
+ name: body.fullName,
1693
+ fullName: undefined,
1694
+ partnerComments,
1695
+ partner,
1696
+ }
1697
+ : {};
1698
+ };
1685
1699
 
1686
1700
  // eslint-disable-next-line max-lines-per-function
1687
1701
  function LeadServiceAPI() {
@@ -2522,11 +2536,11 @@
2522
2536
  });
2523
2537
  const renderText$2 = (text, aboveText) => text || aboveText ? (jsxs("div", { className: "whitespace-pre", children: [aboveText ? jsx("div", { className: "font-light text-left text-xs", children: aboveText }) : null, jsx("div", { className: style('text-left', { 'text-s -mt-3xs': Boolean(aboveText) }), children: text })] })) : null;
2524
2538
 
2525
- const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null] })));
2539
+ const Footnote = JSX(({ text, link, additionalLink }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null, additionalLink ? (jsxs(Text, { children: [' и ', jsx(Link, { ...additionalLink, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0430\u043A\u0446\u0438\u0438", children: additionalLink.text })] })) : null] })));
2526
2540
 
2527
2541
  const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
2528
2542
  const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
2529
- const renderAgreementSubmit = ({ consentDataProcessing, link, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
2543
+ const renderAgreementSubmit = ({ consentDataProcessing, link, additionalLink, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link, additionalLink: additionalLink })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
2530
2544
 
2531
2545
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex sm:justify-center gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
2532
2546
 
@@ -3069,7 +3083,7 @@
3069
3083
  };
3070
3084
 
3071
3085
  const INN_DADATA_URL = 'suggest/party';
3072
- const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
3086
+ const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery }))?.map((_) => ({
3073
3087
  fullName: _?.value,
3074
3088
  address: _?.data?.address?.value,
3075
3089
  inn: _?.data?.inn,
@@ -3817,7 +3831,7 @@
3817
3831
 
3818
3832
  const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
3819
3833
 
3820
- const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3834
+ const renderSections$1 = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3821
3835
 
3822
3836
  const useInterval = (handler, period) => {
3823
3837
  const timer = useRef(null);
@@ -3991,7 +4005,7 @@
3991
4005
  };
3992
4006
  const ApplicationForm = UniBlock(
3993
4007
  // eslint-disable-next-line max-lines-per-function
3994
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
4008
+ ({ className, title, typeForm = '', sections = [], button, link, additionalLink, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
3995
4009
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
3996
4010
  const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
3997
4011
  const router = useRouter();
@@ -4023,9 +4037,10 @@
4023
4037
  });
4024
4038
  const fieldName = getConsentDataProcessing(inputs)?.name;
4025
4039
  const consentDataProcessing = fieldName ? field('consentDataProcessing') : undefined;
4026
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4040
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections$1(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4027
4041
  consentDataProcessing,
4028
4042
  link,
4043
+ additionalLink,
4029
4044
  button,
4030
4045
  typeForm,
4031
4046
  })] }), isContacts ? renderContacts() : null] }));
@@ -14006,6 +14021,62 @@
14006
14021
  return (jsxs(BlockWrapper, { className: style('p-6xl space-y-xl', className), defaultPadding: "p-0", ...rest, children: [jsx(Heading, { className: "mb-xl", children: title }), isArchive ? renderDataPickForm() : null, ratesList.map((list, i) => (jsx(RatesTableItem, { list: list, isRatesValid: isRatesValid, isArchive: isArchive, infoMessage: infoMessage }, String(i)))), href ? renderLink(href) : null] }));
14007
14022
  });
14008
14023
 
14024
+ const sections = [
14025
+ { title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
14026
+ {
14027
+ columns: 2,
14028
+ inputs: [
14029
+ {
14030
+ name: 'dadataPartyInnSelect',
14031
+ required: true,
14032
+ },
14033
+ {
14034
+ name: 'email',
14035
+ required: true,
14036
+ },
14037
+ ],
14038
+ },
14039
+ ];
14040
+
14041
+ const renderSections = (sections, field) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field))] }, `section-${i}`)));
14042
+
14043
+ const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
14044
+ const onClick = useCallback(async () => {
14045
+ try {
14046
+ await globalThis.navigator.clipboard.writeText(value);
14047
+ }
14048
+ catch {
14049
+ console.log('Ошибка копирования');
14050
+ }
14051
+ }, []);
14052
+ return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon }) })] }));
14053
+ });
14054
+
14055
+ const ResultLink = JSX(({ link, copyIcon }) => {
14056
+ return (jsxs("div", { children: [jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: "\u0421\u043A\u043E\u043F\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0441\u044B\u043B\u043A\u0443 \u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0434\u0440\u0443\u0433\u0443" }) }), renderLinkInput({
14057
+ value: link,
14058
+ copyIcon,
14059
+ })] }));
14060
+ });
14061
+
14062
+ const ReferalForm = UniBlock(({ link = '', button, copyIcon, ...rest }) => {
14063
+ const [isShowResultLink, setIsShowResultLink] = useState(false);
14064
+ const [referalLink, setReferalLink] = useState('');
14065
+ const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
14066
+ const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
14067
+ const handleSubmit = useCallback(async (formData) => {
14068
+ setReferalLink(`${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`);
14069
+ setIsShowResultLink(true);
14070
+ }, []);
14071
+ const [, { field, onSubmit }] = useForm({}, {
14072
+ resetOnSubmit: true,
14073
+ formValidator,
14074
+ onSubmit: handleSubmit,
14075
+ });
14076
+ return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field), jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), jsx(Link, { href: "/privacy-policy", target: "_blank", ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438 \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(SubmitButton$1, { className: "w-full @xl:w-auto mt-xs", children: button?.text ?? 'Получить ссылку' })] })) }));
14077
+ });
14078
+ const getTitle = (isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' : 'Как получить бесплатное обслуживание счёта';
14079
+
14009
14080
  const RichTextBlock = UniBlock((props) => {
14010
14081
  const { __html, dynamicQueryParamText = {}, dynamicTextSource, richVersion = '', ...rest } = props;
14011
14082
  const formatText = getFormatDynamicText(dynamicQueryParamText, dynamicTextSource?.list, __html);
@@ -14401,6 +14472,7 @@
14401
14472
  CalculatorRko,
14402
14473
  RkoTariffCardsTable,
14403
14474
  RatesTable,
14475
+ ReferalForm,
14404
14476
  };
14405
14477
 
14406
14478
  const applyAspects = (aspects) => (ev) => {
@@ -14545,7 +14617,7 @@
14545
14617
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14546
14618
  });
14547
14619
 
14548
- const packageVersion = "0.14.1028";
14620
+ const packageVersion = "0.14.1030";
14549
14621
 
14550
14622
  exports.Blocks = Blocks;
14551
14623
  exports.ContentPage = ContentPage;