@adyen/kyc-components 4.0.0-beta.0 → 4.0.0-beta.3

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 (749) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-Dh7RSJoE.js → AcceptTermsOfServiceComponent-i222mdxX.js} +54 -59
  2. package/dist/{AccountSetupRejected-PdYyKwbS.js → AccountSetupRejected-DHph9lFl.js} +6 -6
  3. package/dist/{Avatar-C8aZB2wq.js → Avatar-vCjWXfC7.js} +2 -2
  4. package/dist/{BusinessDetailsDropin-DC8FEWvP.js → BusinessDetailsDropin-DQcfiSR8.js} +408 -393
  5. package/dist/{BusinessFinancingComponent-B0vW7r62.js → BusinessFinancingComponent-DC3jzBrq.js} +3 -3
  6. package/dist/{BusinessFinancingDropin-D8HAwTSq.js → BusinessFinancingDropin-D2lMEbNh.js} +529 -701
  7. package/dist/{BusinessFinancingPage-L1APYvzn.js → BusinessFinancingPage-BPD2cSDR.js} +3 -3
  8. package/dist/{BusinessTypeSelectionPage-sfGqHnp6.js → BusinessTypeSelectionPage-Cdp8joPJ.js} +86 -91
  9. package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
  10. package/dist/ContractViewer-B0bZ14Ts.js +947 -0
  11. package/dist/{CreateIndividualComponent-i-QNCzp0.js → CreateIndividualComponent-D9wnexv4.js} +7 -8
  12. package/dist/{CreateTransferInstrumentComponent-8n3tjBYK.js → CreateTransferInstrumentComponent-COzPdQjC.js} +4 -5
  13. package/dist/{CustomerSupport-BER6nSK2.js → CustomerSupport-NGBoBg3N.js} +27 -33
  14. package/dist/{DebugModal-DeSsKkh_.js → DebugModal-I2U6TjGT.js} +43 -69
  15. package/dist/{DecisionMakerDetailsPage-DgjlfKyP.js → DecisionMakerDetailsPage-BN-H1sJF.js} +3 -4
  16. package/dist/{DecisionMakers-D2TjKnOc.js → DecisionMakers-CZ5-IRtU.js} +128 -25
  17. package/dist/{ES-JRIf-4xI.js → ES-BlWV7xvh.js} +4 -6
  18. package/dist/{EmbeddedStatus-Bn5KNA0V.js → EmbeddedStatus-Blr0seRl.js} +13 -5
  19. package/dist/FormEndState-JB6QFSet.js +59 -0
  20. package/dist/{FormFlow-CZgc09E3.js → FormFlow-DjvdNEiV.js} +18 -22
  21. package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
  22. package/dist/{IndividualOnfidoDropin-D6uwo7VI.js → IndividualOnfidoDropin-DHhyO2ai.js} +1364 -867
  23. package/dist/{Introduction-DW2IQ57R.js → Introduction-erRXgreE.js} +32 -35
  24. package/dist/LandingLayout-B45lEjOv.js +84 -0
  25. package/dist/{LegalRepresentativeDetailsPage-BfIDXqv1.js → LegalRepresentativeDetailsPage-rS5K4657.js} +3 -4
  26. package/dist/{ManageIndividualComponent-DJoEsE2m.js → ManageIndividualComponent-BEzE5lkX.js} +8 -12
  27. package/dist/{ManagePCIComponent-BGESFWL6.js → ManagePCIComponent-BgdGfAuT.js} +5 -5
  28. package/dist/{ManageTermsOfServiceComponent-_wTZrjqd.js → ManageTermsOfServiceComponent-BWkwy6YC.js} +7 -8
  29. package/dist/{ManageTransferInstrumentComponent-Cvc3kk94.js → ManageTransferInstrumentComponent-B8kRNftW.js} +21 -34
  30. package/dist/{OnboardingDropinComponent-CocnpjvA.js → OnboardingDropinComponent-DBW5N3Dr.js} +325 -364
  31. package/dist/{ProviderButton-vD5DUJaN.js → ProviderButton-B58n0cRC.js} +13 -24
  32. package/dist/{Review-BFgzcIDj.js → Review-O6Al47Cu.js} +11 -12
  33. package/dist/{RootBusinessDetailsPage-C6lHQShI.js → RootBusinessDetailsPage-q_6wAcer.js} +3 -4
  34. package/dist/{RootIndividualDetailsPage-DfpqHdAS.js → RootIndividualDetailsPage-CiXgSJsV.js} +3 -4
  35. package/dist/{SignPCIComponent-D35913wJ.js → SignPCIComponent-cqRNhGdl.js} +17 -23
  36. package/dist/{SingpassSelection-D2Xe1wGv.js → SingpassSelection-BWEJ3Yi-.js} +6 -9
  37. package/dist/{SoleProprietorshipPage-D2F8Ghmo.js → SoleProprietorshipPage-CRcJSpn9.js} +4 -5
  38. package/dist/{SourceOfFundsPage-RjAcZ3Bo.js → SourceOfFundsPage-BxLGXTHb.js} +533 -517
  39. package/dist/{StoreProvider-COHi02bX.js → StoreProvider-ClKLaHzy.js} +23640 -25317
  40. package/dist/{TaskItemStatus-Bi1L8gea.js → TaskItemStatus-DrTIwCTx.js} +14 -14
  41. package/dist/TaskStatusIndicator-CTtKjo0m.js +69 -0
  42. package/dist/{TaxReportingDropin-BLXgRbuR.js → TaxReportingDropin-DFZ2ehfk.js} +82 -102
  43. package/dist/{TileGroup-B1IymoWv.js → TileGroup-BtE472I1.js} +6 -8
  44. package/dist/{TrustDetailsPage-DVvGJ_Ta.js → TrustDetailsPage-CGiiTbfR.js} +93 -114
  45. package/dist/{TrustMemberCompanyPage-D0wTEhuh.js → TrustMemberCompanyPage-oLNhg0hg.js} +4 -5
  46. package/dist/{TrustMemberIndividualPage-BLuaBi3j.js → TrustMemberIndividualPage-Bgsis586.js} +3 -4
  47. package/dist/{UnincorporatedPartnershipIndividualPage-BhIihH2v.js → UnincorporatedPartnershipIndividualPage-DPE3grqL.js} +3 -4
  48. package/dist/{UnincorporatedPartnershipMemberCompanyPage-CgujXwfX.js → UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js} +3 -4
  49. package/dist/{VerificationErrorAlert-BkImnGA-.js → VerificationErrorAlert-BBdJmGJu.js} +10 -8
  50. package/dist/{ViewVerificationStatusComponent-CRefu327.js → ViewVerificationStatusComponent-DDtXG_pM.js} +12 -13
  51. package/dist/adyen-business-financing.js +22 -29
  52. package/dist/adyen-individual.js +21 -22
  53. package/dist/adyen-kyc-components.js +137 -122
  54. package/dist/adyen-manage-individual.js +18 -21
  55. package/dist/adyen-manage-pci.js +18 -21
  56. package/dist/adyen-manage-terms-of-service.js +18 -21
  57. package/dist/adyen-manage-transfer-instruments.js +27 -30
  58. package/dist/adyen-onboarding.js +25 -22
  59. package/dist/adyen-sign-pci.js +22 -32
  60. package/dist/adyen-terms-of-service.js +32 -29
  61. package/dist/adyen-transfer-instrument.js +32 -31
  62. package/dist/{adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js → adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js} +5 -1
  63. package/dist/adyen-verification-status.js +30 -33
  64. package/dist/bg-BG-BY3Wa361.js +54 -0
  65. package/dist/bg-BG-BvSUDgGF.js +13 -0
  66. package/dist/bg-BG-HpLj_LOM.js +16 -0
  67. package/dist/cs-CZ-BEFeaKsV.js +54 -0
  68. package/dist/cs-CZ-CQ_M3lEp.js +16 -0
  69. package/dist/cs-CZ-y4mvq4Lv.js +13 -0
  70. package/dist/{css-DZNXkIaY.js → css-BJGWcW8A.js} +2 -2
  71. package/dist/da-DK-D6UK8XT9.js +54 -0
  72. package/dist/da-DK-k4JW3iVF.js +16 -0
  73. package/dist/da-DK-qgQOVjDp.js +13 -0
  74. package/dist/de-DE-B3nctkG8.js +13 -0
  75. package/dist/de-DE-C7mjtS5w.js +16 -0
  76. package/dist/de-DE-DUl6gRKv.js +54 -0
  77. package/dist/de-DE-pSdsxBpQ.js +13 -0
  78. package/dist/decision-makers-group-CgddXgrx.js +1944 -0
  79. package/dist/el-GR-B5j7VZ3E.js +54 -0
  80. package/dist/el-GR-Bvjk5Sw8.js +13 -0
  81. package/dist/el-GR-CEQrkYHW.js +16 -0
  82. package/dist/el-GR-CdgLZhuO.js +13 -0
  83. package/dist/en-US-Bq2Twy6x.js +54 -0
  84. package/dist/en-US-DDagIr01.js +16 -0
  85. package/dist/en-US-DSoLr6rp.js +13 -0
  86. package/dist/es-ES-BRfK6tX7.js +13 -0
  87. package/dist/es-ES-Cavm0szq.js +54 -0
  88. package/dist/es-ES-DB1c74Kv.js +16 -0
  89. package/dist/es-ES-Dy1uR2H_.js +13 -0
  90. package/dist/et-EE-DUWZ2Vqm.js +54 -0
  91. package/dist/et-EE-d9V24rcf.js +13 -0
  92. package/dist/et-EE-xIegUSuv.js +16 -0
  93. package/dist/fi-FI-B0fnAFV2.js +13 -0
  94. package/dist/fi-FI-DVa-ccaW.js +54 -0
  95. package/dist/fi-FI-NCxneAqU.js +16 -0
  96. package/dist/fr-FR-BoKzVp2q.js +13 -0
  97. package/dist/fr-FR-CY9emHgF.js +54 -0
  98. package/dist/fr-FR-Dk6Lw2On.js +13 -0
  99. package/dist/fr-FR-daiUnUwo.js +16 -0
  100. package/dist/{getFieldsWithExistingData-UNUNInq5.js → getFieldsWithExistingData-BY--eXBQ.js} +3 -4
  101. package/dist/{hasDataChanged-CIg-bPSm.js → hasDataChanged-CwfuS4et.js} +4 -4
  102. package/dist/hr-HR-BAUywqDj.js +16 -0
  103. package/dist/hr-HR-CF0AHQzi.js +13 -0
  104. package/dist/hr-HR-CnP5sqih.js +54 -0
  105. package/dist/hu-HU-3GQojIHR.js +16 -0
  106. package/dist/hu-HU-BTlpbCpc.js +54 -0
  107. package/dist/hu-HU-CSPhOvLC.js +13 -0
  108. package/dist/it-IT-BH-eqIKH.js +13 -0
  109. package/dist/it-IT-D7G4BaP7.js +13 -0
  110. package/dist/it-IT-GgHc0cHR.js +54 -0
  111. package/dist/it-IT-pDWPFHEh.js +16 -0
  112. package/dist/ja-JP-B3yqM_FM.js +13 -0
  113. package/dist/ja-JP-BhS-_dIx.js +54 -0
  114. package/dist/ja-JP-DTW_hY1L.js +13 -0
  115. package/dist/ja-JP-scPXJ93L.js +16 -0
  116. package/dist/{json-DGARJCng.js → json-Dk6RRAV8.js} +2 -2
  117. package/dist/{localizeDateString-KlstHAcM.js → localizeDateString-CKCBXzSn.js} +6 -6
  118. package/dist/lt-LT-BcGNy8Ti.js +16 -0
  119. package/dist/lt-LT-DTQGR9M0.js +54 -0
  120. package/dist/lt-LT-Lzl_Cbw-.js +13 -0
  121. package/dist/lv-LV-BQ4F1GrV.js +54 -0
  122. package/dist/lv-LV-CBD07r1Y.js +16 -0
  123. package/dist/lv-LV-y00wN1pj.js +13 -0
  124. package/dist/{mapFinancialReportsToFinancialInformation-Cid31JpK.js → mapFinancialReportsToFinancialInformation-D_6u_bSS.js} +19 -12
  125. package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
  126. package/dist/nl-NL-BxJUDHMK.js +16 -0
  127. package/dist/nl-NL-CFzm75Jw.js +13 -0
  128. package/dist/nl-NL-CUcML482.js +54 -0
  129. package/dist/nl-NL-DmnFXAQC.js +13 -0
  130. package/dist/no-NO-BBCvsecq.js +54 -0
  131. package/dist/no-NO-DbvFfP96.js +13 -0
  132. package/dist/no-NO-Drup6Jyy.js +16 -0
  133. package/dist/pl-PL--mmxopYA.js +13 -0
  134. package/dist/pl-PL-BXv8Mmzb.js +16 -0
  135. package/dist/pl-PL-kGaeUP-w.js +54 -0
  136. package/dist/{plaintext-jF9fCLMp.js → plaintext-9WNCwUtz.js} +2 -2
  137. package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
  138. package/dist/preact/adyen-terms-of-service.js +1 -1
  139. package/dist/preact/adyen-transfer-instrument.js +2 -2
  140. package/dist/pt-PT-BVzXBFp7.js +13 -0
  141. package/dist/pt-PT-D8nU-UM2.js +16 -0
  142. package/dist/pt-PT-DpDxAynk.js +13 -0
  143. package/dist/pt-PT-JVqqgvPs.js +54 -0
  144. package/dist/resolveEnvironment-DQH1ab0S.js +84 -0
  145. package/dist/ro-RO-C83h2zHZ.js +54 -0
  146. package/dist/ro-RO-CG33OwqS.js +16 -0
  147. package/dist/ro-RO-Cdmevo9A.js +13 -0
  148. package/dist/ru-RU-FZb2upqh.js +13 -0
  149. package/dist/{rules-a4kJDPzY.js → rules-CCnLDGvk.js} +63 -64
  150. package/dist/sk-SK-CgLJIuJw.js +54 -0
  151. package/dist/sk-SK-DV_xkO69.js +16 -0
  152. package/dist/sk-SK-nfeuTcY5.js +13 -0
  153. package/dist/sl-SI-B5yeoadY.js +16 -0
  154. package/dist/sl-SI-BzeVaC1Z.js +54 -0
  155. package/dist/sl-SI-DUTZDqkP.js +13 -0
  156. package/dist/style.css +2124 -3093
  157. package/dist/styles-CLV89_hH.js +2125 -3094
  158. package/dist/sv-SE-BTx2XKAp.js +13 -0
  159. package/dist/sv-SE-CVmo11gI.js +54 -0
  160. package/dist/sv-SE-CfxyR53r.js +16 -0
  161. package/dist/sv-SE-rckxD-43.js +13 -0
  162. package/dist/types/api/address/address.types.d.ts +0 -1
  163. package/dist/types/api/address/useAddressCleanse.d.ts +1 -1
  164. package/dist/types/api/address/useSearchAddress.d.ts +0 -1
  165. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +2 -2
  166. package/dist/types/api/companyDataSet/companyDataset.types.d.ts +2 -2
  167. package/dist/types/api/companyDataSet/constants.d.ts +1 -1
  168. package/dist/types/api/companyDataSet/handleCompanyDataset.d.ts +3 -0
  169. package/dist/types/api/companySearch/companySearch.types.d.ts +2 -2
  170. package/dist/types/api/companySelection/companySelection.types.d.ts +6 -0
  171. package/dist/types/api/companySelection/useCompanySelection.d.ts +21 -0
  172. package/dist/types/api/configurations/configurations.types.d.ts +9 -0
  173. package/dist/types/api/configurations/useScenarios.d.ts +33 -35
  174. package/dist/types/api/configurations/useSupportedCountries.d.ts +3 -3
  175. package/dist/types/api/configurations/useTaskTypes.d.ts +2 -2
  176. package/dist/types/api/configurations/useVersionConfiguration.d.ts +2 -2
  177. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +11 -11
  178. package/dist/types/api/datasets/datasets.types.d.ts +6 -0
  179. package/dist/types/api/datasets/useLegalForms.d.ts +3 -8
  180. package/dist/types/api/datasets/useNaceCodes.d.ts +2 -2
  181. package/dist/types/api/datasets/useSourceOfFundsTypes.d.ts +2 -2
  182. package/dist/types/api/entityVerifications/entityVerifications.types.d.ts +15 -0
  183. package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -17
  184. package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +7 -0
  185. package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +14 -0
  186. package/dist/types/api/idVerificationProviders/idVerificationProviders.types.d.ts +6 -0
  187. package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +3 -7
  188. package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +7 -7
  189. package/dist/types/api/legalEntity/useConfirmReview.d.ts +2 -2
  190. package/dist/types/api/legalEntity/useLegalEntity.d.ts +285 -223
  191. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
  192. package/dist/types/api/onboardingStatus/onboardingStatus.types.d.ts +7 -0
  193. package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +2 -5
  194. package/dist/types/api/onboardingStatus/useOnboardingStatus.d.ts +1 -1
  195. package/dist/types/api/pciTemplate/pciTemplate.types.d.ts +9 -0
  196. package/dist/types/api/pciTemplate/usePciQuestionnaire.d.ts +2 -4
  197. package/dist/types/api/pciTemplate/usePciQuestionnaireList.d.ts +7 -9
  198. package/dist/types/api/pciTemplate/usePciStatus.d.ts +4 -9
  199. package/dist/types/api/pciTemplate/usePciTemplate.d.ts +2 -2
  200. package/dist/types/api/pciTemplate/useSignPci.d.ts +2 -2
  201. package/dist/types/api/providersConfiguration/providersConfiguration.types.d.ts +9 -0
  202. package/dist/types/api/providersConfiguration/useProviderStatus.d.ts +3 -13
  203. package/dist/types/api/queryKeys.d.ts +5 -3
  204. package/dist/types/api/taskStatus/taskStatus.types.d.ts +4 -0
  205. package/dist/types/api/taskStatus/useTaskStatus.d.ts +0 -3
  206. package/dist/types/api/taxClassification/taxClassification.types.d.ts +2 -0
  207. package/dist/types/api/taxClassification/useTaxClassification.d.ts +1 -2
  208. package/dist/types/api/termsOfService/termsOfService.types.d.ts +10 -0
  209. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +3 -10
  210. package/dist/types/api/termsOfService/useAcceptedTermsOfService.d.ts +9 -8
  211. package/dist/types/api/termsOfService/useTermsOfService.d.ts +12 -5
  212. package/dist/types/api/termsOfService/useTermsOfServiceAcceptanceInfos.d.ts +2 -2
  213. package/dist/types/api/termsOfService/useTermsOfServiceStatus.d.ts +2 -2
  214. package/dist/types/api/tinVerification/tinVerification.types.d.ts +4 -0
  215. package/dist/types/api/tinVerification/useVerifyTin.d.ts +2 -4
  216. package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +25 -0
  217. package/dist/types/api/transferInstruments/useBankVerificationProviders.d.ts +1 -14
  218. package/dist/types/api/transferInstruments/useCreateTrustedTransferInstrument.d.ts +3 -6
  219. package/dist/types/api/transferInstruments/useHandleBankVerificationError.d.ts +4 -7
  220. package/dist/types/api/transferInstruments/useTransferInstruments.d.ts +1 -9
  221. package/dist/types/api/uiAnalytics/uiAnalytics.types.d.ts +7 -0
  222. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +2 -14
  223. package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +2 -2
  224. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -6
  225. package/dist/types/api/validation/useValidatePhoneNumber.d.ts +4 -7
  226. package/dist/types/api/validation/validation.types.d.ts +8 -0
  227. package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +1 -1
  228. package/dist/types/components/BankAccount/fields/BankAccountNumber/types.d.ts +1 -1
  229. package/dist/types/components/BankAccount/fields/BankCode/fieldConfig.d.ts +1 -1
  230. package/dist/types/components/BankAccount/fields/BankCode/types.d.ts +1 -1
  231. package/dist/types/components/BankAccount/fields/BranchCode/fieldConfig.d.ts +1 -1
  232. package/dist/types/components/BankAccount/fields/BranchCode/types.d.ts +1 -1
  233. package/dist/types/components/BankAccount/fields/Iban/fieldConfig.d.ts +1 -1
  234. package/dist/types/components/BankAccount/fields/Iban/ibanValidator.d.ts +1 -1
  235. package/dist/types/components/BankAccount/fields/Iban/types.d.ts +1 -1
  236. package/dist/types/components/BankAccount/fields/SwiftCode/fieldConfig.d.ts +1 -1
  237. package/dist/types/components/BankAccount/forms/BankDocument/BankDocument.d.ts +0 -1
  238. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +1 -2
  239. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +3 -2
  240. package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +2 -2
  241. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +3 -3
  242. package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/types.d.ts +1 -2
  243. package/dist/types/components/BankAccount/forms/PayoutAccount/CheckGuidance/CheckGuidance.d.ts +0 -1
  244. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
  245. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +0 -1
  246. package/dist/types/components/BankAccount/forms/PayoutDetails/rules.d.ts +6 -6
  247. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +3 -9
  248. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/allowedBankCountriesPerCountry.d.ts +1 -1
  249. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +2 -2
  250. package/dist/types/components/BankAccount/hooks/useAsyncAccountDetailsValidationRules.d.ts +1 -1
  251. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +1 -1
  252. package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +1 -1
  253. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1613 -1919
  254. package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -0
  255. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
  256. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +3 -3
  257. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +3 -0
  258. package/dist/types/components/BankAccount/utils/defaultPayoutAccountFormat.d.ts +1 -1
  259. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +3 -3
  260. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +3 -2
  261. package/dist/types/components/Business/forms/AdditionalInformation/utils.d.ts +1 -0
  262. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +3 -2
  263. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +2 -2
  264. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +2 -2
  265. package/dist/types/components/Business/forms/BusinessSelection/{BusinessInformationCard.d.ts → BusinessInformationCard/BusinessInformationCard.d.ts} +4 -6
  266. package/dist/types/components/Business/forms/BusinessSelection/BusinessSelection.d.ts +1 -1
  267. package/dist/types/components/Business/forms/CompanyStructure/types.d.ts +1 -1
  268. package/dist/types/components/Business/forms/ProofOfDirectorDocument/types.d.ts +1 -1
  269. package/dist/types/components/Business/forms/ProofOfOwnershipDocument/types.d.ts +1 -1
  270. package/dist/types/components/Business/forms/ProofOfSignatoryDocument/types.d.ts +1 -1
  271. package/dist/types/components/Business/forms/RegistrationDocument/config.d.ts +1 -1
  272. package/dist/types/components/Business/forms/RegistrationDocument/types.d.ts +1 -1
  273. package/dist/types/components/Business/forms/TaxDocument/config.d.ts +1 -1
  274. package/dist/types/components/Business/forms/TaxDocument/types.d.ts +1 -1
  275. package/dist/types/components/Business/forms/rules.d.ts +23 -20
  276. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +1 -1
  277. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
  278. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
  279. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +2 -2
  280. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +3 -3
  281. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -4
  282. package/dist/types/components/Business/utils/companyUtil.d.ts +1 -1
  283. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +0 -1
  284. package/dist/types/components/EFP/fields/LegalFormField/LegalFormField.d.ts +1 -1
  285. package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +6 -3
  286. package/dist/types/components/EFP/fields/NaceCodeField/NaceCodeField.d.ts +1 -1
  287. package/dist/types/components/EFP/fields/NaceCodeField/types.d.ts +1 -0
  288. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +2053 -24
  289. package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
  290. package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +1 -2
  291. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBasicCompanyInformation.d.ts +5 -1
  292. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +10 -1
  293. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +11 -1
  294. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingLegalInformation.d.ts +6 -1
  295. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingOwnershipStructure.d.ts +7 -2
  296. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +7 -1
  297. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +27 -112
  298. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +17 -4
  299. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +22 -0
  300. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
  301. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SOFUploadModal.d.ts +0 -1
  302. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/sofStore.d.ts +1 -1
  303. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +3 -3
  304. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -1
  305. package/dist/types/components/EFP/tasks/TaxReportingDropin/taxClassificationStore.d.ts +1 -1
  306. package/dist/types/components/EFP/tasks/TaxReportingDropin/types.d.ts +3 -3
  307. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +3 -3
  308. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -1
  309. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -1
  310. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -1
  311. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/DropinComposer.d.ts +1 -1
  312. package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +1 -1
  313. package/dist/types/components/Individual/fields/DecisionMakerRole/types.d.ts +1 -1
  314. package/dist/types/components/Individual/fields/DriversLicense/DriversLicense.types.d.ts +1 -1
  315. package/dist/types/components/Individual/fields/IdentityNumber/IdentityNumber.d.ts +1 -2
  316. package/dist/types/components/Individual/fields/IdentityNumber/fieldConfig.d.ts +3 -3
  317. package/dist/types/components/Individual/fields/IdentityNumber/type.d.ts +1 -1
  318. package/dist/types/components/Individual/fields/LocalizedNameFields/LocalizedNameFields.d.ts +2 -0
  319. package/dist/types/components/Individual/fields/LocalizedNameFields/types.d.ts +9 -0
  320. package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +13 -0
  321. package/dist/types/components/Individual/fields/NameFields/types.d.ts +23 -0
  322. package/dist/types/components/Individual/fields/NameFields/validate.d.ts +4 -0
  323. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentManualUpload.d.ts +1 -1
  324. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/types.d.ts +3 -3
  325. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/utils.d.ts +1 -1
  326. package/dist/types/components/Individual/forms/Individual/IdVerification/idVerificationProviderId.d.ts +1 -1
  327. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/IdVerificationMethod.d.ts +1 -1
  328. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/types.d.ts +2 -2
  329. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +1 -1
  330. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityAu/IdentityAu.d.ts +1 -1
  331. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityHK/IdentityHK.d.ts +1 -1
  332. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityNZ/IdentityNZ.d.ts +1 -1
  333. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/identityUS/IdentityUS.d.ts +1 -1
  334. package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +7 -5
  335. package/dist/types/components/Individual/forms/Individual/PersonalDetails/validate.d.ts +2 -2
  336. package/dist/types/components/Individual/forms/Individual/rules.d.ts +34 -32
  337. package/dist/types/components/Individual/forms/Individual/types.d.ts +8 -8
  338. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -1
  339. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -1
  340. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/Identity.d.ts +1 -1
  341. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/validate.d.ts +1 -1
  342. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/validate.d.ts +2 -2
  343. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.d.ts +1 -1
  344. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +3 -2
  345. package/dist/types/components/Individual/forms/IndividualOnfido/DataConflictsModal/ConflictRow.d.ts +1 -1
  346. package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
  347. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationMethod.types.d.ts +1 -0
  348. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/individualOnfidoConflictsSchema.d.ts +23 -9
  349. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/mapExtractionResultToSchema.d.ts +1 -1
  350. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
  351. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +37 -34
  352. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +4 -4
  353. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaire.d.ts +1 -1
  354. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaire.types.d.ts +1 -3
  355. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaireModalContent.d.ts +1 -0
  356. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.d.ts +1 -1
  357. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.types.d.ts +3 -3
  358. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaireModalContent.d.ts +5 -0
  359. package/dist/types/components/Individual/helpers/isOnfidoAutofillFlowEnabled.d.ts +1 -1
  360. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
  361. package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
  362. package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
  363. package/dist/types/components/Individual/mapping/individualOnfidoKeyMappings.d.ts +1 -0
  364. package/dist/types/components/Individual/mapping/mapIndividualOnfidoSchemaToLegalEntity.d.ts +3 -1
  365. package/dist/types/components/Individual/mapping/mapLocalization.d.ts +3 -0
  366. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
  367. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
  368. package/dist/types/components/Individual/tasks/IndividualDropin/individualFormConfig.d.ts +1 -1
  369. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
  370. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/individualOnfidoFormConfig.d.ts +1 -1
  371. package/dist/types/components/Shared/EntityAssociation/types.d.ts +1 -1
  372. package/dist/types/components/Shared/EntityGuidanceStatus/types.d.ts +1 -1
  373. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -1
  374. package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
  375. package/dist/types/components/Shared/FormNavigation/types.d.ts +3 -3
  376. package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +2 -2
  377. package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
  378. package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
  379. package/dist/types/components/Shared/Summary/Summary.d.ts +1 -2
  380. package/dist/types/components/Shared/Summary/summaryItem.d.ts +1 -1
  381. package/dist/types/components/Shared/Summary/types.d.ts +3 -3
  382. package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
  383. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
  384. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +6 -4
  385. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +6 -8
  386. package/dist/types/components/Shared/fields/CountryField/CountryField.d.ts +1 -1
  387. package/dist/types/components/Shared/fields/CountryField/types.d.ts +3 -3
  388. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/CountryOfGoverningLawField.d.ts +1 -1
  389. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +2 -2
  390. package/dist/types/components/Shared/fields/Currency/types.d.ts +3 -3
  391. package/dist/types/components/Shared/fields/DBANameField/fieldConfig.d.ts +1 -1
  392. package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
  393. package/dist/types/components/Shared/fields/DateOfIncorporationField/fieldConfig.d.ts +1 -1
  394. package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
  395. package/dist/types/components/Shared/fields/EInvoicingCodeField/fieldConfig.d.ts +1 -1
  396. package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
  397. package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
  398. package/dist/types/components/Shared/fields/IdFieldTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +2 -2
  399. package/dist/types/components/Shared/fields/IdFieldTypeSelector/IndividualIdNumberTypeSelector.d.ts +2 -2
  400. package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +4 -3
  401. package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +2 -2
  402. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +11 -2
  403. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
  404. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultTaxIdNumberType.d.ts +1 -1
  405. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
  406. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferCompanyRegistrationNumberType.d.ts +1 -1
  407. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +1 -1
  408. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferVatNumberType.d.ts +1 -1
  409. package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
  410. package/dist/types/components/Shared/fields/LegalCompanyNameField/fieldConfig.d.ts +1 -1
  411. package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
  412. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
  413. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
  414. package/dist/types/components/Shared/fields/Name/Name.d.ts +1 -1
  415. package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
  416. package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
  417. package/dist/types/components/Shared/fields/PhoneField/fieldConfig.d.ts +1 -1
  418. package/dist/types/components/Shared/fields/PhoneField/types.d.ts +2 -2
  419. package/dist/types/components/Shared/fields/StateField/StateField.d.ts +1 -1
  420. package/dist/types/components/Shared/fields/StateField/fieldConfig.d.ts +1 -1
  421. package/dist/types/components/Shared/fields/StateField/types.d.ts +4 -4
  422. package/dist/types/components/Shared/fields/StockExchangeMICField/fieldConfig.d.ts +1 -1
  423. package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
  424. package/dist/types/components/Shared/fields/StockISINField/fieldConfig.d.ts +1 -1
  425. package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
  426. package/dist/types/components/Shared/fields/StockTickerSymbol/fieldConfig.d.ts +1 -1
  427. package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
  428. package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -2
  429. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +5 -3
  430. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +2 -2
  431. package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
  432. package/dist/types/components/Shared/fields/VatNumberField/fieldConfig.d.ts +1 -1
  433. package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +3 -5
  434. package/dist/types/components/Shared/forms/Address/AddressField.d.ts +1 -1
  435. package/dist/types/components/Shared/forms/Address/SearchAddress.d.ts +3 -3
  436. package/dist/types/components/Shared/forms/Address/constants.d.ts +1 -1
  437. package/dist/types/components/Shared/forms/Address/types.d.ts +1 -2
  438. package/dist/types/components/Shared/forms/Address/utils.d.ts +3 -3
  439. package/dist/types/components/Shared/forms/Address/validate.d.ts +1 -1
  440. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
  441. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +7 -7
  442. package/dist/types/components/Shared/forms/CompanyNameAndCountry/types.d.ts +1 -1
  443. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
  444. package/dist/types/components/Shared/forms/ContactDetails/ContactDetails.d.ts +1 -1
  445. package/dist/types/components/Shared/forms/ContactDetails/types.d.ts +1 -1
  446. package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +2 -2
  447. package/dist/types/components/Shared/forms/FinancialInformation/ReportedValue.d.ts +1 -1
  448. package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +2 -2
  449. package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
  450. package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +3 -3
  451. package/dist/types/components/Shared/forms/FinancialInformation/validate.d.ts +1 -0
  452. package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +2 -2
  453. package/dist/types/components/Shared/tasks/CustomerSupport/types.d.ts +1 -1
  454. package/dist/types/components/Shared/tasks/TaskList/PayoutAccountTaskListItem.d.ts +1 -1
  455. package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
  456. package/dist/types/components/Shared/tasks/TaskList/TaskList.d.ts +1 -1
  457. package/dist/types/components/Shared/tasks/TaskList/types.d.ts +2 -2
  458. package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -1
  459. package/dist/types/components/Trust/forms/Trust/Trust.d.ts +19 -3
  460. package/dist/types/components/Trust/forms/Trust/rules.d.ts +6 -6
  461. package/dist/types/components/Trust/forms/Trust/types.d.ts +2 -2
  462. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -1
  463. package/dist/types/components/Trust/forms/TrustRoleAndEntityType/types.d.ts +1 -1
  464. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +14 -14
  465. package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +1 -1
  466. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
  467. package/dist/types/components/Trust/tasks/TrustDropin/trustFormConfig.d.ts +1 -1
  468. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +1 -1
  469. package/dist/types/components/Trust/utils/trustUtil.d.ts +4 -4
  470. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +2 -2
  471. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -3
  472. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
  473. package/dist/types/components/UnincorporatedPartnership/types/types.d.ts +1 -1
  474. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedParnershipUtil.d.ts +3 -3
  475. package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
  476. package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +1 -1
  477. package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
  478. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
  479. package/dist/types/components/ui/atoms/Checkbox/Checkbox.d.ts +1 -2
  480. package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
  481. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +11 -12
  482. package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
  483. package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +5 -5
  484. package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
  485. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  486. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
  487. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
  488. package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
  489. package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
  490. package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
  491. package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
  492. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
  493. package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
  494. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
  495. package/dist/types/components/ui/atoms/Svg/Svg.d.ts +1 -1
  496. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
  497. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +1 -1
  498. package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
  499. package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
  500. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +10 -0
  501. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
  502. package/dist/types/components/ui/molecules/Alert/Alert.d.ts +1 -1
  503. package/dist/types/components/ui/molecules/Alert/types.d.ts +1 -1
  504. package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
  505. package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
  506. package/dist/types/components/ui/molecules/Confirm/Confirm.d.ts +1 -1
  507. package/dist/types/components/ui/molecules/Confirm/Confirm.types.d.ts +1 -0
  508. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
  509. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +3 -5
  510. package/dist/types/components/ui/molecules/Dropzone/types.d.ts +1 -1
  511. package/dist/types/components/ui/molecules/Dropzone/validate.d.ts +1 -1
  512. package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -2
  513. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
  514. package/dist/types/components/ui/molecules/ErrorPanel/ErrorPanel.d.ts +1 -1
  515. package/dist/types/components/ui/molecules/ErrorPanel/VerificationErrors.d.ts +2 -1
  516. package/dist/types/components/ui/molecules/ErrorPanel/types.d.ts +3 -3
  517. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
  518. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -3
  519. package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
  520. package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +1 -1
  521. package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +1 -1
  522. package/dist/types/components/ui/molecules/InputText/InputText.d.ts +1 -1
  523. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +3 -7
  524. package/dist/types/constants/countries.d.ts +1 -1
  525. package/dist/types/constants/keys.d.ts +2 -0
  526. package/dist/types/context/ExperimentContext/types.d.ts +18 -1
  527. package/dist/types/context/FormContext/FormContext.d.ts +1 -1
  528. package/dist/types/context/FormRouterContext/FormRouterContext.d.ts +1 -1
  529. package/dist/types/context/FormRouterContext/types.d.ts +1 -1
  530. package/dist/types/context/SettingsContext/SettingsContext.d.ts +1 -1
  531. package/dist/types/context/SettingsContext/types.d.ts +1 -1
  532. package/dist/types/context/StateContext/StateContext.d.ts +1 -1
  533. package/dist/types/context/StateContext/StateContextSetter.d.ts +1 -1
  534. package/dist/types/context/StateContext/StateReducer.d.ts +4 -10
  535. package/dist/types/context/StateContext/types.d.ts +19 -17
  536. package/dist/types/context/StateContext/useGlobalData.d.ts +2 -2
  537. package/dist/types/core/EmbedShell/EmbedShell.d.ts +2 -1
  538. package/dist/types/core/UIElement/UIElement.d.ts +2 -1
  539. package/dist/types/core/analytics.d.ts +12 -10
  540. package/dist/types/core/environment/resolveEnvironment.d.ts +1 -1
  541. package/dist/types/core/error.d.ts +1 -1
  542. package/dist/types/core/errorMapping.d.ts +3 -3
  543. package/dist/types/core/models/api/address.d.ts +1 -1
  544. package/dist/types/core/models/api/financialReport.d.ts +3 -3
  545. package/dist/types/core/models/api/get-scenarios.d.ts +2 -8
  546. package/dist/types/core/models/api/individual.d.ts +10 -0
  547. package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
  548. package/dist/types/core/models/api/legal-entity-association.d.ts +5 -0
  549. package/dist/types/core/models/api/organization.d.ts +9 -1
  550. package/dist/types/core/models/api/phone.d.ts +1 -1
  551. package/dist/types/core/models/api/remediating-action.d.ts +1 -1
  552. package/dist/types/core/models/api/source-of-funds.d.ts +1 -1
  553. package/dist/types/core/models/api/transfer-instrument.d.ts +1 -1
  554. package/dist/types/core/models/api/verification-error.d.ts +1 -1
  555. package/dist/types/core/models/api/view-verification-status.d.ts +0 -4
  556. package/dist/types/core/process-field-configurations.d.ts +9 -9
  557. package/dist/types/core/types.d.ts +1 -1
  558. package/dist/types/core/user-events.d.ts +14 -3
  559. package/dist/types/datasets/generators/getAccountFormatForCountry.d.ts +2 -2
  560. package/dist/types/datasets/generators/getBusinessTypeExamplesForCountry.d.ts +2 -2
  561. package/dist/types/datasets/generators/getCompanyTypeExamplesForCountry.d.ts +2 -2
  562. package/dist/types/datasets/generators/getLegalArrangementTypeExamplesForCountry.d.ts +3 -3
  563. package/dist/types/datasets/generators/loadCountries.d.ts +1 -1
  564. package/dist/types/datasets/generators/loadStatesDataset.d.ts +1 -1
  565. package/dist/types/embeds/EmbedBaseElement.d.ts +41 -0
  566. package/dist/types/embeds/EmbedCore.d.ts +22 -0
  567. package/dist/types/embeds/baseEmbedProps.d.ts +21 -0
  568. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +13 -0
  569. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
  570. package/dist/types/embeds/individual/AdyenIndividual.d.ts +12 -0
  571. package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
  572. package/dist/types/embeds/manage-individual/AdyenManageIndividual.d.ts +12 -0
  573. package/dist/types/embeds/manage-pci/AdyenManagePci.d.ts +12 -0
  574. package/dist/types/embeds/manage-terms-of-service/AdyenManageTermsOfService.d.ts +12 -0
  575. package/dist/types/embeds/manage-transfer-instruments/AdyenManageTransferInstrument.d.ts +15 -0
  576. package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +12 -0
  577. package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
  578. package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +14 -0
  579. package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +5 -3
  580. package/dist/types/embeds/terms-of-service/AdyenTermsOfService.d.ts +12 -0
  581. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
  582. package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +16 -0
  583. package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
  584. package/dist/types/embeds/verification-status/AdyenVerificationStatus.d.ts +20 -0
  585. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  586. package/dist/types/hooks/singpass/useHasSeenSingpassSelection.d.ts +2 -1
  587. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +2 -2
  588. package/dist/types/hooks/useAccountHolder.d.ts +1 -1
  589. package/dist/types/hooks/useAllowedCountries.d.ts +1 -1
  590. package/dist/types/hooks/useAsyncValidator.d.ts +2 -1
  591. package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
  592. package/dist/types/hooks/useDataConflicts.d.ts +0 -6
  593. package/dist/types/hooks/useDataMissingRemediations.d.ts +1 -1
  594. package/dist/types/hooks/useForm/reducer.d.ts +2 -2
  595. package/dist/types/hooks/useForm/types.d.ts +14 -19
  596. package/dist/types/hooks/useFormComposer.d.ts +2 -2
  597. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +28 -0
  598. package/dist/types/hooks/useMultiForm/reducer.d.ts +4 -3
  599. package/dist/types/hooks/useMultiForm/types.d.ts +36 -73
  600. package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
  601. package/dist/types/hooks/useMultiForm/useMultiFormAsyncValidator.d.ts +2 -2
  602. package/dist/types/hooks/useScenarioConfiguration.d.ts +5 -5
  603. package/dist/types/language/Language.d.ts +1 -7
  604. package/dist/types/language/i18n.d.ts +2 -0
  605. package/dist/types/language/types.d.ts +3 -0
  606. package/dist/types/language/utils.d.ts +12 -3
  607. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +2 -2
  608. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +2 -2
  609. package/dist/types/stores/globalStore/get-task-status.d.ts +1 -1
  610. package/dist/types/stores/globalStore/globalStore.d.ts +4 -4
  611. package/dist/types/stores/globalStore/taskStatus.d.ts +1 -1
  612. package/dist/types/types/datasets/country-code.d.ts +251 -0
  613. package/dist/types/{core/models → types}/errors/capability-problems.d.ts +1 -1
  614. package/dist/types/{core/models → types}/errors/entity-problems.d.ts +4 -4
  615. package/dist/types/{core/models → types}/errors/error-message.d.ts +1 -1
  616. package/dist/types/{core/models → types}/errors/maintenance-mode-error.d.ts +1 -1
  617. package/dist/types/{core/models → types}/errors/remediation.d.ts +1 -1
  618. package/dist/types/{core/models → types}/form-configuration.d.ts +4 -4
  619. package/dist/types/{core/models → types}/form-rules.d.ts +10 -8
  620. package/dist/types/{core/models → types}/form.d.ts +1 -1
  621. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  622. package/dist/types/utils/api/documentUtils.d.ts +1 -1
  623. package/dist/types/utils/api/getProblemsForEntity.d.ts +2 -2
  624. package/dist/types/utils/api/processCapabilitites.d.ts +5 -4
  625. package/dist/types/utils/api/processValidationErrors.d.ts +3 -3
  626. package/dist/types/utils/birthDateUtils.d.ts +53 -2
  627. package/dist/types/utils/country.d.ts +5 -2
  628. package/dist/types/utils/datasetUtil.d.ts +3 -3
  629. package/dist/types/{core/models/decision-maker.d.ts → utils/decisionMaker.d.ts} +2 -2
  630. package/dist/types/utils/dropinUtils.d.ts +2 -2
  631. package/dist/types/utils/entityAssociationUtil.d.ts +6 -7
  632. package/dist/types/utils/entityStatusUtil.d.ts +2 -2
  633. package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
  634. package/dist/types/{core/models/field-configurations.d.ts → utils/fieldConfigurations.d.ts} +4 -4
  635. package/dist/types/utils/formUtils.d.ts +1 -1
  636. package/dist/types/utils/formatCurrency.d.ts +1 -1
  637. package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
  638. package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
  639. package/dist/types/utils/getName.d.ts +2 -2
  640. package/dist/types/utils/getSSNType.d.ts +1 -1
  641. package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
  642. package/dist/types/utils/mapping/mapExistingFile.d.ts +1 -1
  643. package/dist/types/utils/mapping/utils.d.ts +7 -10
  644. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
  645. package/dist/types/utils/omitObscuredFieldsIfUnchanged.d.ts +1 -1
  646. package/dist/types/utils/perCountry.d.ts +1 -1
  647. package/dist/types/utils/perState.d.ts +3 -2
  648. package/dist/types/utils/regex/patternValidators.d.ts +2 -0
  649. package/dist/types/utils/regex/postalCodePatterns.d.ts +1 -1
  650. package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
  651. package/dist/types/utils/trackNavigation.d.ts +1 -2
  652. package/dist/types/utils/urlUtils.d.ts +1 -0
  653. package/dist/types/utils/validation/types.d.ts +1 -1
  654. package/dist/types/utils/validation/validationResult.d.ts +1 -1
  655. package/dist/types/{core/models/errors/validation-error.d.ts → utils/validationError.d.ts} +1 -1
  656. package/dist/types/utils/validatorUtils.d.ts +7 -3
  657. package/dist/types/utils/verification/helpers/verifyIdNumber.d.ts +2 -2
  658. package/dist/{useMultiForm-Lh2i5tRJ.js → useMultiForm-KQwxav4F.js} +160 -136
  659. package/dist/{useOnboardingStatus-D1ym3MHp.js → useOnboardingStatus-BMyj9Pwn.js} +2 -2
  660. package/dist/{useSalesChannelsSettings-BGuBY0ls.js → useSalesChannelsSettings-43TfSoxc.js} +2 -2
  661. package/dist/{useTermsOfServiceStatus-DGZYHVsm.js → useTermsOfServiceStatus-CBHKWYSb.js} +4 -4
  662. package/dist/{useUpdateLegalEntity-By6uwPUg.js → useUpdateLegalEntity-D8dw9Oc3.js} +2 -2
  663. package/dist/{utils-BPrqY9DW.js → utils-CL9qlD-O.js} +18 -11
  664. package/dist/{validate-Dyb8B4Hi.js → validate-CeF0YKvL.js} +2 -2
  665. package/dist/validate-CuwYJGc9.js +94 -0
  666. package/dist/vue/adyen-individual.js +1 -1
  667. package/dist/vue/adyen-manage-individual.js +1 -1
  668. package/dist/vue/adyen-terms-of-service.js +1 -1
  669. package/dist/vue/adyen-transfer-instrument.js +5 -4
  670. package/dist/{yaml-Ba_Tz8d4.js → yaml-CBkrSAtc.js} +2 -2
  671. package/dist/zh-CN-wUb4MmTZ.js +13 -0
  672. package/dist/zh-TW-DNTXHLKa.js +13 -0
  673. package/package.json +53 -51
  674. package/dist/CXEL7IU7-B_FIdhoh.js +0 -55
  675. package/dist/Confirm-okTxq40p.js +0 -56
  676. package/dist/ContractViewer-BChszuWL.js +0 -980
  677. package/dist/FormEndState-BQOQ83vO.js +0 -32
  678. package/dist/FormNavigation-B6RspX9C.js +0 -145
  679. package/dist/FormWrapper-Dvm1o4tC.js +0 -149
  680. package/dist/HASRA6WW-C1SPXfmX.js +0 -12411
  681. package/dist/I3HPI4QX-A8JLvlId.js +0 -46
  682. package/dist/MaybeModal-Djz8fRfd.js +0 -18
  683. package/dist/Modal-CRNejb1x.js +0 -135
  684. package/dist/PayoutDetailsDropin-Bw29V8E7.js +0 -901
  685. package/dist/PayoutDetailsPage-BHNHaMbR.js +0 -57
  686. package/dist/ShadowStylesRoot-D4KvocCc.js +0 -103
  687. package/dist/SourceOfFunds.module-OqFTr4WQ.js +0 -128
  688. package/dist/Spacer-BK3jDget.js +0 -18
  689. package/dist/StepProgressIndicator-BuGfVdlr.js +0 -74
  690. package/dist/bg-BG-CGHVGS50.js +0 -1986
  691. package/dist/cs-CZ-5Os6MsQs.js +0 -1986
  692. package/dist/da-DK-Dk9852pS.js +0 -1986
  693. package/dist/de-DE-B3TpRjZX.js +0 -994
  694. package/dist/de-DE-dk9CMgxF.js +0 -1986
  695. package/dist/documentUtils-51iMbUyU.js +0 -226
  696. package/dist/dropinUtils-Bk0T79SK.js +0 -204
  697. package/dist/el-GR-CFEuLvxK.js +0 -994
  698. package/dist/el-GR-DgI6Cgl6.js +0 -1986
  699. package/dist/en-US-ghR-1_C2.js +0 -994
  700. package/dist/es-ES-BtWn2FOQ.js +0 -994
  701. package/dist/es-ES-BzoYprDP.js +0 -1986
  702. package/dist/et-EE-DlbiEFQu.js +0 -1986
  703. package/dist/fi-FI-GSyT4vm7.js +0 -1986
  704. package/dist/fr-FR-BEImhl_J.js +0 -1986
  705. package/dist/fr-FR-HvIkGqJf.js +0 -994
  706. package/dist/hr-HR-CNFI9uDD.js +0 -1986
  707. package/dist/hu-HU-D4xFA3R6.js +0 -1986
  708. package/dist/individualFormConfig-BrFLPTfr.js +0 -171
  709. package/dist/it-IT-B65JP9Qv.js +0 -1986
  710. package/dist/it-IT-CjbZahlB.js +0 -994
  711. package/dist/ja-JP-4jufT0xh.js +0 -994
  712. package/dist/ja-JP-CgGmwtzl.js +0 -1986
  713. package/dist/lt-LT-D_Q1Z3N4.js +0 -1986
  714. package/dist/lv-LV-aF5bMtic.js +0 -1986
  715. package/dist/mapExistingFile-BE74t9jV.js +0 -25
  716. package/dist/mapTransferInstrumentToPayoutAccount-DR8zv8gS.js +0 -30
  717. package/dist/nl-NL-B3xjfpMi.js +0 -994
  718. package/dist/nl-NL-GDXpht_y.js +0 -1986
  719. package/dist/no-NO-CEow5Bac.js +0 -1986
  720. package/dist/omitObscuredFieldsIfUnchanged-DhCrqm4T.js +0 -28
  721. package/dist/pl-PL-Bir_Ltlv.js +0 -1986
  722. package/dist/process-field-configurations-DugpEY9k.js +0 -185
  723. package/dist/processValidationErrors-RYlNmxB9.js +0 -203
  724. package/dist/pt-PT-BpYDD-PX.js +0 -994
  725. package/dist/pt-PT-lkmVY63I.js +0 -1986
  726. package/dist/ro-RO-CTQvP4R9.js +0 -1986
  727. package/dist/ru-RU-BlgIj-Q4.js +0 -994
  728. package/dist/sk-SK-Ct3OVI0e.js +0 -1986
  729. package/dist/sl-SI-CNjkFWB7.js +0 -1986
  730. package/dist/sv-SE-7lcf_fB9.js +0 -994
  731. package/dist/sv-SE-BwREUuQq.js +0 -1986
  732. package/dist/types/api/companyDataSet/useCompanyDataset.d.ts +0 -5
  733. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/formatId.d.ts +0 -3
  734. package/dist/types/core/models/country-code.d.ts +0 -250
  735. package/dist/types/embeds/ShadowStylesRoot.d.ts +0 -3
  736. package/dist/types/utils/sanitizeHtml.d.ts +0 -3
  737. package/dist/types/utils/useStateFromProp.d.ts +0 -9
  738. package/dist/useToastContext-CF2xonft.js +0 -21
  739. package/dist/utils-B1H_8b1P.js +0 -74
  740. package/dist/validate-wd48TLfx.js +0 -245
  741. package/dist/zh-CN-xYZH718R.js +0 -994
  742. package/dist/zh-TW-DqBBNurv.js +0 -994
  743. /package/dist/types/{core/types/AccountHolder.types.d.ts → types/accountHolder.d.ts} +0 -0
  744. /package/dist/types/{core/models → types/datasets}/currency.d.ts +0 -0
  745. /package/dist/types/{core/models → types/datasets}/province-code.d.ts +0 -0
  746. /package/dist/types/{core/models → types/datasets}/state-code.d.ts +0 -0
  747. /package/dist/types/{core/models → types}/errors/form-verification-errors.d.ts +0 -0
  748. /package/dist/types/{core/models → types}/errors/remediation-action-context.d.ts +0 -0
  749. /package/dist/types/{core/models → types}/file.d.ts +0 -0
