@voplus/morpho-csp 11.2.8 → 11.3.0-dev.0

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 (212) hide show
  1. package/es/components/LegalContactSelect/index.d.ts +7 -0
  2. package/es/components/LegalContactSelect/index.js +127 -12
  3. package/es/components/LegalContactSelect/index.js.map +1 -1
  4. package/es/data/clda-form/conversion.d.ts +9 -6
  5. package/es/data/clda-form/conversion.js +11 -18
  6. package/es/data/clda-form/conversion.js.map +1 -1
  7. package/es/data/clda-form/identityAdapter.d.ts +60 -0
  8. package/es/data/clda-form/identityAdapter.js +196 -0
  9. package/es/data/clda-form/identityAdapter.js.map +1 -0
  10. package/es/data/clda-form/interfaces.d.ts +20 -1
  11. package/es/data/clda-form/saveFormDraft.d.ts +4 -0
  12. package/es/data/clda-form/saveFormDraft.js +21 -0
  13. package/es/data/clda-form/saveFormDraft.js.map +1 -0
  14. package/es/data/clda-form/types.d.ts +31 -2
  15. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.d.ts +35 -0
  16. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js +53 -0
  17. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js.map +1 -0
  18. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js +41 -15
  19. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js.map +1 -1
  20. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.d.ts +59 -1
  21. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js +244 -15
  22. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js.map +1 -1
  23. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.d.ts +5 -0
  24. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js +13 -7
  25. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js.map +1 -1
  26. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.d.ts +2 -2
  27. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js +20 -24
  28. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js.map +1 -1
  29. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.d.ts +2 -2
  30. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js +38 -11
  31. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js.map +1 -1
  32. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.d.ts +3 -3
  33. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.js.map +1 -1
  34. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.d.ts +25 -4
  35. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js +88 -5
  36. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js.map +1 -1
  37. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.d.ts +13 -0
  38. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js +20 -0
  39. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js.map +1 -0
  40. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js +28 -28
  41. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js.map +1 -1
  42. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js +3 -4
  43. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js.map +1 -1
  44. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js +16 -9
  45. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js.map +1 -1
  46. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.d.ts +2 -2
  47. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js +128 -61
  48. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js.map +1 -1
  49. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.d.ts +2 -2
  50. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js +119 -24
  51. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js.map +1 -1
  52. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.d.ts +0 -1
  53. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js +16 -8
  54. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js.map +1 -1
  55. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.d.ts +274 -23
  56. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js +560 -210
  57. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js.map +1 -1
  58. package/es/modules/corporate/components/CorporateSelect/index.d.ts +12 -1
  59. package/es/modules/corporate/components/CorporateSelect/index.js +19 -5
  60. package/es/modules/corporate/components/CorporateSelect/index.js.map +1 -1
  61. package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js +9 -6
  62. package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js.map +1 -1
  63. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.d.ts +6 -1
  64. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js +3 -2
  65. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js.map +1 -1
  66. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.d.ts +6 -1
  67. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js +3 -2
  68. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js.map +1 -1
  69. package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js +3 -3
  70. package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js.map +1 -1
  71. package/es/modules/corporate/legal-generation/components/IssueShares/interface.d.ts +1 -1
  72. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.d.ts +16 -1
  73. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js +27 -9
  74. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js.map +1 -1
  75. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/interface.d.ts +5 -2
  76. package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js +1 -1
  77. package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js.map +1 -1
  78. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.d.ts +13 -1
  79. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js +24 -6
  80. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js.map +1 -1
  81. package/es/modules/corporate/legal-generation/components/ShareTransfer/interface.d.ts +5 -2
  82. package/es/modules/corporate/legal-generation/components/SubmitButton/index.d.ts +11 -3
  83. package/es/modules/corporate/legal-generation/components/SubmitButton/index.js +9 -3
  84. package/es/modules/corporate/legal-generation/components/SubmitButton/index.js.map +1 -1
  85. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.d.ts +31 -2
  86. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js +52 -37
  87. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js.map +1 -1
  88. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.d.ts +27 -2
  89. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js +78 -21
  90. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js.map +1 -1
  91. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.d.ts +17 -0
  92. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js +36 -0
  93. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js.map +1 -0
  94. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.d.ts +11 -0
  95. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js +25 -0
  96. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js.map +1 -0
  97. package/es/modules/corporate/legal-generation/fields/state/index.d.ts +7 -0
  98. package/es/modules/corporate/legal-generation/fields/state/index.js +5 -0
  99. package/es/modules/corporate/legal-generation/fields/state/index.js.map +1 -0
  100. package/es/modules/corporate/legal-generation/fields/state/types.d.ts +37 -0
  101. package/es/modules/corporate/legal-generation/fields/state/types.js +27 -0
  102. package/es/modules/corporate/legal-generation/fields/state/types.js.map +1 -0
  103. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.d.ts +28 -0
  104. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js +45 -0
  105. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js.map +1 -0
  106. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.d.ts +31 -0
  107. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js +47 -0
  108. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js.map +1 -0
  109. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.d.ts +35 -0
  110. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js +36 -0
  111. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js.map +1 -0
  112. package/es/modules/corporate/legal-generation/fields/state/useOperateField.d.ts +15 -0
  113. package/es/modules/corporate/legal-generation/fields/state/useOperateField.js +27 -0
  114. package/es/modules/corporate/legal-generation/fields/state/useOperateField.js.map +1 -0
  115. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.d.ts +18 -9
  116. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js +130 -28
  117. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js.map +1 -1
  118. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.d.ts +27 -17
  119. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js +112 -24
  120. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js.map +1 -1
  121. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.d.ts +637 -0
  122. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js +840 -0
  123. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js.map +1 -0
  124. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.d.ts +23 -0
  125. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js +55 -0
  126. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js.map +1 -0
  127. package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js +38 -8
  128. package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js.map +1 -1
  129. package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js +50 -33
  130. package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js.map +1 -1
  131. package/es/modules/self-registration/clda-form/components/ContactFields/index.d.ts +5 -2
  132. package/es/modules/self-registration/clda-form/components/ContactFields/index.js +6 -3
  133. package/es/modules/self-registration/clda-form/components/ContactFields/index.js.map +1 -1
  134. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.d.ts +1 -2
  135. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js +7 -18
  136. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js.map +1 -1
  137. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.d.ts +1 -2
  138. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js +7 -18
  139. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js.map +1 -1
  140. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.d.ts +1 -2
  141. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js +7 -18
  142. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js.map +1 -1
  143. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.d.ts +1 -2
  144. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js +7 -18
  145. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js.map +1 -1
  146. package/es/modules/self-registration/clda-form/components/useContactEditSession.d.ts +35 -0
  147. package/es/modules/self-registration/clda-form/components/useContactEditSession.js +51 -0
  148. package/es/modules/self-registration/clda-form/components/useContactEditSession.js.map +1 -0
  149. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.d.ts +2 -3
  150. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js +60 -12
  151. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js.map +1 -1
  152. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.d.ts +1 -2
  153. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js +3 -5
  154. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js.map +1 -1
  155. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js +7 -21
  156. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js.map +1 -1
  157. package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js +6 -5
  158. package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js.map +1 -1
  159. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.d.ts +1 -2
  160. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js +23 -28
  161. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js.map +1 -1
  162. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.d.ts +1 -2
  163. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js +11 -24
  164. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js.map +1 -1
  165. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.d.ts +1 -2
  166. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js +13 -8
  167. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js.map +1 -1
  168. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.d.ts +1 -2
  169. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js +11 -24
  170. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js.map +1 -1
  171. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.d.ts +1 -2
  172. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js +18 -9
  173. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js.map +1 -1
  174. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.d.ts +1 -2
  175. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js +11 -24
  176. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js.map +1 -1
  177. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.d.ts +1 -2
  178. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js +23 -28
  179. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js.map +1 -1
  180. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.d.ts +2 -3
  181. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js +81 -14
  182. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js.map +1 -1
  183. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.d.ts +1 -2
  184. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js +11 -15
  185. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js.map +1 -1
  186. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.d.ts +2 -3
  187. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js +34 -5
  188. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js.map +1 -1
  189. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.d.ts +1 -2
  190. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js +4 -5
  191. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js.map +1 -1
  192. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.d.ts +1 -2
  193. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js +5 -4
  194. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js.map +1 -1
  195. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.d.ts +1 -2
  196. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js +32 -12
  197. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js.map +1 -1
  198. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.d.ts +2 -3
  199. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js +80 -13
  200. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js.map +1 -1
  201. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.d.ts +1 -2
  202. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js +7 -9
  203. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js.map +1 -1
  204. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.d.ts +3 -0
  205. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js +4 -2
  206. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js.map +1 -1
  207. package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js +16 -1
  208. package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js.map +1 -1
  209. package/es/routes.d.ts +1 -1
  210. package/es/routes.js +4 -2
  211. package/es/routes.js.map +1 -1
  212. package/package.json +4 -4
@@ -1,8 +1,23 @@
1
1
  import { __esDecorate, __runInitializers } from "tslib";
2
2
  import { serialize } from "@voplus/morpho-data";
3
- import { action, observable } from "mobx";
3
+ import { action, computed, observable } from "mobx";
4
+ import { CAPTURED_FIELD_LABEL, CATALOG_UNAVAILABLE_MESSAGE, } from "@voplus/morpho-compliance/es/data/identityShape";
4
5
  import { message } from "antd";
6
+ /**
7
+ * spec:1955 — the labels this editor renders the platform-mandatory fields under. No identity
8
+ * shape governs them (`CAPTURED_FIELD_LABEL` covers only the captured fields), so the save gate
9
+ * names them with the same labels the form shows rather than inventing a second vocabulary.
10
+ */
11
+ const MANDATORY_FIELD_LABEL = {
12
+ FullName: "Full Name",
13
+ Number: "Identity #",
14
+ Country: "Country",
15
+ Type: "Identity Type",
16
+ };
17
+ /** The three fields a shape's policies govern, in the order the block renders them. */
18
+ const CAPTURED_FIELDS = ["alias", "issuingCountry", "expiryDate"];
5
19
  let State = (() => {
20
+ let _instanceExtraInitializers = [];
6
21
  let _editable_decorators;
7
22
  let _editable_initializers = [];
8
23
  let _editable_extraInitializers = [];
@@ -12,9 +27,32 @@ let State = (() => {
12
27
  let _loading_decorators;
13
28
  let _loading_initializers = [];
14
29
  let _loading_extraInitializers = [];
30
+ let _shape_decorators;
31
+ let _shape_initializers = [];
32
+ let _shape_extraInitializers = [];
33
+ let _catalogStatus_decorators;
34
+ let _catalogStatus_initializers = [];
35
+ let _catalogStatus_extraInitializers = [];
36
+ let _pendingShape_decorators;
37
+ let _pendingShape_initializers = [];
38
+ let _pendingShape_extraInitializers = [];
39
+ let _fieldErrors_decorators;
40
+ let _fieldErrors_initializers = [];
41
+ let _fieldErrors_extraInitializers = [];
42
+ let _initial_decorators;
43
+ let _initial_initializers = [];
44
+ let _initial_extraInitializers = [];
45
+ let _baselineShape_decorators;
46
+ let _baselineShape_initializers = [];
47
+ let _baselineShape_extraInitializers = [];
15
48
  let _reset_decorators;
16
49
  let _reset_initializers = [];
17
50
  let _reset_extraInitializers = [];
51
+ let _get_capturedValues_decorators;
52
+ let _applyShape_decorators;
53
+ let _applyShape_initializers = [];
54
+ let _applyShape_extraInitializers = [];
55
+ let _get_payload_decorators;
18
56
  let _onOk_decorators;
19
57
  let _onOk_initializers = [];
20
58
  let _onOk_extraInitializers = [];
@@ -24,16 +62,34 @@ let State = (() => {
24
62
  _editable_decorators = [observable];
25
63
  _value_decorators = [observable];
26
64
  _loading_decorators = [observable];
65
+ _shape_decorators = [observable];
66
+ _catalogStatus_decorators = [observable];
67
+ _pendingShape_decorators = [observable];
68
+ _fieldErrors_decorators = [observable];
69
+ _initial_decorators = [observable];
70
+ _baselineShape_decorators = [observable];
27
71
  _reset_decorators = [action];
72
+ _get_capturedValues_decorators = [computed];
73
+ _applyShape_decorators = [action];
74
+ _get_payload_decorators = [computed];
28
75
  _onOk_decorators = [action];
29
76
  __esDecorate(this, null, _editable_decorators, { kind: "accessor", name: "editable", static: false, private: false, access: { has: obj => "editable" in obj, get: obj => obj.editable, set: (obj, value) => { obj.editable = value; } }, metadata: _metadata }, _editable_initializers, _editable_extraInitializers);
30
77
  __esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
31
78
  __esDecorate(this, null, _loading_decorators, { kind: "accessor", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
79
+ __esDecorate(this, null, _shape_decorators, { kind: "accessor", name: "shape", static: false, private: false, access: { has: obj => "shape" in obj, get: obj => obj.shape, set: (obj, value) => { obj.shape = value; } }, metadata: _metadata }, _shape_initializers, _shape_extraInitializers);
80
+ __esDecorate(this, null, _catalogStatus_decorators, { kind: "accessor", name: "catalogStatus", static: false, private: false, access: { has: obj => "catalogStatus" in obj, get: obj => obj.catalogStatus, set: (obj, value) => { obj.catalogStatus = value; } }, metadata: _metadata }, _catalogStatus_initializers, _catalogStatus_extraInitializers);
81
+ __esDecorate(this, null, _pendingShape_decorators, { kind: "accessor", name: "pendingShape", static: false, private: false, access: { has: obj => "pendingShape" in obj, get: obj => obj.pendingShape, set: (obj, value) => { obj.pendingShape = value; } }, metadata: _metadata }, _pendingShape_initializers, _pendingShape_extraInitializers);
82
+ __esDecorate(this, null, _fieldErrors_decorators, { kind: "accessor", name: "fieldErrors", static: false, private: false, access: { has: obj => "fieldErrors" in obj, get: obj => obj.fieldErrors, set: (obj, value) => { obj.fieldErrors = value; } }, metadata: _metadata }, _fieldErrors_initializers, _fieldErrors_extraInitializers);
83
+ __esDecorate(this, null, _initial_decorators, { kind: "accessor", name: "initial", static: false, private: false, access: { has: obj => "initial" in obj, get: obj => obj.initial, set: (obj, value) => { obj.initial = value; } }, metadata: _metadata }, _initial_initializers, _initial_extraInitializers);
84
+ __esDecorate(this, null, _baselineShape_decorators, { kind: "accessor", name: "baselineShape", static: false, private: false, access: { has: obj => "baselineShape" in obj, get: obj => obj.baselineShape, set: (obj, value) => { obj.baselineShape = value; } }, metadata: _metadata }, _baselineShape_initializers, _baselineShape_extraInitializers);
85
+ __esDecorate(this, null, _get_capturedValues_decorators, { kind: "getter", name: "capturedValues", static: false, private: false, access: { has: obj => "capturedValues" in obj, get: obj => obj.capturedValues }, metadata: _metadata }, null, _instanceExtraInitializers);
86
+ __esDecorate(this, null, _get_payload_decorators, { kind: "getter", name: "payload", static: false, private: false, access: { has: obj => "payload" in obj, get: obj => obj.payload }, metadata: _metadata }, null, _instanceExtraInitializers);
32
87
  __esDecorate(null, null, _reset_decorators, { kind: "field", name: "reset", static: false, private: false, access: { has: obj => "reset" in obj, get: obj => obj.reset, set: (obj, value) => { obj.reset = value; } }, metadata: _metadata }, _reset_initializers, _reset_extraInitializers);
88
+ __esDecorate(null, null, _applyShape_decorators, { kind: "field", name: "applyShape", static: false, private: false, access: { has: obj => "applyShape" in obj, get: obj => obj.applyShape, set: (obj, value) => { obj.applyShape = value; } }, metadata: _metadata }, _applyShape_initializers, _applyShape_extraInitializers);
33
89
  __esDecorate(null, null, _onOk_decorators, { kind: "field", name: "onOk", static: false, private: false, access: { has: obj => "onOk" in obj, get: obj => obj.onOk, set: (obj, value) => { obj.onOk = value; } }, metadata: _metadata }, _onOk_initializers, _onOk_extraInitializers);
34
90
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
35
91
  }
36
- id;
92
+ id = __runInitializers(this, _instanceExtraInitializers);
37
93
  identityStore;
38
94
  #editable_accessor_storage = __runInitializers(this, _editable_initializers, false);
39
95
  /** hover on edit */
@@ -47,34 +103,207 @@ let State = (() => {
47
103
  /** loading of save */
48
104
  get loading() { return this.#loading_accessor_storage; }
49
105
  set loading(value) { this.#loading_accessor_storage = value; }
106
+ #shape_accessor_storage = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _shape_initializers, undefined));
107
+ /**
108
+ * the shape the editor is working with: the identity's captured shape on `reset`, and the
109
+ * replacement the user picks mid-edit — never re-derived from the live catalog, so a shape
110
+ * edited or deleted after capture still reads as what the identity actually carries.
111
+ */
112
+ get shape() { return this.#shape_accessor_storage; }
113
+ set shape(value) { this.#shape_accessor_storage = value; }
114
+ #catalogStatus_accessor_storage = (__runInitializers(this, _shape_extraInitializers), __runInitializers(this, _catalogStatus_initializers, "loading"));
115
+ /** spec:3717 — the picker's catalog status; the save stays blocked until it reports "ready". */
116
+ get catalogStatus() { return this.#catalogStatus_accessor_storage; }
117
+ set catalogStatus(value) { this.#catalogStatus_accessor_storage = value; }
118
+ #pendingShape_accessor_storage = (__runInitializers(this, _catalogStatus_extraInitializers), __runInitializers(this, _pendingShape_initializers, null));
119
+ /** spec:3715 — a replacement shape that would clear populated fields, awaiting confirmation. */
120
+ get pendingShape() { return this.#pendingShape_accessor_storage; }
121
+ set pendingShape(value) { this.#pendingShape_accessor_storage = value; }
122
+ #fieldErrors_accessor_storage = (__runInitializers(this, _pendingShape_extraInitializers), __runInitializers(this, _fieldErrors_initializers, {}));
123
+ /**
124
+ * spec:3713 — the captured fields a blocked save rejected, each with the reason it was
125
+ * rejected: a field the frozen snapshot still needs, or one carrying a value that snapshot
126
+ * does not permit.
127
+ */
128
+ get fieldErrors() { return this.#fieldErrors_accessor_storage; }
129
+ set fieldErrors(value) { this.#fieldErrors_accessor_storage = value; }
130
+ #initial_accessor_storage = (__runInitializers(this, _fieldErrors_extraInitializers), __runInitializers(this, _initial_initializers, {}));
131
+ // spec:1955 — CSP: Identity properties edit form validation
132
+ /**
133
+ * The clearable values as the identity carried them when editing opened. A value present here
134
+ * but empty in `value` is one the form is showing as cleared, so the save has to say so
135
+ * explicitly: an omitted key means "leave unchanged" to the server, which would let the old
136
+ * value survive a save whose shape selection never changed.
137
+ */
138
+ get initial() { return this.#initial_accessor_storage; }
139
+ set initial(value) { this.#initial_accessor_storage = value; }
140
+ #baselineShape_accessor_storage = (__runInitializers(this, _initial_extraInitializers), __runInitializers(this, _baselineShape_initializers, undefined));
141
+ /** The last server-confirmed snapshot remains independent of the active selection. */
142
+ get baselineShape() { return this.#baselineShape_accessor_storage; }
143
+ set baselineShape(value) { this.#baselineShape_accessor_storage = value; }
50
144
  constructor(id, identityStore) {
51
145
  __runInitializers(this, _onOk_extraInitializers);
52
146
  this.id = id;
53
147
  this.identityStore = identityStore;
54
148
  }
55
- reset = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _reset_initializers, (identity) => {
149
+ reset = (__runInitializers(this, _baselineShape_extraInitializers), __runInitializers(this, _reset_initializers, (identity) => {
56
150
  this.editable = false;
151
+ this.pendingShape = null;
152
+ this.fieldErrors = {};
153
+ this.baselineShape = identity.shape
154
+ ? { ...identity.shape, policies: { ...identity.shape.policies } }
155
+ : undefined;
156
+ this.shape = this.baselineShape;
57
157
  this.value = serialize({
58
158
  Number: undefined,
59
- Type: identity.type,
159
+ SourceNumber: identity.shape?.source,
160
+ Alias: identity.alias,
60
161
  Country: identity.country,
162
+ IssuingCountry: identity.issuingCountry,
61
163
  ExpiryDate: identity.expiryDate,
62
164
  FullName: identity.fullName,
63
165
  });
166
+ // spec:1955 — what the save has to clear explicitly if the form ends up showing it empty:
167
+ // `applyShape` drops a value the replacement shape does not capture from the edit buffer, so
168
+ // the buffer alone can no longer say whether the field was ever populated.
169
+ this.initial = {
170
+ Alias: identity.alias,
171
+ IssuingCountry: identity.issuingCountry,
172
+ ExpiryDate: identity.expiryDate,
173
+ };
64
174
  }));
175
+ // spec:3848 — CSP form identities retain their selected shape snapshot
176
+ /** Resolve an original source before confirmation and destructive field clearing. */
177
+ resolveShape = (__runInitializers(this, _reset_extraInitializers), (candidate) => candidate.source === this.baselineShape?.source ? this.baselineShape : candidate);
178
+ /** The edit buffer projected onto the captured-field keys the shape policies are keyed by. */
179
+ get capturedValues() {
180
+ return {
181
+ alias: this.value.Alias,
182
+ issuingCountry: this.value.IssuingCountry,
183
+ expiryDate: this.value.ExpiryDate,
184
+ };
185
+ }
186
+ applyShape = __runInitializers(this, _applyShape_initializers, (shape) => {
187
+ shape = this.resolveShape(shape);
188
+ this.shape = shape;
189
+ this.value.SourceNumber = shape.source;
190
+ if (shape.policies.alias === "omitted")
191
+ this.value.Alias = undefined;
192
+ if (shape.policies.issuingCountry === "omitted")
193
+ this.value.IssuingCountry = undefined;
194
+ if (shape.policies.expiryDate === "omitted")
195
+ this.value.ExpiryDate = undefined;
196
+ this.pendingShape = null;
197
+ this.fieldErrors = {};
198
+ });
65
199
  // spec:1955 — CSP: Identity properties edit form validation
66
- onOk = (__runInitializers(this, _reset_extraInitializers), __runInitializers(this, _onOk_initializers, async () => {
67
- if (!this.value?.Number ||
68
- !this.value?.Country ||
69
- (this.value.Type === "Passport" && !this.value.ExpiryDate))
70
- return message.warning("Identity information required");
200
+ // spec:3848 — CSP: CSP form identities retain their selected shape snapshot
201
+ /**
202
+ * The edit buffer as the wire payload (spec:1955). `applyShape` clears a value the replacement
203
+ * shape does not capture by assigning `undefined`, and the user can empty a control directly;
204
+ * either way `JSON.stringify` drops the key, and to the server an absent key means "leave the
205
+ * captured value unchanged". A value the form is showing as cleared therefore has to become an
206
+ * EXPLICIT clear here, or it survives the save (spec:3848) — most visibly after a shape change,
207
+ * where the omitted field is not rendered any more and no control is left to clear it.
208
+ *
209
+ * The two kinds of field clear differently, exactly as the shared write contract
210
+ * (`IdentityEditDataOptions`) and the sibling Compliance editor do: `Alias` / `IssuingCountry`
211
+ * are nullable strings, so an empty string IS the clear signal, while `ExpiryDate` is applied
212
+ * only when non-null and is removed with the `ClearExpiryDate` flag. The flag and a date
213
+ * together are rejected with a 400, so exactly one of them is ever sent.
214
+ *
215
+ * A field that was already empty when editing opened is omitted rather than cleared: it has
216
+ * nothing to remove, and a redundant "" would write a value and log a spurious property change
217
+ * on every unrelated save.
218
+ */
219
+ get payload() {
220
+ const data = serialize(this.value);
221
+ if (!data.Alias) {
222
+ if (this.initial.Alias)
223
+ data.Alias = "";
224
+ else
225
+ delete data.Alias;
226
+ }
227
+ if (!data.IssuingCountry) {
228
+ if (this.initial.IssuingCountry)
229
+ data.IssuingCountry = "";
230
+ else
231
+ delete data.IssuingCountry;
232
+ }
233
+ if (!data.ExpiryDate) {
234
+ delete data.ExpiryDate;
235
+ if (this.initial.ExpiryDate)
236
+ data.ClearExpiryDate = true;
237
+ }
238
+ return data;
239
+ }
240
+ // spec:1955 — CSP: Identity properties edit form validation
241
+ // spec:1956 — CSP: Identity shape options
242
+ // spec:3717 — COMPLIANCE: A shape-dependent save is blocked until the catalog is available
243
+ onOk = (__runInitializers(this, _applyShape_extraInitializers), __runInitializers(this, _onOk_initializers, async () => {
244
+ if (this.catalogStatus !== "ready") {
245
+ message.warning(CATALOG_UNAVAILABLE_MESSAGE);
246
+ return;
247
+ }
248
+ const offences = [];
249
+ // spec:1955 — legal name, document number and country are platform-mandatory: the captured
250
+ // shape decides only the three captured fields below and can never relax these.
251
+ if (!this.value?.FullName?.trim())
252
+ offences.push(`${MANDATORY_FIELD_LABEL.FullName} is required`);
253
+ if (!this.value?.Number?.trim())
254
+ offences.push(`${MANDATORY_FIELD_LABEL.Number} is required`);
255
+ if (!this.value?.Country?.trim())
256
+ offences.push(`${MANDATORY_FIELD_LABEL.Country} is required`);
257
+ if (!this.shape)
258
+ offences.push(`${MANDATORY_FIELD_LABEL.Type} is required`);
259
+ // spec:3848 — the identity's FROZEN snapshot decides what this save still needs: `shape` is
260
+ // seeded from the identity on `reset` and only ever replaced by a shape the user picks from
261
+ // the catalog, so a source shape re-policied or deleted after capture cannot change the
262
+ // verdict. The live catalog is never consulted here.
263
+ const captured = this.capturedValues;
264
+ const fieldErrors = {};
265
+ if (this.shape) {
266
+ for (const field of CAPTURED_FIELDS) {
267
+ const policy = this.shape.policies[field];
268
+ let offence;
269
+ // spec:3713 — an omitted field is never required; a value it does not permit is
270
+ // disallowed rather than missing, and is named as such below.
271
+ if (policy === "mandatory" && !captured[field]?.trim())
272
+ offence = `${CAPTURED_FIELD_LABEL[field]} is required`;
273
+ else if (policy === "omitted" && captured[field]?.trim())
274
+ offence = `${CAPTURED_FIELD_LABEL[field]} is not permitted by the captured identity shape`;
275
+ if (!offence)
276
+ continue;
277
+ fieldErrors[field] = offence;
278
+ offences.push(offence);
279
+ }
280
+ }
281
+ this.fieldErrors = fieldErrors;
282
+ // spec:1955 — the rejection names every offending field with its reason instead of one
283
+ // generic warning, and returns before the save: `editable` is untouched so the form stays
284
+ // open, and the edit buffer keeps every value the user entered for correction.
285
+ if (offences.length > 0) {
286
+ message.warning(`Identity information required: ${offences.join("; ")}`);
287
+ return;
288
+ }
71
289
  this.loading = true;
72
- await this.identityStore.edit(this.id, {
73
- data: serialize(this.value),
74
- error: "message",
75
- });
76
- this.loading = false;
77
- return (this.editable = false);
290
+ try {
291
+ const saved = await this.identityStore.edit(this.id, {
292
+ // spec:1955 — the buffer goes out with every cleared value expressed as the explicit
293
+ // removal the write contract understands, so a value the frozen shape no longer captures
294
+ // is genuinely cleared on the server instead of silently kept.
295
+ data: this.payload,
296
+ error: "message",
297
+ });
298
+ if (saved)
299
+ this.reset(saved);
300
+ }
301
+ catch (error) {
302
+ message.error(error instanceof Error ? error.message : String(error));
303
+ }
304
+ finally {
305
+ this.loading = false;
306
+ }
78
307
  }));
79
308
  };
80
309
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;IAElB,KAAK;;;;;;;;;;;;;;;;iBAAL,KAAK;;;oCAEhB,UAAU;iCAEV,UAAU;mCAGV,UAAU;iCAIV,MAAM;gCAcN,MAAM;YAvBK,6KAAgB,QAAQ,6BAAR,QAAQ,2FAAS;YAEjC,oKAAgB,KAAK,6BAAL,KAAK,qFAAwC;YAG7D,0KAAgB,OAAO,6BAAP,OAAO,yFAAS;YAM5C,iKAAO,KAAK,6BAAL,KAAK,qFASV;YAKF,8JAAO,IAAI,6BAAJ,IAAI,mFAeT;;;QAjCyB,EAAE;QAAkB,aAAa;QAPhD,6EAA2B,KAAK,EAAC;QAD7C,oBAAoB;QACR,IAAgB,QAAQ,8CAAS;QAAjC,IAAgB,QAAQ,oDAAS;QAEjC,8HAA0D,E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AG,KAAK,CAAC,CAAC;QAChC,CAAC,GAAC;;;SA1CU,KAAK"}
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EACN,oBAAoB,EACpB,2BAA2B,GAC3B,MAAM,iDAAiD,CAAC;AAKzD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B;;;;GAIG;AACH,MAAM,qBAAqB,GAAG;IAC7B,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,eAAe;CACZ,CAAC;AAEX,uFAAuF;AACvF,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAU,CAAC;IAQ9D,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAL,KAAK;;;oCAEhB,UAAU;iCAEV,UAAU;mCAGV,UAAU;iCAOV,UAAU;yCAGV,UAAU;wCAGV,UAAU;uCAOV,UAAU;mCAUV,UAAU;yCAGV,UAAU;iCAIV,MAAM;8CAmCN,QAAQ;sCASR,MAAM;uCAiCN,QAAQ;gCAqBR,MAAM;YA5IK,6KAAgB,QAAQ,6BAAR,QAAQ,2FAAS;YAEjC,oKAAgB,KAAK,6BAAL,KAAK,qFAAwC;YAG7D,0KAAgB,OAAO,6BAAP,OAAO,yFAAS;YAOhC,oKAAgB,KAAK,6BAAL,KAAK,qFAAyC;YAG9D,4LAAgB,aAAa,6BAAb,aAAa,qGAAyC;YAGtE,yLAAgB,YAAY,6BAAZ,YAAY,mGAA+B;YAO3D,sLAAgB,WAAW,6BAAX,WAAW,iGACnC;YASQ,0KAAgB,O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EAAE,EAAE;oBACpD,qFAAqF;oBACrF,yFAAyF;oBACzF,+DAA+D;oBAC/D,IAAI,EAAE,IAAI,CAAC,OAAO;oBAClB,KAAK,EAAE,SAAS;iBAChB,CAAC,CAAC;gBACH,IAAI,KAAK;oBAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvE,CAAC;oBAAS,CAAC;gBACV,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACtB,CAAC;QACF,CAAC,GAAC;;;SA9MU,KAAK"}
@@ -5,6 +5,11 @@ declare const CorporateOfficerSelect: (props: {
5
5
  isFilterAuditor?: boolean;
6
6
  disable?: boolean;
7
7
  defaultValue?: string;
8
+ /** Form-controlled restored officer, using its picker id rather than contact owner id. */
9
+ value?: {
10
+ id: string;
11
+ name?: string;
12
+ };
8
13
  style?: CSSProperties;
9
14
  onBlur?: () => void;
10
15
  onChange?: (officer: IOfficer) => void | Promise<void>;
@@ -13,13 +13,19 @@ const CorporateOfficerSelect = (props) => {
13
13
  },
14
14
  }, [corporateId]);
15
15
  useOfficerListEffect(list, (result) => list.union(result), list.filters.options);
16
- return observe(() => (React.createElement(Select, { allowClear: true, autoFocus: true, showSearch: { filterOption: false }, disabled: disable, defaultValue: defaultValue, style: { width: "100%", ...style }, placeholder: "Please Select Corporate", onBlur: props.onBlur, onChange: onSelect, loading: list.loading, notFoundContent: React.createElement(NotFoundContent, { loading: list.loading }), styles: { popup: { root: { backgroundColor: "#fff" } } }, options: list.data.map((officer) => {
17
- return {
18
- value: officer.id,
19
- label: (React.createElement(React.Fragment, null, officer.identity?.fullName ? (officer.identity.fullName) : officer.contact ? (React.createElement(UnitNameNoteAlert, { id: officer.contact.id, name: officer.contact.name })) : null)),
20
- title: officer.identity?.fullName ?? officer.contact?.name,
21
- };
22
- }) })));
16
+ return observe(() => (React.createElement(Select, { allowClear: true, autoFocus: true, showSearch: { filterOption: false }, disabled: disable, defaultValue: defaultValue, value: props.value?.id, style: { width: "100%", ...style }, placeholder: "Please Select Corporate", onBlur: props.onBlur, onChange: onSelect, loading: list.loading, notFoundContent: React.createElement(NotFoundContent, { loading: list.loading }), styles: { popup: { root: { backgroundColor: "#fff" } } }, options: [
17
+ ...(props.value?.id && !list.data.some((officer) => officer.id === props.value?.id)
18
+ ? [{ value: props.value.id, label: props.value.name ?? props.value.id }]
19
+ : []),
20
+ ...list.data.map((officer) => {
21
+ return {
22
+ value: officer.id,
23
+ label: (React.createElement(React.Fragment, null, officer.identity?.fullName ? (officer.identity.fullName) : officer.contact ? (React.createElement(UnitNameNoteAlert, { id: officer.contact.id, name: officer.contact.name })) : null)),
24
+ title: officer.identity?.fullName ?? officer.contact?.name,
25
+ };
26
+ }),
27
+ ] })));
28
+ // spec:3848 — CSP form identities retain their selected shape snapshot
23
29
  // spec:1932 — CSP: Officer dropdowns scope to a corporate via filter
24
30
  function filters() {
25
31
  const filter = [];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/company/components/CorporateOfficerSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAY,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,eAAe,MAAM,+CAA+C,CAAC;AAC5E,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,sBAAsB,GAAG,CAAC,KAQ/B,EAAE,EAAE;IACJ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,iBAAiB,IAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,GAAI,CACzE,CAAC,CAAC,CAAC,IAAI,CACN,CACH;gBACD,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI;aAC1D,CAAC;QACH,CAAC,CAAC,GACD,CACF,CAAC,CAAC;IAEH,qEAAqE;IACrE,SAAS,OAAO;QACf,MAAM,MAAM,GAAmB,EAAE,CAAC;QAElC,IAAI,WAAW;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QAEtF,uEAAuE;QACvE,IAAI,eAAe;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAErF,OAAO,MAAM,CAAC;IACf,CAAC;IAED,qBAAqB;IACrB,KAAK,UAAU,QAAQ,CAAC,KAAa;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAS,CAAC,CAAC;IACnC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/company/components/CorporateOfficerSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAY,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,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EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QAEtF,uEAAuE;QACvE,IAAI,eAAe;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAErF,OAAO,MAAM,CAAC;IACf,CAAC;IAED,qBAAqB;IACrB,KAAK,UAAU,QAAQ,CAAC,KAAa;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAS,CAAC,CAAC;IACnC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,3 +1,3 @@
1
- import React from "react";
2
- declare const Step3: () => React.JSX.Element;
1
+ /** Preserve contact validation while capturing identity types through shared controls. */
2
+ declare const Step3: () => JSX.Element;
3
3
  export default Step3;
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
- import { Button, Form, Input, Select, Tabs, message } from "antd";
3
- import { utcdayjs } from "@voplus/morpho-ui/es/controls/UTCDatePicker/state";
4
- import { InputCountry, UTCDatePicker as DatePicker, observe } from "@voplus/morpho-ui";
2
+ import { Button, Form, Input, Tabs, message } from "antd";
3
+ import { observe } from "@voplus/morpho-ui";
5
4
  import { runInAction } from "mobx";
6
5
  import { useLegalContext } from "./state";
6
+ import IdentityChange from "../IdentityChange";
7
+ import { toFormIdentity, validateFormIdentity, } from "../../../../../../data/clda-form/identityAdapter";
7
8
  import Address from "@voplus/morpho-ui/es/controls/Address";
9
+ /** Preserve contact validation while capturing identity types through shared controls. */
8
10
  const Step3 = () => {
9
11
  const legal = useLegalContext();
10
12
  return observe(() => (React.createElement(React.Fragment, null,
@@ -28,27 +30,9 @@ const Step3 = () => {
28
30
  {
29
31
  key: "Identify",
30
32
  label: "Identify Info",
31
- children: (React.createElement(Form, { layout: "vertical" },
32
- React.createElement(Form.Item, { className: "identify-info-country-of-nationality", label: legal.unitType === "Organization"
33
- ? "Country of Registration"
34
- : "Country of Nationality", name: "country", rules: [{ required: true }] },
35
- React.createElement(InputCountry, { defaultValue: legal.country, onChange: (country) => (legal.country = country) })),
36
- legal.unitType === "Person" && (React.createElement(Form.Item, { label: "Identify Type", name: "identifyType", rules: [{ required: true }] },
37
- React.createElement(Select, { defaultValue: legal.type, value: legal.type, onChange: (value) => {
38
- legal.type = value;
39
- }, options: [
40
- { value: "Passport", label: "International Passport" },
41
- { value: "IdentityCard", label: "Identify Card" },
42
- { value: "BusinessRegistration", label: "Business Registration" },
43
- ] }))),
44
- React.createElement(Form.Item, { label: legal.unitType === "Organization" ? "Registration #" : "Identify #", name: "identity", rules: [{ required: true }] },
45
- React.createElement(Input, { defaultValue: legal.number, value: legal.number, onChange: (e) => {
46
- legal.number = e.target.value;
47
- } })),
48
- legal.unitType === "Person" && (React.createElement(Form.Item, { label: "Expiry Date", name: "expiryDate", rules: [{ required: legal.type === "Passport" }] },
49
- React.createElement(DatePicker, { defaultValue: legal.expiryDate ? utcdayjs(legal.expiryDate) : undefined, onChange: (date, dateString) => {
50
- legal.expiryDate = dateString;
51
- } }))))),
33
+ children: (React.createElement(IdentityChange, { value: toFormIdentity(legal.contact), onCatalogStatus: (status) => runInAction(() => {
34
+ legal.catalogStatus = status;
35
+ }), onChange: (value) => legal.updateIdentity(value) })),
52
36
  },
53
37
  ] }),
54
38
  React.createElement("div", { className: "select-legal-contact_footer" },
@@ -57,6 +41,7 @@ const Step3 = () => {
57
41
  } }, "Back"),
58
42
  React.createElement(Button, { size: "middle", type: "primary", onClick: next }, "Next")))));
59
43
  // spec:1806 — CSP: Legal contact wizard validation jumps to the offending tab
44
+ /** Route validation failures to their existing contact or identity tab. */
60
45
  function next() {
61
46
  runInAction(() => {
62
47
  const text = !legal.address.line1
@@ -81,6 +66,17 @@ const Step3 = () => {
81
66
  legal.tabKey = "Identify";
82
67
  return;
83
68
  }
69
+ if (legal.catalogStatus !== "ready" || !legal.identityShape) {
70
+ message.warning("Please select an identity type.");
71
+ legal.tabKey = "Identify";
72
+ return;
73
+ }
74
+ const errors = validateFormIdentity(legal.contact);
75
+ if (errors.length) {
76
+ message.warning(errors.join(" "));
77
+ legal.tabKey = "Identify";
78
+ return;
79
+ }
84
80
  legal.step += 1;
85
81
  });
86
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Step3.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,aAAa,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAE5D,MAAM,KAAK,GAAG,GAAG,EAAE;IAClB,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,CAAC,QAAQ;QACd,oBAAC,IAAI,IACJ,SAAS,EAAE,KAAK,CAAC,MAAM,EACvB,YAAY,EAAC,OAAO,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,GAA6B,CAAC,EACjE,KAAK,EAAE;gBACN;oBACC,GAAG,EAAE,SAAS;oBAC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;gBACV,OAAO,CAAC,OAAO,CAAC,gBAAgB,IAAI,eAAe,CAAC,CAAC;gBACrD,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;gBACzB,OAAO;YACR,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACrC,OAAO,CAAC,OAAO,CACd,KAAK,CAAC,QAAQ,KAAK,cAAc;oBAChC,CAAC,CAAC,sCAAsC;oBACxC,CAAC,CAAC,kCAAkC,CACrC,CAAC;gBACF,6CAA6C;gBAC7C,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;gBAC1B,OAAO;YACR,CAAC;YAED,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Step3.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACN,cAAc,EACd,oBAAoB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAE5D,0FAA0F;AAC1F,MAAM,KAAK,GAAG,GAAgB,EAAE;IAC/B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,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CAAC;gBACrC,OAAO,CAAC,OAAO,CACd,KAAK,CAAC,QAAQ,KAAK,cAAc;oBAChC,CAAC,CAAC,sCAAsC;oBACxC,CAAC,CAAC,kCAAkC,CACrC,CAAC;gBACF,6CAA6C;gBAC7C,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;gBAC1B,OAAO;YACR,CAAC;YAED,IAAI,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;gBAC7D,OAAO,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;gBACnD,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;gBAC1B,OAAO;YACR,CAAC;YACD,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBACnB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;gBAC1B,OAAO;YACR,CAAC;YACD,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,3 +1,3 @@
1
- import React from "react";
2
- declare const Step4: () => React.JSX.Element;
1
+ /** Confirm the form-only capture and keep it intact if the host refuses persistence. */
2
+ declare const Step4: () => JSX.Element;
3
3
  export default Step4;
@@ -1,21 +1,25 @@
1
1
  import React from "react";
2
- import { Button, Form } from "antd";
2
+ import { Button, Form, message } from "antd";
3
3
  import { observe } from "@voplus/morpho-ui";
4
4
  import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
5
5
  import { runInAction } from "mobx";
6
+ import { validateFormIdentity } from "../../../../../../data/clda-form/identityAdapter";
6
7
  import { useLegalContext } from "./state";
8
+ /** Confirm the form-only capture and keep it intact if the host refuses persistence. */
7
9
  const Step4 = () => {
8
10
  const legal = useLegalContext();
9
11
  return observe(() => (React.createElement(React.Fragment, null,
10
12
  React.createElement("div", { className: "select-legal-contact_content page5" },
11
13
  React.createElement("div", { className: "full-name" }, legal.fullName),
12
14
  React.createElement("div", { className: "padding-bottom-20" },
15
+ legal.identityShape?.name ?? legal.type,
16
+ " \u2014 ",
13
17
  legal.country,
14
18
  "\uFF08",
15
19
  legal.number,
16
20
  legal.expiryDate ? (React.createElement(React.Fragment, null,
17
21
  "\u00A0 expiryDate: \u00A0 ",
18
- React.createElement(UTCShortDate, { value: legal.expiryDate }))) : (""),
22
+ React.createElement(UTCShortDate, { value: legal.expiryDate ?? undefined }))) : (""),
19
23
  "\uFF09"),
20
24
  React.createElement(Form, { labelCol: { span: 4 }, labelAlign: "left", colon: false },
21
25
  React.createElement(Form.Item, { label: "Phone" }, legal.phone),
@@ -28,23 +32,46 @@ const Step4 = () => {
28
32
  legal.address?.country))),
29
33
  React.createElement("div", { className: "select-legal-contact_footer" },
30
34
  React.createElement(Button, { size: "middle", onClick: () => runInAction(() => (legal.step -= 1)) }, "Back"),
31
- React.createElement(Button, { size: "middle", type: "primary", loading: legal.saving, onClick: Ok }, "Ok")))));
32
- function Ok() {
33
- runInAction(() => (legal.saving = true));
34
- const Option = {
35
+ React.createElement(Button, { size: "middle", type: "primary", loading: legal.saving, disabled: legal.catalogStatus !== "ready" || !legal.identityShape, onClick: Ok }, "Ok")))));
36
+ // spec:3848 — every form-only completion returns explicit source and the sibling snapshot.
37
+ /** Await the host form save; no owner or Compliance Identity record is created here. */
38
+ async function Ok() {
39
+ if (legal.saving || legal.catalogStatus !== "ready" || !legal.identityShape)
40
+ return;
41
+ const errors = validateFormIdentity(legal.contact);
42
+ if (errors.length) {
43
+ message.warning(errors.join(" "));
44
+ return;
45
+ }
46
+ const option = {
35
47
  FullName: legal.fullName,
36
48
  Number: legal.number,
37
49
  Country: legal.country,
38
- ExpiryDate: legal.expiryDate,
39
50
  Type: legal.type,
51
+ UnitType: legal.unitType,
52
+ SourceNumber: legal.identityShape.sourceNumber,
53
+ IdentityShape: { ...legal.identityShape },
54
+ Alias: legal.alias,
55
+ IssuingCountry: legal.issuingCountry,
56
+ ExpiryDate: legal.expiryDate,
40
57
  Email: legal.email,
41
58
  Phone: legal.phone,
42
59
  Address: legal.address,
43
- UnitType: legal.unitType,
44
60
  };
45
- if (Option)
46
- legal.props.updateVisible?.(Option);
47
- runInAction(() => (legal.saving = false));
61
+ runInAction(() => {
62
+ legal.saving = true;
63
+ });
64
+ try {
65
+ await legal.props.updateVisible?.(option);
66
+ }
67
+ catch (error) {
68
+ message.error(error instanceof Error ? error.message : String(error));
69
+ }
70
+ finally {
71
+ runInAction(() => {
72
+ legal.saving = false;
73
+ });
74
+ }
48
75
  }
49
76
  };
50
77
  export default Step4;
@@ -1 +1 @@
1
- {"version":3,"file":"Step4.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,KAAK,GAAG,GAAG,EAAE;IAClB,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,CAAC,QAAQ;QAEd,6BAAK,SAAS,EAAC,oCAAoC;YAClD,6BAAK,SAAS,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,CAAO;YAEjD,6BAAK,SAAS,EAAC,mBAAmB;gBAChC,KAAK,CAAC,OAAO;;gBAAG,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C,IAAI,IAAI,CAAC,CAAC,CAAC,WAEhE;YACT,oBAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,SAE9D,CACJ,CACU,CACjB,CAAC,CAAC;IACH,SAAS,EAAE;QACV,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG;YACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC;QACF,IAAI,MAAM;YAAE,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC;QAChD,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IAC3C,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Step4.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,WAA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