@@ -2,39 +2,22 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "934bfa8f-3825-4f4c-9e55-66df91e68842", e._sentryDebugIdIdentifier = "sentry-dbid-934bfa8f-3825-4f4c-9e55-66df91e68842");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ba18ab40-57e3-4f27-878f-7d4de0949d67", e._sentryDebugIdIdentifier = "sentry-dbid-ba18ab40-57e3-4f27-878f-7d4de0949d67");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
10
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
- import { useMemo, useEffect, useCallback, useState, useRef } from "preact/hooks";
12
- import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-By6uwPUg.js";
13
- import { bJ as reverseMapping, z as LegalEntityType, b1 as cloneObject, an as isEmpty, q as useApiContext, r as useQuery, t as httpGet, b as useI18nContext, ax as Field, bw as Select, G as Typography, aT as RadioGroup, bK as Link, bg as InputText, b2 as currencyByCountry, bL as InputNumber, bM as InputDate, bN as Currency, bO as CURRENCY_FIELD, bP as InputCurrency, as as useForm, bQ as useGlobalDataSlice, av as ErrorPanel, aw as createFormUtils, bR as useGlobalData, bS as getAddressSchemaForCountry, bT as COUNTRIES_WITH_STATES_DATASET, bU as Address, bV as getAddressSchemaLabelsByCountry, $ as useAnalyticsContext, b4 as useInvalidateRootLegalEntity, al as useAssociatedLegalEntity, a_ as datasetUtilities, bG as useStateContext, K as useSettingsContext, M as SettingNames, bW as getAssociatedLeAnalyticsPayload, by as getFormProps, L as Loader, a3 as Icon, Z as Button } from "./StoreProvider-COHi02bX.js";
14
- import { h as hasDataChanged } from "./hasDataChanged-CIg-bPSm.js";
15
- import { u as useToastContext } from "./useToastContext-CF2xonft.js";
16
- import { u as useScenarioConfiguration, i as isValidationError, p as processValidationErrors, d as isMaintenanceModeError } from "./processValidationErrors-RYlNmxB9.js";
17
- import { g as getPropsFromConfigurations, c as composePerScenarioFormConfigurations } from "./process-field-configurations-DugpEY9k.js";
18
- import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer, t as trackNavigation } from "./dropinUtils-Bk0T79SK.js";
19
- import { F as FormEndState } from "./FormEndState-BQOQ83vO.js";
20
- import { F as FormWrapper } from "./FormWrapper-Dvm1o4tC.js";
21
- import { l as localizeDateString } from "./localizeDateString-KlstHAcM.js";
22
- import { f as formatObject, g as getProp } from "./utils-B1H_8b1P.js";
23
- import { m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./mapFinancialReportsToFinancialInformation-Cid31JpK.js";
24
- import { i as isEeaCountry, f as fieldsPerScenario } from "./individualFormConfig-BrFLPTfr.js";
25
- import { b as businessFinancingCompanyDetailsValidations, a as businessFinancingParentCompanyDetailsValidations } from "./validate-wd48TLfx.js";
26
- const MANDATORY_FIELDS_BUSINESS_FINANCING = [
27
- "company.numberOfEmployees",
28
- "parentCompany.numberOfEmployees",
29
- "ultimateParentCompany.numberOfEmployees"
30
- ];
11
+ import { useRef, useEffect, useMemo, useState, useCallback } from "preact/hooks";
12
+ import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-D8dw9Oc3.js";
13
+ import { bz as reverseMapping, bA as formatObject, bB as isEeaCountry, y as LegalEntityType, bd as cloneObject, p as useApiContext, q as useQuery, r as httpGet, ap as useI18nContext, aB as Field, bu as Select, G as Typography, bC as LegalFormField, aA as createFormUtils, aY as RadioGroup, bD as Link, bE as InputText, be as currencyByCountry, bF as InputNumber, bG as InputDate, bH as Currency, bI as CURRENCY_FIELD, bJ as InputCurrency, bK as useFormContext, ax as getFieldProps, az as ErrorPanel, bL as getAddressSchemaForCountry, bM as COUNTRIES_WITH_STATES_DATASET, bN as Address, bO as getAddressSchemaLabelsByCountry, a0 as useAnalyticsContext, bh as useInvalidateRootLegalEntity, ao as useAssociatedLegalEntity, b3 as datasetUtilities, a6 as useToastContext, K as useSettingsContext, M as SettingNames, bP as getAssociatedLeAnalyticsPayload, bQ as getRequiredForms, bR as addValidityToForms, bS as useFormComposer, bT as trackNavigation, L as Loader, a4 as Icon, _ as Button, bU as isValidationError, bV as processValidationErrors, bW as isMaintenanceModeError } from "./StoreProvider-ClKLaHzy.js";
14
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-DjvdNEiV.js";
15
+ import { u as useMultiForm } from "./useMultiForm-KQwxav4F.js";
16
+ import { F as FormEndState } from "./FormEndState-JB6QFSet.js";
17
+ import { l as localizeDateString } from "./localizeDateString-CKCBXzSn.js";
18
+ import { m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./mapFinancialReportsToFinancialInformation-D_6u_bSS.js";
19
+ import { b as businessFinancingMultiformRules } from "./validate-CuwYJGc9.js";
31
20
  const businessFinancingBaseMapping = {
32
- // TODO delete the financialReports keys, they wouldn't get mapped correctly anyway
33
- numberOfEmployees: "organization.financialReports.employeeCount",
34
- annualTurnover: "organization.financialReports.annualTurnover",
35
- netAssets: "organization.financialReports.netAssets",
36
- financialReportingDate: "organization.financialReports.dateOfFinancialData",
37
- currency: "organization.financialReports.currencyOfFinancialData",
38
21
  legalProceedingsDate: "organization.dateOfInitiationOfLegalProceeding",
39
22
  legalInformationInsolvency: "organization.statusOfLegalProceeding",
40
23
  legalEntityIdentifier: "organization.globalLegalEntityIdentifier",
@@ -46,13 +29,7 @@ const businessFinancingBaseMapping = {
46
29
  "registrationAddress.postalCode": "organization.registeredAddress.postalCode",
47
30
  "registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
48
31
  "registrationAddress.address": "organization.registeredAddress.street",
49
- "registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
50
- "principalPlaceOfBusiness.city": "organization.principalPlaceOfBusiness.city",
51
- "principalPlaceOfBusiness.country": "organization.principalPlaceOfBusiness.country",
52
- "principalPlaceOfBusiness.postalCode": "organization.principalPlaceOfBusiness.postalCode",
53
- "principalPlaceOfBusiness.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
54
- "principalPlaceOfBusiness.address": "organization.principalPlaceOfBusiness.street",
55
- "principalPlaceOfBusiness.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
32
+ "registrationAddress.otherAddressInformation": "organization.registeredAddress.street2"
56
33
  };
57
34
  const businessFinancingComponentsKeyMapping = {
58
35
  ...businessFinancingBaseMapping
@@ -61,7 +38,10 @@ const businessFinancingApiKeyMapping = {
61
38
  ...reverseMapping(businessFinancingBaseMapping)
62
39
  };
63
40
  const mapBusinessFinancingToLegalEntity = (data) => ({
64
- ...formatObject(data, businessFinancingApiKeyMapping)
41
+ ...formatObject(
42
+ data,
43
+ businessFinancingApiKeyMapping
44
+ )
65
45
  });
66
46
  var BusinessFinancingPagesEnums = /* @__PURE__ */ ((BusinessFinancingPagesEnums2) => {
67
47
  BusinessFinancingPagesEnums2["COMPANY_PAGE"] = "company";
@@ -111,7 +91,6 @@ const parentCompaniesSchemaKeys = [
111
91
  "numberOfEmployees",
112
92
  "doesYourCompanyHaveLEI",
113
93
  "legalEntityIdentifier",
114
- "doesNotKnowNumberOfEmployees",
115
94
  "isThisAddressTheMainHeadquarters",
116
95
  "financialReportingDate",
117
96
  "currency",
@@ -145,27 +124,28 @@ var BusinessFinancingIndex = /* @__PURE__ */ ((BusinessFinancingIndex2) => {
145
124
  return BusinessFinancingIndex2;
146
125
  })(BusinessFinancingIndex || {});
147
126
  const getLegalEntityId = (businessFinancingIndex, rootLegalEntity) => {
148
- var _a;
149
127
  if (!rootLegalEntity) return void 0;
150
128
  if (businessFinancingIndex === BusinessFinancingIndex.COMPANY) return rootLegalEntity.id;
151
- if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return void 0;
129
+ if (!rootLegalEntity?.entityAssociations) return void 0;
152
130
  const businessFinancingEntityType = BusinessFinancingIndex.PARENT_COMPANY ? "immediateParentCompany" : "ultimateParentCompany";
153
- const businessFinancingEntityAssociation = (_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.find(
131
+ const businessFinancingEntityAssociation = rootLegalEntity.entityAssociations?.find(
154
132
  (entity) => entity.type === businessFinancingEntityType
155
133
  );
156
- return businessFinancingEntityAssociation == null ? void 0 : businessFinancingEntityAssociation.legalEntityId;
134
+ return businessFinancingEntityAssociation?.legalEntityId;
157
135
  };
158
136
  const USER_LOCALE = typeof navigator !== "undefined" ? navigator.language : "en-US";
159
- const entityHasParentCompany = (data) => {
160
- var _a, _b;
161
- return ((_a = data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) === "Yes";
162
- };
163
- const entityHasUltimateParentCompany = (data) => {
164
- var _a, _b;
165
- return ((_a = data.company) == null ? void 0 : _a.isParentOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany) === "Yes";
137
+ const entityHasParentCompany = (data) => data.company?.isCompanyOwnedByAnotherCompany && data.company?.isCompanyOwnedByAnotherCompany === "Yes";
138
+ const entityHasUltimateParentCompany = (data) => data.company?.isParentOwnedByAnotherCompany && data.company?.isParentOwnedByAnotherCompany === "Yes";
139
+ const financialReportsToString = (financialReports) => {
140
+ return {
141
+ ...financialReports,
142
+ numberOfEmployees: financialReports.numberOfEmployees ? financialReports.numberOfEmployees.toString() : void 0,
143
+ netAssets: financialReports.netAssets ? financialReports.netAssets.toString() : void 0,
144
+ annualTurnover: financialReports.annualTurnover ? financialReports.annualTurnover.toString() : void 0,
145
+ balanceSheetTotal: financialReports.balanceSheetTotal ? financialReports.balanceSheetTotal.toString() : void 0
146
+ };
166
147
  };
167
148
  const prepareBusinessFinancingSubmitData = (businessFinancingIndex, data, rootLegalEntity) => {
168
- var _a, _b, _c;
169
149
  const businessFinancingData = data[businessFinancingIndex];
170
150
  if (!businessFinancingData) return null;
171
151
  if (businessFinancingIndex === BusinessFinancingIndex.PARENT_COMPANY && !entityHasParentCompany(data)) {
@@ -174,15 +154,18 @@ const prepareBusinessFinancingSubmitData = (businessFinancingIndex, data, rootLe
174
154
  if (businessFinancingIndex === BusinessFinancingIndex.ULTIMATE_PARENT_COMPANY && (!entityHasUltimateParentCompany(data) || !entityHasParentCompany(data))) {
175
155
  return null;
176
156
  }
177
- const businessFinancingDetails = mapBusinessFinancingToLegalEntity(
178
- businessFinancingData
179
- );
157
+ const businessFinancingDetails = mapBusinessFinancingToLegalEntity(businessFinancingData);
180
158
  if (!businessFinancingDetails.organization) return null;
181
- const businessFinancingCountry = ((_a = businessFinancingDetails.organization.registeredAddress) == null ? void 0 : _a.country) || ((_c = (_b = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _b.registeredAddress) == null ? void 0 : _c.country);
182
- if (businessFinancingDetails.organization.financialReports && isEeaCountry(businessFinancingCountry)) {
183
- const businessFinancingFinancialReport = mapFinancialInformationToFinancialReport(
184
- businessFinancingData
185
- );
159
+ const businessFinancingCountry = businessFinancingDetails.organization.registeredAddress?.country || rootLegalEntity?.organization?.registeredAddress?.country;
160
+ if (businessFinancingData.financialReportingDate && isEeaCountry(businessFinancingCountry)) {
161
+ const finReports = {
162
+ currency: businessFinancingData.currency,
163
+ financialReportingDate: businessFinancingData.financialReportingDate,
164
+ numberOfEmployees: businessFinancingData.numberOfEmployees ? Number(businessFinancingData.numberOfEmployees) : void 0,
165
+ netAssets: businessFinancingData.netAssets ? Number(businessFinancingData.netAssets) : void 0,
166
+ annualTurnover: businessFinancingData.annualTurnover ? Number(businessFinancingData.annualTurnover) : void 0
167
+ };
168
+ const businessFinancingFinancialReport = mapFinancialInformationToFinancialReport(finReports);
186
169
  businessFinancingDetails.organization.financialReports = [businessFinancingFinancialReport];
187
170
  }
188
171
  if (!isEeaCountry(businessFinancingCountry)) {
@@ -218,11 +201,19 @@ const appendBusinessFinancingData = (legalOrganization, businessFinancingData) =
218
201
  let financialReportData = {};
219
202
  if (legalOrganization.financialReports) {
220
203
  const financialReportsArray = Array.isArray(legalOrganization.financialReports) ? legalOrganization.financialReports : [legalOrganization.financialReports];
221
- financialReportData = mapFinancialReportsToFinancialInformation(financialReportsArray, false);
204
+ const financialInformationSchema = mapFinancialReportsToFinancialInformation(
205
+ financialReportsArray,
206
+ false
207
+ );
208
+ financialReportData = financialReportsToString(financialInformationSchema);
209
+ if (financialReportData.numberOfEmployees) {
210
+ financialReportData.numberOfEmployees = financialReportData.numberOfEmployees.toString();
211
+ }
222
212
  }
223
213
  return {
224
214
  ...clonedBusinessFinancingData,
225
215
  ...financialReportData,
216
+ numberOfEmployees: financialReportData.numberOfEmployees ? financialReportData.numberOfEmployees.toString() : void 0,
226
217
  doesYourCompanyHaveLEI: legalOrganization.globalLegalEntityIdentifier ? "Yes" : "No",
227
218
  isThisAddressTheMainHeadquarters: legalOrganization.principalPlaceOfBusiness ? "Yes" : clonedBusinessFinancingData.isThisAddressTheMainHeadquarters
228
219
  };
@@ -258,15 +249,14 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
258
249
  if (currentData.doesYourCompanyHaveLEI !== "Yes") {
259
250
  fieldsToRemove.push("legalEntityIdentifier");
260
251
  }
261
- if (!(currentData == null ? void 0 : currentData.legalInformationInsolvency) || ["noLegalActionsTaken", "iDontKnow"].includes(currentData == null ? void 0 : currentData.legalInformationInsolvency)) {
252
+ if (!currentData?.legalInformationInsolvency || ["noLegalActionsTaken", "iDontKnow"].includes(currentData?.legalInformationInsolvency)) {
262
253
  fieldsToRemove.push("legalProceedingsDate");
263
254
  }
264
255
  return schemaKeys.filter((field) => !fieldsToRemove.includes(field));
265
256
  };
266
257
  const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
267
- var _a;
268
258
  const fieldsToRemove = [];
269
- const companyCountry = (_a = currentData == null ? void 0 : currentData.registrationAddress) == null ? void 0 : _a.country;
259
+ const companyCountry = currentData?.registrationAddress?.country;
270
260
  if (!isEeaCountry(companyCountry)) {
271
261
  fieldsToRemove.push(
272
262
  "financialReportingDate",
@@ -279,11 +269,44 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
279
269
  if (currentData.doesYourCompanyHaveLEI !== "Yes") {
280
270
  fieldsToRemove.push("legalEntityIdentifier");
281
271
  }
282
- if (!(currentData == null ? void 0 : currentData.legalInformationInsolvency) || ["noLegalActionsTaken", "iDontKnow"].includes(currentData == null ? void 0 : currentData.legalInformationInsolvency)) {
272
+ if (!currentData?.legalInformationInsolvency || ["noLegalActionsTaken", "iDontKnow"].includes(currentData?.legalInformationInsolvency)) {
283
273
  fieldsToRemove.push("legalProceedingsDate");
284
274
  }
285
275
  return schemaKeys.filter((field) => !fieldsToRemove.includes(field));
286
276
  };
277
+ const getBusinessFinancingRequiredFields = (country, data) => {
278
+ let requiredFields = {
279
+ company: companySchemaKeys
280
+ };
281
+ if (!data) {
282
+ return requiredFields;
283
+ }
284
+ const { company, parentCompany = {}, ultimateParentCompany = {} } = data;
285
+ if (company) {
286
+ requiredFields.company = getCompanySchemaKeys(country, company, companySchemaKeys);
287
+ }
288
+ if (company?.isCompanyOwnedByAnotherCompany === "Yes") {
289
+ const parentCompanyRequiredFields = getParentCompanySchemaKeys(
290
+ parentCompany,
291
+ parentCompaniesSchemaKeys
292
+ );
293
+ requiredFields = {
294
+ ...requiredFields,
295
+ parentCompany: parentCompanyRequiredFields
296
+ };
297
+ }
298
+ if (company?.isParentOwnedByAnotherCompany === "Yes") {
299
+ const ultimateParentCompanyRequiredFields = getParentCompanySchemaKeys(
300
+ ultimateParentCompany,
301
+ parentCompaniesSchemaKeys
302
+ );
303
+ requiredFields = {
304
+ ...requiredFields,
305
+ ultimateParentCompany: ultimateParentCompanyRequiredFields
306
+ };
307
+ }
308
+ return requiredFields;
309
+ };
287
310
  const customLabels = {
288
311
  company: {
289
312
  legalForm: "businessStructure",
@@ -325,15 +348,14 @@ const getFormattedAmount = (value, currency) => {
325
348
  const formattedValue = Number(value).toLocaleString(userLocale);
326
349
  return `${currency} ${formattedValue}`;
327
350
  };
328
- const formatDataForSummary = (data, i18n, datasetUtils) => {
329
- var _a, _b, _c, _d, _e;
351
+ const formatDataForSummary = (i18n, datasetUtils, data) => {
330
352
  const summaryData = cloneObject(data) || {};
331
353
  if (summaryData.company) {
332
354
  summaryData.company.legalForm = summaryData.company.legalFormLabel;
333
355
  summaryData.company.naceCode = summaryData.company.naceCodeLabel;
334
356
  summaryData.company.legalInformationInsolvency = getTranslatedLegalInsolvency(
335
357
  i18n,
336
- (_a = summaryData.company) == null ? void 0 : _a.legalInformationInsolvency
358
+ summaryData.company?.legalInformationInsolvency
337
359
  );
338
360
  summaryData.company.annualTurnover = getFormattedAmount(
339
361
  summaryData.company.annualTurnover,
@@ -347,13 +369,13 @@ const formatDataForSummary = (data, i18n, datasetUtils) => {
347
369
  summaryData.company.legalProceedingsDate = legalProceedingsDate ? localizeDateString(legalProceedingsDate, i18n.locale) : void 0;
348
370
  summaryData.company.financialReportingDate = financialReportingDate ? localizeDateString(financialReportingDate, i18n.locale) : void 0;
349
371
  }
350
- if ((_b = summaryData.parentCompany) == null ? void 0 : _b.legalName) {
372
+ if (summaryData.parentCompany?.legalName) {
351
373
  summaryData.parentCompany.legalForm = summaryData.parentCompany.legalFormLabel;
352
374
  summaryData.parentCompany.naceCode = summaryData.parentCompany.naceCodeLabel;
353
375
  summaryData.parentCompany.country = summaryData.parentCompany.country ? datasetUtils.getCountryName(summaryData.parentCompany.country) : "";
354
376
  summaryData.parentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency(
355
377
  i18n,
356
- (_c = summaryData.parentCompany) == null ? void 0 : _c.legalInformationInsolvency
378
+ summaryData.parentCompany?.legalInformationInsolvency
357
379
  );
358
380
  summaryData.parentCompany.annualTurnover = getFormattedAmount(
359
381
  summaryData.parentCompany.annualTurnover,
@@ -367,13 +389,13 @@ const formatDataForSummary = (data, i18n, datasetUtils) => {
367
389
  summaryData.parentCompany.legalProceedingsDate = legalProceedingsDate ? localizeDateString(legalProceedingsDate, i18n.locale) : void 0;
368
390
  summaryData.parentCompany.financialReportingDate = financialReportingDate ? localizeDateString(financialReportingDate, i18n.locale) : void 0;
369
391
  }
370
- if ((_d = summaryData.ultimateParentCompany) == null ? void 0 : _d.legalName) {
392
+ if (summaryData.ultimateParentCompany?.legalName) {
371
393
  summaryData.ultimateParentCompany.legalForm = summaryData.ultimateParentCompany.legalFormLabel;
372
394
  summaryData.ultimateParentCompany.naceCode = summaryData.ultimateParentCompany.naceCodeLabel;
373
395
  summaryData.ultimateParentCompany.country = summaryData.ultimateParentCompany.country ? datasetUtils.getCountryName(summaryData.ultimateParentCompany.country) : "";
374
396
  summaryData.ultimateParentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency(
375
397
  i18n,
376
- (_e = summaryData.ultimateParentCompany) == null ? void 0 : _e.legalInformationInsolvency
398
+ summaryData.ultimateParentCompany?.legalInformationInsolvency
377
399
  );
378
400
  summaryData.ultimateParentCompany.annualTurnover = getFormattedAmount(
379
401
  summaryData.ultimateParentCompany.annualTurnover,
@@ -389,78 +411,7 @@ const formatDataForSummary = (data, i18n, datasetUtils) => {
389
411
  }
390
412
  return summaryData;
391
413
  };
392
- const canSubmit = (data) => MANDATORY_FIELDS_BUSINESS_FINANCING.every((detail) => {
393
- const value = getProp(data, detail);
394
- return !isEmpty(value);
395
- });
396
414
  const mapLegalEntityToBusinessFinancing = (legalEntity) => formatObject(legalEntity, businessFinancingComponentsKeyMapping);
397
- const getLegalForms = async (countryCode, baseUrl) => {
398
- return httpGet({
399
- baseUrl,
400
- path: `datasets/legalForms/${countryCode}`
401
- });
402
- };
403
- const useLegalForms = (countryCode, options) => {
404
- const { baseUrl } = useApiContext();
405
- return useQuery({
406
- queryKey: ["legalForms", countryCode],
407
- queryFn: () => getLegalForms(countryCode, baseUrl.value),
408
- ...options
409
- });
410
- };
411
- function LegalFormField({
412
- name = "legalForm",
413
- data,
414
- valid,
415
- errorMessage,
416
- label,
417
- readonly,
418
- handleChangeFor,
419
- helperText,
420
- countryCode,
421
- classNameModifiers = []
422
- }) {
423
- const { i18n } = useI18nContext();
424
- const { data: legalFormsData } = useLegalForms(countryCode);
425
- const handleChangeForLegalForm = (e) => {
426
- var _a;
427
- const legalFormValue = e.target.value;
428
- const selectedLabel = (_a = legalFormsData == null ? void 0 : legalFormsData.find(
429
- (legalForm) => legalForm.id === legalFormValue
430
- )) == null ? void 0 : _a.name;
431
- const legalFormEvent = {
432
- target: {
433
- name: "legalForm",
434
- value: e.target.value,
435
- label: selectedLabel
436
- }
437
- };
438
- handleChangeFor("legalForm")(legalFormEvent);
439
- };
440
- return /* @__PURE__ */ jsx(
441
- Field,
442
- {
443
- name,
444
- label: label || i18n.get("businessStructure"),
445
- errorMessage,
446
- classNameModifiers,
447
- isValid: valid.legalForm,
448
- helper: helperText == null ? void 0 : helperText.legalForm,
449
- children: (childProps) => /* @__PURE__ */ jsx(
450
- Select,
451
- {
452
- ...childProps,
453
- name,
454
- placeholder: i18n.get("selectOne"),
455
- selected: data.legalForm,
456
- items: legalFormsData ?? [],
457
- readonly: readonly && !!data,
458
- onChange: handleChangeForLegalForm
459
- }
460
- )
461
- }
462
- );
463
- }
464
415
  const getNaceCodes = async (baseUrl) => {
465
416
  return httpGet({
466
417
  baseUrl,
@@ -483,35 +434,41 @@ function NaceCodeField({
483
434
  label,
484
435
  readonly,
485
436
  handleChangeFor,
486
- helperText,
487
- classNameModifiers = []
437
+ helperText
488
438
  }) {
489
439
  const { i18n } = useI18nContext();
490
440
  const { data: naceCodesData } = useNaceCodes();
441
+ const handleChangeForRef = useRef(handleChangeFor);
442
+ useEffect(() => {
443
+ handleChangeForRef.current = handleChangeFor;
444
+ }, [handleChangeFor]);
491
445
  const handleChangeForNaceCode = (e) => {
492
- var _a;
493
- const naceCodeFormValue = e.target.value;
494
- const selectedLabel = (_a = naceCodesData == null ? void 0 : naceCodesData.find(
495
- (naceCode) => naceCode.id === naceCodeFormValue
496
- )) == null ? void 0 : _a.name;
497
446
  const naceCodeEvent = {
498
447
  target: {
499
448
  name: "naceCode",
500
- value: e.target.value,
501
- label: selectedLabel
449
+ value: e.target.value
502
450
  }
503
451
  };
504
452
  handleChangeFor("naceCode")(naceCodeEvent);
505
453
  };
454
+ useEffect(() => {
455
+ const selectedLabel = naceCodesData?.find((naceCode) => naceCode.id === data.naceCode)?.name;
456
+ const naceCodeEvent = {
457
+ target: {
458
+ name: "naceCodeLabel",
459
+ value: selectedLabel
460
+ }
461
+ };
462
+ handleChangeForRef.current("naceCodeLabel")(naceCodeEvent);
463
+ }, [data.naceCode, naceCodesData]);
506
464
  return /* @__PURE__ */ jsx(
507
465
  Field,
508
466
  {
509
467
  name,
510
468
  label: label || i18n.get("industryAndNaceCode"),
511
469
  errorMessage,
512
- classNameModifiers,
513
470
  isValid: valid.naceCode,
514
- helper: helperText == null ? void 0 : helperText.naceCode,
471
+ helper: helperText?.naceCode,
515
472
  children: (childProps) => /* @__PURE__ */ jsx(
516
473
  Select,
517
474
  {
@@ -527,51 +484,44 @@ function NaceCodeField({
527
484
  }
528
485
  );
529
486
  }
530
- function BusinessFinancingBusinessInformation({
531
- formUtils,
532
- data,
533
- valid,
534
- errors,
535
- fieldProblems,
536
- handleChangeFor,
537
- country,
538
- targetPage,
539
- sectionHeading
540
- }) {
541
- var _a;
487
+ const businessInformationFields = [
488
+ "legalForm",
489
+ "naceCode",
490
+ "naceCodeLabel",
491
+ "legalFormLabel",
492
+ "doesYourCompanyHaveLEI",
493
+ "legalEntityIdentifier"
494
+ ];
495
+ function BusinessFinancingBusinessInformation(props) {
496
+ const {
497
+ data,
498
+ valid,
499
+ errors,
500
+ country,
501
+ handleFieldChange,
502
+ fieldValidationErrors,
503
+ targetPage,
504
+ sectionHeading
505
+ } = props;
542
506
  const { i18n } = useI18nContext();
507
+ const formUtils = createFormUtils(props, i18n);
508
+ if (!handleFieldChange) {
509
+ return;
510
+ }
543
511
  const isMainCompany = targetPage === BusinessFinancingPagesEnums.COMPANY_PAGE;
544
- const companyCountry = targetPage === BusinessFinancingPagesEnums.COMPANY_PAGE ? country : (_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country;
545
- const handleChangeWithLabel = (key) => (e) => {
546
- const labelKey = `${key}Label`;
547
- const fieldEvent = {
548
- target: {
549
- name: key,
550
- value: e.target.value
551
- }
552
- };
553
- const labelEvent = {
554
- target: {
555
- name: labelKey,
556
- value: e.target.label
557
- }
558
- };
559
- handleChangeFor(key)(fieldEvent);
560
- handleChangeFor(labelKey)(labelEvent);
561
- };
562
512
  return /* @__PURE__ */ jsxs(Fragment, { children: [
563
513
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "yourBusinessInformation") }),
564
514
  /* @__PURE__ */ jsx(
565
515
  LegalFormField,
566
516
  {
567
517
  name: "legalForm",
568
- countryCode: companyCountry,
518
+ countryCode: country,
569
519
  data: {
570
- legalForm: data.legalForm
520
+ legalForm: data?.legalForm
571
521
  },
572
- valid: { legalForm: valid.legalForm },
573
- errorMessage: formUtils.getErrorMessage("legalForm", errors, fieldProblems),
574
- handleChangeFor: handleChangeWithLabel,
522
+ valid: { legalForm: valid?.legalForm },
523
+ errorMessage: formUtils.getErrorMessage("legalForm", errors, fieldValidationErrors),
524
+ handleChangeFor: handleFieldChange,
575
525
  readonly: false,
576
526
  label: formUtils.getLabel("legalForm", "businessStructure")
577
527
  }
@@ -580,10 +530,10 @@ function BusinessFinancingBusinessInformation({
580
530
  NaceCodeField,
581
531
  {
582
532
  name: "naceCode",
583
- data: { naceCode: data.naceCode },
584
- valid: { naceCode: valid.naceCode },
585
- errorMessage: formUtils.getErrorMessage("naceCode", errors, fieldProblems),
586
- handleChangeFor: handleChangeWithLabel,
533
+ data: { naceCode: data?.naceCode },
534
+ valid: { naceCode: valid?.naceCode },
535
+ errorMessage: formUtils.getErrorMessage("naceCode", errors, fieldValidationErrors),
536
+ handleChangeFor: handleFieldChange,
587
537
  readonly: false,
588
538
  label: formUtils.getLabel("naceCode", "industryAndNaceCode")
589
539
  }
@@ -600,29 +550,37 @@ function BusinessFinancingBusinessInformation({
600
550
  " ",
601
551
  /* @__PURE__ */ jsx(Link, { href: "https://search.gleif.org/#/search/", external: true, inline: true, children: i18n.get("lookUpYourLEI") })
602
552
  ] }),
603
- errorMessage: formUtils.getErrorMessage("doesYourCompanyHaveLEI", errors, fieldProblems),
553
+ errorMessage: formUtils.getErrorMessage(
554
+ "doesYourCompanyHaveLEI",
555
+ errors,
556
+ fieldValidationErrors
557
+ ),
604
558
  children: (childProps) => /* @__PURE__ */ jsx(
605
559
  RadioGroup,
606
560
  {
607
561
  ...childProps,
608
562
  name: "doesYourCompanyHaveLEI",
609
563
  items: isMainCompany ? businessFinancingRadioItems : businessFinancingParentRadioItems,
610
- value: data.doesYourCompanyHaveLEI,
564
+ value: data?.doesYourCompanyHaveLEI,
611
565
  disabled: false,
612
- onChange: handleChangeFor("doesYourCompanyHaveLEI"),
566
+ onChange: handleFieldChange("doesYourCompanyHaveLEI"),
613
567
  "aria-required": true,
614
- "aria-invalid": !valid.doesYourCompanyHaveLEI
568
+ "aria-invalid": !valid?.doesYourCompanyHaveLEI
615
569
  }
616
570
  )
617
571
  }
618
572
  ),
619
- data.doesYourCompanyHaveLEI === "Yes" && /* @__PURE__ */ jsx(
573
+ data?.doesYourCompanyHaveLEI === "Yes" && /* @__PURE__ */ jsx(
620
574
  Field,
621
575
  {
622
576
  name: "legalEntityIdentifier",
623
577
  label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
624
- errorMessage: formUtils.getErrorMessage("legalEntityIdentifier", errors, fieldProblems),
625
- isValid: valid.legalEntityIdentifier,
578
+ errorMessage: formUtils.getErrorMessage(
579
+ "legalEntityIdentifier",
580
+ errors,
581
+ fieldValidationErrors
582
+ ),
583
+ isValid: valid?.legalEntityIdentifier,
626
584
  helper: i18n.get("enterNCharactersWithAMixForExample", {
627
585
  values: {
628
586
  numChars: 20,
@@ -634,14 +592,13 @@ function BusinessFinancingBusinessInformation({
634
592
  {
635
593
  ...childProps,
636
594
  name: "legalEntityIdentifier",
637
- value: data.legalEntityIdentifier,
595
+ value: data?.legalEntityIdentifier,
638
596
  readonly: false,
639
- classNameModifiers: ["legalName"],
640
- onInput: handleChangeFor("legalEntityIdentifier", "input"),
641
- onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
597
+ onInput: handleFieldChange("legalEntityIdentifier", "input"),
598
+ onBlur: handleFieldChange("legalEntityIdentifier", "blur"),
642
599
  "aria-required": true,
643
- "aria-invalid": !valid.legalEntityIdentifier,
644
- isValid: valid.legalEntityIdentifier
600
+ "aria-invalid": !valid?.legalEntityIdentifier,
601
+ isValid: valid?.legalEntityIdentifier
645
602
  }
646
603
  )
647
604
  }
@@ -649,31 +606,28 @@ function BusinessFinancingBusinessInformation({
649
606
  ] });
650
607
  }
651
608
  const TODAY_DATE$1 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
652
- function BusinessFinancingFinancialInformation({
653
- formUtils,
654
- data,
655
- valid,
656
- errors,
657
- fieldProblems,
658
- handleChangeFor,
659
- country,
660
- sectionHeading,
661
- setValidCurrency
662
- }) {
663
- var _a;
609
+ const financialInformationFields = [
610
+ "numberOfEmployees",
611
+ "financialReportingDate",
612
+ "doesYourCompanyHaveLEI",
613
+ "legalEntityIdentifier",
614
+ "currency",
615
+ "netAssets",
616
+ "annualTurnover"
617
+ ];
618
+ function BusinessFinancingFinancialInformation(props) {
619
+ const { data, valid, errors, country, sectionHeading, handleFieldChange, fieldValidationErrors } = props;
664
620
  const { i18n } = useI18nContext();
621
+ const formUtils = createFormUtils(props, i18n);
622
+ const currenciesForCurrCountry = useMemo(() => currencyByCountry[country] ?? [], [country]);
623
+ if (!handleFieldChange) {
624
+ return;
625
+ }
665
626
  const financialData = data;
666
627
  const financialErrors = errors;
667
628
  const isFinancialDataValid = valid;
668
- const currenciesForCurrCountry = useMemo(() => currencyByCountry[country] ?? [], [country]);
669
629
  const [firstCurrency] = currenciesForCurrCountry;
670
630
  const defaultCurrency = firstCurrency ?? "EUR";
671
- useEffect(() => {
672
- if ((currenciesForCurrCountry == null ? void 0 : currenciesForCurrCountry.length) === 1) {
673
- financialData.currency = firstCurrency;
674
- setValidCurrency("currency", true);
675
- }
676
- }, [currenciesForCurrCountry, firstCurrency, setValidCurrency, financialData]);
677
631
  return /* @__PURE__ */ jsxs("section", { children: [
678
632
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "financialInformation") }),
679
633
  /* @__PURE__ */ jsx(
@@ -681,21 +635,20 @@ function BusinessFinancingFinancialInformation({
681
635
  {
682
636
  name: "numberOfEmployees",
683
637
  label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
684
- errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
685
- isValid: valid.numberOfEmployees,
686
- classNameModifiers: ["numberOfEmployees"],
638
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldValidationErrors),
639
+ isValid: valid?.numberOfEmployees,
687
640
  children: (childProps) => /* @__PURE__ */ jsx(
688
641
  InputNumber,
689
642
  {
690
643
  ...childProps,
691
644
  "aria-required": true,
692
- "aria-invalid": !valid.numberOfEmployees,
645
+ "aria-invalid": !valid?.numberOfEmployees,
693
646
  name: "numberOfEmployees",
694
647
  min: "0",
695
648
  step: "1",
696
- value: data.numberOfEmployees,
697
- onInput: handleChangeFor("numberOfEmployees", "input"),
698
- onBlur: handleChangeFor("numberOfEmployees", "blur")
649
+ value: data?.numberOfEmployees,
650
+ onInput: handleFieldChange("numberOfEmployees", "input"),
651
+ onBlur: handleFieldChange("numberOfEmployees", "blur")
699
652
  }
700
653
  )
701
654
  }
@@ -706,19 +659,22 @@ function BusinessFinancingFinancialInformation({
706
659
  name: "financialReportingDate",
707
660
  label: formUtils.getLabel("financialReportingDate", "financialReportingDate"),
708
661
  helper: i18n.get("dateOfTotalAssetsCalculation"),
709
- errorMessage: formUtils.getErrorMessage("financialReportingDate", errors, fieldProblems),
710
- isValid: valid.financialReportingDate,
711
- classNameModifiers: ["financialReportingDate"],
662
+ errorMessage: formUtils.getErrorMessage(
663
+ "financialReportingDate",
664
+ errors,
665
+ fieldValidationErrors
666
+ ),
667
+ isValid: valid?.financialReportingDate,
712
668
  children: (childProps) => /* @__PURE__ */ jsx(
713
669
  InputDate,
714
670
  {
715
671
  ...childProps,
716
672
  name: "financialReportingDate",
717
- value: data.financialReportingDate,
718
- onInput: handleChangeFor("financialReportingDate", "input"),
719
- onBlur: handleChangeFor("financialReportingDate", "blur"),
673
+ value: data?.financialReportingDate,
674
+ onInput: handleFieldChange("financialReportingDate", "input"),
675
+ onBlur: handleFieldChange("financialReportingDate", "blur"),
720
676
  "aria-required": true,
721
- "aria-invalid": !valid.financialReportingDate,
677
+ "aria-invalid": !valid?.financialReportingDate,
722
678
  max: TODAY_DATE$1
723
679
  }
724
680
  )
@@ -727,10 +683,10 @@ function BusinessFinancingFinancialInformation({
727
683
  /* @__PURE__ */ jsx(
728
684
  Currency,
729
685
  {
730
- country: ((_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country) ?? country,
686
+ country,
731
687
  data: formUtils.getFieldData(financialData, CURRENCY_FIELD),
732
- errors: formUtils.getFieldErrors(financialErrors, fieldProblems, CURRENCY_FIELD),
733
- handleChangeFor,
688
+ errors: formUtils.getFieldErrors(financialErrors, fieldValidationErrors, CURRENCY_FIELD),
689
+ handleChangeFor: handleFieldChange,
734
690
  labels: { currency: i18n.get("reportingCurrency") },
735
691
  readonly: formUtils.isReadOnly("currency"),
736
692
  valid: formUtils.getFieldValid(isFinancialDataValid, CURRENCY_FIELD)
@@ -743,15 +699,15 @@ function BusinessFinancingFinancialInformation({
743
699
  name: "netAssets",
744
700
  label: formUtils.getLabel("netAssets", "totalAssets"),
745
701
  helper: i18n.get("totalAssetsHelper"),
746
- errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldProblems),
702
+ errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldValidationErrors),
747
703
  children: (childProps) => /* @__PURE__ */ jsx(
748
704
  InputCurrency,
749
705
  {
750
706
  ...childProps,
751
707
  locale: i18n.locale,
752
- currency: data.currency ?? defaultCurrency,
753
- amount: data.netAssets,
754
- onAmountChanged: handleChangeFor("netAssets")
708
+ currency: data?.currency ?? defaultCurrency,
709
+ amount: data?.netAssets ? Number(data?.netAssets) : void 0,
710
+ onAmountChanged: handleFieldChange("netAssets")
755
711
  }
756
712
  )
757
713
  }
@@ -762,16 +718,16 @@ function BusinessFinancingFinancialInformation({
762
718
  name: "annualTurnover",
763
719
  label: formUtils.getLabel("annualTurnover", "annualTurnover"),
764
720
  helper: i18n.get("annualTurnoverHelper"),
765
- errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldProblems),
721
+ errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldValidationErrors),
766
722
  children: (childProps) => /* @__PURE__ */ jsx(
767
723
  InputCurrency,
768
724
  {
769
725
  ...childProps,
770
726
  name: "annualTurnover",
771
727
  locale: i18n.locale,
772
- currency: data.currency ?? defaultCurrency,
773
- amount: data.annualTurnover,
774
- onAmountChanged: handleChangeFor("annualTurnover")
728
+ currency: data?.currency ?? defaultCurrency,
729
+ amount: data?.annualTurnover ? Number(data?.annualTurnover) : void 0,
730
+ onAmountChanged: handleFieldChange("annualTurnover")
775
731
  }
776
732
  )
777
733
  }
@@ -780,16 +736,17 @@ function BusinessFinancingFinancialInformation({
780
736
  ] });
781
737
  }
782
738
  const TODAY_DATE = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
783
- function BusinessFinancingLegalInformation({
784
- formUtils,
785
- data,
786
- valid,
787
- errors,
788
- fieldProblems,
789
- handleChangeFor,
790
- sectionHeading
791
- }) {
739
+ const legalInformationFields = [
740
+ "legalInformationInsolvency",
741
+ "legalProceedingsDate"
742
+ ];
743
+ function BusinessFinancingLegalInformation(props) {
744
+ const { data, valid, errors, fieldValidationErrors, handleFieldChange, sectionHeading } = props;
792
745
  const { i18n } = useI18nContext();
746
+ const formUtils = createFormUtils(props, i18n);
747
+ if (!handleFieldChange) {
748
+ return;
749
+ }
793
750
  const legalInformationInsolvencyItems = [
794
751
  { id: "noLegalActionsTaken", name: i18n.get("no") },
795
752
  { id: "underJudicialAdministration", name: i18n.get("underJudicialAdministration") },
@@ -797,7 +754,7 @@ function BusinessFinancingLegalInformation({
797
754
  { id: "otherLegalMeasures", name: i18n.get("otherLegalMeasures") },
798
755
  { id: "iDontKnow", name: i18n.get("iDontKnow") }
799
756
  ];
800
- const showLegalProceedingsDateField = data.legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(data.legalInformationInsolvency);
757
+ const showLegalProceedingsDateField = data?.legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(data?.legalInformationInsolvency);
801
758
  return /* @__PURE__ */ jsxs(Fragment, { children: [
802
759
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "legalInformation") }),
803
760
  /* @__PURE__ */ jsx(
@@ -808,20 +765,20 @@ function BusinessFinancingLegalInformation({
808
765
  errorMessage: formUtils.getErrorMessage(
809
766
  "legalInformationInsolvency",
810
767
  errors,
811
- fieldProblems
768
+ fieldValidationErrors
812
769
  ),
813
- isValid: valid.legalInformationInsolvency,
770
+ isValid: valid?.legalInformationInsolvency,
814
771
  children: (childProps) => /* @__PURE__ */ jsx(
815
772
  Select,
816
773
  {
817
774
  ...childProps,
818
- onChange: handleChangeFor("legalInformationInsolvency", "blur"),
775
+ onChange: handleFieldChange("legalInformationInsolvency", "blur"),
819
776
  name: "legalInformationInsolvency",
820
777
  placeholder: i18n.get("selectOne"),
821
- selected: data.legalInformationInsolvency,
778
+ selected: data?.legalInformationInsolvency,
822
779
  items: legalInformationInsolvencyItems,
823
780
  "aria-required": true,
824
- "aria-invalid": !valid.legalInformationInsolvency
781
+ "aria-invalid": !valid?.legalInformationInsolvency
825
782
  }
826
783
  )
827
784
  }
@@ -831,19 +788,22 @@ function BusinessFinancingLegalInformation({
831
788
  {
832
789
  name: "legalProceedingsDate",
833
790
  label: formUtils.getLabel("legalProceedingsDate", "legalProceedingsDate"),
834
- errorMessage: formUtils.getErrorMessage("legalProceedingsDate", errors, fieldProblems),
835
- isValid: valid.legalProceedingsDate,
791
+ errorMessage: formUtils.getErrorMessage(
792
+ "legalProceedingsDate",
793
+ errors,
794
+ fieldValidationErrors
795
+ ),
796
+ isValid: valid?.legalProceedingsDate,
836
797
  children: (childProps) => /* @__PURE__ */ jsx(
837
798
  InputDate,
838
799
  {
839
800
  ...childProps,
840
801
  name: "legalProceedingsDate",
841
802
  value: data.legalProceedingsDate,
842
- classNameModifiers: ["legalProceedingsDate"],
843
- onInput: handleChangeFor("legalProceedingsDate", "input"),
844
- onBlur: handleChangeFor("legalProceedingsDate", "blur"),
803
+ onInput: handleFieldChange("legalProceedingsDate", "input"),
804
+ onBlur: handleFieldChange("legalProceedingsDate", "blur"),
845
805
  "aria-required": true,
846
- "aria-invalid": !valid.legalProceedingsDate,
806
+ "aria-invalid": !valid?.legalProceedingsDate,
847
807
  max: TODAY_DATE
848
808
  }
849
809
  )
@@ -851,16 +811,17 @@ function BusinessFinancingLegalInformation({
851
811
  )
852
812
  ] });
853
813
  }
854
- function BusinessFinancingOwnershipStructure({
855
- formUtils,
856
- data,
857
- valid,
858
- errors,
859
- fieldProblems,
860
- handleChangeFor,
861
- legalEntity
862
- }) {
814
+ const ownershipStructureFields = [
815
+ "isCompanyOwnedByAnotherCompany",
816
+ "isParentOwnedByAnotherCompany"
817
+ ];
818
+ function BusinessFinancingOwnershipStructure(props) {
819
+ const { data, valid, errors = {}, legalEntity, fieldValidationErrors, handleFieldChange } = props;
863
820
  const { i18n } = useI18nContext();
821
+ const formUtils = createFormUtils(props, i18n);
822
+ if (!handleFieldChange) {
823
+ return;
824
+ }
864
825
  return /* @__PURE__ */ jsxs(Fragment, { children: [
865
826
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("ownershipStructure") }),
866
827
  /* @__PURE__ */ jsx(
@@ -870,12 +831,12 @@ function BusinessFinancingOwnershipStructure({
870
831
  name: "isCompanyOwnedByAnotherCompany",
871
832
  classNameModifiers: ["highExposureBusinessInformation"],
872
833
  label: i18n.get("isCompanyOwnedByAnotherCompany", {
873
- values: { company: (legalEntity == null ? void 0 : legalEntity.organization) ? legalEntity.organization.legalName : "" }
834
+ values: { company: legalEntity?.organization ? legalEntity.organization.legalName : "" }
874
835
  }),
875
836
  errorMessage: formUtils.getErrorMessage(
876
837
  "isCompanyOwnedByAnotherCompany",
877
838
  errors,
878
- fieldProblems
839
+ fieldValidationErrors
879
840
  ),
880
841
  helper: /* @__PURE__ */ jsx(Typography, { el: "div", variant: "body", color: "secondary", children: /* @__PURE__ */ jsx("span", { children: i18n.get("thisMeansYouHaveAParentCompany") }) }),
881
842
  children: (childProps) => /* @__PURE__ */ jsx(
@@ -884,16 +845,16 @@ function BusinessFinancingOwnershipStructure({
884
845
  ...childProps,
885
846
  name: "isCompanyOwnedByAnotherCompany",
886
847
  items: businessFinancingRadioItems,
887
- value: data.isCompanyOwnedByAnotherCompany,
848
+ value: data?.isCompanyOwnedByAnotherCompany,
888
849
  disabled: false,
889
- onChange: handleChangeFor("isCompanyOwnedByAnotherCompany"),
850
+ onChange: handleFieldChange("isCompanyOwnedByAnotherCompany"),
890
851
  "aria-required": true,
891
- "aria-invalid": !valid.isCompanyOwnedByAnotherCompany
852
+ "aria-invalid": !valid?.isCompanyOwnedByAnotherCompany
892
853
  }
893
854
  )
894
855
  }
895
856
  ),
896
- (data == null ? void 0 : data.isCompanyOwnedByAnotherCompany) === "Yes" && /* @__PURE__ */ jsx(
857
+ data?.isCompanyOwnedByAnotherCompany === "Yes" && /* @__PURE__ */ jsx(
897
858
  Field,
898
859
  {
899
860
  el: "fieldset",
@@ -904,7 +865,7 @@ function BusinessFinancingOwnershipStructure({
904
865
  errorMessage: formUtils.getErrorMessage(
905
866
  "isParentOwnedByAnotherCompany",
906
867
  errors,
907
- fieldProblems
868
+ fieldValidationErrors
908
869
  ),
909
870
  children: (childProps) => /* @__PURE__ */ jsx(
910
871
  RadioGroup,
@@ -914,9 +875,9 @@ function BusinessFinancingOwnershipStructure({
914
875
  items: businessFinancingRadioItems,
915
876
  value: data.isParentOwnedByAnotherCompany,
916
877
  disabled: false,
917
- onChange: handleChangeFor("isParentOwnedByAnotherCompany"),
878
+ onChange: handleFieldChange("isParentOwnedByAnotherCompany"),
918
879
  "aria-required": true,
919
- "aria-invalid": !valid.isParentOwnedByAnotherCompany
880
+ "aria-invalid": !valid?.isParentOwnedByAnotherCompany
920
881
  }
921
882
  )
922
883
  }
@@ -926,35 +887,15 @@ function BusinessFinancingOwnershipStructure({
926
887
  function AdditionalFieldsForBusinessFinancingCompany(props) {
927
888
  const { i18n } = useI18nContext();
928
889
  const {
929
- country,
930
- data: businessFinancingCompanyDetailsData,
931
- validators,
932
- formVerificationErrors,
933
- legalEntity
934
- } = props;
935
- const getFormSchema = useCallback(
936
- (currentData) => getCompanySchemaKeys(country, currentData, companySchemaKeys),
937
- []
938
- );
939
- const { handleChangeFor, data, schema, valid, errors, fieldProblems, setValid } = useForm({
940
- ...props,
941
- schema: getFormSchema,
942
- defaultData: businessFinancingCompanyDetailsData,
943
- rules: validators || businessFinancingCompanyDetailsValidations,
944
- fieldProblems: props == null ? void 0 : props.fieldValidationErrors
945
- });
890
+ form: { handleChangeFor, data }
891
+ } = useFormContext();
892
+ const { country, formVerificationErrors, legalEntity, fieldValidationErrors } = props;
946
893
  const formUtils = createFormUtils(props, i18n);
947
- const businessFinancingHandleChangeFor = handleChangeFor;
948
- const { updateStateSlice } = useGlobalDataSlice("company");
949
- useEffect(() => {
950
- updateStateSlice == null ? void 0 : updateStateSlice({
951
- data,
952
- valid,
953
- errors,
954
- fieldProblems,
955
- schema
956
- });
957
- }, [data, valid, errors, schema, fieldProblems]);
894
+ const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "company", mode);
895
+ const ownershipStructureProps = getFieldProps(props, ownershipStructureFields);
896
+ const businessInformationProps = getFieldProps(props, businessInformationFields);
897
+ const financialInformationProps = getFieldProps(props, financialInformationFields);
898
+ const legalInformationProps = getFieldProps(props, legalInformationFields);
958
899
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-company", children: [
959
900
  /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("additionalInformationForBusinessFinancing") }),
960
901
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("beforeSubmittingYourCapitalLoanApplication") }),
@@ -962,7 +903,7 @@ function AdditionalFieldsForBusinessFinancingCompany(props) {
962
903
  ErrorPanel,
963
904
  {
964
905
  verificationErrors: formVerificationErrors,
965
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
906
+ validationErrors: fieldValidationErrors,
966
907
  formUtils,
967
908
  id: "ariaErrorField"
968
909
  }
@@ -970,71 +911,56 @@ function AdditionalFieldsForBusinessFinancingCompany(props) {
970
911
  /* @__PURE__ */ jsx(
971
912
  BusinessFinancingBusinessInformation,
972
913
  {
973
- ...props,
974
- handleChangeFor: businessFinancingHandleChangeFor,
975
- errors,
976
- data,
977
- valid,
914
+ ...businessInformationProps,
915
+ handleFieldChange: handleChange,
978
916
  country,
979
- formUtils,
980
- fieldProblems,
981
917
  targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
982
- sectionHeading: "yourBusinessInformation"
918
+ sectionHeading: "yourBusinessInformation",
919
+ data: formUtils.getFieldData(data?.company ?? {}, businessInformationFields)
983
920
  }
984
921
  ),
985
922
  /* @__PURE__ */ jsx(
986
923
  BusinessFinancingOwnershipStructure,
987
924
  {
988
- ...props,
989
- handleChangeFor,
990
- errors,
991
- data,
992
- valid,
925
+ ...ownershipStructureProps,
993
926
  legalEntity,
994
- formUtils,
995
- fieldProblems
927
+ handleFieldChange: handleChange,
928
+ data: formUtils.getFieldData(data?.company ?? {}, ownershipStructureFields)
996
929
  }
997
930
  ),
998
931
  isEeaCountry(country) && /* @__PURE__ */ jsx(
999
932
  BusinessFinancingFinancialInformation,
1000
933
  {
1001
- ...props,
1002
- handleChangeFor: businessFinancingHandleChangeFor,
1003
- errors,
1004
- data,
1005
- valid,
934
+ ...financialInformationProps,
935
+ handleFieldChange: handleChange,
1006
936
  country,
1007
- formUtils,
1008
- fieldProblems,
1009
937
  targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
1010
- setValidCurrency: setValid
938
+ data: formUtils.getFieldData(data?.company ?? {}, financialInformationFields)
1011
939
  }
1012
940
  ),
1013
941
  /* @__PURE__ */ jsx(
1014
942
  BusinessFinancingLegalInformation,
1015
943
  {
1016
- ...props,
1017
- handleChangeFor: businessFinancingHandleChangeFor,
1018
- errors,
1019
- data,
1020
- valid,
1021
- formUtils,
1022
- fieldProblems,
1023
- targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE
944
+ ...legalInformationProps,
945
+ country,
946
+ handleFieldChange: handleChange,
947
+ targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
948
+ sectionHeading: "legalInformation",
949
+ data: formUtils.getFieldData(data?.company ?? {}, legalInformationFields)
1024
950
  }
1025
951
  )
1026
952
  ] });
1027
953
  }
1028
- function BusinessFinancingBasicCompanyInformation({
1029
- formUtils,
1030
- data,
1031
- valid,
1032
- errors,
1033
- fieldProblems,
1034
- handleChangeFor,
1035
- sectionHeading
1036
- }) {
954
+ const basicInformationFields = [
955
+ "legalName"
956
+ ];
957
+ function BusinessFinancingBasicCompanyInformation(props) {
958
+ const { data, valid, errors, fieldValidationErrors, handleFieldChange, sectionHeading } = props;
1037
959
  const { i18n } = useI18nContext();
960
+ const formUtils = createFormUtils(props, i18n);
961
+ if (!handleFieldChange) {
962
+ return;
963
+ }
1038
964
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1039
965
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "basicCompanyInformation") }),
1040
966
  /* @__PURE__ */ jsx(
@@ -1042,22 +968,20 @@ function BusinessFinancingBasicCompanyInformation({
1042
968
  {
1043
969
  name: "legalName",
1044
970
  label: formUtils.getLabel("legalName", "legalName"),
1045
- classNameModifiers: ["legalName"],
1046
- errorMessage: formUtils.getErrorMessage("legalName", errors, fieldProblems),
1047
- isValid: valid.legalName,
971
+ errorMessage: formUtils.getErrorMessage("legalName", errors, fieldValidationErrors),
972
+ isValid: valid?.legalName,
1048
973
  helper: i18n.get("legalNameIsUsedToIdentifyABusinessWithTheGovernment"),
1049
974
  children: (childProps) => /* @__PURE__ */ jsx(
1050
975
  InputText,
1051
976
  {
1052
977
  ...childProps,
1053
978
  name: "legalName",
1054
- value: data.legalName,
979
+ value: data?.legalName,
1055
980
  readonly: false,
1056
- classNameModifiers: ["legalName"],
1057
- onInput: handleChangeFor("legalName", "input"),
1058
- onBlur: handleChangeFor("legalName", "blur"),
981
+ onInput: handleFieldChange("legalName", "input"),
982
+ onBlur: handleFieldChange("legalName", "blur"),
1059
983
  "aria-required": true,
1060
- "aria-invalid": !valid.legalName
984
+ "aria-invalid": !valid?.legalName
1061
985
  }
1062
986
  )
1063
987
  }
@@ -1065,24 +989,26 @@ function BusinessFinancingBasicCompanyInformation({
1065
989
  ] });
1066
990
  }
1067
991
  const OPTIONAL_ADDRESS_FIELDS = ["otherAddressInformation"];
1068
- function BusinessFinancingRegisteredAddress({
1069
- formUtils,
1070
- valid,
1071
- errors,
1072
- fieldProblems,
1073
- handleChangeFor,
1074
- legalEntity,
1075
- sectionHeading,
1076
- formId,
1077
- setValid,
1078
- shouldValidate,
1079
- defaultData
1080
- }) {
1081
- var _a, _b;
992
+ const registeredAddressFields = [
993
+ "isThisAddressTheMainHeadquarters",
994
+ "registrationAddress"
995
+ ];
996
+ function BusinessFinancingRegisteredAddress(props) {
997
+ const {
998
+ data,
999
+ valid,
1000
+ errors,
1001
+ fieldValidationErrors,
1002
+ shouldValidate,
1003
+ defaultData,
1004
+ handleFieldChange,
1005
+ formId,
1006
+ legalEntity,
1007
+ sectionHeading
1008
+ } = props;
1082
1009
  const { i18n } = useI18nContext();
1083
- const { parentCompany, ultimateParentCompany } = useGlobalData();
1084
- const data = formId === "parentCompany" ? parentCompany : ultimateParentCompany;
1085
- const addressCountry = (_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country;
1010
+ const formUtils = createFormUtils(props, i18n);
1011
+ const addressCountry = data?.registrationAddress?.country;
1086
1012
  const addressSchema = useMemo(() => {
1087
1013
  return getAddressSchemaForCountry(addressCountry).filter((field) => {
1088
1014
  if (addressCountry) {
@@ -1091,27 +1017,15 @@ function BusinessFinancingRegisteredAddress({
1091
1017
  return true;
1092
1018
  });
1093
1019
  }, [addressCountry]);
1020
+ if (!handleFieldChange) {
1021
+ return;
1022
+ }
1094
1023
  const handleRegistrationAddressChange = (state) => {
1095
1024
  if (!state.data.country) {
1096
1025
  state.data.country = addressCountry;
1097
1026
  }
1098
- handleChangeFor("registrationAddress")(state.data);
1099
- if (setValid) {
1100
- setValid("registrationAddress", Boolean(state.isValid));
1101
- }
1027
+ handleFieldChange("registrationAddress")(state.data);
1102
1028
  };
1103
- useEffect(() => {
1104
- var _a2, _b2;
1105
- const countryCurrencies = ((_a2 = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a2.country) ? currencyByCountry[(_b2 = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _b2.country] : null;
1106
- if ((countryCurrencies == null ? void 0 : countryCurrencies.length) === 1) {
1107
- handleChangeFor("currency")({
1108
- target: {
1109
- name: "currency",
1110
- value: countryCurrencies[0]
1111
- }
1112
- });
1113
- }
1114
- }, [(_b = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _b.country]);
1115
1029
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1116
1030
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "registeredAddress") }),
1117
1031
  /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "caption", children: i18n.get("addressRegisteredWithSecretaryOfState") }),
@@ -1122,12 +1036,12 @@ function BusinessFinancingRegisteredAddress({
1122
1036
  name: "isThisAddressTheMainHeadquarters",
1123
1037
  classNameModifiers: ["highExposureBusinessInformation"],
1124
1038
  label: i18n.get("isThisAddressTheMainHeadquarters", {
1125
- values: { company: (legalEntity == null ? void 0 : legalEntity.organization) ? legalEntity.organization.legalName : "" }
1039
+ values: { company: legalEntity?.organization ? legalEntity.organization.legalName : "" }
1126
1040
  }),
1127
1041
  errorMessage: formUtils.getErrorMessage(
1128
1042
  "isThisAddressTheMainHeadquarters",
1129
1043
  errors,
1130
- fieldProblems
1044
+ fieldValidationErrors
1131
1045
  ),
1132
1046
  children: (childProps) => /* @__PURE__ */ jsx(
1133
1047
  RadioGroup,
@@ -1135,11 +1049,11 @@ function BusinessFinancingRegisteredAddress({
1135
1049
  ...childProps,
1136
1050
  name: "isThisAddressTheMainHeadquarters",
1137
1051
  items: businessFinancingRadioItems,
1138
- value: data == null ? void 0 : data.isThisAddressTheMainHeadquarters,
1052
+ value: data?.isThisAddressTheMainHeadquarters,
1139
1053
  disabled: false,
1140
- onChange: handleChangeFor("isThisAddressTheMainHeadquarters"),
1054
+ onChange: handleFieldChange("isThisAddressTheMainHeadquarters"),
1141
1055
  "aria-required": true,
1142
- "aria-invalid": !valid.isThisAddressTheMainHeadquarters
1056
+ "aria-invalid": !valid?.isThisAddressTheMainHeadquarters
1143
1057
  }
1144
1058
  )
1145
1059
  }
@@ -1149,7 +1063,7 @@ function BusinessFinancingRegisteredAddress({
1149
1063
  {
1150
1064
  id: formId,
1151
1065
  addressType: "registrationAddress",
1152
- data: { ...defaultData == null ? void 0 : defaultData.registrationAddress, country: addressCountry },
1066
+ data: { ...defaultData?.registrationAddress, country: addressCountry },
1153
1067
  labels: addressCountry ? getAddressSchemaLabelsByCountry(addressCountry) : void 0,
1154
1068
  countryCode: addressCountry,
1155
1069
  requiredFields: addressSchema,
@@ -1162,40 +1076,18 @@ function BusinessFinancingRegisteredAddress({
1162
1076
  }
1163
1077
  const parentCompanyFormId$1 = businessFinancingForms.parentCompany.formId;
1164
1078
  function AdditionalFieldsForBusinessFinancingParentCompany(props) {
1165
- var _a;
1166
- const {
1167
- shouldValidate,
1168
- data: businessFinancingParentCompanyDetailsData,
1169
- country,
1170
- formVerificationErrors
1171
- } = props;
1172
1079
  const { i18n } = useI18nContext();
1173
- const getFormSchema = useCallback(
1174
- (currentData) => getParentCompanySchemaKeys(currentData, parentCompaniesSchemaKeys),
1175
- []
1176
- );
1177
- const { handleChangeFor, data, valid, schema, setValid, errors, fieldProblems } = useForm({
1178
- ...props,
1179
- schema: getFormSchema,
1180
- defaultData: businessFinancingParentCompanyDetailsData,
1181
- rules: businessFinancingParentCompanyDetailsValidations,
1182
- fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
1183
- shouldValidate
1184
- });
1080
+ const {
1081
+ form: { handleChangeFor, data }
1082
+ } = useFormContext();
1083
+ const { country, formVerificationErrors, fieldValidationErrors } = props;
1185
1084
  const formUtils = createFormUtils(props, i18n);
1186
- const businessFinancingHandleChangeFor = handleChangeFor;
1187
- const { updateStateSlice } = useGlobalDataSlice(
1188
- "parentCompany"
1189
- );
1190
- useEffect(() => {
1191
- updateStateSlice == null ? void 0 : updateStateSlice({
1192
- data,
1193
- valid,
1194
- errors,
1195
- fieldProblems,
1196
- schema
1197
- });
1198
- }, [data, valid, errors, schema, fieldProblems]);
1085
+ const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "parentCompany", mode);
1086
+ const basicCompanyInformationProps = getFieldProps(props, basicInformationFields);
1087
+ const registeredAddressProps = getFieldProps(props, registeredAddressFields);
1088
+ const businessInformationProps = getFieldProps(props, businessInformationFields);
1089
+ const financialInformationProps = getFieldProps(props, financialInformationFields);
1090
+ const legalInformationProps = getFieldProps(props, legalInformationFields);
1199
1091
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-parent-company", children: [
1200
1092
  /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("parentCompanyInformation") }),
1201
1093
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("inThePreviousStepOwnedByAParentCompany") }),
@@ -1203,7 +1095,7 @@ function AdditionalFieldsForBusinessFinancingParentCompany(props) {
1203
1095
  ErrorPanel,
1204
1096
  {
1205
1097
  verificationErrors: formVerificationErrors,
1206
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
1098
+ validationErrors: fieldValidationErrors,
1207
1099
  formUtils,
1208
1100
  id: "ariaErrorField"
1209
1101
  }
@@ -1211,116 +1103,71 @@ function AdditionalFieldsForBusinessFinancingParentCompany(props) {
1211
1103
  /* @__PURE__ */ jsx(
1212
1104
  BusinessFinancingBasicCompanyInformation,
1213
1105
  {
1214
- ...props,
1215
- handleChangeFor: businessFinancingHandleChangeFor,
1106
+ ...basicCompanyInformationProps,
1216
1107
  sectionHeading: "basicCompanyInformation",
1217
- errors,
1218
- data,
1219
- valid,
1220
- formUtils,
1221
- fieldProblems
1108
+ handleFieldChange: handleChange,
1109
+ data: formUtils.getFieldData(data?.parentCompany ?? {}, basicInformationFields)
1222
1110
  }
1223
1111
  ),
1224
1112
  /* @__PURE__ */ jsx(
1225
1113
  BusinessFinancingRegisteredAddress,
1226
1114
  {
1227
- ...props,
1115
+ ...registeredAddressProps,
1228
1116
  formId: parentCompanyFormId$1,
1229
- handleChangeFor: businessFinancingHandleChangeFor,
1230
1117
  sectionHeading: "registeredAddress",
1231
- errors,
1232
- defaultData: businessFinancingParentCompanyDetailsData,
1233
- valid,
1234
- setValid,
1235
- formUtils,
1236
- fieldProblems,
1237
- targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
1238
- shouldValidate
1118
+ defaultData: data?.parentCompany,
1119
+ handleFieldChange: handleChange,
1120
+ data: formUtils.getFieldData(data?.parentCompany ?? {}, registeredAddressFields)
1239
1121
  }
1240
1122
  ),
1241
1123
  /* @__PURE__ */ jsx(
1242
1124
  BusinessFinancingBusinessInformation,
1243
1125
  {
1244
- ...props,
1245
- handleChangeFor: businessFinancingHandleChangeFor,
1126
+ ...businessInformationProps,
1246
1127
  sectionHeading: "additionalCompanyInformation",
1247
- errors,
1248
- data,
1249
- valid,
1250
- country,
1251
- formUtils,
1252
- fieldProblems,
1253
- targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE
1128
+ country: data?.parentCompany?.registrationAddress?.country ?? country,
1129
+ targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
1130
+ handleFieldChange: handleChange,
1131
+ data: formUtils.getFieldData(data?.parentCompany ?? {}, businessInformationFields)
1254
1132
  }
1255
1133
  ),
1256
- isEeaCountry((_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country) && /* @__PURE__ */ jsx(
1134
+ isEeaCountry(data?.parentCompany?.registrationAddress?.country) && /* @__PURE__ */ jsx(
1257
1135
  BusinessFinancingFinancialInformation,
1258
1136
  {
1259
- ...props,
1260
- handleChangeFor: businessFinancingHandleChangeFor,
1261
- errors,
1262
- data,
1263
- valid,
1264
- country,
1265
- formUtils,
1266
- fieldProblems,
1137
+ ...financialInformationProps,
1138
+ country: data?.parentCompany?.registrationAddress?.country ?? country,
1267
1139
  targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
1268
- setValidCurrency: setValid
1140
+ handleFieldChange: handleChange,
1141
+ data: formUtils.getFieldData(data?.parentCompany ?? {}, financialInformationFields)
1269
1142
  }
1270
1143
  ),
1271
1144
  /* @__PURE__ */ jsx(
1272
1145
  BusinessFinancingLegalInformation,
1273
1146
  {
1274
- ...props,
1275
- handleChangeFor: businessFinancingHandleChangeFor,
1276
- errors,
1277
- data,
1278
- valid,
1279
- formUtils,
1280
- fieldProblems,
1281
- targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE
1147
+ ...legalInformationProps,
1148
+ country: data?.parentCompany?.registrationAddress?.country ?? country,
1149
+ targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
1150
+ sectionHeading: "legalInformation",
1151
+ handleFieldChange: handleChange,
1152
+ data: formUtils.getFieldData(data?.parentCompany ?? {}, legalInformationFields)
1282
1153
  }
1283
1154
  )
1284
1155
  ] });
1285
1156
  }
1286
1157
  const ultimateParentCompanyFormId$1 = businessFinancingForms.ultimateParentCompany.formId;
1287
1158
  function AdditionalFieldsForBusinessFinancingUltimateParentCompany(props) {
1288
- var _a;
1289
- const {
1290
- data: additionalFieldsForBusinessFinancingUltimateParentCompanyData,
1291
- validators,
1292
- formVerificationErrors,
1293
- country
1294
- } = props;
1159
+ const { formVerificationErrors, country, fieldValidationErrors } = props;
1295
1160
  const { i18n } = useI18nContext();
1296
- const getFormSchema = useCallback(
1297
- (currentData) => getParentCompanySchemaKeys(currentData, parentCompaniesSchemaKeys),
1298
- []
1299
- );
1300
- const { handleChangeFor, data, valid, errors, fieldProblems, schema, setValid } = useForm({
1301
- ...props,
1302
- schema: getFormSchema,
1303
- defaultData: { ...additionalFieldsForBusinessFinancingUltimateParentCompanyData },
1304
- rules: validators || businessFinancingParentCompanyDetailsValidations,
1305
- fieldProblems: props == null ? void 0 : props.fieldValidationErrors
1306
- });
1307
- const formUtils = createFormUtils(
1308
- props,
1309
- i18n
1310
- );
1311
- const businessFinancingHandleChangeFor = handleChangeFor;
1312
- const { updateStateSlice } = useGlobalDataSlice(
1313
- "ultimateParentCompany"
1314
- );
1315
- useEffect(() => {
1316
- updateStateSlice == null ? void 0 : updateStateSlice({
1317
- data,
1318
- valid,
1319
- errors,
1320
- fieldProblems,
1321
- schema
1322
- });
1323
- }, [data, valid, errors, schema, fieldProblems]);
1161
+ const formUtils = createFormUtils(props, i18n);
1162
+ const {
1163
+ form: { handleChangeFor, data }
1164
+ } = useFormContext();
1165
+ const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "ultimateParentCompany", mode);
1166
+ const basicCompanyInformationProps = getFieldProps(props, basicInformationFields);
1167
+ const registeredAddressProps = getFieldProps(props, registeredAddressFields);
1168
+ const businessInformationProps = getFieldProps(props, businessInformationFields);
1169
+ const financialInformationProps = getFieldProps(props, financialInformationFields);
1170
+ const legalInformationProps = getFieldProps(props, legalInformationFields);
1324
1171
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-ultimate-parent-company", children: [
1325
1172
  /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("ultimateParentCompanyInformation") }),
1326
1173
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("inThePreviousStepOwnedByAnUltimateParentCompany") }),
@@ -1328,7 +1175,7 @@ function AdditionalFieldsForBusinessFinancingUltimateParentCompany(props) {
1328
1175
  ErrorPanel,
1329
1176
  {
1330
1177
  verificationErrors: formVerificationErrors,
1331
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
1178
+ validationErrors: fieldValidationErrors,
1332
1179
  formUtils,
1333
1180
  id: "ariaErrorField"
1334
1181
  }
@@ -1336,76 +1183,69 @@ function AdditionalFieldsForBusinessFinancingUltimateParentCompany(props) {
1336
1183
  /* @__PURE__ */ jsx(
1337
1184
  BusinessFinancingBasicCompanyInformation,
1338
1185
  {
1339
- ...props,
1340
- handleChangeFor: businessFinancingHandleChangeFor,
1186
+ ...basicCompanyInformationProps,
1341
1187
  sectionHeading: "businessInformation",
1342
- errors,
1343
- data,
1344
- valid,
1345
- formUtils,
1346
- fieldProblems
1188
+ handleFieldChange: handleChange,
1189
+ data: formUtils.getFieldData(data?.ultimateParentCompany ?? {}, basicInformationFields)
1347
1190
  }
1348
1191
  ),
1349
1192
  /* @__PURE__ */ jsx(
1350
1193
  BusinessFinancingRegisteredAddress,
1351
1194
  {
1352
- ...props,
1195
+ ...registeredAddressProps,
1353
1196
  formId: ultimateParentCompanyFormId$1,
1354
- handleChangeFor: businessFinancingHandleChangeFor,
1355
1197
  sectionHeading: "registeredAddress",
1356
- errors,
1357
- defaultData: additionalFieldsForBusinessFinancingUltimateParentCompanyData,
1358
- valid,
1359
- formUtils,
1360
- fieldProblems,
1361
- targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
1198
+ defaultData: data?.ultimateParentCompany,
1199
+ handleFieldChange: handleChange,
1200
+ data: formUtils.getFieldData(data?.ultimateParentCompany ?? {}, registeredAddressFields)
1362
1201
  }
1363
1202
  ),
1364
1203
  /* @__PURE__ */ jsx(
1365
1204
  BusinessFinancingBusinessInformation,
1366
1205
  {
1367
- ...props,
1368
- handleChangeFor: businessFinancingHandleChangeFor,
1206
+ ...businessInformationProps,
1369
1207
  sectionHeading: "additionalCompanyInformation",
1370
- errors,
1371
- data,
1372
- valid,
1373
- country,
1374
- formUtils,
1375
- fieldProblems,
1376
- targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
1208
+ country: data?.ultimateParentCompany?.registrationAddress?.country ?? country,
1209
+ targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
1210
+ handleFieldChange: handleChange,
1211
+ data: formUtils.getFieldData(data?.ultimateParentCompany ?? {}, businessInformationFields)
1377
1212
  }
1378
1213
  ),
1379
- isEeaCountry((_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country) && /* @__PURE__ */ jsx(
1214
+ isEeaCountry(data?.ultimateParentCompany?.registrationAddress?.country) && /* @__PURE__ */ jsx(
1380
1215
  BusinessFinancingFinancialInformation,
1381
1216
  {
1382
- ...props,
1383
- handleChangeFor: businessFinancingHandleChangeFor,
1384
- errors,
1385
- data,
1386
- valid,
1387
- country,
1388
- formUtils,
1389
- fieldProblems,
1217
+ ...financialInformationProps,
1218
+ country: data?.ultimateParentCompany?.registrationAddress?.country ?? country,
1390
1219
  targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
1391
- setValidCurrency: setValid
1220
+ handleFieldChange: handleChange,
1221
+ data: formUtils.getFieldData(
1222
+ data?.ultimateParentCompany ?? {},
1223
+ financialInformationFields
1224
+ )
1392
1225
  }
1393
1226
  ),
1394
1227
  /* @__PURE__ */ jsx(
1395
1228
  BusinessFinancingLegalInformation,
1396
1229
  {
1397
- ...props,
1398
- handleChangeFor: businessFinancingHandleChangeFor,
1399
- errors,
1400
- data,
1401
- valid,
1402
- formUtils,
1403
- fieldProblems,
1404
- targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
1230
+ ...legalInformationProps,
1231
+ country: data?.ultimateParentCompany?.registrationAddress?.country ?? country,
1232
+ sectionHeading: "legalInformation",
1233
+ targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
1234
+ handleFieldChange: handleChange,
1235
+ data: formUtils.getFieldData(data?.ultimateParentCompany ?? {}, legalInformationFields)
1405
1236
  }
1406
1237
  )
1407
1238
  ] });
1408
1239
  }
1240
+ const getOrgAnalyticsData = (prefix, details) => {
1241
+ const org = details?.organization;
1242
+ if (!org) return {};
1243
+ return {
1244
+ [`${prefix}--economicSector`]: org?.economicSector ?? "",
1245
+ [`${prefix}--legalForm`]: org?.legalForm ?? "",
1246
+ [`${prefix}--statusOfLegalProceeding`]: org?.statusOfLegalProceeding ?? ""
1247
+ };
1248
+ };
1409
1249
  const businessFinancingFormsRequiredFields = {
1410
1250
  company: businessFinancingForms.company.fields,
1411
1251
  parentCompany: businessFinancingForms.parentCompany.fields,
@@ -1414,10 +1254,7 @@ const businessFinancingFormsRequiredFields = {
1414
1254
  const parentCompanyFormId = businessFinancingForms.parentCompany.formId;
1415
1255
  const companyFormId = businessFinancingForms.company.formId;
1416
1256
  const ultimateParentCompanyFormId = businessFinancingForms.ultimateParentCompany.formId;
1417
- const parseBusinessFinancingScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, fieldsPerScenario);
1418
- const parseConfiguration = ({ scenarios }) => parseBusinessFinancingScenarios(scenarios);
1419
1257
  function BusinessFinancingDropin(props) {
1420
- var _a, _b;
1421
1258
  const {
1422
1259
  country,
1423
1260
  rootLegalEntity,
@@ -1428,7 +1265,6 @@ function BusinessFinancingDropin(props) {
1428
1265
  } = props;
1429
1266
  const userEvents = useAnalyticsContext();
1430
1267
  const [defaultData, setDefaultData] = useState();
1431
- const [data, setData] = useState({});
1432
1268
  useRef(null);
1433
1269
  const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
1434
1270
  const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
@@ -1437,34 +1273,37 @@ function BusinessFinancingDropin(props) {
1437
1273
  const { data: ultimateParentCompany, isLoading: ultimateParentCompanyIsLoading } = useAssociatedLegalEntity(rootLegalEntity, "ultimateParentCompany");
1438
1274
  const derivedData = useMemo(() => {
1439
1275
  if (immediateParentCompanyIsLoading || ultimateParentCompanyIsLoading) return void 0;
1440
- const data2 = {};
1441
- data2.company = mapLegalEntityToBusinessFinancing(
1276
+ const dataFromResponse = {};
1277
+ dataFromResponse.company = mapLegalEntityToBusinessFinancing(
1442
1278
  rootLegalEntity
1443
1279
  );
1444
- data2.company = appendBusinessFinancingData(rootLegalEntity.organization, data2.company);
1445
- data2.company.isCompanyOwnedByAnotherCompany = "No";
1446
- data2.company.isParentOwnedByAnotherCompany = "No";
1280
+ dataFromResponse.company = appendBusinessFinancingData(
1281
+ rootLegalEntity.organization,
1282
+ dataFromResponse.company
1283
+ );
1284
+ dataFromResponse.company.isCompanyOwnedByAnotherCompany = "No";
1285
+ dataFromResponse.company.isParentOwnedByAnotherCompany = "No";
1447
1286
  if (immediateParentCompany) {
1448
- data2.parentCompany = mapLegalEntityToBusinessFinancing(
1287
+ dataFromResponse.parentCompany = mapLegalEntityToBusinessFinancing(
1449
1288
  immediateParentCompany
1450
1289
  );
1451
- data2.parentCompany = appendBusinessFinancingData(
1290
+ dataFromResponse.parentCompany = appendBusinessFinancingData(
1452
1291
  immediateParentCompany.organization,
1453
- data2.parentCompany
1292
+ dataFromResponse.parentCompany
1454
1293
  );
1455
- data2.company.isCompanyOwnedByAnotherCompany = "Yes";
1294
+ dataFromResponse.company.isCompanyOwnedByAnotherCompany = "Yes";
1456
1295
  }
1457
1296
  if (ultimateParentCompany) {
1458
- data2.ultimateParentCompany = mapLegalEntityToBusinessFinancing(
1297
+ dataFromResponse.ultimateParentCompany = mapLegalEntityToBusinessFinancing(
1459
1298
  ultimateParentCompany
1460
1299
  );
1461
- data2.ultimateParentCompany = appendBusinessFinancingData(
1300
+ dataFromResponse.ultimateParentCompany = appendBusinessFinancingData(
1462
1301
  ultimateParentCompany.organization,
1463
- data2.ultimateParentCompany
1302
+ dataFromResponse.ultimateParentCompany
1464
1303
  );
1465
- data2.company.isParentOwnedByAnotherCompany = "Yes";
1304
+ dataFromResponse.company.isParentOwnedByAnotherCompany = "Yes";
1466
1305
  }
1467
- return data2;
1306
+ return dataFromResponse;
1468
1307
  }, [
1469
1308
  immediateParentCompanyIsLoading,
1470
1309
  ultimateParentCompanyIsLoading,
@@ -1479,10 +1318,9 @@ function BusinessFinancingDropin(props) {
1479
1318
  }, [userEvents]);
1480
1319
  useEffect(() => {
1481
1320
  if (derivedData) {
1482
- setData(derivedData);
1483
- if (!defaultData) setDefaultData({ ...derivedData });
1321
+ setDefaultData({ ...derivedData });
1484
1322
  }
1485
- }, [derivedData, defaultData]);
1323
+ }, [derivedData]);
1486
1324
  const { i18n } = useI18nContext();
1487
1325
  const datasetUtils = datasetUtilities(i18n.locale);
1488
1326
  const [problems, setProblems] = useState();
@@ -1490,85 +1328,26 @@ function BusinessFinancingDropin(props) {
1490
1328
  const [showEndState, setShowEndState] = useState(false);
1491
1329
  const [businessFinancingRequiredForms, setBusinessFinancingRequiredForms] = useState(businessFinancingForms);
1492
1330
  const { showToast } = useToastContext();
1493
- const { fieldConfigurations } = useScenarioConfiguration({
1494
- parseConfiguration,
1495
- legalEntityType: LegalEntityType.ORGANIZATION,
1496
- setLoadingStatus,
1497
- country
1498
- });
1499
- const derivedProps = useMemo(
1500
- () => getPropsFromConfigurations(
1501
- fieldConfigurations,
1502
- businessFinancingForms,
1503
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
1504
- (problems == null ? void 0 : problems.missingData) ?? [],
1505
- // TODO this is not a valid key mapping so we can't put it here
1506
- // rootLegalEntity
1507
- // ? getFieldsWithExistingData(rootLegalEntity, businessFinancingApiKeyMapping)
1508
- // : [],
1509
- [],
1510
- {},
1511
- {},
1512
- {},
1513
- rootLegalEntity == null ? void 0 : rootLegalEntity.type,
1514
- rootLegalEntity == null ? void 0 : rootLegalEntity.trustedFields
1515
- ),
1516
- [fieldConfigurations, problems == null ? void 0 : problems.missingData, problems == null ? void 0 : problems.remediationActions, rootLegalEntity]
1517
- );
1518
- const {
1519
- state: { currentState }
1520
- } = useStateContext();
1521
- const formValidity = currentState.validityByForm;
1522
- useEffect(() => {
1523
- const newState = {
1524
- ...data,
1525
- ...currentState.data
1526
- };
1527
- setData(newState);
1528
- }, [currentState]);
1529
- useEffect(() => {
1530
- var _a2, _b2;
1531
- const showParentCompany = ((_a2 = data == null ? void 0 : data.company) == null ? void 0 : _a2.isCompanyOwnedByAnotherCompany) === "Yes";
1532
- const showUltimateParentCompany = ((_b2 = data == null ? void 0 : data.company) == null ? void 0 : _b2.isParentOwnedByAnotherCompany) === "Yes";
1533
- let updateForms = {
1534
- company: { ...businessFinancingForms.company }
1535
- };
1536
- if (showParentCompany) {
1537
- updateForms = { ...updateForms, parentCompany: businessFinancingForms.parentCompany };
1538
- }
1539
- if (showParentCompany && showUltimateParentCompany) {
1540
- updateForms = {
1541
- ...updateForms,
1542
- ultimateParentCompany: businessFinancingForms.ultimateParentCompany
1543
- };
1544
- }
1545
- setBusinessFinancingRequiredForms(updateForms);
1546
- }, [(_a = data == null ? void 0 : data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany, (_b = data == null ? void 0 : data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany]);
1547
- const forms = useMemo(() => {
1548
- const requiredForms = getRequiredForms(
1549
- businessFinancingRequiredForms,
1550
- businessFinancingFormsRequiredFields,
1551
- derivedProps == null ? void 0 : derivedProps.optionalFields
1552
- );
1553
- return addValidityToForms(requiredForms, formValidity, problems);
1554
- }, [derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, businessFinancingRequiredForms, problems]);
1555
1331
  const { isSettingEnabled } = useSettingsContext();
1556
1332
  const showBusinessFinancingFirst = isSettingEnabled(SettingNames.ShowBusinessFinancingFirst);
1557
1333
  const onSubmit = async () => {
1558
1334
  setLoadingStatus("loading");
1335
+ if (!umfData) {
1336
+ return;
1337
+ }
1559
1338
  const companyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
1560
1339
  BusinessFinancingIndex.COMPANY,
1561
- data,
1340
+ umfData,
1562
1341
  rootLegalEntity
1563
1342
  );
1564
1343
  const parentCompanyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
1565
1344
  BusinessFinancingIndex.PARENT_COMPANY,
1566
- data,
1345
+ umfData,
1567
1346
  rootLegalEntity
1568
1347
  );
1569
1348
  const ultimateParentCompanyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
1570
1349
  BusinessFinancingIndex.ULTIMATE_PARENT_COMPANY,
1571
- data,
1350
+ umfData,
1572
1351
  rootLegalEntity
1573
1352
  );
1574
1353
  if (!companyBusinessFinancingDetails || !rootLegalEntity) {
@@ -1585,7 +1364,7 @@ function BusinessFinancingDropin(props) {
1585
1364
  parentCompanyBusinessFinancingDetails,
1586
1365
  createLegalEntity,
1587
1366
  updateLegalEntity,
1588
- parentCompanyBusinessFinancingDetails == null ? void 0 : parentCompanyBusinessFinancingDetails.id
1367
+ parentCompanyBusinessFinancingDetails?.id
1589
1368
  );
1590
1369
  promises.push(parentCompanyPromise);
1591
1370
  }
@@ -1595,7 +1374,7 @@ function BusinessFinancingDropin(props) {
1595
1374
  ultimateParentCompanyBusinessFinancingDetails,
1596
1375
  createLegalEntity,
1597
1376
  updateLegalEntity,
1598
- ultimateParentCompanyBusinessFinancingDetails == null ? void 0 : ultimateParentCompanyBusinessFinancingDetails.id
1377
+ ultimateParentCompanyBusinessFinancingDetails?.id
1599
1378
  );
1600
1379
  promises.push(ultimateParentCompanyPromise);
1601
1380
  }
@@ -1639,23 +1418,32 @@ function BusinessFinancingDropin(props) {
1639
1418
  companyBusinessFinancingDetails.entityAssociations = [
1640
1419
  ...businessFinancingEntityAssociations
1641
1420
  ];
1421
+ const eventsAdditionalData = {
1422
+ ...getOrgAnalyticsData("Business", companyBusinessFinancingDetails),
1423
+ ...getOrgAnalyticsData("ParentCompany", parentCompanyBusinessFinancingDetails),
1424
+ ...getOrgAnalyticsData(
1425
+ "UltimateParentCompany",
1426
+ ultimateParentCompanyBusinessFinancingDetails
1427
+ )
1428
+ };
1642
1429
  try {
1643
1430
  await handleBusinessFinancingFormSubmission(
1644
1431
  BusinessFinancingIndex.COMPANY,
1645
1432
  companyBusinessFinancingDetails,
1646
1433
  createLegalEntity,
1647
1434
  updateLegalEntity,
1648
- companyBusinessFinancingDetails == null ? void 0 : companyBusinessFinancingDetails.id
1435
+ companyBusinessFinancingDetails?.id
1649
1436
  );
1650
1437
  userEvents.addTaskEvent("Success", {
1651
1438
  actionType: "submit",
1652
- returnValue: entitiesToTrack
1439
+ returnValue: entitiesToTrack,
1440
+ additionalData: eventsAdditionalData
1653
1441
  });
1654
1442
  await invalidateRootLegalEntity();
1655
1443
  if (showBusinessFinancingFirst || isStandaloneComponent) {
1656
1444
  setShowEndState(true);
1657
1445
  } else {
1658
- externalOnSubmit == null ? void 0 : externalOnSubmit({ ...data });
1446
+ externalOnSubmit?.({ ...umfData });
1659
1447
  }
1660
1448
  } catch (e) {
1661
1449
  showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
@@ -1682,8 +1470,8 @@ function BusinessFinancingDropin(props) {
1682
1470
  setProblems((prevProblems) => ({
1683
1471
  ...prevProblems,
1684
1472
  validationErrors: {
1685
- ...prevProblems == null ? void 0 : prevProblems.validationErrors,
1686
- [businessFinancingType]: (validationErrors == null ? void 0 : validationErrors[businessFinancingType]) ?? {}
1473
+ ...prevProblems?.validationErrors,
1474
+ [businessFinancingType]: validationErrors?.[businessFinancingType] ?? {}
1687
1475
  }
1688
1476
  }));
1689
1477
  } else if (isMaintenanceModeError(error)) {
@@ -1700,29 +1488,67 @@ function BusinessFinancingDropin(props) {
1700
1488
  associatedLegalEntity: rootLegalEntity
1701
1489
  });
1702
1490
  const omittedSummaryKeys = ["naceCodeLabel", "legalFormLabel", "currency"];
1491
+ const [requiredFields, setRequiredFields] = useState(void 0);
1492
+ const form = useMultiForm({
1493
+ requiredFields,
1494
+ defaultData: derivedData,
1495
+ rules: businessFinancingMultiformRules
1496
+ });
1497
+ const { data: umfData = derivedData, isValid, errors, valid } = form;
1498
+ useEffect(() => {
1499
+ const showParentCompany = umfData?.company?.isCompanyOwnedByAnotherCompany === "Yes";
1500
+ const showUltimateParentCompany = umfData?.company?.isParentOwnedByAnotherCompany === "Yes";
1501
+ let updateForms = {
1502
+ company: { ...businessFinancingForms.company }
1503
+ };
1504
+ if (showParentCompany) {
1505
+ updateForms = { ...updateForms, parentCompany: businessFinancingForms.parentCompany };
1506
+ }
1507
+ if (showParentCompany && showUltimateParentCompany) {
1508
+ updateForms = {
1509
+ ...updateForms,
1510
+ ultimateParentCompany: businessFinancingForms.ultimateParentCompany
1511
+ };
1512
+ }
1513
+ setBusinessFinancingRequiredForms(updateForms);
1514
+ }, [
1515
+ umfData?.company?.isCompanyOwnedByAnotherCompany,
1516
+ umfData?.company?.isParentOwnedByAnotherCompany
1517
+ ]);
1518
+ useEffect(() => {
1519
+ const reqs = getBusinessFinancingRequiredFields(country, umfData);
1520
+ setRequiredFields(reqs);
1521
+ }, [umfData]);
1522
+ const forms = useMemo(() => {
1523
+ const requiredForms = getRequiredForms(
1524
+ businessFinancingRequiredForms,
1525
+ businessFinancingFormsRequiredFields,
1526
+ {}
1527
+ );
1528
+ return addValidityToForms(requiredForms, isValid, problems);
1529
+ }, [businessFinancingRequiredForms, isValid, businessFinancingFormsRequiredFields, problems]);
1703
1530
  const {
1704
1531
  handleNextClick,
1705
1532
  handleBackClick,
1706
1533
  activeForm,
1707
- setShouldValidate,
1708
1534
  gotoFormByFormIndex,
1709
- shouldValidate,
1710
- steps
1535
+ steps,
1536
+ shouldValidate
1711
1537
  } = useFormComposer({
1712
1538
  problems,
1713
1539
  navigationTrackingParams: associatedLeTrackingParams,
1714
1540
  forms,
1715
1541
  onSubmit
1716
1542
  });
1717
- const allDerivedProps = {
1718
- ...props,
1719
- ...derivedProps,
1720
- problems,
1721
- shouldValidate
1722
- };
1723
- const businessFinancingCompanyDetailsFormProps = getFormProps(allDerivedProps, companyFormId);
1724
- const businessFinancingParentCompanyDetailsFormProps = getFormProps(allDerivedProps, parentCompanyFormId);
1725
- const businessFinancingUltimateParentCompanyDetailsFormProps = getFormProps(allDerivedProps, ultimateParentCompanyFormId);
1543
+ const handleTrackNavigation = useCallback(
1544
+ (props2) => {
1545
+ trackNavigation({
1546
+ ...props2,
1547
+ additionalTrackingParams: associatedLeTrackingParams
1548
+ });
1549
+ },
1550
+ [associatedLeTrackingParams]
1551
+ );
1726
1552
  const homeClick = () => {
1727
1553
  trackNavigation({
1728
1554
  userEvents,
@@ -1730,77 +1556,79 @@ function BusinessFinancingDropin(props) {
1730
1556
  toForm: "home",
1731
1557
  label: "home"
1732
1558
  });
1733
- handleHomeClick == null ? void 0 : handleHomeClick();
1559
+ handleHomeClick?.();
1734
1560
  };
1735
- const formWrapperClasses = (activeForm2, formId) => (activeForm2 == null ? void 0 : activeForm2.formId) !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
1736
- const renderActiveForm = (activeForm2) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
1737
- /* @__PURE__ */ jsx("div", { className: formWrapperClasses(activeForm2, companyFormId), children: /* @__PURE__ */ jsx(
1561
+ const renderActiveForm = (selectedForm) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
1562
+ selectedForm.formId === companyFormId && /* @__PURE__ */ jsx(
1738
1563
  AdditionalFieldsForBusinessFinancingCompany,
1739
1564
  {
1740
- ...businessFinancingCompanyDetailsFormProps,
1741
- data: defaultData == null ? void 0 : defaultData.company,
1565
+ data: defaultData?.company,
1742
1566
  legalEntity: rootLegalEntity,
1743
1567
  heading: i18n.get("additionalInformationForBusinessFinancing"),
1744
1568
  id: companyFormId,
1745
- country
1569
+ country,
1570
+ shouldValidate,
1571
+ fieldValidationErrors: problems?.validationErrors?.[selectedForm?.formId],
1572
+ formVerificationErrors: problems?.verificationErrors?.[selectedForm?.formId],
1573
+ errors: errors?.company,
1574
+ valid: valid?.company
1746
1575
  }
1747
- ) }),
1748
- /* @__PURE__ */ jsx("div", { className: formWrapperClasses(activeForm2, parentCompanyFormId), children: /* @__PURE__ */ jsx(
1576
+ ),
1577
+ selectedForm.formId === parentCompanyFormId && /* @__PURE__ */ jsx(
1749
1578
  AdditionalFieldsForBusinessFinancingParentCompany,
1750
1579
  {
1751
- ...businessFinancingParentCompanyDetailsFormProps,
1752
- data: defaultData == null ? void 0 : defaultData.parentCompany,
1580
+ data: defaultData?.parentCompany,
1753
1581
  heading: i18n.get("parentCompanyInformation"),
1754
1582
  id: companyFormId,
1755
- country
1583
+ country,
1584
+ shouldValidate,
1585
+ errors: errors?.parentCompany
1756
1586
  }
1757
- ) }),
1758
- /* @__PURE__ */ jsx("div", { className: formWrapperClasses(activeForm2, ultimateParentCompanyFormId), children: /* @__PURE__ */ jsx(
1587
+ ),
1588
+ selectedForm.formId === ultimateParentCompanyFormId && /* @__PURE__ */ jsx(
1759
1589
  AdditionalFieldsForBusinessFinancingUltimateParentCompany,
1760
1590
  {
1761
- ...businessFinancingUltimateParentCompanyDetailsFormProps,
1762
- data: defaultData == null ? void 0 : defaultData.ultimateParentCompany,
1591
+ data: defaultData?.ultimateParentCompany,
1763
1592
  heading: i18n.get("ultimateParentCompanyInformation"),
1764
1593
  id: companyFormId,
1765
- country
1594
+ country,
1595
+ shouldValidate,
1596
+ errors: errors?.ultimateParentCompany
1766
1597
  }
1767
- ) })
1598
+ )
1768
1599
  ] });
1769
- if (!(defaultData == null ? void 0 : defaultData.company)) {
1600
+ if (!defaultData?.company) {
1770
1601
  return /* @__PURE__ */ jsx(Loader, {});
1771
1602
  }
1772
1603
  return showEndState ? /* @__PURE__ */ jsxs(FormEndState, { variant: "success", children: [
1773
1604
  /* @__PURE__ */ jsx("template", { slot: "title", children: i18n.get("applicationSubmittedSuccessfully") }),
1774
1605
  /* @__PURE__ */ jsx("template", { slot: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) }),
1775
- /* @__PURE__ */ jsx("template", { slot: "actions", children: externalOnSubmit && !showBusinessFinancingFirst && /* @__PURE__ */ jsx(Button, { onClick: () => externalOnSubmit == null ? void 0 : externalOnSubmit({ ...data }), children: externalOnSubmitLabel || i18n.get("finish") }) }),
1606
+ /* @__PURE__ */ jsx("template", { slot: "actions", children: externalOnSubmit && !showBusinessFinancingFirst && /* @__PURE__ */ jsx(Button, { onClick: () => externalOnSubmit?.({ ...umfData }), children: externalOnSubmitLabel || i18n.get("finish") }) }),
1776
1607
  /* @__PURE__ */ jsx("div", { children: i18n.get("yourLoanApplicationHasBeenReceived") })
1777
- ] }) : /* @__PURE__ */ jsx(
1778
- FormWrapper,
1608
+ ] }) : /* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
1609
+ FormFlow,
1779
1610
  {
1780
- taskName: "businessFinancing",
1781
- handleNextClick,
1782
- handleBackClick,
1783
- gotoFormByFormIndex,
1784
- loadingStatus,
1785
- forms,
1786
- activeForm,
1787
- navigationTrackingParams: associatedLeTrackingParams,
1788
- onSubmit,
1789
- validateForm: () => setShouldValidate(true),
1790
- canSubmit: canSubmit(data) && hasDataChanged(defaultData, data),
1791
- problems,
1792
- handleHomeClick: homeClick,
1793
1611
  summary: {
1794
- data: formatDataForSummary(data, i18n, datasetUtils),
1795
- labels: customLabels,
1612
+ data: formatDataForSummary(i18n, datasetUtils, umfData),
1796
1613
  omitted: {
1797
1614
  keys: omittedSummaryKeys
1798
- }
1615
+ },
1616
+ problems,
1617
+ trackNavigation: handleTrackNavigation,
1618
+ labels: customLabels
1799
1619
  },
1800
- steps,
1620
+ currentStep: steps.current,
1621
+ disableNextButton: !activeForm.isValid,
1622
+ forms,
1623
+ gotoFormByFormIndex,
1624
+ handleBackClick,
1625
+ handleCancelClick: homeClick,
1626
+ handleNextClick,
1627
+ loadingStatus,
1628
+ totalSteps: steps.total,
1801
1629
  children: /* @__PURE__ */ jsx("div", { children: renderActiveForm(activeForm || businessFinancingForms.company) })
1802
1630
  }
1803
- );
1631
+ ) });
1804
1632
  }
1805
1633
  export {
1806
1634
  BusinessFinancingDropin as B